Skip to content

feat: add ton-trading-bot plugin & ton-bridge plugin & github-dev-assistant#10

Open
xlabtg wants to merge 97 commits intoTONresistor:mainfrom
xlabtg:main
Open

feat: add ton-trading-bot plugin & ton-bridge plugin & github-dev-assistant#10
xlabtg wants to merge 97 commits intoTONresistor:mainfrom
xlabtg:main

Conversation

@xlabtg
Copy link

@xlabtg xlabtg commented Mar 16, 2026

📋 Description of changes

This PR adds three new plug-ins to extend the functionality of the Teleton AI Agent.:

Plugin Purpose Number of tools
ton-bridge Quick access to the TON Bridge Mini App via inline buttons 3
ton-trading-bot Atomic tools for trading in TON (DeDust, STON.fi) 6
`github-dev-assistant' Full automation of the GitHub workflow from the chat 15

🔌 Details on plugins

🌉 TON Bridge Plugin

  • Beautiful inline buttons for launching the Mini App: https://t.me/TONBridge_robot?startapp
  • Support for customization of button text and emojis
  • Tools:
  • ton_bridge_open — open the bridge with a button
  • ton_bridge_about — send information about the project
    • ton_bridge_custom_message — custom message with a button
  • ⚡ Works with the support of TONBANKCARD

💹 TON Trading Bot Plugin

*WARNING: Trading cryptocurrency involves financial risks. The plugin does not provide financial recommendations.

Architecture according to the tool-provider pattern:

  • Plugin = atomic tools (data, validation, execution)
  • Agent = strategy (LLM makes decisions)

Tools:

Tool Description Category
ton_trading_get_market_data Getting DEX prices and quotes
/ ton_trading_get_portfolio Wallet balance and position data-bearing
ton_trading_validate_trade Checking limits and risks before the transaction data-bearing
ton_trading_simulate_trade Test transaction without real funds action
ton_trading_execute_swap Real swap on DeDust/STON.fi (only in BOS) action
ton_trading_record_trade Closing the transaction and logging PnL action

🔐 Risk Management:

  • `maxTradePercent' (default: 10%) — limit per trade
  • `minBalanceTON' (default: 1 TON) — minimum balance
  • scope: dm-only for execute_swap — real operations only in private messages

🐙 GitHub Dev Assistant Plugin

Full development cycle on GitHub directly from Telegram:

Category Tools
🔐 Authorization github_auth', github_check_auth`
📁 Repositories github_list_repos', github_create_repo`
📄 Files and branches github_get_file, github_update_file, github_create_branch
🔀 Pull Requests github_create_pr, github_list_prs, github_merge_pr
🐛 Issues github_create_issue, github_list_issues, github_comment_issue, github_close_issue
⚙️ GitHub Actions github_trigger_workflow

, Security:

  • Tokens are stored only in the sdk.secrets
  • CSRF state with TTL of 10 minutes
  • Automatic hiding of sensitive data in logs
  • The require_pr_review option to confirm the PR merger

✅ Checklist

  • All plugins comply with the architecture of the @teleton-agent/sdk
  • Added manifest.json and index.js with the export manifest
  • Tool return format: { success, data?, error? }
  • Operation in Teleton Agent runtime has been tested
  • Updated README with usage examples
  • Added unit tests (where applicable)
  • Compatibility with the config.yaml configuration has been verified

Testing

# Installing dependencies for each plugin
cd plugins/ton-bridge & npm install
cd ../ton-trading-bot & npm install
cd ../github-dev-assistant & npm install

# Running tests (where available)
cd github-dev-assistant & npm test

📝 Notes

  • All plugins are developed by Tony (AI Agent) under the supervision of Anton Poroshin
  • Studio: xlabtg
  • Plugin versions: ton-bridge@1.2.0 , ton-trading-bot@1.0.0 , github-dev-assistant@1.0.0

