fix(ton-bridge): remove empty package.json/lock to prevent npm install failure#26
Merged
xlabtg merged 3 commits intoxlabtg:mainfrom Mar 19, 2026
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: xlabtg#25
…l failure The ton-bridge plugin had package.json and package-lock.json files but declared no npm dependencies. The PluginLoader in teleton-agent runs `npm ci` for any plugin directory that contains both files, causing `Error: spawn npm ENOENT` in environments where npm is not in PATH (e.g. the agent's production runtime). This prevented the plugin from being marked as available, resulting in the "TON Bridge недоступен — модуль не запущен" message. Plugins with no external dependencies should not have package.json — consistent with all other zero-dependency plugins in the repo (boards, casino, crypto-prices, dyor, example, fragment, etc.). Also adds 25 unit tests covering manifest exports, all three tools (ton_bridge_open, ton_bridge_about, ton_bridge_custom_message), buttonText fallback logic, startParam URL building, and error handling. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This reverts commit 8eccfe6.
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause
The
ton-bridgeplugin hadpackage.jsonandpackage-lock.jsonfiles but declared zero npm dependencies. The PluginLoader in teleton-agent runsnpm cifor every plugin directory that contains both files. In environments wherenpmis not on PATH (the agent's runtime), this fails with:This caused the plugin to be unavailable, producing the secondary error:
The rate-limit message (
API rate limited — Telegram заблокировал запросы после 3 неудачных попыток) is a separate concern in the agent, not caused by the plugin itself.Fix
Removed
package.jsonandpackage-lock.jsonfromplugins/ton-bridge/. The plugin has no external npm dependencies, so these files serve no purpose. This matches the pattern of all other zero-dependency plugins in the repo (boards,casino,crypto-prices,dyor,example,fragment,giftstat, etc.) — none of them have apackage.json.Tests
Added 25 unit tests in
plugins/ton-bridge/tests/index.test.jsusing Node's built-in test runner:name,version,sdkVersion,defaultConfig)tools(sdk)returns array of 3 tools with required fieldston_bridge_open: success/failure, custom message, custom buttonText, SDK config fallback, URL contains TONBridge_robotton_bridge_about: success/failure, message contentton_bridge_custom_message: success/failure,customMessagerequired fieldstartParamURL building: appended when set, omitted when emptyAll 25 tests pass locally.
Checklist
[OK] ton-bridge: 3 tool(s) validated)Fixes #25
This PR was created automatically by the AI issue solver