🔗 Related changes

  • Bringing plug-ins to a single SDK standard (see commits `fix(*): align plugin with teleton-agent SDK architecture')
  • Unification of the response format of the tools
  • Adding inline export of manifest for runtime validation

@xlabtg xlabtg changed the title feat: add ton-trading-bot plugin feat: add ton-trading-bot plugin & ton-bridge Mar 17, 2026
@xlabtg xlabtg changed the title feat: add ton-trading-bot plugin & ton-bridge feat: add ton-trading-bot plugin & ton-bridge plugin Mar 17, 2026
konard and others added 22 commits March 17, 2026 19:02
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #1
Implements all 15 tools from issue #1:
- Auth (2): github_auth (OAuth 2.0 with CSRF state), github_check_auth
- Repos (2): github_list_repos, github_create_repo
- Files/Branches (3): github_get_file, github_update_file, github_create_branch
- PRs (3): github_create_pr, github_list_prs, github_merge_pr
- Issues (4): github_create_issue, github_list_issues, github_comment_issue, github_close_issue
- Actions (1): github_trigger_workflow

Architecture: modular lib/*.js separation (github-client, auth, repo-ops,
pr-manager, issue-tracker, utils), web-ui components (config-panel.jsx,
oauth-callback.html), Vitest tests (unit + integration with mocked API).

Security: tokens only in sdk.secrets, cryptographically random CSRF state
with 10-min TTL, token redaction in errors, require_pr_review merge policy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: add github-dev-assistant plugin — full GitHub workflow automation
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #3
- Remove all sdk.inline.send() calls that caused 400/BOT_RESPONSE_TIMEOUT errors
- Tools now return structured inline result objects (article type with
  input_message_content + reply_markup) instead of sending messages directly
- Add sdk.bot.onInlineQuery handler with three results: open, about, custom
- Add query alias routing (ton-bridge:open, ton_bridge_open, etc.)
- Fix button label: no leading space when emoji is empty
- Support dynamic startParam in Mini App URL
- Bump version to 1.1.0 and declare bot.inline: true in manifest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
refactor: rewrite ton-bridge plugin to inline-native architecture
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #5
Fixes #5 — the plugin had architectural issues that
prevented the LLM from using it correctly:

- Renamed tools with ton_trading_ prefix for global uniqueness
- Removed embedded signal/strategy logic (ton_analyze_signal,
  ton_generate_plan, ton_switch_mode) — the LLM now owns strategy decisions
- Fixed sdk.ton.dex API calls: use dex.quote({fromAsset,toAsset,amount})
  and dex.swap() instead of the non-existent dex.quoteDeDust/quoteSTONfi
  variants with wrong parameter shapes
- Fixed sdk.telegram.sendMessage calls to use (chatId, text) signature
- Removed sdk.ton.validate_risk() call (non-existent SDK method)
- Removed autoTrade config gate from execute path — LLM decides when to act
- Collapsed from 10 tools to 6 atomic, well-named tools:
    ton_trading_get_market_data, ton_trading_get_portfolio,
    ton_trading_validate_trade, ton_trading_simulate_trade,
    ton_trading_execute_swap, ton_trading_record_trade
- Simplified DB schema (trade_journal + sim_balance)
- Updated manifest.json and README.md to match new architecture
- Updated registry.json description and tags

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #7
refactor: rewrite ton-trading-bot as atomic tool-provider plugin
- Remove sdk.bot.onInlineQuery handler (never executed in MTProto agent)
- Fix tool return format: was { success, data: { type: "article", ... } },
  now returns agent-compatible { content, reply_markup }
- Add proper manifest.json following the same structure as other plugins
- Remove TypeScript build files (index.ts, manifest.ts, tsconfig.json,
  tsup.config.ts) — the plugin uses plain JS like all other plugins
- Use optional chaining (?.)) for sdk.log and sdk.pluginConfig access
  to avoid crashes if they are not provided

Fixes #7

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(ton-bridge): rewrite plugin for LLM tool agent compatibility
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #9
Fixes critical incompatibilities identified in issue #9:

1. **Return format**: All tools now return `{ content: string }` (human-readable
   text) instead of `{ success, data }` JSON blobs. The LLM agent directly
   reads `content` and presents it to the user without extra parsing.

2. **Authentication**: Replaced OAuth 2.0 flow (incompatible with agent runtime —
   no callback handler) with Personal Access Token (PAT) via `sdk.secrets`.
   Set `github_token` secret to connect. Removed `github_auth` tool and the
   OAuth `lib/auth.js` module. Updated `manifest.json` secrets declaration.

3. **Client instantiation**: GitHub client is now created inside each tool's
   `execute()` function (not shared at SDK init time), so token updates in
   `sdk.secrets` are always picked up — no stale client issues.

4. **LLM-friendly descriptions**: All tool descriptions rewritten from technical
   API docs to intent-level ("Use this when the user wants to...") so the LLM
   can correctly decide when to call each tool.

5. **Normalized output**: List tools (repos, PRs, issues) return formatted
   Markdown lists instead of raw JSON arrays. Errors include a human-readable
   prefix ("Failed to list repositories: ...").

6. **Tests**: All 38 tests updated and passing — auth tests cover new PAT flow,
   integration tests use `global.fetch` mocking instead of injected client mock.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(github-dev-assistant): rewrite plugin for LLM agent compatibility
xlabtg and others added 30 commits March 19, 2026 18:18
docs(ton-bridge): clarify auto-loading and optional config
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #29
- Remove unused createRequire import from test file
- Align registry.json description with manifest.json for consistency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix(ton-bridge): clean up plugin and document agent-side duplication bug
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #31
…_custom_message

When the LLM calls ton_bridge_custom_message without providing customMessage
(despite it being in the JSON Schema required array), params.customMessage is
undefined and gets passed directly to sdk.telegram.sendMessage, causing a crash.

Add a ?? fallback chain: params.customMessage ?? sdk.pluginConfig?.customMessage
?? hardcoded default, consistent with how ton_bridge_open handles params.message.

Closes #31

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(ton-bridge): add fallback for missing customMessage in ton_bridge_custom_message
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #33
…t links

The agent's TelegramBridge.sendMessage only supports callback_data buttons
in inlineKeyboard. URL buttons ({ text, url }) cause Buffer.from(undefined)
because the agent code expects callback_data on every button. This fixes
all three tools (ton_bridge_open, ton_bridge_about, ton_bridge_custom_message)
by embedding the Mini App deep link directly in the message text instead.

Fixes #33

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix(ton-bridge): replace inlineKeyboard URL buttons with embedded text links
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #35
Implements all enhancements proposed in issue #35:

File operations (4 new tools):
- github_delete_file: delete a file from a repository
- github_list_directory: list contents of a directory
- github_search_code: search code patterns using GitHub's search API
- github_download_file: download file content with optional local save

Commit operations (2 new tools):
- github_list_commits: list commit history with branch/path/author filters
- github_get_commit: get detailed commit info including file diffs

Extended issue/PR operations (5 new tools):
- github_list_comments: list comments on issues or PRs
- github_update_issue: update title, body, labels, assignees, state
- github_reopen_issue: reopen a closed issue
- github_assign_issue: assign/clear assignees on an issue
- github_list_pull_request_reviews: list PR reviews with state

Repository info tools (3 new tools):
- github_list_languages: list languages with byte counts and percentages
- github_list_collaborators: list collaborators with permission levels
- github_list_teams: list teams in a GitHub organization

Extended workflow operations (3 new tools):
- github_list_workflows: list all GitHub Actions workflows
- github_list_workflow_runs: list runs with branch/status filtering
- github_cancel_workflow_run: cancel a running workflow run

Label operations (3 new tools):
- github_list_labels: list all labels with colors/descriptions
- github_create_label: create a label with custom hex color
- github_delete_label: delete a label from a repository

Also: allow JSON body in DELETE requests (needed by GitHub delete file API).

Total tools: 14 → 34. All 34 tools pass npm run validate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…server parity, bump to v3.0.0

Expands the plugin from 34 to 57 tools based on comparison with the official
github-mcp-server (https://github.com/github/github-mcp-server).

New tools:
- Extended repo ops (8): fork_repo, search_repos, list_branches, push_files,
  get_repo_tree, list_tags, list_releases, get_latest_release
- Extended PR/issue ops (4): search_issues, update_pr, add_pr_review, get_job_logs
- User/social ops (8): get_me, search_users, list_notifications, star_repo,
  unstar_repo, list_gists, get_gist, create_gist
- Security ops (2): list_code_scanning_alerts, list_dependabot_alerts
- Discussion ops (2): list_discussions, get_discussion

Also adds GraphQL support to the GitHub client (required for Discussions API).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat(github-dev-assistant): add 23 new tools for github-mcp-server parity, bump to v3.0.0
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #37
- Expand features table from 14 tools (v1.0.0) to 57 tools across 12 categories
- Add instructions for changing the GitHub token via the web UI Keys tab
- Add usage examples for all new tool categories (fork, branches, commits,
  Actions management, labels, repo info, user/social, security, discussions)
- Add tool reference entries for all 43 new tools added in v2.0.0 and v3.0.0

Fixes #37

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
docs(github-dev-assistant): update README to v3.0.0 with all 57 tools
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #39
- Add comprehensive unit tests (35 tests covering all 6 tools) with
  mocked SDK — no real network or disk access required
- Fix unused `context` parameter lint warnings in index.js execute
  functions (rename to `_context` per eslint no-unused-vars rule)
- Add ton-trading-bot to README.md DeFi & Trading table so the agent
  can discover it via the marketplace and documentation
- Update README plugin/tool count badges (25→26 plugins, 183→189 tools)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(ton-trading-bot): add tests, fix lint warnings, register in README
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #41
…on-trading-bot README

- Add ton-bridge (3 tools) to TON Infrastructure section in main README
- Add new Developer Tools section with github-dev-assistant (57 tools)
- Update plugin/tool badge counts: 26→28 plugins, 189→249 tools
- Align ton-trading-bot README headings with other plugins:
  - "Installation" → "Install" + restart note
  - "Usage Examples" → "Usage" with bullet list style
  - "Tool Schemas" → "Schemas"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
docs: add ton-bridge and github-dev-assistant to main README, align ton-trading-bot README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants