@anh3d0nic/qwen-code-termux-ice 21.0.1 → 21.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/qwen-ice +127 -331
- package/core/ice-core.js +101 -0
- package/core-dist/index.d.ts +6 -0
- package/core-dist/index.js +7 -0
- package/core-dist/index.js.map +1 -0
- package/core-dist/src/__mocks__/fs/promises.d.ts +11 -0
- package/core-dist/src/__mocks__/fs/promises.js +17 -0
- package/core-dist/src/__mocks__/fs/promises.js.map +1 -0
- package/core-dist/src/config/config.d.ts +648 -0
- package/core-dist/src/config/config.js +1374 -0
- package/core-dist/src/config/config.js.map +1 -0
- package/core-dist/src/config/config.test.d.ts +6 -0
- package/core-dist/src/config/config.test.js +1116 -0
- package/core-dist/src/config/config.test.js.map +1 -0
- package/core-dist/src/config/constants.d.ts +11 -0
- package/core-dist/src/config/constants.js +16 -0
- package/core-dist/src/config/constants.js.map +1 -0
- package/core-dist/src/config/models.d.ts +9 -0
- package/core-dist/src/config/models.js +10 -0
- package/core-dist/src/config/models.js.map +1 -0
- package/core-dist/src/config/storage.d.ts +38 -0
- package/core-dist/src/config/storage.js +114 -0
- package/core-dist/src/config/storage.js.map +1 -0
- package/core-dist/src/config/storage.test.d.ts +6 -0
- package/core-dist/src/config/storage.test.js +36 -0
- package/core-dist/src/config/storage.test.js.map +1 -0
- package/core-dist/src/confirmation-bus/message-bus.d.ts +22 -0
- package/core-dist/src/confirmation-bus/message-bus.js +98 -0
- package/core-dist/src/confirmation-bus/message-bus.js.map +1 -0
- package/core-dist/src/confirmation-bus/types.d.ts +104 -0
- package/core-dist/src/confirmation-bus/types.js +16 -0
- package/core-dist/src/confirmation-bus/types.js.map +1 -0
- package/core-dist/src/core/__tests__/openaiTimeoutHandling.test.d.ts +6 -0
- package/core-dist/src/core/__tests__/openaiTimeoutHandling.test.js +298 -0
- package/core-dist/src/core/__tests__/openaiTimeoutHandling.test.js.map +1 -0
- package/core-dist/src/core/__tests__/orphanedToolCallsTest.d.ts +64 -0
- package/core-dist/src/core/__tests__/orphanedToolCallsTest.js +122 -0
- package/core-dist/src/core/__tests__/orphanedToolCallsTest.js.map +1 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.d.ts +28 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.js +349 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.js.map +1 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.test.d.ts +6 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.test.js +396 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.test.js.map +1 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.d.ts +48 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.js +449 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.js.map +1 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.test.d.ts +6 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.test.js +843 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.test.js.map +1 -0
- package/core-dist/src/core/anthropicContentGenerator/index.d.ts +9 -0
- package/core-dist/src/core/anthropicContentGenerator/index.js +11 -0
- package/core-dist/src/core/anthropicContentGenerator/index.js.map +1 -0
- package/core-dist/src/core/baseLlmClient.d.ts +48 -0
- package/core-dist/src/core/baseLlmClient.js +98 -0
- package/core-dist/src/core/baseLlmClient.js.map +1 -0
- package/core-dist/src/core/baseLlmClient.test.d.ts +6 -0
- package/core-dist/src/core/baseLlmClient.test.js +319 -0
- package/core-dist/src/core/baseLlmClient.test.js.map +1 -0
- package/core-dist/src/core/client.d.ts +48 -0
- package/core-dist/src/core/client.js +547 -0
- package/core-dist/src/core/client.js.map +1 -0
- package/core-dist/src/core/client.test.d.ts +6 -0
- package/core-dist/src/core/client.test.js +1885 -0
- package/core-dist/src/core/client.test.js.map +1 -0
- package/core-dist/src/core/contentGenerator.d.ts +100 -0
- package/core-dist/src/core/contentGenerator.js +162 -0
- package/core-dist/src/core/contentGenerator.js.map +1 -0
- package/core-dist/src/core/contentGenerator.test.d.ts +6 -0
- package/core-dist/src/core/contentGenerator.test.js +95 -0
- package/core-dist/src/core/contentGenerator.test.js.map +1 -0
- package/core-dist/src/core/coreToolScheduler.d.ts +142 -0
- package/core-dist/src/core/coreToolScheduler.js +872 -0
- package/core-dist/src/core/coreToolScheduler.js.map +1 -0
- package/core-dist/src/core/coreToolScheduler.test.d.ts +6 -0
- package/core-dist/src/core/coreToolScheduler.test.js +2221 -0
- package/core-dist/src/core/coreToolScheduler.test.js.map +1 -0
- package/core-dist/src/core/geminiChat.d.ts +122 -0
- package/core-dist/src/core/geminiChat.js +571 -0
- package/core-dist/src/core/geminiChat.js.map +1 -0
- package/core-dist/src/core/geminiChat.test.d.ts +6 -0
- package/core-dist/src/core/geminiChat.test.js +1276 -0
- package/core-dist/src/core/geminiChat.test.js.map +1 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.d.ts +38 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.js +193 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.js.map +1 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.test.d.ts +6 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.test.js +304 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.test.js.map +1 -0
- package/core-dist/src/core/geminiContentGenerator/index.d.ts +12 -0
- package/core-dist/src/core/geminiContentGenerator/index.js +36 -0
- package/core-dist/src/core/geminiContentGenerator/index.js.map +1 -0
- package/core-dist/src/core/geminiContentGenerator/index.test.d.ts +6 -0
- package/core-dist/src/core/geminiContentGenerator/index.test.js +34 -0
- package/core-dist/src/core/geminiContentGenerator/index.test.js.map +1 -0
- package/core-dist/src/core/geminiRequest.d.ts +13 -0
- package/core-dist/src/core/geminiRequest.js +11 -0
- package/core-dist/src/core/geminiRequest.js.map +1 -0
- package/core-dist/src/core/geminiRequest.test.d.ts +6 -0
- package/core-dist/src/core/geminiRequest.test.js +73 -0
- package/core-dist/src/core/geminiRequest.test.js.map +1 -0
- package/core-dist/src/core/logger.d.ts +68 -0
- package/core-dist/src/core/logger.js +364 -0
- package/core-dist/src/core/logger.js.map +1 -0
- package/core-dist/src/core/logger.test.d.ts +6 -0
- package/core-dist/src/core/logger.test.js +520 -0
- package/core-dist/src/core/logger.test.js.map +1 -0
- package/core-dist/src/core/loggingContentGenerator/index.d.ts +6 -0
- package/core-dist/src/core/loggingContentGenerator/index.js +7 -0
- package/core-dist/src/core/loggingContentGenerator/index.js.map +1 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.d.ts +36 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.js +321 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.js.map +1 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.test.d.ts +6 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.test.js +287 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.test.js.map +1 -0
- package/core-dist/src/core/modalityDefaults.d.ts +14 -0
- package/core-dist/src/core/modalityDefaults.js +81 -0
- package/core-dist/src/core/modalityDefaults.js.map +1 -0
- package/core-dist/src/core/modalityDefaults.test.d.ts +6 -0
- package/core-dist/src/core/modalityDefaults.test.js +181 -0
- package/core-dist/src/core/modalityDefaults.test.js.map +1 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.d.ts +16 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.js +30 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.js.map +1 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.test.d.ts +6 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.test.js +296 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/constants.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/constants.js +7 -0
- package/core-dist/src/core/openaiContentGenerator/constants.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/converter.d.ts +133 -0
- package/core-dist/src/core/openaiContentGenerator/converter.js +1020 -0
- package/core-dist/src/core/openaiContentGenerator/converter.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/converter.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/converter.test.js +1966 -0
- package/core-dist/src/core/openaiContentGenerator/converter.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.d.ts +27 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.js +84 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.test.js +267 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/index.d.ts +21 -0
- package/core-dist/src/core/openaiContentGenerator/index.js +43 -0
- package/core-dist/src/core/openaiContentGenerator/index.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.d.ts +22 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.js +117 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.test.js +298 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.d.ts +74 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.js +327 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.test.js +1143 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/README.md +61 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.d.ts +70 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.js +258 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.test.js +781 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.d.ts +14 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.js +21 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.test.js +51 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.d.ts +17 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.js +52 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.test.js +227 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/index.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/index.js +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/index.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.d.ts +17 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.js +25 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.test.js +66 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.d.ts +8 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.js +21 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.test.js +152 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/types.d.ts +26 -0
- package/core-dist/src/core/openaiContentGenerator/provider/types.js +2 -0
- package/core-dist/src/core/openaiContentGenerator/provider/types.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.d.ts +157 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.js +390 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.test.js +585 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.test.js.map +1 -0
- package/core-dist/src/core/prompts.d.ts +81 -0
- package/core-dist/src/core/prompts.js +996 -0
- package/core-dist/src/core/prompts.js.map +1 -0
- package/core-dist/src/core/prompts.test.d.ts +6 -0
- package/core-dist/src/core/prompts.test.js +485 -0
- package/core-dist/src/core/prompts.test.js.map +1 -0
- package/core-dist/src/core/tokenLimits.d.ts +29 -0
- package/core-dist/src/core/tokenLimits.js +171 -0
- package/core-dist/src/core/tokenLimits.js.map +1 -0
- package/core-dist/src/core/tokenLimits.test.d.ts +1 -0
- package/core-dist/src/core/tokenLimits.test.js +270 -0
- package/core-dist/src/core/tokenLimits.test.js.map +1 -0
- package/core-dist/src/core/turn.d.ts +161 -0
- package/core-dist/src/core/turn.js +197 -0
- package/core-dist/src/core/turn.js.map +1 -0
- package/core-dist/src/core/turn.test.d.ts +6 -0
- package/core-dist/src/core/turn.test.js +817 -0
- package/core-dist/src/core/turn.test.js.map +1 -0
- package/core-dist/src/extension/claude-converter.d.ts +121 -0
- package/core-dist/src/extension/claude-converter.js +572 -0
- package/core-dist/src/extension/claude-converter.js.map +1 -0
- package/core-dist/src/extension/claude-converter.test.d.ts +6 -0
- package/core-dist/src/extension/claude-converter.test.js +305 -0
- package/core-dist/src/extension/claude-converter.test.js.map +1 -0
- package/core-dist/src/extension/extensionManager.d.ts +159 -0
- package/core-dist/src/extension/extensionManager.js +829 -0
- package/core-dist/src/extension/extensionManager.js.map +1 -0
- package/core-dist/src/extension/extensionManager.test.d.ts +6 -0
- package/core-dist/src/extension/extensionManager.test.js +598 -0
- package/core-dist/src/extension/extensionManager.test.js.map +1 -0
- package/core-dist/src/extension/extensionSettings.d.ts +33 -0
- package/core-dist/src/extension/extensionSettings.js +186 -0
- package/core-dist/src/extension/extensionSettings.js.map +1 -0
- package/core-dist/src/extension/extensionSettings.test.d.ts +1 -0
- package/core-dist/src/extension/extensionSettings.test.js +488 -0
- package/core-dist/src/extension/extensionSettings.test.js.map +1 -0
- package/core-dist/src/extension/gemini-converter.d.ts +47 -0
- package/core-dist/src/extension/gemini-converter.js +185 -0
- package/core-dist/src/extension/gemini-converter.js.map +1 -0
- package/core-dist/src/extension/gemini-converter.test.d.ts +6 -0
- package/core-dist/src/extension/gemini-converter.test.js +128 -0
- package/core-dist/src/extension/gemini-converter.test.js.map +1 -0
- package/core-dist/src/extension/github.d.ts +30 -0
- package/core-dist/src/extension/github.js +330 -0
- package/core-dist/src/extension/github.js.map +1 -0
- package/core-dist/src/extension/github.test.d.ts +6 -0
- package/core-dist/src/extension/github.test.js +376 -0
- package/core-dist/src/extension/github.test.js.map +1 -0
- package/core-dist/src/extension/index.d.ts +6 -0
- package/core-dist/src/extension/index.js +7 -0
- package/core-dist/src/extension/index.js.map +1 -0
- package/core-dist/src/extension/marketplace.d.ts +19 -0
- package/core-dist/src/extension/marketplace.js +222 -0
- package/core-dist/src/extension/marketplace.js.map +1 -0
- package/core-dist/src/extension/marketplace.test.d.ts +6 -0
- package/core-dist/src/extension/marketplace.test.js +215 -0
- package/core-dist/src/extension/marketplace.test.js.map +1 -0
- package/core-dist/src/extension/override.d.ts +25 -0
- package/core-dist/src/extension/override.js +82 -0
- package/core-dist/src/extension/override.js.map +1 -0
- package/core-dist/src/extension/override.test.d.ts +6 -0
- package/core-dist/src/extension/override.test.js +94 -0
- package/core-dist/src/extension/override.test.js.map +1 -0
- package/core-dist/src/extension/settings.d.ts +39 -0
- package/core-dist/src/extension/settings.js +116 -0
- package/core-dist/src/extension/settings.js.map +1 -0
- package/core-dist/src/extension/settings.test.d.ts +6 -0
- package/core-dist/src/extension/settings.test.js +125 -0
- package/core-dist/src/extension/settings.test.js.map +1 -0
- package/core-dist/src/extension/storage.d.ts +9 -0
- package/core-dist/src/extension/storage.js +38 -0
- package/core-dist/src/extension/storage.js.map +1 -0
- package/core-dist/src/extension/storage.test.d.ts +6 -0
- package/core-dist/src/extension/storage.test.js +64 -0
- package/core-dist/src/extension/storage.test.js.map +1 -0
- package/core-dist/src/extension/variableSchema.d.ts +40 -0
- package/core-dist/src/extension/variableSchema.js +26 -0
- package/core-dist/src/extension/variableSchema.js.map +1 -0
- package/core-dist/src/extension/variables.d.ts +21 -0
- package/core-dist/src/extension/variables.js +46 -0
- package/core-dist/src/extension/variables.js.map +1 -0
- package/core-dist/src/extension/variables.test.d.ts +6 -0
- package/core-dist/src/extension/variables.test.js +17 -0
- package/core-dist/src/extension/variables.test.js.map +1 -0
- package/core-dist/src/hooks/hookAggregator.d.ts +66 -0
- package/core-dist/src/hooks/hookAggregator.js +280 -0
- package/core-dist/src/hooks/hookAggregator.js.map +1 -0
- package/core-dist/src/hooks/hookAggregator.test.d.ts +6 -0
- package/core-dist/src/hooks/hookAggregator.test.js +449 -0
- package/core-dist/src/hooks/hookAggregator.test.js.map +1 -0
- package/core-dist/src/hooks/hookEventHandler.d.ts +42 -0
- package/core-dist/src/hooks/hookEventHandler.js +127 -0
- package/core-dist/src/hooks/hookEventHandler.js.map +1 -0
- package/core-dist/src/hooks/hookEventHandler.test.d.ts +6 -0
- package/core-dist/src/hooks/hookEventHandler.test.js +183 -0
- package/core-dist/src/hooks/hookEventHandler.test.js.map +1 -0
- package/core-dist/src/hooks/hookPlanner.d.ts +42 -0
- package/core-dist/src/hooks/hookPlanner.js +101 -0
- package/core-dist/src/hooks/hookPlanner.js.map +1 -0
- package/core-dist/src/hooks/hookPlanner.test.d.ts +6 -0
- package/core-dist/src/hooks/hookPlanner.test.js +303 -0
- package/core-dist/src/hooks/hookPlanner.test.js.map +1 -0
- package/core-dist/src/hooks/hookRegistry.d.ts +106 -0
- package/core-dist/src/hooks/hookRegistry.js +225 -0
- package/core-dist/src/hooks/hookRegistry.js.map +1 -0
- package/core-dist/src/hooks/hookRegistry.test.d.ts +6 -0
- package/core-dist/src/hooks/hookRegistry.test.js +539 -0
- package/core-dist/src/hooks/hookRegistry.test.js.map +1 -0
- package/core-dist/src/hooks/hookRunner.d.ts +40 -0
- package/core-dist/src/hooks/hookRunner.js +318 -0
- package/core-dist/src/hooks/hookRunner.js.map +1 -0
- package/core-dist/src/hooks/hookRunner.test.d.ts +6 -0
- package/core-dist/src/hooks/hookRunner.test.js +466 -0
- package/core-dist/src/hooks/hookRunner.test.js.map +1 -0
- package/core-dist/src/hooks/hookSystem.d.ts +43 -0
- package/core-dist/src/hooks/hookSystem.js +75 -0
- package/core-dist/src/hooks/hookSystem.js.map +1 -0
- package/core-dist/src/hooks/hookSystem.test.d.ts +6 -0
- package/core-dist/src/hooks/hookSystem.test.js +237 -0
- package/core-dist/src/hooks/hookSystem.test.js.map +1 -0
- package/core-dist/src/hooks/index.d.ts +16 -0
- package/core-dist/src/hooks/index.js +16 -0
- package/core-dist/src/hooks/index.js.map +1 -0
- package/core-dist/src/hooks/trustedHooks.d.ts +28 -0
- package/core-dist/src/hooks/trustedHooks.js +91 -0
- package/core-dist/src/hooks/trustedHooks.js.map +1 -0
- package/core-dist/src/hooks/types.d.ts +498 -0
- package/core-dist/src/hooks/types.js +292 -0
- package/core-dist/src/hooks/types.js.map +1 -0
- package/core-dist/src/ide/constants.d.ts +9 -0
- package/core-dist/src/ide/constants.js +10 -0
- package/core-dist/src/ide/constants.js.map +1 -0
- package/core-dist/src/ide/detect-ide.d.ts +56 -0
- package/core-dist/src/ide/detect-ide.js +68 -0
- package/core-dist/src/ide/detect-ide.js.map +1 -0
- package/core-dist/src/ide/detect-ide.test.d.ts +6 -0
- package/core-dist/src/ide/detect-ide.test.js +113 -0
- package/core-dist/src/ide/detect-ide.test.js.map +1 -0
- package/core-dist/src/ide/ide-client.d.ts +132 -0
- package/core-dist/src/ide/ide-client.js +750 -0
- package/core-dist/src/ide/ide-client.js.map +1 -0
- package/core-dist/src/ide/ide-client.test.d.ts +6 -0
- package/core-dist/src/ide/ide-client.test.js +463 -0
- package/core-dist/src/ide/ide-client.test.js.map +1 -0
- package/core-dist/src/ide/ide-installer.d.ts +14 -0
- package/core-dist/src/ide/ide-installer.js +112 -0
- package/core-dist/src/ide/ide-installer.js.map +1 -0
- package/core-dist/src/ide/ide-installer.test.d.ts +6 -0
- package/core-dist/src/ide/ide-installer.test.js +134 -0
- package/core-dist/src/ide/ide-installer.test.js.map +1 -0
- package/core-dist/src/ide/ideContext.d.ts +44 -0
- package/core-dist/src/ide/ideContext.js +101 -0
- package/core-dist/src/ide/ideContext.js.map +1 -0
- package/core-dist/src/ide/ideContext.test.d.ts +6 -0
- package/core-dist/src/ide/ideContext.test.js +393 -0
- package/core-dist/src/ide/ideContext.test.js.map +1 -0
- package/core-dist/src/ide/process-utils.d.ts +21 -0
- package/core-dist/src/ide/process-utils.js +170 -0
- package/core-dist/src/ide/process-utils.js.map +1 -0
- package/core-dist/src/ide/process-utils.test.d.ts +6 -0
- package/core-dist/src/ide/process-utils.test.js +130 -0
- package/core-dist/src/ide/process-utils.test.js.map +1 -0
- package/core-dist/src/ide/types.d.ts +486 -0
- package/core-dist/src/ide/types.js +138 -0
- package/core-dist/src/ide/types.js.map +1 -0
- package/core-dist/src/index.d.ts +179 -0
- package/core-dist/src/index.js +225 -0
- package/core-dist/src/index.js.map +1 -0
- package/core-dist/src/index.test.d.ts +6 -0
- package/core-dist/src/index.test.js +12 -0
- package/core-dist/src/index.test.js.map +1 -0
- package/core-dist/src/lsp/LspConfigLoader.d.ts +46 -0
- package/core-dist/src/lsp/LspConfigLoader.js +381 -0
- package/core-dist/src/lsp/LspConfigLoader.js.map +1 -0
- package/core-dist/src/lsp/LspConfigLoader.test.d.ts +6 -0
- package/core-dist/src/lsp/LspConfigLoader.test.js +80 -0
- package/core-dist/src/lsp/LspConfigLoader.test.js.map +1 -0
- package/core-dist/src/lsp/LspConnectionFactory.d.ts +62 -0
- package/core-dist/src/lsp/LspConnectionFactory.js +305 -0
- package/core-dist/src/lsp/LspConnectionFactory.js.map +1 -0
- package/core-dist/src/lsp/LspLanguageDetector.d.ts +39 -0
- package/core-dist/src/lsp/LspLanguageDetector.js +199 -0
- package/core-dist/src/lsp/LspLanguageDetector.js.map +1 -0
- package/core-dist/src/lsp/LspResponseNormalizer.d.ts +122 -0
- package/core-dist/src/lsp/LspResponseNormalizer.js +710 -0
- package/core-dist/src/lsp/LspResponseNormalizer.js.map +1 -0
- package/core-dist/src/lsp/LspServerManager.d.ts +87 -0
- package/core-dist/src/lsp/LspServerManager.js +563 -0
- package/core-dist/src/lsp/LspServerManager.js.map +1 -0
- package/core-dist/src/lsp/NativeLspClient.d.ts +149 -0
- package/core-dist/src/lsp/NativeLspClient.js +169 -0
- package/core-dist/src/lsp/NativeLspClient.js.map +1 -0
- package/core-dist/src/lsp/NativeLspService.d.ts +106 -0
- package/core-dist/src/lsp/NativeLspService.integration.test.d.ts +6 -0
- package/core-dist/src/lsp/NativeLspService.integration.test.js +663 -0
- package/core-dist/src/lsp/NativeLspService.integration.test.js.map +1 -0
- package/core-dist/src/lsp/NativeLspService.js +623 -0
- package/core-dist/src/lsp/NativeLspService.js.map +1 -0
- package/core-dist/src/lsp/NativeLspService.test.d.ts +6 -0
- package/core-dist/src/lsp/NativeLspService.test.js +99 -0
- package/core-dist/src/lsp/NativeLspService.test.js.map +1 -0
- package/core-dist/src/lsp/constants.d.ts +35 -0
- package/core-dist/src/lsp/constants.js +86 -0
- package/core-dist/src/lsp/constants.js.map +1 -0
- package/core-dist/src/lsp/types.d.ts +409 -0
- package/core-dist/src/lsp/types.js +7 -0
- package/core-dist/src/lsp/types.js.map +1 -0
- package/core-dist/src/mcp/constants.d.ts +22 -0
- package/core-dist/src/mcp/constants.js +23 -0
- package/core-dist/src/mcp/constants.js.map +1 -0
- package/core-dist/src/mcp/google-auth-provider.d.ts +23 -0
- package/core-dist/src/mcp/google-auth-provider.js +75 -0
- package/core-dist/src/mcp/google-auth-provider.js.map +1 -0
- package/core-dist/src/mcp/google-auth-provider.test.d.ts +6 -0
- package/core-dist/src/mcp/google-auth-provider.test.js +89 -0
- package/core-dist/src/mcp/google-auth-provider.test.js.map +1 -0
- package/core-dist/src/mcp/oauth-provider.d.ts +150 -0
- package/core-dist/src/mcp/oauth-provider.js +617 -0
- package/core-dist/src/mcp/oauth-provider.js.map +1 -0
- package/core-dist/src/mcp/oauth-provider.test.d.ts +6 -0
- package/core-dist/src/mcp/oauth-provider.test.js +917 -0
- package/core-dist/src/mcp/oauth-provider.test.js.map +1 -0
- package/core-dist/src/mcp/oauth-token-storage.d.ts +65 -0
- package/core-dist/src/mcp/oauth-token-storage.js +182 -0
- package/core-dist/src/mcp/oauth-token-storage.js.map +1 -0
- package/core-dist/src/mcp/oauth-token-storage.test.d.ts +6 -0
- package/core-dist/src/mcp/oauth-token-storage.test.js +307 -0
- package/core-dist/src/mcp/oauth-token-storage.test.js.map +1 -0
- package/core-dist/src/mcp/oauth-utils.d.ts +124 -0
- package/core-dist/src/mcp/oauth-utils.js +252 -0
- package/core-dist/src/mcp/oauth-utils.js.map +1 -0
- package/core-dist/src/mcp/oauth-utils.test.d.ts +6 -0
- package/core-dist/src/mcp/oauth-utils.test.js +220 -0
- package/core-dist/src/mcp/oauth-utils.test.js.map +1 -0
- package/core-dist/src/mcp/sa-impersonation-provider.d.ts +33 -0
- package/core-dist/src/mcp/sa-impersonation-provider.js +133 -0
- package/core-dist/src/mcp/sa-impersonation-provider.js.map +1 -0
- package/core-dist/src/mcp/sa-impersonation-provider.test.d.ts +6 -0
- package/core-dist/src/mcp/sa-impersonation-provider.test.js +117 -0
- package/core-dist/src/mcp/sa-impersonation-provider.test.js.map +1 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.d.ts +19 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.js +36 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.js.map +1 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.test.d.ts +6 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.test.js +160 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.test.js.map +1 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.d.ts +24 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.js +144 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.js.map +1 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.test.d.ts +6 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.test.js +235 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.test.js.map +1 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.d.ts +23 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.js +78 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.js.map +1 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.test.d.ts +6 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.test.js +193 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.test.js.map +1 -0
- package/core-dist/src/mcp/token-storage/index.d.ts +11 -0
- package/core-dist/src/mcp/token-storage/index.js +12 -0
- package/core-dist/src/mcp/token-storage/index.js.map +1 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.d.ts +35 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.js +248 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.test.d.ts +6 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.test.js +254 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.test.js.map +1 -0
- package/core-dist/src/mcp/token-storage/types.d.ts +38 -0
- package/core-dist/src/mcp/token-storage/types.js +11 -0
- package/core-dist/src/mcp/token-storage/types.js.map +1 -0
- package/core-dist/src/mocks/msw.d.ts +6 -0
- package/core-dist/src/mocks/msw.js +8 -0
- package/core-dist/src/mocks/msw.js.map +1 -0
- package/core-dist/src/models/constants.d.ts +71 -0
- package/core-dist/src/models/constants.js +92 -0
- package/core-dist/src/models/constants.js.map +1 -0
- package/core-dist/src/models/index.d.ts +10 -0
- package/core-dist/src/models/index.js +12 -0
- package/core-dist/src/models/index.js.map +1 -0
- package/core-dist/src/models/modelConfigErrors.d.ts +46 -0
- package/core-dist/src/models/modelConfigErrors.js +87 -0
- package/core-dist/src/models/modelConfigErrors.js.map +1 -0
- package/core-dist/src/models/modelConfigResolver.d.ts +84 -0
- package/core-dist/src/models/modelConfigResolver.js +204 -0
- package/core-dist/src/models/modelConfigResolver.js.map +1 -0
- package/core-dist/src/models/modelConfigResolver.test.d.ts +6 -0
- package/core-dist/src/models/modelConfigResolver.test.js +302 -0
- package/core-dist/src/models/modelConfigResolver.test.js.map +1 -0
- package/core-dist/src/models/modelRegistry.d.ts +55 -0
- package/core-dist/src/models/modelRegistry.js +182 -0
- package/core-dist/src/models/modelRegistry.js.map +1 -0
- package/core-dist/src/models/modelRegistry.test.d.ts +6 -0
- package/core-dist/src/models/modelRegistry.test.js +408 -0
- package/core-dist/src/models/modelRegistry.test.js.map +1 -0
- package/core-dist/src/models/modelsConfig.d.ts +343 -0
- package/core-dist/src/models/modelsConfig.js +957 -0
- package/core-dist/src/models/modelsConfig.js.map +1 -0
- package/core-dist/src/models/modelsConfig.test.d.ts +6 -0
- package/core-dist/src/models/modelsConfig.test.js +1242 -0
- package/core-dist/src/models/modelsConfig.test.js.map +1 -0
- package/core-dist/src/models/types.d.ts +114 -0
- package/core-dist/src/models/types.js +7 -0
- package/core-dist/src/models/types.js.map +1 -0
- package/core-dist/src/output/json-formatter.d.ts +11 -0
- package/core-dist/src/output/json-formatter.js +30 -0
- package/core-dist/src/output/json-formatter.js.map +1 -0
- package/core-dist/src/output/json-formatter.test.d.ts +6 -0
- package/core-dist/src/output/json-formatter.test.js +266 -0
- package/core-dist/src/output/json-formatter.test.js.map +1 -0
- package/core-dist/src/output/types.d.ts +25 -0
- package/core-dist/src/output/types.js +17 -0
- package/core-dist/src/output/types.js.map +1 -0
- package/core-dist/src/prompts/mcp-prompts.d.ts +8 -0
- package/core-dist/src/prompts/mcp-prompts.js +13 -0
- package/core-dist/src/prompts/mcp-prompts.js.map +1 -0
- package/core-dist/src/prompts/prompt-registry.d.ts +34 -0
- package/core-dist/src/prompts/prompt-registry.js +65 -0
- package/core-dist/src/prompts/prompt-registry.js.map +1 -0
- package/core-dist/src/qwen/qwenContentGenerator.d.ts +71 -0
- package/core-dist/src/qwen/qwenContentGenerator.js +182 -0
- package/core-dist/src/qwen/qwenContentGenerator.js.map +1 -0
- package/core-dist/src/qwen/qwenContentGenerator.test.d.ts +6 -0
- package/core-dist/src/qwen/qwenContentGenerator.test.js +1175 -0
- package/core-dist/src/qwen/qwenContentGenerator.test.js.map +1 -0
- package/core-dist/src/qwen/qwenOAuth2.d.ts +195 -0
- package/core-dist/src/qwen/qwenOAuth2.js +677 -0
- package/core-dist/src/qwen/qwenOAuth2.js.map +1 -0
- package/core-dist/src/qwen/qwenOAuth2.test.d.ts +6 -0
- package/core-dist/src/qwen/qwenOAuth2.test.js +1621 -0
- package/core-dist/src/qwen/qwenOAuth2.test.js.map +1 -0
- package/core-dist/src/qwen/sharedTokenManager.d.ts +196 -0
- package/core-dist/src/qwen/sharedTokenManager.js +649 -0
- package/core-dist/src/qwen/sharedTokenManager.js.map +1 -0
- package/core-dist/src/qwen/sharedTokenManager.test.d.ts +7 -0
- package/core-dist/src/qwen/sharedTokenManager.test.js +662 -0
- package/core-dist/src/qwen/sharedTokenManager.test.js.map +1 -0
- package/core-dist/src/services/chatCompressionService.d.ts +32 -0
- package/core-dist/src/services/chatCompressionService.js +213 -0
- package/core-dist/src/services/chatCompressionService.js.map +1 -0
- package/core-dist/src/services/chatCompressionService.test.d.ts +6 -0
- package/core-dist/src/services/chatCompressionService.test.js +343 -0
- package/core-dist/src/services/chatCompressionService.test.js.map +1 -0
- package/core-dist/src/services/chatRecordingService.d.ts +215 -0
- package/core-dist/src/services/chatRecordingService.js +285 -0
- package/core-dist/src/services/chatRecordingService.js.map +1 -0
- package/core-dist/src/services/chatRecordingService.test.d.ts +6 -0
- package/core-dist/src/services/chatRecordingService.test.js +299 -0
- package/core-dist/src/services/chatRecordingService.test.js.map +1 -0
- package/core-dist/src/services/fileDiscoveryService.d.ts +45 -0
- package/core-dist/src/services/fileDiscoveryService.js +104 -0
- package/core-dist/src/services/fileDiscoveryService.js.map +1 -0
- package/core-dist/src/services/fileDiscoveryService.test.d.ts +6 -0
- package/core-dist/src/services/fileDiscoveryService.test.js +143 -0
- package/core-dist/src/services/fileDiscoveryService.test.js.map +1 -0
- package/core-dist/src/services/fileSystemService.d.ts +88 -0
- package/core-dist/src/services/fileSystemService.js +131 -0
- package/core-dist/src/services/fileSystemService.js.map +1 -0
- package/core-dist/src/services/fileSystemService.test.d.ts +6 -0
- package/core-dist/src/services/fileSystemService.test.js +216 -0
- package/core-dist/src/services/fileSystemService.test.js.map +1 -0
- package/core-dist/src/services/gitService.d.ts +22 -0
- package/core-dist/src/services/gitService.js +98 -0
- package/core-dist/src/services/gitService.js.map +1 -0
- package/core-dist/src/services/gitService.test.d.ts +6 -0
- package/core-dist/src/services/gitService.test.js +187 -0
- package/core-dist/src/services/gitService.test.js.map +1 -0
- package/core-dist/src/services/loopDetectionService.d.ts +86 -0
- package/core-dist/src/services/loopDetectionService.js +239 -0
- package/core-dist/src/services/loopDetectionService.js.map +1 -0
- package/core-dist/src/services/loopDetectionService.test.d.ts +6 -0
- package/core-dist/src/services/loopDetectionService.test.js +478 -0
- package/core-dist/src/services/loopDetectionService.test.js.map +1 -0
- package/core-dist/src/services/sessionService.d.ts +200 -0
- package/core-dist/src/services/sessionService.js +527 -0
- package/core-dist/src/services/sessionService.js.map +1 -0
- package/core-dist/src/services/sessionService.test.d.ts +6 -0
- package/core-dist/src/services/sessionService.test.js +576 -0
- package/core-dist/src/services/sessionService.test.js.map +1 -0
- package/core-dist/src/services/shellExecutionService.d.ts +104 -0
- package/core-dist/src/services/shellExecutionService.js +626 -0
- package/core-dist/src/services/shellExecutionService.js.map +1 -0
- package/core-dist/src/services/shellExecutionService.test.d.ts +6 -0
- package/core-dist/src/services/shellExecutionService.test.js +684 -0
- package/core-dist/src/services/shellExecutionService.test.js.map +1 -0
- package/core-dist/src/skills/index.d.ts +19 -0
- package/core-dist/src/skills/index.js +9 -0
- package/core-dist/src/skills/index.js.map +1 -0
- package/core-dist/src/skills/skill-load.d.ts +4 -0
- package/core-dist/src/skills/skill-load.js +137 -0
- package/core-dist/src/skills/skill-load.js.map +1 -0
- package/core-dist/src/skills/skill-load.test.d.ts +6 -0
- package/core-dist/src/skills/skill-load.test.js +237 -0
- package/core-dist/src/skills/skill-load.test.js.map +1 -0
- package/core-dist/src/skills/skill-manager.d.ts +134 -0
- package/core-dist/src/skills/skill-manager.js +505 -0
- package/core-dist/src/skills/skill-manager.js.map +1 -0
- package/core-dist/src/skills/skill-manager.test.d.ts +6 -0
- package/core-dist/src/skills/skill-manager.test.js +527 -0
- package/core-dist/src/skills/skill-manager.test.js.map +1 -0
- package/core-dist/src/skills/types.d.ts +88 -0
- package/core-dist/src/skills/types.js +29 -0
- package/core-dist/src/skills/types.js.map +1 -0
- package/core-dist/src/subagents/builtin-agents.d.ts +35 -0
- package/core-dist/src/subagents/builtin-agents.js +85 -0
- package/core-dist/src/subagents/builtin-agents.js.map +1 -0
- package/core-dist/src/subagents/builtin-agents.test.d.ts +6 -0
- package/core-dist/src/subagents/builtin-agents.test.js +78 -0
- package/core-dist/src/subagents/builtin-agents.test.js.map +1 -0
- package/core-dist/src/subagents/index.d.ts +29 -0
- package/core-dist/src/subagents/index.js +15 -0
- package/core-dist/src/subagents/index.js.map +1 -0
- package/core-dist/src/subagents/subagent-events.d.ts +105 -0
- package/core-dist/src/subagents/subagent-events.js +32 -0
- package/core-dist/src/subagents/subagent-events.js.map +1 -0
- package/core-dist/src/subagents/subagent-hooks.d.ts +29 -0
- package/core-dist/src/subagents/subagent-hooks.js +7 -0
- package/core-dist/src/subagents/subagent-hooks.js.map +1 -0
- package/core-dist/src/subagents/subagent-manager.d.ts +178 -0
- package/core-dist/src/subagents/subagent-manager.js +711 -0
- package/core-dist/src/subagents/subagent-manager.js.map +1 -0
- package/core-dist/src/subagents/subagent-manager.test.d.ts +6 -0
- package/core-dist/src/subagents/subagent-manager.test.js +829 -0
- package/core-dist/src/subagents/subagent-manager.test.js.map +1 -0
- package/core-dist/src/subagents/subagent-statistics.d.ts +50 -0
- package/core-dist/src/subagents/subagent-statistics.js +210 -0
- package/core-dist/src/subagents/subagent-statistics.js.map +1 -0
- package/core-dist/src/subagents/subagent-statistics.test.d.ts +6 -0
- package/core-dist/src/subagents/subagent-statistics.test.js +238 -0
- package/core-dist/src/subagents/subagent-statistics.test.js.map +1 -0
- package/core-dist/src/subagents/subagent.d.ts +167 -0
- package/core-dist/src/subagents/subagent.js +758 -0
- package/core-dist/src/subagents/subagent.js.map +1 -0
- package/core-dist/src/subagents/subagent.test.d.ts +6 -0
- package/core-dist/src/subagents/subagent.test.js +819 -0
- package/core-dist/src/subagents/subagent.test.js.map +1 -0
- package/core-dist/src/subagents/types.d.ts +224 -0
- package/core-dist/src/subagents/types.js +58 -0
- package/core-dist/src/subagents/types.js.map +1 -0
- package/core-dist/src/subagents/types.test.d.ts +6 -0
- package/core-dist/src/subagents/types.test.js +31 -0
- package/core-dist/src/subagents/types.test.js.map +1 -0
- package/core-dist/src/subagents/validation.d.ts +63 -0
- package/core-dist/src/subagents/validation.js +293 -0
- package/core-dist/src/subagents/validation.js.map +1 -0
- package/core-dist/src/subagents/validation.test.d.ts +6 -0
- package/core-dist/src/subagents/validation.test.js +330 -0
- package/core-dist/src/subagents/validation.test.js.map +1 -0
- package/core-dist/src/telemetry/config.d.ts +31 -0
- package/core-dist/src/telemetry/config.js +74 -0
- package/core-dist/src/telemetry/config.js.map +1 -0
- package/core-dist/src/telemetry/config.test.d.ts +6 -0
- package/core-dist/src/telemetry/config.test.js +124 -0
- package/core-dist/src/telemetry/config.test.js.map +1 -0
- package/core-dist/src/telemetry/constants.d.ts +39 -0
- package/core-dist/src/telemetry/constants.js +41 -0
- package/core-dist/src/telemetry/constants.js.map +1 -0
- package/core-dist/src/telemetry/file-exporters.d.ts +29 -0
- package/core-dist/src/telemetry/file-exporters.js +62 -0
- package/core-dist/src/telemetry/file-exporters.js.map +1 -0
- package/core-dist/src/telemetry/index.d.ts +25 -0
- package/core-dist/src/telemetry/index.js +31 -0
- package/core-dist/src/telemetry/index.js.map +1 -0
- package/core-dist/src/telemetry/integration.test.circular.d.ts +6 -0
- package/core-dist/src/telemetry/integration.test.circular.js +95 -0
- package/core-dist/src/telemetry/integration.test.circular.js.map +1 -0
- package/core-dist/src/telemetry/loggers.d.ts +40 -0
- package/core-dist/src/telemetry/loggers.js +712 -0
- package/core-dist/src/telemetry/loggers.js.map +1 -0
- package/core-dist/src/telemetry/loggers.test.circular.d.ts +6 -0
- package/core-dist/src/telemetry/loggers.test.circular.js +107 -0
- package/core-dist/src/telemetry/loggers.test.circular.js.map +1 -0
- package/core-dist/src/telemetry/loggers.test.d.ts +6 -0
- package/core-dist/src/telemetry/loggers.test.js +961 -0
- package/core-dist/src/telemetry/loggers.test.js.map +1 -0
- package/core-dist/src/telemetry/metrics.d.ts +320 -0
- package/core-dist/src/telemetry/metrics.js +532 -0
- package/core-dist/src/telemetry/metrics.js.map +1 -0
- package/core-dist/src/telemetry/metrics.test.d.ts +6 -0
- package/core-dist/src/telemetry/metrics.test.js +746 -0
- package/core-dist/src/telemetry/metrics.test.js.map +1 -0
- package/core-dist/src/telemetry/qwen-logger/event-types.d.ts +89 -0
- package/core-dist/src/telemetry/qwen-logger/event-types.js +2 -0
- package/core-dist/src/telemetry/qwen-logger/event-types.js.map +1 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.d.ts +102 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.js +739 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.js.map +1 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.test.d.ts +6 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.test.js +380 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.test.js.map +1 -0
- package/core-dist/src/telemetry/sdk.d.ts +9 -0
- package/core-dist/src/telemetry/sdk.js +163 -0
- package/core-dist/src/telemetry/sdk.js.map +1 -0
- package/core-dist/src/telemetry/sdk.test.d.ts +6 -0
- package/core-dist/src/telemetry/sdk.test.js +116 -0
- package/core-dist/src/telemetry/sdk.test.js.map +1 -0
- package/core-dist/src/telemetry/telemetry-utils.d.ts +6 -0
- package/core-dist/src/telemetry/telemetry-utils.js +14 -0
- package/core-dist/src/telemetry/telemetry-utils.js.map +1 -0
- package/core-dist/src/telemetry/telemetry-utils.test.d.ts +6 -0
- package/core-dist/src/telemetry/telemetry-utils.test.js +40 -0
- package/core-dist/src/telemetry/telemetry-utils.test.js.map +1 -0
- package/core-dist/src/telemetry/telemetry.test.d.ts +6 -0
- package/core-dist/src/telemetry/telemetry.test.js +49 -0
- package/core-dist/src/telemetry/telemetry.test.js.map +1 -0
- package/core-dist/src/telemetry/tool-call-decision.d.ts +13 -0
- package/core-dist/src/telemetry/tool-call-decision.js +29 -0
- package/core-dist/src/telemetry/tool-call-decision.js.map +1 -0
- package/core-dist/src/telemetry/types.d.ts +363 -0
- package/core-dist/src/telemetry/types.js +635 -0
- package/core-dist/src/telemetry/types.js.map +1 -0
- package/core-dist/src/telemetry/uiTelemetry.d.ts +80 -0
- package/core-dist/src/telemetry/uiTelemetry.js +164 -0
- package/core-dist/src/telemetry/uiTelemetry.js.map +1 -0
- package/core-dist/src/telemetry/uiTelemetry.test.d.ts +6 -0
- package/core-dist/src/telemetry/uiTelemetry.test.js +625 -0
- package/core-dist/src/telemetry/uiTelemetry.test.js.map +1 -0
- package/core-dist/src/test-utils/config.d.ts +17 -0
- package/core-dist/src/test-utils/config.js +31 -0
- package/core-dist/src/test-utils/config.js.map +1 -0
- package/core-dist/src/test-utils/index.d.ts +6 -0
- package/core-dist/src/test-utils/index.js +7 -0
- package/core-dist/src/test-utils/index.js.map +1 -0
- package/core-dist/src/test-utils/mock-tool.d.ts +66 -0
- package/core-dist/src/test-utils/mock-tool.js +121 -0
- package/core-dist/src/test-utils/mock-tool.js.map +1 -0
- package/core-dist/src/test-utils/mockWorkspaceContext.d.ts +13 -0
- package/core-dist/src/test-utils/mockWorkspaceContext.js +24 -0
- package/core-dist/src/test-utils/mockWorkspaceContext.js.map +1 -0
- package/core-dist/src/tools/askUserQuestion.d.ts +41 -0
- package/core-dist/src/tools/askUserQuestion.js +247 -0
- package/core-dist/src/tools/askUserQuestion.js.map +1 -0
- package/core-dist/src/tools/askUserQuestion.test.d.ts +6 -0
- package/core-dist/src/tools/askUserQuestion.test.js +218 -0
- package/core-dist/src/tools/askUserQuestion.test.js.map +1 -0
- package/core-dist/src/tools/diffOptions.d.ts +9 -0
- package/core-dist/src/tools/diffOptions.js +46 -0
- package/core-dist/src/tools/diffOptions.js.map +1 -0
- package/core-dist/src/tools/diffOptions.test.d.ts +6 -0
- package/core-dist/src/tools/diffOptions.test.js +155 -0
- package/core-dist/src/tools/diffOptions.test.js.map +1 -0
- package/core-dist/src/tools/edit.d.ts +55 -0
- package/core-dist/src/tools/edit.js +446 -0
- package/core-dist/src/tools/edit.js.map +1 -0
- package/core-dist/src/tools/edit.test.d.ts +6 -0
- package/core-dist/src/tools/edit.test.js +742 -0
- package/core-dist/src/tools/edit.test.js.map +1 -0
- package/core-dist/src/tools/exitPlanMode.d.ts +28 -0
- package/core-dist/src/tools/exitPlanMode.js +144 -0
- package/core-dist/src/tools/exitPlanMode.js.map +1 -0
- package/core-dist/src/tools/exitPlanMode.test.d.ts +6 -0
- package/core-dist/src/tools/exitPlanMode.test.js +178 -0
- package/core-dist/src/tools/exitPlanMode.test.js.map +1 -0
- package/core-dist/src/tools/glob.d.ts +44 -0
- package/core-dist/src/tools/glob.js +195 -0
- package/core-dist/src/tools/glob.js.map +1 -0
- package/core-dist/src/tools/glob.test.d.ts +6 -0
- package/core-dist/src/tools/glob.test.js +481 -0
- package/core-dist/src/tools/glob.test.js.map +1 -0
- package/core-dist/src/tools/grep.d.ts +44 -0
- package/core-dist/src/tools/grep.js +427 -0
- package/core-dist/src/tools/grep.js.map +1 -0
- package/core-dist/src/tools/grep.test.d.ts +6 -0
- package/core-dist/src/tools/grep.test.js +360 -0
- package/core-dist/src/tools/grep.test.js.map +1 -0
- package/core-dist/src/tools/ls.d.ts +68 -0
- package/core-dist/src/tools/ls.js +221 -0
- package/core-dist/src/tools/ls.js.map +1 -0
- package/core-dist/src/tools/ls.test.d.ts +6 -0
- package/core-dist/src/tools/ls.test.js +246 -0
- package/core-dist/src/tools/ls.test.js.map +1 -0
- package/core-dist/src/tools/lsp.d.ts +66 -0
- package/core-dist/src/tools/lsp.js +894 -0
- package/core-dist/src/tools/lsp.js.map +1 -0
- package/core-dist/src/tools/lsp.test.d.ts +6 -0
- package/core-dist/src/tools/lsp.test.js +960 -0
- package/core-dist/src/tools/lsp.test.js.map +1 -0
- package/core-dist/src/tools/mcp-client-manager.d.ts +110 -0
- package/core-dist/src/tools/mcp-client-manager.js +381 -0
- package/core-dist/src/tools/mcp-client-manager.js.map +1 -0
- package/core-dist/src/tools/mcp-client-manager.test.d.ts +6 -0
- package/core-dist/src/tools/mcp-client-manager.test.js +207 -0
- package/core-dist/src/tools/mcp-client-manager.test.js.map +1 -0
- package/core-dist/src/tools/mcp-client.d.ts +199 -0
- package/core-dist/src/tools/mcp-client.js +1001 -0
- package/core-dist/src/tools/mcp-client.js.map +1 -0
- package/core-dist/src/tools/mcp-client.test.d.ts +6 -0
- package/core-dist/src/tools/mcp-client.test.js +307 -0
- package/core-dist/src/tools/mcp-client.test.js.map +1 -0
- package/core-dist/src/tools/mcp-tool.d.ts +69 -0
- package/core-dist/src/tools/mcp-tool.js +365 -0
- package/core-dist/src/tools/mcp-tool.js.map +1 -0
- package/core-dist/src/tools/mcp-tool.test.d.ts +6 -0
- package/core-dist/src/tools/mcp-tool.test.js +827 -0
- package/core-dist/src/tools/mcp-tool.test.js.map +1 -0
- package/core-dist/src/tools/memoryTool.d.ts +42 -0
- package/core-dist/src/tools/memoryTool.js +403 -0
- package/core-dist/src/tools/memoryTool.js.map +1 -0
- package/core-dist/src/tools/memoryTool.test.d.ts +6 -0
- package/core-dist/src/tools/memoryTool.test.js +416 -0
- package/core-dist/src/tools/memoryTool.test.js.map +1 -0
- package/core-dist/src/tools/modifiable-tool.d.ts +32 -0
- package/core-dist/src/tools/modifiable-tool.js +90 -0
- package/core-dist/src/tools/modifiable-tool.js.map +1 -0
- package/core-dist/src/tools/modifiable-tool.test.d.ts +6 -0
- package/core-dist/src/tools/modifiable-tool.test.js +188 -0
- package/core-dist/src/tools/modifiable-tool.test.js.map +1 -0
- package/core-dist/src/tools/read-file.d.ts +35 -0
- package/core-dist/src/tools/read-file.js +141 -0
- package/core-dist/src/tools/read-file.js.map +1 -0
- package/core-dist/src/tools/read-file.test.d.ts +6 -0
- package/core-dist/src/tools/read-file.test.js +333 -0
- package/core-dist/src/tools/read-file.test.js.map +1 -0
- package/core-dist/src/tools/ripGrep.d.ts +44 -0
- package/core-dist/src/tools/ripGrep.js +235 -0
- package/core-dist/src/tools/ripGrep.js.map +1 -0
- package/core-dist/src/tools/ripGrep.test.d.ts +6 -0
- package/core-dist/src/tools/ripGrep.test.js +529 -0
- package/core-dist/src/tools/ripGrep.test.js.map +1 -0
- package/core-dist/src/tools/sdk-control-client-transport.d.ts +67 -0
- package/core-dist/src/tools/sdk-control-client-transport.js +93 -0
- package/core-dist/src/tools/sdk-control-client-transport.js.map +1 -0
- package/core-dist/src/tools/shell.d.ts +34 -0
- package/core-dist/src/tools/shell.js +509 -0
- package/core-dist/src/tools/shell.js.map +1 -0
- package/core-dist/src/tools/shell.test.d.ts +6 -0
- package/core-dist/src/tools/shell.test.js +880 -0
- package/core-dist/src/tools/shell.test.js.map +1 -0
- package/core-dist/src/tools/skill.d.ts +45 -0
- package/core-dist/src/tools/skill.js +214 -0
- package/core-dist/src/tools/skill.js.map +1 -0
- package/core-dist/src/tools/skill.test.d.ts +6 -0
- package/core-dist/src/tools/skill.test.js +280 -0
- package/core-dist/src/tools/skill.test.js.map +1 -0
- package/core-dist/src/tools/task.d.ts +60 -0
- package/core-dist/src/tools/task.js +417 -0
- package/core-dist/src/tools/task.js.map +1 -0
- package/core-dist/src/tools/task.test.d.ts +6 -0
- package/core-dist/src/tools/task.test.js +367 -0
- package/core-dist/src/tools/task.test.js.map +1 -0
- package/core-dist/src/tools/todoWrite.d.ts +42 -0
- package/core-dist/src/tools/todoWrite.js +409 -0
- package/core-dist/src/tools/todoWrite.js.map +1 -0
- package/core-dist/src/tools/todoWrite.test.d.ts +6 -0
- package/core-dist/src/tools/todoWrite.test.js +234 -0
- package/core-dist/src/tools/todoWrite.test.js.map +1 -0
- package/core-dist/src/tools/tool-error.d.ts +45 -0
- package/core-dist/src/tools/tool-error.js +61 -0
- package/core-dist/src/tools/tool-error.js.map +1 -0
- package/core-dist/src/tools/tool-names.d.ts +60 -0
- package/core-dist/src/tools/tool-names.js +66 -0
- package/core-dist/src/tools/tool-names.js.map +1 -0
- package/core-dist/src/tools/tool-registry.d.ts +103 -0
- package/core-dist/src/tools/tool-registry.js +404 -0
- package/core-dist/src/tools/tool-registry.js.map +1 -0
- package/core-dist/src/tools/tool-registry.test.d.ts +6 -0
- package/core-dist/src/tools/tool-registry.test.js +331 -0
- package/core-dist/src/tools/tool-registry.test.js.map +1 -0
- package/core-dist/src/tools/tools.d.ts +364 -0
- package/core-dist/src/tools/tools.js +263 -0
- package/core-dist/src/tools/tools.js.map +1 -0
- package/core-dist/src/tools/tools.test.d.ts +6 -0
- package/core-dist/src/tools/tools.test.js +205 -0
- package/core-dist/src/tools/tools.test.js.map +1 -0
- package/core-dist/src/tools/web-fetch.d.ts +31 -0
- package/core-dist/src/tools/web-fetch.js +168 -0
- package/core-dist/src/tools/web-fetch.js.map +1 -0
- package/core-dist/src/tools/web-fetch.test.d.ts +6 -0
- package/core-dist/src/tools/web-fetch.test.js +134 -0
- package/core-dist/src/tools/web-fetch.test.js.map +1 -0
- package/core-dist/src/tools/web-search/base-provider.d.ts +31 -0
- package/core-dist/src/tools/web-search/base-provider.js +34 -0
- package/core-dist/src/tools/web-search/base-provider.js.map +1 -0
- package/core-dist/src/tools/web-search/index.d.ts +24 -0
- package/core-dist/src/tools/web-search/index.js +249 -0
- package/core-dist/src/tools/web-search/index.js.map +1 -0
- package/core-dist/src/tools/web-search/index.test.d.ts +6 -0
- package/core-dist/src/tools/web-search/index.test.js +237 -0
- package/core-dist/src/tools/web-search/index.test.js.map +1 -0
- package/core-dist/src/tools/web-search/providers/dashscope-provider.d.ts +23 -0
- package/core-dist/src/tools/web-search/providers/dashscope-provider.js +120 -0
- package/core-dist/src/tools/web-search/providers/dashscope-provider.js.map +1 -0
- package/core-dist/src/tools/web-search/providers/google-provider.d.ts +17 -0
- package/core-dist/src/tools/web-search/providers/google-provider.js +55 -0
- package/core-dist/src/tools/web-search/providers/google-provider.js.map +1 -0
- package/core-dist/src/tools/web-search/providers/tavily-provider.d.ts +17 -0
- package/core-dist/src/tools/web-search/providers/tavily-provider.js +54 -0
- package/core-dist/src/tools/web-search/providers/tavily-provider.js.map +1 -0
- package/core-dist/src/tools/web-search/types.d.ts +138 -0
- package/core-dist/src/tools/web-search/types.js +7 -0
- package/core-dist/src/tools/web-search/types.js.map +1 -0
- package/core-dist/src/tools/web-search/utils.d.ts +28 -0
- package/core-dist/src/tools/web-search/utils.js +35 -0
- package/core-dist/src/tools/web-search/utils.js.map +1 -0
- package/core-dist/src/tools/write-file.d.ts +52 -0
- package/core-dist/src/tools/write-file.js +316 -0
- package/core-dist/src/tools/write-file.js.map +1 -0
- package/core-dist/src/tools/write-file.test.d.ts +6 -0
- package/core-dist/src/tools/write-file.test.js +613 -0
- package/core-dist/src/tools/write-file.test.js.map +1 -0
- package/core-dist/src/utils/LruCache.d.ts +13 -0
- package/core-dist/src/utils/LruCache.js +38 -0
- package/core-dist/src/utils/LruCache.js.map +1 -0
- package/core-dist/src/utils/browser.d.ts +13 -0
- package/core-dist/src/utils/browser.js +50 -0
- package/core-dist/src/utils/browser.js.map +1 -0
- package/core-dist/src/utils/configResolver.d.ts +120 -0
- package/core-dist/src/utils/configResolver.js +125 -0
- package/core-dist/src/utils/configResolver.js.map +1 -0
- package/core-dist/src/utils/configResolver.test.d.ts +6 -0
- package/core-dist/src/utils/configResolver.test.js +99 -0
- package/core-dist/src/utils/configResolver.test.js.map +1 -0
- package/core-dist/src/utils/debugLogger.d.ts +46 -0
- package/core-dist/src/utils/debugLogger.js +159 -0
- package/core-dist/src/utils/debugLogger.js.map +1 -0
- package/core-dist/src/utils/debugLogger.test.d.ts +6 -0
- package/core-dist/src/utils/debugLogger.test.js +188 -0
- package/core-dist/src/utils/debugLogger.test.js.map +1 -0
- package/core-dist/src/utils/editHelper.d.ts +58 -0
- package/core-dist/src/utils/editHelper.js +342 -0
- package/core-dist/src/utils/editHelper.js.map +1 -0
- package/core-dist/src/utils/editHelper.test.d.ts +6 -0
- package/core-dist/src/utils/editHelper.test.js +127 -0
- package/core-dist/src/utils/editHelper.test.js.map +1 -0
- package/core-dist/src/utils/editor.d.ts +37 -0
- package/core-dist/src/utils/editor.js +179 -0
- package/core-dist/src/utils/editor.js.map +1 -0
- package/core-dist/src/utils/editor.test.d.ts +6 -0
- package/core-dist/src/utils/editor.test.js +434 -0
- package/core-dist/src/utils/editor.test.js.map +1 -0
- package/core-dist/src/utils/envVarResolver.d.ts +39 -0
- package/core-dist/src/utils/envVarResolver.js +100 -0
- package/core-dist/src/utils/envVarResolver.js.map +1 -0
- package/core-dist/src/utils/envVarResolver.test.d.ts +6 -0
- package/core-dist/src/utils/envVarResolver.test.js +221 -0
- package/core-dist/src/utils/envVarResolver.test.js.map +1 -0
- package/core-dist/src/utils/environmentContext.d.ts +21 -0
- package/core-dist/src/utils/environmentContext.js +73 -0
- package/core-dist/src/utils/environmentContext.js.map +1 -0
- package/core-dist/src/utils/environmentContext.test.d.ts +6 -0
- package/core-dist/src/utils/environmentContext.test.js +151 -0
- package/core-dist/src/utils/environmentContext.test.js.map +1 -0
- package/core-dist/src/utils/errorParsing.d.ts +7 -0
- package/core-dist/src/utils/errorParsing.js +72 -0
- package/core-dist/src/utils/errorParsing.js.map +1 -0
- package/core-dist/src/utils/errorParsing.test.d.ts +6 -0
- package/core-dist/src/utils/errorParsing.test.js +87 -0
- package/core-dist/src/utils/errorParsing.test.js.map +1 -0
- package/core-dist/src/utils/errorReporting.d.ts +14 -0
- package/core-dist/src/utils/errorReporting.js +56 -0
- package/core-dist/src/utils/errorReporting.js.map +1 -0
- package/core-dist/src/utils/errorReporting.test.d.ts +6 -0
- package/core-dist/src/utils/errorReporting.test.js +84 -0
- package/core-dist/src/utils/errorReporting.test.js.map +1 -0
- package/core-dist/src/utils/errors.d.ts +44 -0
- package/core-dist/src/utils/errors.js +114 -0
- package/core-dist/src/utils/errors.js.map +1 -0
- package/core-dist/src/utils/errors.test.d.ts +6 -0
- package/core-dist/src/utils/errors.test.js +70 -0
- package/core-dist/src/utils/errors.test.js.map +1 -0
- package/core-dist/src/utils/fetch.d.ts +14 -0
- package/core-dist/src/utils/fetch.js +152 -0
- package/core-dist/src/utils/fetch.js.map +1 -0
- package/core-dist/src/utils/fetch.test.d.ts +6 -0
- package/core-dist/src/utils/fetch.test.js +40 -0
- package/core-dist/src/utils/fetch.test.js.map +1 -0
- package/core-dist/src/utils/fileUtils.d.ts +102 -0
- package/core-dist/src/utils/fileUtils.js +584 -0
- package/core-dist/src/utils/fileUtils.js.map +1 -0
- package/core-dist/src/utils/fileUtils.test.d.ts +6 -0
- package/core-dist/src/utils/fileUtils.test.js +808 -0
- package/core-dist/src/utils/fileUtils.test.js.map +1 -0
- package/core-dist/src/utils/filesearch/crawlCache.d.ts +25 -0
- package/core-dist/src/utils/filesearch/crawlCache.js +57 -0
- package/core-dist/src/utils/filesearch/crawlCache.js.map +1 -0
- package/core-dist/src/utils/filesearch/crawlCache.test.d.ts +6 -0
- package/core-dist/src/utils/filesearch/crawlCache.test.js +103 -0
- package/core-dist/src/utils/filesearch/crawlCache.test.js.map +1 -0
- package/core-dist/src/utils/filesearch/crawler.d.ts +15 -0
- package/core-dist/src/utils/filesearch/crawler.js +50 -0
- package/core-dist/src/utils/filesearch/crawler.js.map +1 -0
- package/core-dist/src/utils/filesearch/crawler.test.d.ts +6 -0
- package/core-dist/src/utils/filesearch/crawler.test.js +468 -0
- package/core-dist/src/utils/filesearch/crawler.test.js.map +1 -0
- package/core-dist/src/utils/filesearch/fileSearch.d.ts +38 -0
- package/core-dist/src/utils/filesearch/fileSearch.js +194 -0
- package/core-dist/src/utils/filesearch/fileSearch.js.map +1 -0
- package/core-dist/src/utils/filesearch/fileSearch.test.d.ts +6 -0
- package/core-dist/src/utils/filesearch/fileSearch.test.js +642 -0
- package/core-dist/src/utils/filesearch/fileSearch.test.js.map +1 -0
- package/core-dist/src/utils/filesearch/ignore.d.ts +42 -0
- package/core-dist/src/utils/filesearch/ignore.js +106 -0
- package/core-dist/src/utils/filesearch/ignore.js.map +1 -0
- package/core-dist/src/utils/filesearch/ignore.test.d.ts +6 -0
- package/core-dist/src/utils/filesearch/ignore.test.js +144 -0
- package/core-dist/src/utils/filesearch/ignore.test.js.map +1 -0
- package/core-dist/src/utils/filesearch/result-cache.d.ts +33 -0
- package/core-dist/src/utils/filesearch/result-cache.js +59 -0
- package/core-dist/src/utils/filesearch/result-cache.js.map +1 -0
- package/core-dist/src/utils/filesearch/result-cache.test.d.ts +6 -0
- package/core-dist/src/utils/filesearch/result-cache.test.js +46 -0
- package/core-dist/src/utils/filesearch/result-cache.test.js.map +1 -0
- package/core-dist/src/utils/formatters.d.ts +6 -0
- package/core-dist/src/utils/formatters.js +16 -0
- package/core-dist/src/utils/formatters.js.map +1 -0
- package/core-dist/src/utils/generateContentResponseUtilities.d.ts +13 -0
- package/core-dist/src/utils/generateContentResponseUtilities.js +95 -0
- package/core-dist/src/utils/generateContentResponseUtilities.js.map +1 -0
- package/core-dist/src/utils/generateContentResponseUtilities.test.d.ts +6 -0
- package/core-dist/src/utils/generateContentResponseUtilities.test.js +235 -0
- package/core-dist/src/utils/generateContentResponseUtilities.test.js.map +1 -0
- package/core-dist/src/utils/getFolderStructure.d.ts +31 -0
- package/core-dist/src/utils/getFolderStructure.js +233 -0
- package/core-dist/src/utils/getFolderStructure.js.map +1 -0
- package/core-dist/src/utils/getFolderStructure.test.d.ts +6 -0
- package/core-dist/src/utils/getFolderStructure.test.js +282 -0
- package/core-dist/src/utils/getFolderStructure.test.js.map +1 -0
- package/core-dist/src/utils/getPty.d.ts +7 -0
- package/core-dist/src/utils/getPty.js +7 -0
- package/core-dist/src/utils/getPty.js.map +1 -0
- package/core-dist/src/utils/gitIgnoreParser.d.ts +16 -0
- package/core-dist/src/utils/gitIgnoreParser.js +152 -0
- package/core-dist/src/utils/gitIgnoreParser.js.map +1 -0
- package/core-dist/src/utils/gitIgnoreParser.test.d.ts +6 -0
- package/core-dist/src/utils/gitIgnoreParser.test.js +185 -0
- package/core-dist/src/utils/gitIgnoreParser.test.js.map +1 -0
- package/core-dist/src/utils/gitUtils.d.ts +21 -0
- package/core-dist/src/utils/gitUtils.js +78 -0
- package/core-dist/src/utils/gitUtils.js.map +1 -0
- package/core-dist/src/utils/iconvHelper.d.ts +33 -0
- package/core-dist/src/utils/iconvHelper.js +48 -0
- package/core-dist/src/utils/iconvHelper.js.map +1 -0
- package/core-dist/src/utils/ignorePatterns.d.ts +103 -0
- package/core-dist/src/utils/ignorePatterns.js +222 -0
- package/core-dist/src/utils/ignorePatterns.js.map +1 -0
- package/core-dist/src/utils/ignorePatterns.test.d.ts +6 -0
- package/core-dist/src/utils/ignorePatterns.test.js +255 -0
- package/core-dist/src/utils/ignorePatterns.test.js.map +1 -0
- package/core-dist/src/utils/installationManager.d.ts +16 -0
- package/core-dist/src/utils/installationManager.js +52 -0
- package/core-dist/src/utils/installationManager.js.map +1 -0
- package/core-dist/src/utils/installationManager.test.d.ts +6 -0
- package/core-dist/src/utils/installationManager.test.js +79 -0
- package/core-dist/src/utils/installationManager.test.js.map +1 -0
- package/core-dist/src/utils/jsonl-utils.d.ts +38 -0
- package/core-dist/src/utils/jsonl-utils.js +176 -0
- package/core-dist/src/utils/jsonl-utils.js.map +1 -0
- package/core-dist/src/utils/language-detection.d.ts +6 -0
- package/core-dist/src/utils/language-detection.js +101 -0
- package/core-dist/src/utils/language-detection.js.map +1 -0
- package/core-dist/src/utils/memoryDiscovery.d.ts +15 -0
- package/core-dist/src/utils/memoryDiscovery.js +238 -0
- package/core-dist/src/utils/memoryDiscovery.js.map +1 -0
- package/core-dist/src/utils/memoryDiscovery.test.d.ts +6 -0
- package/core-dist/src/utils/memoryDiscovery.test.js +212 -0
- package/core-dist/src/utils/memoryDiscovery.test.js.map +1 -0
- package/core-dist/src/utils/memoryImportProcessor.d.ts +41 -0
- package/core-dist/src/utils/memoryImportProcessor.js +296 -0
- package/core-dist/src/utils/memoryImportProcessor.js.map +1 -0
- package/core-dist/src/utils/memoryImportProcessor.test.d.ts +6 -0
- package/core-dist/src/utils/memoryImportProcessor.test.js +631 -0
- package/core-dist/src/utils/memoryImportProcessor.test.js.map +1 -0
- package/core-dist/src/utils/messageInspectors.d.ts +8 -0
- package/core-dist/src/utils/messageInspectors.js +16 -0
- package/core-dist/src/utils/messageInspectors.js.map +1 -0
- package/core-dist/src/utils/nextSpeakerChecker.d.ts +12 -0
- package/core-dist/src/utils/nextSpeakerChecker.js +99 -0
- package/core-dist/src/utils/nextSpeakerChecker.js.map +1 -0
- package/core-dist/src/utils/nextSpeakerChecker.test.d.ts +6 -0
- package/core-dist/src/utils/nextSpeakerChecker.test.js +183 -0
- package/core-dist/src/utils/nextSpeakerChecker.test.js.map +1 -0
- package/core-dist/src/utils/openaiLogger.d.ts +42 -0
- package/core-dist/src/utils/openaiLogger.js +140 -0
- package/core-dist/src/utils/openaiLogger.js.map +1 -0
- package/core-dist/src/utils/openaiLogger.test.d.ts +6 -0
- package/core-dist/src/utils/openaiLogger.test.js +314 -0
- package/core-dist/src/utils/openaiLogger.test.js.map +1 -0
- package/core-dist/src/utils/partUtils.d.ts +35 -0
- package/core-dist/src/utils/partUtils.js +133 -0
- package/core-dist/src/utils/partUtils.js.map +1 -0
- package/core-dist/src/utils/partUtils.test.d.ts +6 -0
- package/core-dist/src/utils/partUtils.test.js +241 -0
- package/core-dist/src/utils/partUtils.test.js.map +1 -0
- package/core-dist/src/utils/pathReader.d.ts +17 -0
- package/core-dist/src/utils/pathReader.js +92 -0
- package/core-dist/src/utils/pathReader.js.map +1 -0
- package/core-dist/src/utils/pathReader.test.d.ts +6 -0
- package/core-dist/src/utils/pathReader.test.js +367 -0
- package/core-dist/src/utils/pathReader.test.js.map +1 -0
- package/core-dist/src/utils/paths.d.ts +110 -0
- package/core-dist/src/utils/paths.js +269 -0
- package/core-dist/src/utils/paths.js.map +1 -0
- package/core-dist/src/utils/paths.test.d.ts +6 -0
- package/core-dist/src/utils/paths.test.js +633 -0
- package/core-dist/src/utils/paths.test.js.map +1 -0
- package/core-dist/src/utils/projectSummary.d.ts +22 -0
- package/core-dist/src/utils/projectSummary.js +86 -0
- package/core-dist/src/utils/projectSummary.js.map +1 -0
- package/core-dist/src/utils/promptIdContext.d.ts +7 -0
- package/core-dist/src/utils/promptIdContext.js +8 -0
- package/core-dist/src/utils/promptIdContext.js.map +1 -0
- package/core-dist/src/utils/quotaErrorDetection.d.ts +19 -0
- package/core-dist/src/utils/quotaErrorDetection.js +84 -0
- package/core-dist/src/utils/quotaErrorDetection.js.map +1 -0
- package/core-dist/src/utils/quotaErrorDetection.test.d.ts +6 -0
- package/core-dist/src/utils/quotaErrorDetection.test.js +104 -0
- package/core-dist/src/utils/quotaErrorDetection.test.js.map +1 -0
- package/core-dist/src/utils/qwenIgnoreParser.d.ts +18 -0
- package/core-dist/src/utils/qwenIgnoreParser.js +61 -0
- package/core-dist/src/utils/qwenIgnoreParser.js.map +1 -0
- package/core-dist/src/utils/qwenIgnoreParser.test.d.ts +6 -0
- package/core-dist/src/utils/qwenIgnoreParser.test.js +50 -0
- package/core-dist/src/utils/qwenIgnoreParser.test.js.map +1 -0
- package/core-dist/src/utils/rateLimit.d.ts +23 -0
- package/core-dist/src/utils/rateLimit.js +69 -0
- package/core-dist/src/utils/rateLimit.js.map +1 -0
- package/core-dist/src/utils/rateLimit.test.d.ts +6 -0
- package/core-dist/src/utils/rateLimit.test.js +72 -0
- package/core-dist/src/utils/rateLimit.test.js.map +1 -0
- package/core-dist/src/utils/readManyFiles.d.ts +67 -0
- package/core-dist/src/utils/readManyFiles.js +133 -0
- package/core-dist/src/utils/readManyFiles.js.map +1 -0
- package/core-dist/src/utils/readManyFiles.test.d.ts +6 -0
- package/core-dist/src/utils/readManyFiles.test.js +230 -0
- package/core-dist/src/utils/readManyFiles.test.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.d.ts +112 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.js +403 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.test.d.ts +6 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.test.js +114 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.test.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/index.d.ts +9 -0
- package/core-dist/src/utils/request-tokenizer/index.js +9 -0
- package/core-dist/src/utils/request-tokenizer/index.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.d.ts +52 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.js +252 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.test.d.ts +6 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.test.js +227 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.test.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/supportedImageFormats.d.ts +30 -0
- package/core-dist/src/utils/request-tokenizer/supportedImageFormats.js +41 -0
- package/core-dist/src/utils/request-tokenizer/supportedImageFormats.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.d.ts +32 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.js +54 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.test.d.ts +6 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.test.js +237 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.test.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/types.d.ts +34 -0
- package/core-dist/src/utils/request-tokenizer/types.js +7 -0
- package/core-dist/src/utils/request-tokenizer/types.js.map +1 -0
- package/core-dist/src/utils/retry.d.ts +38 -0
- package/core-dist/src/utils/retry.js +180 -0
- package/core-dist/src/utils/retry.js.map +1 -0
- package/core-dist/src/utils/retry.test.d.ts +6 -0
- package/core-dist/src/utils/retry.test.js +402 -0
- package/core-dist/src/utils/retry.test.js.map +1 -0
- package/core-dist/src/utils/ripgrepUtils.d.ts +61 -0
- package/core-dist/src/utils/ripgrepUtils.js +227 -0
- package/core-dist/src/utils/ripgrepUtils.js.map +1 -0
- package/core-dist/src/utils/ripgrepUtils.test.d.ts +6 -0
- package/core-dist/src/utils/ripgrepUtils.test.js +101 -0
- package/core-dist/src/utils/ripgrepUtils.test.js.map +1 -0
- package/core-dist/src/utils/runtimeFetchOptions.d.ts +44 -0
- package/core-dist/src/utils/runtimeFetchOptions.js +92 -0
- package/core-dist/src/utils/runtimeFetchOptions.js.map +1 -0
- package/core-dist/src/utils/runtimeFetchOptions.test.d.ts +6 -0
- package/core-dist/src/utils/runtimeFetchOptions.test.js +70 -0
- package/core-dist/src/utils/runtimeFetchOptions.test.js.map +1 -0
- package/core-dist/src/utils/safeJsonParse.d.ts +15 -0
- package/core-dist/src/utils/safeJsonParse.js +43 -0
- package/core-dist/src/utils/safeJsonParse.js.map +1 -0
- package/core-dist/src/utils/safeJsonParse.test.d.ts +6 -0
- package/core-dist/src/utils/safeJsonParse.test.js +112 -0
- package/core-dist/src/utils/safeJsonParse.test.js.map +1 -0
- package/core-dist/src/utils/safeJsonStringify.d.ts +13 -0
- package/core-dist/src/utils/safeJsonStringify.js +25 -0
- package/core-dist/src/utils/safeJsonStringify.js.map +1 -0
- package/core-dist/src/utils/safeJsonStringify.test.d.ts +6 -0
- package/core-dist/src/utils/safeJsonStringify.test.js +61 -0
- package/core-dist/src/utils/safeJsonStringify.test.js.map +1 -0
- package/core-dist/src/utils/schemaConverter.d.ts +15 -0
- package/core-dist/src/utils/schemaConverter.js +109 -0
- package/core-dist/src/utils/schemaConverter.js.map +1 -0
- package/core-dist/src/utils/schemaConverter.test.d.ts +6 -0
- package/core-dist/src/utils/schemaConverter.test.js +106 -0
- package/core-dist/src/utils/schemaConverter.test.js.map +1 -0
- package/core-dist/src/utils/schemaValidator.d.ts +16 -0
- package/core-dist/src/utils/schemaValidator.js +123 -0
- package/core-dist/src/utils/schemaValidator.js.map +1 -0
- package/core-dist/src/utils/schemaValidator.test.d.ts +6 -0
- package/core-dist/src/utils/schemaValidator.test.js +266 -0
- package/core-dist/src/utils/schemaValidator.test.js.map +1 -0
- package/core-dist/src/utils/secure-browser-launcher.d.ts +23 -0
- package/core-dist/src/utils/secure-browser-launcher.js +165 -0
- package/core-dist/src/utils/secure-browser-launcher.js.map +1 -0
- package/core-dist/src/utils/secure-browser-launcher.test.d.ts +6 -0
- package/core-dist/src/utils/secure-browser-launcher.test.js +149 -0
- package/core-dist/src/utils/secure-browser-launcher.test.js.map +1 -0
- package/core-dist/src/utils/shell-utils.d.ts +158 -0
- package/core-dist/src/utils/shell-utils.js +739 -0
- package/core-dist/src/utils/shell-utils.js.map +1 -0
- package/core-dist/src/utils/shell-utils.test.d.ts +6 -0
- package/core-dist/src/utils/shell-utils.test.js +466 -0
- package/core-dist/src/utils/shell-utils.test.js.map +1 -0
- package/core-dist/src/utils/shellReadOnlyChecker.d.ts +6 -0
- package/core-dist/src/utils/shellReadOnlyChecker.js +290 -0
- package/core-dist/src/utils/shellReadOnlyChecker.js.map +1 -0
- package/core-dist/src/utils/shellReadOnlyChecker.test.d.ts +6 -0
- package/core-dist/src/utils/shellReadOnlyChecker.test.js +157 -0
- package/core-dist/src/utils/shellReadOnlyChecker.test.js.map +1 -0
- package/core-dist/src/utils/subagentGenerator.d.ts +20 -0
- package/core-dist/src/utils/subagentGenerator.js +120 -0
- package/core-dist/src/utils/subagentGenerator.js.map +1 -0
- package/core-dist/src/utils/subagentGenerator.test.d.ts +6 -0
- package/core-dist/src/utils/subagentGenerator.test.js +135 -0
- package/core-dist/src/utils/subagentGenerator.test.js.map +1 -0
- package/core-dist/src/utils/summarizer.d.ts +25 -0
- package/core-dist/src/utils/summarizer.js +53 -0
- package/core-dist/src/utils/summarizer.js.map +1 -0
- package/core-dist/src/utils/summarizer.test.d.ts +6 -0
- package/core-dist/src/utils/summarizer.test.js +128 -0
- package/core-dist/src/utils/summarizer.test.js.map +1 -0
- package/core-dist/src/utils/symlink.d.ts +26 -0
- package/core-dist/src/utils/symlink.js +43 -0
- package/core-dist/src/utils/symlink.js.map +1 -0
- package/core-dist/src/utils/systemEncoding.d.ts +40 -0
- package/core-dist/src/utils/systemEncoding.js +160 -0
- package/core-dist/src/utils/systemEncoding.js.map +1 -0
- package/core-dist/src/utils/systemEncoding.test.d.ts +6 -0
- package/core-dist/src/utils/systemEncoding.test.js +367 -0
- package/core-dist/src/utils/systemEncoding.test.js.map +1 -0
- package/core-dist/src/utils/terminalSerializer.d.ts +25 -0
- package/core-dist/src/utils/terminalSerializer.js +432 -0
- package/core-dist/src/utils/terminalSerializer.js.map +1 -0
- package/core-dist/src/utils/terminalSerializer.test.d.ts +6 -0
- package/core-dist/src/utils/terminalSerializer.test.js +176 -0
- package/core-dist/src/utils/terminalSerializer.test.js.map +1 -0
- package/core-dist/src/utils/testUtils.d.ts +29 -0
- package/core-dist/src/utils/testUtils.js +70 -0
- package/core-dist/src/utils/testUtils.js.map +1 -0
- package/core-dist/src/utils/textUtils.d.ts +29 -0
- package/core-dist/src/utils/textUtils.js +59 -0
- package/core-dist/src/utils/textUtils.js.map +1 -0
- package/core-dist/src/utils/textUtils.test.d.ts +6 -0
- package/core-dist/src/utils/textUtils.test.js +91 -0
- package/core-dist/src/utils/textUtils.test.js.map +1 -0
- package/core-dist/src/utils/thoughtUtils.d.ts +23 -0
- package/core-dist/src/utils/thoughtUtils.js +53 -0
- package/core-dist/src/utils/thoughtUtils.js.map +1 -0
- package/core-dist/src/utils/thoughtUtils.test.d.ts +6 -0
- package/core-dist/src/utils/thoughtUtils.test.js +78 -0
- package/core-dist/src/utils/thoughtUtils.test.js.map +1 -0
- package/core-dist/src/utils/toml-to-markdown-converter.d.ts +22 -0
- package/core-dist/src/utils/toml-to-markdown-converter.js +61 -0
- package/core-dist/src/utils/toml-to-markdown-converter.js.map +1 -0
- package/core-dist/src/utils/toml-to-markdown-converter.test.d.ts +6 -0
- package/core-dist/src/utils/toml-to-markdown-converter.test.js +73 -0
- package/core-dist/src/utils/toml-to-markdown-converter.test.js.map +1 -0
- package/core-dist/src/utils/tool-utils.d.ts +22 -0
- package/core-dist/src/utils/tool-utils.js +121 -0
- package/core-dist/src/utils/tool-utils.js.map +1 -0
- package/core-dist/src/utils/tool-utils.test.d.ts +6 -0
- package/core-dist/src/utils/tool-utils.test.js +100 -0
- package/core-dist/src/utils/tool-utils.test.js.map +1 -0
- package/core-dist/src/utils/workspaceContext.d.ts +66 -0
- package/core-dist/src/utils/workspaceContext.js +173 -0
- package/core-dist/src/utils/workspaceContext.js.map +1 -0
- package/core-dist/src/utils/workspaceContext.test.d.ts +6 -0
- package/core-dist/src/utils/workspaceContext.test.js +313 -0
- package/core-dist/src/utils/workspaceContext.test.js.map +1 -0
- package/core-dist/src/utils/yaml-parser.d.ts +29 -0
- package/core-dist/src/utils/yaml-parser.js +172 -0
- package/core-dist/src/utils/yaml-parser.js.map +1 -0
- package/core-dist/src/utils/yaml-parser.test.d.ts +6 -0
- package/core-dist/src/utils/yaml-parser.test.js +170 -0
- package/core-dist/src/utils/yaml-parser.test.js.map +1 -0
- package/core-dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -1
- package/scripts/postinstall.cjs +102 -203
|
@@ -0,0 +1,827 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
7
|
+
import { safeJsonStringify } from '../utils/safeJsonStringify.js';
|
|
8
|
+
import { DiscoveredMCPTool, generateValidName, } from './mcp-tool.js';
|
|
9
|
+
import { ToolConfirmationOutcome } from './tools.js';
|
|
10
|
+
import { ToolErrorType } from './tool-error.js';
|
|
11
|
+
// Mock @google/genai mcpToTool and CallableTool
|
|
12
|
+
// We only need to mock the parts of CallableTool that DiscoveredMCPTool uses.
|
|
13
|
+
const mockCallTool = vi.fn();
|
|
14
|
+
const mockToolMethod = vi.fn();
|
|
15
|
+
const mockCallableToolInstance = {
|
|
16
|
+
tool: mockToolMethod, // Not directly used by DiscoveredMCPTool instance methods
|
|
17
|
+
callTool: mockCallTool,
|
|
18
|
+
// Add other methods if DiscoveredMCPTool starts using them
|
|
19
|
+
};
|
|
20
|
+
describe('generateValidName', () => {
|
|
21
|
+
it('should return a valid name for a simple function', () => {
|
|
22
|
+
expect(generateValidName('myFunction')).toBe('myFunction');
|
|
23
|
+
});
|
|
24
|
+
it('should replace invalid characters with underscores', () => {
|
|
25
|
+
expect(generateValidName('invalid-name with spaces')).toBe('invalid-name_with_spaces');
|
|
26
|
+
});
|
|
27
|
+
it('should truncate long names', () => {
|
|
28
|
+
expect(generateValidName('x'.repeat(80))).toBe('xxxxxxxxxxxxxxxxxxxxxxxxxxxx___xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
|
29
|
+
});
|
|
30
|
+
it('should handle names with only invalid characters', () => {
|
|
31
|
+
expect(generateValidName('!@#$%^&*()')).toBe('__________');
|
|
32
|
+
});
|
|
33
|
+
it('should handle names that are exactly 63 characters long', () => {
|
|
34
|
+
expect(generateValidName('a'.repeat(63)).length).toBe(63);
|
|
35
|
+
});
|
|
36
|
+
it('should handle names that are exactly 64 characters long', () => {
|
|
37
|
+
expect(generateValidName('a'.repeat(64)).length).toBe(63);
|
|
38
|
+
});
|
|
39
|
+
it('should handle names that are longer than 64 characters', () => {
|
|
40
|
+
expect(generateValidName('a'.repeat(80)).length).toBe(63);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
describe('DiscoveredMCPTool', () => {
|
|
44
|
+
const serverName = 'mock-mcp-server';
|
|
45
|
+
const serverToolName = 'actual-server-tool-name';
|
|
46
|
+
const baseDescription = 'A test MCP tool.';
|
|
47
|
+
const inputSchema = {
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: { param: { type: 'string' } },
|
|
50
|
+
required: ['param'],
|
|
51
|
+
};
|
|
52
|
+
let tool;
|
|
53
|
+
beforeEach(() => {
|
|
54
|
+
mockCallTool.mockClear();
|
|
55
|
+
mockToolMethod.mockClear();
|
|
56
|
+
tool = new DiscoveredMCPTool(mockCallableToolInstance, serverName, serverToolName, baseDescription, inputSchema);
|
|
57
|
+
// Clear allowlist before each relevant test, especially for shouldConfirmExecute
|
|
58
|
+
const invocation = tool.build({ param: 'mock' });
|
|
59
|
+
invocation.constructor.allowlist.clear();
|
|
60
|
+
});
|
|
61
|
+
afterEach(() => {
|
|
62
|
+
vi.restoreAllMocks();
|
|
63
|
+
});
|
|
64
|
+
describe('constructor', () => {
|
|
65
|
+
it('should set properties correctly', () => {
|
|
66
|
+
const expectedName = `mcp__${serverName}__${serverToolName}`;
|
|
67
|
+
expect(tool.name).toBe(expectedName);
|
|
68
|
+
expect(tool.schema.name).toBe(expectedName);
|
|
69
|
+
expect(tool.schema.description).toBe(baseDescription);
|
|
70
|
+
expect(tool.schema.parameters).toBeUndefined();
|
|
71
|
+
expect(tool.schema.parametersJsonSchema).toEqual(inputSchema);
|
|
72
|
+
expect(tool.serverToolName).toBe(serverToolName);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
describe('execute', () => {
|
|
76
|
+
it('should call mcpTool.callTool with correct parameters and format display output', async () => {
|
|
77
|
+
const params = { param: 'testValue' };
|
|
78
|
+
const mockToolSuccessResultObject = {
|
|
79
|
+
success: true,
|
|
80
|
+
details: 'executed',
|
|
81
|
+
};
|
|
82
|
+
const mockFunctionResponseContent = [
|
|
83
|
+
{
|
|
84
|
+
type: 'text',
|
|
85
|
+
text: JSON.stringify(mockToolSuccessResultObject),
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
const mockMcpToolResponseParts = [
|
|
89
|
+
{
|
|
90
|
+
functionResponse: {
|
|
91
|
+
name: serverToolName,
|
|
92
|
+
response: { content: mockFunctionResponseContent },
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
mockCallTool.mockResolvedValue(mockMcpToolResponseParts);
|
|
97
|
+
const invocation = tool.build(params);
|
|
98
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
99
|
+
expect(mockCallTool).toHaveBeenCalledWith([
|
|
100
|
+
{ name: serverToolName, args: params },
|
|
101
|
+
]);
|
|
102
|
+
const stringifiedResponseContent = JSON.stringify(mockToolSuccessResultObject);
|
|
103
|
+
expect(toolResult.llmContent).toEqual([
|
|
104
|
+
{ text: stringifiedResponseContent },
|
|
105
|
+
]);
|
|
106
|
+
expect(toolResult.returnDisplay).toBe(stringifiedResponseContent);
|
|
107
|
+
});
|
|
108
|
+
it('should handle empty result from getStringifiedResultForDisplay', async () => {
|
|
109
|
+
const params = { param: 'testValue' };
|
|
110
|
+
const mockMcpToolResponsePartsEmpty = [];
|
|
111
|
+
mockCallTool.mockResolvedValue(mockMcpToolResponsePartsEmpty);
|
|
112
|
+
const invocation = tool.build(params);
|
|
113
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
114
|
+
expect(toolResult.returnDisplay).toBe('```json\n[]\n```');
|
|
115
|
+
expect(toolResult.llmContent).toEqual([
|
|
116
|
+
{ text: '[Error: Could not parse tool response]' },
|
|
117
|
+
]);
|
|
118
|
+
});
|
|
119
|
+
it('should propagate rejection if mcpTool.callTool rejects', async () => {
|
|
120
|
+
const params = { param: 'failCase' };
|
|
121
|
+
const expectedError = new Error('MCP call failed');
|
|
122
|
+
mockCallTool.mockRejectedValue(expectedError);
|
|
123
|
+
const invocation = tool.build(params);
|
|
124
|
+
await expect(invocation.execute(new AbortController().signal)).rejects.toThrow(expectedError);
|
|
125
|
+
});
|
|
126
|
+
it.each([
|
|
127
|
+
{ isErrorValue: true, description: 'true (bool)' },
|
|
128
|
+
{ isErrorValue: 'true', description: '"true" (str)' },
|
|
129
|
+
])('should return a structured error if MCP tool reports an error', async ({ isErrorValue }) => {
|
|
130
|
+
const tool = new DiscoveredMCPTool(mockCallableToolInstance, serverName, serverToolName, baseDescription, inputSchema);
|
|
131
|
+
const params = { param: 'isErrorTrueCase' };
|
|
132
|
+
const functionCall = {
|
|
133
|
+
name: serverToolName,
|
|
134
|
+
args: params,
|
|
135
|
+
};
|
|
136
|
+
const errorResponse = { isError: isErrorValue };
|
|
137
|
+
const mockMcpToolResponseParts = [
|
|
138
|
+
{
|
|
139
|
+
functionResponse: {
|
|
140
|
+
name: serverToolName,
|
|
141
|
+
response: { error: errorResponse },
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
];
|
|
145
|
+
mockCallTool.mockResolvedValue(mockMcpToolResponseParts);
|
|
146
|
+
const expectedErrorMessage = `MCP tool '${serverToolName}' reported tool error for function call: ${safeJsonStringify(functionCall)} with response: ${safeJsonStringify(mockMcpToolResponseParts)}`;
|
|
147
|
+
const invocation = tool.build(params);
|
|
148
|
+
const result = await invocation.execute(new AbortController().signal);
|
|
149
|
+
expect(result.error?.type).toBe(ToolErrorType.MCP_TOOL_ERROR);
|
|
150
|
+
expect(result.llmContent).toBe(expectedErrorMessage);
|
|
151
|
+
expect(result.returnDisplay).toContain(`Error: MCP tool '${serverToolName}' reported an error.`);
|
|
152
|
+
});
|
|
153
|
+
it.each([
|
|
154
|
+
{ isErrorValue: false, description: 'false (bool)' },
|
|
155
|
+
{ isErrorValue: 'false', description: '"false" (str)' },
|
|
156
|
+
])('should consider a ToolResult with isError ${description} to be a success', async ({ isErrorValue }) => {
|
|
157
|
+
const tool = new DiscoveredMCPTool(mockCallableToolInstance, serverName, serverToolName, baseDescription, inputSchema);
|
|
158
|
+
const params = { param: 'isErrorFalseCase' };
|
|
159
|
+
const mockToolSuccessResultObject = {
|
|
160
|
+
success: true,
|
|
161
|
+
details: 'executed',
|
|
162
|
+
};
|
|
163
|
+
const mockFunctionResponseContent = [
|
|
164
|
+
{
|
|
165
|
+
type: 'text',
|
|
166
|
+
text: JSON.stringify(mockToolSuccessResultObject),
|
|
167
|
+
},
|
|
168
|
+
];
|
|
169
|
+
const errorResponse = { isError: isErrorValue };
|
|
170
|
+
const mockMcpToolResponseParts = [
|
|
171
|
+
{
|
|
172
|
+
functionResponse: {
|
|
173
|
+
name: serverToolName,
|
|
174
|
+
response: {
|
|
175
|
+
error: errorResponse,
|
|
176
|
+
content: mockFunctionResponseContent,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
];
|
|
181
|
+
mockCallTool.mockResolvedValue(mockMcpToolResponseParts);
|
|
182
|
+
const invocation = tool.build(params);
|
|
183
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
184
|
+
const stringifiedResponseContent = JSON.stringify(mockToolSuccessResultObject);
|
|
185
|
+
expect(toolResult.llmContent).toEqual([
|
|
186
|
+
{ text: stringifiedResponseContent },
|
|
187
|
+
]);
|
|
188
|
+
expect(toolResult.returnDisplay).toBe(stringifiedResponseContent);
|
|
189
|
+
});
|
|
190
|
+
it('should handle a simple text response correctly', async () => {
|
|
191
|
+
const params = { param: 'test' };
|
|
192
|
+
const successMessage = 'This is a success message.';
|
|
193
|
+
// Simulate the response from the GenAI SDK, which wraps the MCP
|
|
194
|
+
// response in a functionResponse Part.
|
|
195
|
+
const sdkResponse = [
|
|
196
|
+
{
|
|
197
|
+
functionResponse: {
|
|
198
|
+
name: serverToolName,
|
|
199
|
+
response: {
|
|
200
|
+
// The `content` array contains MCP ContentBlocks.
|
|
201
|
+
content: [{ type: 'text', text: successMessage }],
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
];
|
|
206
|
+
mockCallTool.mockResolvedValue(sdkResponse);
|
|
207
|
+
const invocation = tool.build(params);
|
|
208
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
209
|
+
// 1. Assert that the llmContent sent to the scheduler is a clean Part array.
|
|
210
|
+
expect(toolResult.llmContent).toEqual([{ text: successMessage }]);
|
|
211
|
+
// 2. Assert that the display output is the simple text message.
|
|
212
|
+
expect(toolResult.returnDisplay).toBe(successMessage);
|
|
213
|
+
// 3. Verify that the underlying callTool was made correctly.
|
|
214
|
+
expect(mockCallTool).toHaveBeenCalledWith([
|
|
215
|
+
{ name: serverToolName, args: params },
|
|
216
|
+
]);
|
|
217
|
+
});
|
|
218
|
+
it('should handle an AudioBlock response', async () => {
|
|
219
|
+
const params = { param: 'play' };
|
|
220
|
+
const sdkResponse = [
|
|
221
|
+
{
|
|
222
|
+
functionResponse: {
|
|
223
|
+
name: serverToolName,
|
|
224
|
+
response: {
|
|
225
|
+
content: [
|
|
226
|
+
{
|
|
227
|
+
type: 'audio',
|
|
228
|
+
data: 'BASE64_AUDIO_DATA',
|
|
229
|
+
mimeType: 'audio/mp3',
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
];
|
|
236
|
+
mockCallTool.mockResolvedValue(sdkResponse);
|
|
237
|
+
const invocation = tool.build(params);
|
|
238
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
239
|
+
expect(toolResult.llmContent).toEqual([
|
|
240
|
+
{
|
|
241
|
+
text: `[Tool '${serverToolName}' provided the following audio data with mime-type: audio/mp3]`,
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
inlineData: {
|
|
245
|
+
mimeType: 'audio/mp3',
|
|
246
|
+
data: 'BASE64_AUDIO_DATA',
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
]);
|
|
250
|
+
expect(toolResult.returnDisplay).toBe('[Audio: audio/mp3]');
|
|
251
|
+
});
|
|
252
|
+
it('should handle a ResourceLinkBlock response', async () => {
|
|
253
|
+
const params = { param: 'get' };
|
|
254
|
+
const sdkResponse = [
|
|
255
|
+
{
|
|
256
|
+
functionResponse: {
|
|
257
|
+
name: serverToolName,
|
|
258
|
+
response: {
|
|
259
|
+
content: [
|
|
260
|
+
{
|
|
261
|
+
type: 'resource_link',
|
|
262
|
+
uri: 'file:///path/to/thing',
|
|
263
|
+
name: 'resource-name',
|
|
264
|
+
title: 'My Resource',
|
|
265
|
+
},
|
|
266
|
+
],
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
];
|
|
271
|
+
mockCallTool.mockResolvedValue(sdkResponse);
|
|
272
|
+
const invocation = tool.build(params);
|
|
273
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
274
|
+
expect(toolResult.llmContent).toEqual([
|
|
275
|
+
{
|
|
276
|
+
text: 'Resource Link: My Resource at file:///path/to/thing',
|
|
277
|
+
},
|
|
278
|
+
]);
|
|
279
|
+
expect(toolResult.returnDisplay).toBe('[Link to My Resource: file:///path/to/thing]');
|
|
280
|
+
});
|
|
281
|
+
it('should handle an embedded text ResourceBlock response', async () => {
|
|
282
|
+
const params = { param: 'get' };
|
|
283
|
+
const sdkResponse = [
|
|
284
|
+
{
|
|
285
|
+
functionResponse: {
|
|
286
|
+
name: serverToolName,
|
|
287
|
+
response: {
|
|
288
|
+
content: [
|
|
289
|
+
{
|
|
290
|
+
type: 'resource',
|
|
291
|
+
resource: {
|
|
292
|
+
uri: 'file:///path/to/text.txt',
|
|
293
|
+
text: 'This is the text content.',
|
|
294
|
+
mimeType: 'text/plain',
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
];
|
|
302
|
+
mockCallTool.mockResolvedValue(sdkResponse);
|
|
303
|
+
const invocation = tool.build(params);
|
|
304
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
305
|
+
expect(toolResult.llmContent).toEqual([
|
|
306
|
+
{ text: 'This is the text content.' },
|
|
307
|
+
]);
|
|
308
|
+
expect(toolResult.returnDisplay).toBe('This is the text content.');
|
|
309
|
+
});
|
|
310
|
+
it('should handle an embedded binary ResourceBlock response', async () => {
|
|
311
|
+
const params = { param: 'get' };
|
|
312
|
+
const sdkResponse = [
|
|
313
|
+
{
|
|
314
|
+
functionResponse: {
|
|
315
|
+
name: serverToolName,
|
|
316
|
+
response: {
|
|
317
|
+
content: [
|
|
318
|
+
{
|
|
319
|
+
type: 'resource',
|
|
320
|
+
resource: {
|
|
321
|
+
uri: 'file:///path/to/data.bin',
|
|
322
|
+
blob: 'BASE64_BINARY_DATA',
|
|
323
|
+
mimeType: 'application/octet-stream',
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
],
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
];
|
|
331
|
+
mockCallTool.mockResolvedValue(sdkResponse);
|
|
332
|
+
const invocation = tool.build(params);
|
|
333
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
334
|
+
expect(toolResult.llmContent).toEqual([
|
|
335
|
+
{
|
|
336
|
+
text: `[Tool '${serverToolName}' provided the following embedded resource with mime-type: application/octet-stream]`,
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
inlineData: {
|
|
340
|
+
mimeType: 'application/octet-stream',
|
|
341
|
+
data: 'BASE64_BINARY_DATA',
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
]);
|
|
345
|
+
expect(toolResult.returnDisplay).toBe('[Embedded Resource: application/octet-stream]');
|
|
346
|
+
});
|
|
347
|
+
it('should handle a mix of content block types', async () => {
|
|
348
|
+
const params = { param: 'complex' };
|
|
349
|
+
const sdkResponse = [
|
|
350
|
+
{
|
|
351
|
+
functionResponse: {
|
|
352
|
+
name: serverToolName,
|
|
353
|
+
response: {
|
|
354
|
+
content: [
|
|
355
|
+
{ type: 'text', text: 'First part.' },
|
|
356
|
+
{
|
|
357
|
+
type: 'image',
|
|
358
|
+
data: 'BASE64_IMAGE_DATA',
|
|
359
|
+
mimeType: 'image/jpeg',
|
|
360
|
+
},
|
|
361
|
+
{ type: 'text', text: 'Second part.' },
|
|
362
|
+
],
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
];
|
|
367
|
+
mockCallTool.mockResolvedValue(sdkResponse);
|
|
368
|
+
const invocation = tool.build(params);
|
|
369
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
370
|
+
expect(toolResult.llmContent).toEqual([
|
|
371
|
+
{ text: 'First part.' },
|
|
372
|
+
{
|
|
373
|
+
text: `[Tool '${serverToolName}' provided the following image data with mime-type: image/jpeg]`,
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
inlineData: {
|
|
377
|
+
mimeType: 'image/jpeg',
|
|
378
|
+
data: 'BASE64_IMAGE_DATA',
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
{ text: 'Second part.' },
|
|
382
|
+
]);
|
|
383
|
+
expect(toolResult.returnDisplay).toBe('First part.\n[Image: image/jpeg]\nSecond part.');
|
|
384
|
+
});
|
|
385
|
+
it('should ignore unknown content block types', async () => {
|
|
386
|
+
const params = { param: 'test' };
|
|
387
|
+
const sdkResponse = [
|
|
388
|
+
{
|
|
389
|
+
functionResponse: {
|
|
390
|
+
name: serverToolName,
|
|
391
|
+
response: {
|
|
392
|
+
content: [
|
|
393
|
+
{ type: 'text', text: 'Valid part.' },
|
|
394
|
+
{ type: 'future_block', data: 'some-data' },
|
|
395
|
+
],
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
];
|
|
400
|
+
mockCallTool.mockResolvedValue(sdkResponse);
|
|
401
|
+
const invocation = tool.build(params);
|
|
402
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
403
|
+
expect(toolResult.llmContent).toEqual([{ text: 'Valid part.' }]);
|
|
404
|
+
expect(toolResult.returnDisplay).toBe('Valid part.\n[Unknown content type: future_block]');
|
|
405
|
+
});
|
|
406
|
+
it('should handle a complex mix of content block types', async () => {
|
|
407
|
+
const params = { param: 'super-complex' };
|
|
408
|
+
const sdkResponse = [
|
|
409
|
+
{
|
|
410
|
+
functionResponse: {
|
|
411
|
+
name: serverToolName,
|
|
412
|
+
response: {
|
|
413
|
+
content: [
|
|
414
|
+
{ type: 'text', text: 'Here is a resource.' },
|
|
415
|
+
{
|
|
416
|
+
type: 'resource_link',
|
|
417
|
+
uri: 'file:///path/to/resource',
|
|
418
|
+
name: 'resource-name',
|
|
419
|
+
title: 'My Resource',
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
type: 'resource',
|
|
423
|
+
resource: {
|
|
424
|
+
uri: 'file:///path/to/text.txt',
|
|
425
|
+
text: 'Embedded text content.',
|
|
426
|
+
mimeType: 'text/plain',
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
type: 'image',
|
|
431
|
+
data: 'BASE64_IMAGE_DATA',
|
|
432
|
+
mimeType: 'image/jpeg',
|
|
433
|
+
},
|
|
434
|
+
],
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
];
|
|
439
|
+
mockCallTool.mockResolvedValue(sdkResponse);
|
|
440
|
+
const invocation = tool.build(params);
|
|
441
|
+
const toolResult = await invocation.execute(new AbortController().signal);
|
|
442
|
+
expect(toolResult.llmContent).toEqual([
|
|
443
|
+
{ text: 'Here is a resource.' },
|
|
444
|
+
{
|
|
445
|
+
text: 'Resource Link: My Resource at file:///path/to/resource',
|
|
446
|
+
},
|
|
447
|
+
{ text: 'Embedded text content.' },
|
|
448
|
+
{
|
|
449
|
+
text: `[Tool '${serverToolName}' provided the following image data with mime-type: image/jpeg]`,
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
inlineData: {
|
|
453
|
+
mimeType: 'image/jpeg',
|
|
454
|
+
data: 'BASE64_IMAGE_DATA',
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
]);
|
|
458
|
+
expect(toolResult.returnDisplay).toBe('Here is a resource.\n[Link to My Resource: file:///path/to/resource]\nEmbedded text content.\n[Image: image/jpeg]');
|
|
459
|
+
});
|
|
460
|
+
describe('AbortSignal support', () => {
|
|
461
|
+
it('should abort immediately if signal is already aborted', async () => {
|
|
462
|
+
const params = { param: 'test' };
|
|
463
|
+
const controller = new AbortController();
|
|
464
|
+
controller.abort();
|
|
465
|
+
const invocation = tool.build(params);
|
|
466
|
+
await expect(invocation.execute(controller.signal)).rejects.toThrow('Tool call aborted');
|
|
467
|
+
// Tool should not be called if signal is already aborted
|
|
468
|
+
expect(mockCallTool).not.toHaveBeenCalled();
|
|
469
|
+
});
|
|
470
|
+
it('should abort during tool execution', async () => {
|
|
471
|
+
const params = { param: 'test' };
|
|
472
|
+
const controller = new AbortController();
|
|
473
|
+
// Mock a delayed response to simulate long-running tool
|
|
474
|
+
mockCallTool.mockImplementation(() => new Promise((resolve) => {
|
|
475
|
+
setTimeout(() => {
|
|
476
|
+
resolve([
|
|
477
|
+
{
|
|
478
|
+
functionResponse: {
|
|
479
|
+
name: serverToolName,
|
|
480
|
+
response: {
|
|
481
|
+
content: [{ type: 'text', text: 'Success' }],
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
]);
|
|
486
|
+
}, 1000);
|
|
487
|
+
}));
|
|
488
|
+
const invocation = tool.build(params);
|
|
489
|
+
const promise = invocation.execute(controller.signal);
|
|
490
|
+
// Abort after a short delay to simulate cancellation during execution
|
|
491
|
+
setTimeout(() => controller.abort(), 50);
|
|
492
|
+
await expect(promise).rejects.toThrow('Tool call aborted');
|
|
493
|
+
});
|
|
494
|
+
it('should complete successfully if not aborted', async () => {
|
|
495
|
+
const params = { param: 'test' };
|
|
496
|
+
const controller = new AbortController();
|
|
497
|
+
const successResponse = [
|
|
498
|
+
{
|
|
499
|
+
functionResponse: {
|
|
500
|
+
name: serverToolName,
|
|
501
|
+
response: {
|
|
502
|
+
content: [{ type: 'text', text: 'Success' }],
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
},
|
|
506
|
+
];
|
|
507
|
+
mockCallTool.mockResolvedValue(successResponse);
|
|
508
|
+
const invocation = tool.build(params);
|
|
509
|
+
const result = await invocation.execute(controller.signal);
|
|
510
|
+
expect(result.llmContent).toEqual([{ text: 'Success' }]);
|
|
511
|
+
expect(result.returnDisplay).toBe('Success');
|
|
512
|
+
expect(mockCallTool).toHaveBeenCalledWith([
|
|
513
|
+
{ name: serverToolName, args: params },
|
|
514
|
+
]);
|
|
515
|
+
});
|
|
516
|
+
it('should handle tool error even when abort signal is provided', async () => {
|
|
517
|
+
const params = { param: 'test' };
|
|
518
|
+
const controller = new AbortController();
|
|
519
|
+
const errorResponse = [
|
|
520
|
+
{
|
|
521
|
+
functionResponse: {
|
|
522
|
+
name: serverToolName,
|
|
523
|
+
response: { error: { isError: true } },
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
];
|
|
527
|
+
mockCallTool.mockResolvedValue(errorResponse);
|
|
528
|
+
const invocation = tool.build(params);
|
|
529
|
+
const result = await invocation.execute(controller.signal);
|
|
530
|
+
expect(result.error?.type).toBe(ToolErrorType.MCP_TOOL_ERROR);
|
|
531
|
+
expect(result.returnDisplay).toContain(`Error: MCP tool '${serverToolName}' reported an error.`);
|
|
532
|
+
});
|
|
533
|
+
it('should handle callTool rejection with abort signal', async () => {
|
|
534
|
+
const params = { param: 'test' };
|
|
535
|
+
const controller = new AbortController();
|
|
536
|
+
const expectedError = new Error('Network error');
|
|
537
|
+
mockCallTool.mockRejectedValue(expectedError);
|
|
538
|
+
const invocation = tool.build(params);
|
|
539
|
+
await expect(invocation.execute(controller.signal)).rejects.toThrow(expectedError);
|
|
540
|
+
});
|
|
541
|
+
it('should cleanup event listeners properly on successful completion', async () => {
|
|
542
|
+
const params = { param: 'test' };
|
|
543
|
+
const controller = new AbortController();
|
|
544
|
+
const successResponse = [
|
|
545
|
+
{
|
|
546
|
+
functionResponse: {
|
|
547
|
+
name: serverToolName,
|
|
548
|
+
response: {
|
|
549
|
+
content: [{ type: 'text', text: 'Success' }],
|
|
550
|
+
},
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
];
|
|
554
|
+
mockCallTool.mockResolvedValue(successResponse);
|
|
555
|
+
const invocation = tool.build(params);
|
|
556
|
+
await invocation.execute(controller.signal);
|
|
557
|
+
controller.abort();
|
|
558
|
+
expect(controller.signal.aborted).toBe(true);
|
|
559
|
+
});
|
|
560
|
+
it('should cleanup event listeners properly on error', async () => {
|
|
561
|
+
const params = { param: 'test' };
|
|
562
|
+
const controller = new AbortController();
|
|
563
|
+
const expectedError = new Error('Tool execution failed');
|
|
564
|
+
mockCallTool.mockRejectedValue(expectedError);
|
|
565
|
+
const invocation = tool.build(params);
|
|
566
|
+
try {
|
|
567
|
+
await invocation.execute(controller.signal);
|
|
568
|
+
}
|
|
569
|
+
catch (error) {
|
|
570
|
+
expect(error).toBe(expectedError);
|
|
571
|
+
}
|
|
572
|
+
// Verify cleanup by aborting after error
|
|
573
|
+
controller.abort();
|
|
574
|
+
expect(controller.signal.aborted).toBe(true);
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
});
|
|
578
|
+
describe('shouldConfirmExecute', () => {
|
|
579
|
+
it('should return false if trust is true', async () => {
|
|
580
|
+
const trustedTool = new DiscoveredMCPTool(mockCallableToolInstance, serverName, serverToolName, baseDescription, inputSchema, true, undefined, { isTrustedFolder: () => true });
|
|
581
|
+
const invocation = trustedTool.build({ param: 'mock' });
|
|
582
|
+
expect(await invocation.shouldConfirmExecute(new AbortController().signal)).toBe(false);
|
|
583
|
+
});
|
|
584
|
+
it('should return false if server is allowlisted', async () => {
|
|
585
|
+
const invocation = tool.build({ param: 'mock' });
|
|
586
|
+
invocation.constructor.allowlist.add(serverName);
|
|
587
|
+
expect(await invocation.shouldConfirmExecute(new AbortController().signal)).toBe(false);
|
|
588
|
+
});
|
|
589
|
+
it('should return false if tool is allowlisted', async () => {
|
|
590
|
+
const toolAllowlistKey = `${serverName}.${serverToolName}`;
|
|
591
|
+
const invocation = tool.build({ param: 'mock' });
|
|
592
|
+
invocation.constructor.allowlist.add(toolAllowlistKey);
|
|
593
|
+
expect(await invocation.shouldConfirmExecute(new AbortController().signal)).toBe(false);
|
|
594
|
+
});
|
|
595
|
+
it('should return confirmation details if not trusted and not allowlisted', async () => {
|
|
596
|
+
const invocation = tool.build({ param: 'mock' });
|
|
597
|
+
const confirmation = await invocation.shouldConfirmExecute(new AbortController().signal);
|
|
598
|
+
expect(confirmation).not.toBe(false);
|
|
599
|
+
if (confirmation && confirmation.type === 'mcp') {
|
|
600
|
+
// Type guard for ToolMcpConfirmationDetails
|
|
601
|
+
expect(confirmation.type).toBe('mcp');
|
|
602
|
+
expect(confirmation.serverName).toBe(serverName);
|
|
603
|
+
expect(confirmation.toolName).toBe(serverToolName);
|
|
604
|
+
}
|
|
605
|
+
else if (confirmation) {
|
|
606
|
+
// Handle other possible confirmation types if necessary, or strengthen test if only MCP is expected
|
|
607
|
+
throw new Error('Confirmation was not of expected type MCP or was false');
|
|
608
|
+
}
|
|
609
|
+
else {
|
|
610
|
+
throw new Error('Confirmation details not in expected format or was false');
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
it('should add server to allowlist on ProceedAlwaysServer', async () => {
|
|
614
|
+
const invocation = tool.build({ param: 'mock' });
|
|
615
|
+
const confirmation = await invocation.shouldConfirmExecute(new AbortController().signal);
|
|
616
|
+
expect(confirmation).not.toBe(false);
|
|
617
|
+
if (confirmation &&
|
|
618
|
+
typeof confirmation === 'object' &&
|
|
619
|
+
'onConfirm' in confirmation &&
|
|
620
|
+
typeof confirmation.onConfirm === 'function') {
|
|
621
|
+
await confirmation.onConfirm(ToolConfirmationOutcome.ProceedAlwaysServer);
|
|
622
|
+
expect(invocation.constructor.allowlist.has(serverName)).toBe(true);
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
throw new Error('Confirmation details or onConfirm not in expected format');
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
it('should add tool to allowlist on ProceedAlwaysTool', async () => {
|
|
629
|
+
const toolAllowlistKey = `${serverName}.${serverToolName}`;
|
|
630
|
+
const invocation = tool.build({ param: 'mock' });
|
|
631
|
+
const confirmation = await invocation.shouldConfirmExecute(new AbortController().signal);
|
|
632
|
+
expect(confirmation).not.toBe(false);
|
|
633
|
+
if (confirmation &&
|
|
634
|
+
typeof confirmation === 'object' &&
|
|
635
|
+
'onConfirm' in confirmation &&
|
|
636
|
+
typeof confirmation.onConfirm === 'function') {
|
|
637
|
+
await confirmation.onConfirm(ToolConfirmationOutcome.ProceedAlwaysTool);
|
|
638
|
+
expect(invocation.constructor.allowlist.has(toolAllowlistKey)).toBe(true);
|
|
639
|
+
}
|
|
640
|
+
else {
|
|
641
|
+
throw new Error('Confirmation details or onConfirm not in expected format');
|
|
642
|
+
}
|
|
643
|
+
});
|
|
644
|
+
it('should handle Cancel confirmation outcome', async () => {
|
|
645
|
+
const invocation = tool.build({ param: 'mock' });
|
|
646
|
+
const confirmation = await invocation.shouldConfirmExecute(new AbortController().signal);
|
|
647
|
+
expect(confirmation).not.toBe(false);
|
|
648
|
+
if (confirmation &&
|
|
649
|
+
typeof confirmation === 'object' &&
|
|
650
|
+
'onConfirm' in confirmation &&
|
|
651
|
+
typeof confirmation.onConfirm === 'function') {
|
|
652
|
+
// Cancel should not add anything to allowlist
|
|
653
|
+
await confirmation.onConfirm(ToolConfirmationOutcome.Cancel);
|
|
654
|
+
expect(invocation.constructor.allowlist.has(serverName)).toBe(false);
|
|
655
|
+
expect(invocation.constructor.allowlist.has(`${serverName}.${serverToolName}`)).toBe(false);
|
|
656
|
+
}
|
|
657
|
+
else {
|
|
658
|
+
throw new Error('Confirmation details or onConfirm not in expected format');
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
it('should handle ProceedOnce confirmation outcome', async () => {
|
|
662
|
+
const invocation = tool.build({ param: 'mock' });
|
|
663
|
+
const confirmation = await invocation.shouldConfirmExecute(new AbortController().signal);
|
|
664
|
+
expect(confirmation).not.toBe(false);
|
|
665
|
+
if (confirmation &&
|
|
666
|
+
typeof confirmation === 'object' &&
|
|
667
|
+
'onConfirm' in confirmation &&
|
|
668
|
+
typeof confirmation.onConfirm === 'function') {
|
|
669
|
+
// ProceedOnce should not add anything to allowlist
|
|
670
|
+
await confirmation.onConfirm(ToolConfirmationOutcome.ProceedOnce);
|
|
671
|
+
expect(invocation.constructor.allowlist.has(serverName)).toBe(false);
|
|
672
|
+
expect(invocation.constructor.allowlist.has(`${serverName}.${serverToolName}`)).toBe(false);
|
|
673
|
+
}
|
|
674
|
+
else {
|
|
675
|
+
throw new Error('Confirmation details or onConfirm not in expected format');
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
});
|
|
679
|
+
describe('shouldConfirmExecute with folder trust', () => {
|
|
680
|
+
const mockConfig = (isTrusted) => ({
|
|
681
|
+
isTrustedFolder: () => isTrusted,
|
|
682
|
+
});
|
|
683
|
+
it('should return false if trust is true and folder is trusted', async () => {
|
|
684
|
+
const trustedTool = new DiscoveredMCPTool(mockCallableToolInstance, serverName, serverToolName, baseDescription, inputSchema, true, // trust = true
|
|
685
|
+
undefined, mockConfig(true));
|
|
686
|
+
const invocation = trustedTool.build({ param: 'mock' });
|
|
687
|
+
expect(await invocation.shouldConfirmExecute(new AbortController().signal)).toBe(false);
|
|
688
|
+
});
|
|
689
|
+
it('should return confirmation details if trust is true but folder is not trusted', async () => {
|
|
690
|
+
const trustedTool = new DiscoveredMCPTool(mockCallableToolInstance, serverName, serverToolName, baseDescription, inputSchema, true, // trust = true
|
|
691
|
+
undefined, mockConfig(false));
|
|
692
|
+
const invocation = trustedTool.build({ param: 'mock' });
|
|
693
|
+
const confirmation = await invocation.shouldConfirmExecute(new AbortController().signal);
|
|
694
|
+
expect(confirmation).not.toBe(false);
|
|
695
|
+
expect(confirmation).toHaveProperty('type', 'mcp');
|
|
696
|
+
});
|
|
697
|
+
it('should return confirmation details if trust is false, even if folder is trusted', async () => {
|
|
698
|
+
const untrustedTool = new DiscoveredMCPTool(mockCallableToolInstance, serverName, serverToolName, baseDescription, inputSchema, false, // trust = false
|
|
699
|
+
undefined, mockConfig(true));
|
|
700
|
+
const invocation = untrustedTool.build({ param: 'mock' });
|
|
701
|
+
const confirmation = await invocation.shouldConfirmExecute(new AbortController().signal);
|
|
702
|
+
expect(confirmation).not.toBe(false);
|
|
703
|
+
expect(confirmation).toHaveProperty('type', 'mcp');
|
|
704
|
+
});
|
|
705
|
+
});
|
|
706
|
+
describe('DiscoveredMCPToolInvocation', () => {
|
|
707
|
+
it('should return the stringified params from getDescription', () => {
|
|
708
|
+
const params = { param: 'testValue', param2: 'anotherOne' };
|
|
709
|
+
const invocation = tool.build(params);
|
|
710
|
+
const description = invocation.getDescription();
|
|
711
|
+
expect(description).toBe('{"param":"testValue","param2":"anotherOne"}');
|
|
712
|
+
});
|
|
713
|
+
});
|
|
714
|
+
describe('streaming progress for long-running MCP tools', () => {
|
|
715
|
+
it('should have canUpdateOutput set to true so the scheduler creates liveOutputCallback', () => {
|
|
716
|
+
// For long-running MCP tools (e.g., browseruse), the scheduler needs
|
|
717
|
+
// canUpdateOutput=true to create a liveOutputCallback. Without this,
|
|
718
|
+
// users see no progress during potentially minutes-long operations.
|
|
719
|
+
expect(tool.canUpdateOutput).toBe(true);
|
|
720
|
+
});
|
|
721
|
+
it('should forward MCP progress notifications to updateOutput callback during execution', async () => {
|
|
722
|
+
const params = { param: 'https://example.com' };
|
|
723
|
+
// Create a mock MCP direct client that simulates progress notifications.
|
|
724
|
+
// When callTool is called with an onprogress callback, it invokes
|
|
725
|
+
// the callback to simulate the MCP server sending progress updates.
|
|
726
|
+
const mockMcpClient = {
|
|
727
|
+
callTool: vi.fn(async (_params, _schema, options) => {
|
|
728
|
+
// Simulate 3 progress notifications from the MCP server
|
|
729
|
+
for (let i = 1; i <= 3; i++) {
|
|
730
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
731
|
+
options?.onprogress?.({
|
|
732
|
+
progress: i,
|
|
733
|
+
total: 3,
|
|
734
|
+
message: `Step ${i} of 3`,
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
return {
|
|
738
|
+
content: [
|
|
739
|
+
{
|
|
740
|
+
type: 'text',
|
|
741
|
+
text: 'Browser automation completed successfully.',
|
|
742
|
+
},
|
|
743
|
+
],
|
|
744
|
+
};
|
|
745
|
+
}),
|
|
746
|
+
};
|
|
747
|
+
// Create a tool with the direct MCP client
|
|
748
|
+
const streamingTool = new DiscoveredMCPTool(mockCallableToolInstance, serverName, serverToolName, baseDescription, inputSchema, undefined, // trust
|
|
749
|
+
undefined, // nameOverride
|
|
750
|
+
undefined, // cliConfig
|
|
751
|
+
mockMcpClient);
|
|
752
|
+
const invocation = streamingTool.build(params);
|
|
753
|
+
const updateOutputSpy = vi.fn();
|
|
754
|
+
const result = await invocation.execute(new AbortController().signal, updateOutputSpy);
|
|
755
|
+
// The final result should still be correct
|
|
756
|
+
expect(result.llmContent).toEqual([
|
|
757
|
+
{ text: 'Browser automation completed successfully.' },
|
|
758
|
+
]);
|
|
759
|
+
// The updateOutput callback SHOULD have been called at least once
|
|
760
|
+
// with intermediate progress, so users can see what's happening
|
|
761
|
+
// during the long wait.
|
|
762
|
+
expect(updateOutputSpy).toHaveBeenCalled();
|
|
763
|
+
expect(updateOutputSpy).toHaveBeenCalledTimes(3);
|
|
764
|
+
// Verify progress data contains structured MCP progress info
|
|
765
|
+
expect(updateOutputSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
766
|
+
type: 'mcp_tool_progress',
|
|
767
|
+
progress: 1,
|
|
768
|
+
total: 3,
|
|
769
|
+
message: 'Step 1 of 3',
|
|
770
|
+
}));
|
|
771
|
+
expect(updateOutputSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
772
|
+
type: 'mcp_tool_progress',
|
|
773
|
+
progress: 3,
|
|
774
|
+
total: 3,
|
|
775
|
+
message: 'Step 3 of 3',
|
|
776
|
+
}));
|
|
777
|
+
});
|
|
778
|
+
it('should show incremental progress for multi-step browser automation', async () => {
|
|
779
|
+
const params = { param: 'fill-form' };
|
|
780
|
+
const steps = [
|
|
781
|
+
'Navigating to page...',
|
|
782
|
+
'Filling username field...',
|
|
783
|
+
'Filling password field...',
|
|
784
|
+
'Clicking submit...',
|
|
785
|
+
];
|
|
786
|
+
const mockMcpClient = {
|
|
787
|
+
callTool: vi.fn(async (_params, _schema, options) => {
|
|
788
|
+
for (let i = 0; i < steps.length; i++) {
|
|
789
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
790
|
+
options?.onprogress?.({
|
|
791
|
+
progress: i + 1,
|
|
792
|
+
total: steps.length,
|
|
793
|
+
message: steps[i],
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
return {
|
|
797
|
+
content: [{ type: 'text', text: steps.join('\n') }],
|
|
798
|
+
};
|
|
799
|
+
}),
|
|
800
|
+
};
|
|
801
|
+
const streamingTool = new DiscoveredMCPTool(mockCallableToolInstance, serverName, serverToolName, baseDescription, inputSchema, undefined, undefined, undefined, mockMcpClient);
|
|
802
|
+
const invocation = streamingTool.build(params);
|
|
803
|
+
const receivedUpdates = [];
|
|
804
|
+
const updateOutputCallback = (output) => {
|
|
805
|
+
receivedUpdates.push(output);
|
|
806
|
+
};
|
|
807
|
+
await invocation.execute(new AbortController().signal, updateOutputCallback);
|
|
808
|
+
// User should have received one update per step
|
|
809
|
+
expect(receivedUpdates.length).toBeGreaterThan(0);
|
|
810
|
+
expect(receivedUpdates).toHaveLength(steps.length);
|
|
811
|
+
// Each update should be structured McpToolProgressData
|
|
812
|
+
expect(receivedUpdates[0]).toEqual({
|
|
813
|
+
type: 'mcp_tool_progress',
|
|
814
|
+
progress: 1,
|
|
815
|
+
total: steps.length,
|
|
816
|
+
message: 'Navigating to page...',
|
|
817
|
+
});
|
|
818
|
+
expect(receivedUpdates[3]).toEqual({
|
|
819
|
+
type: 'mcp_tool_progress',
|
|
820
|
+
progress: 4,
|
|
821
|
+
total: steps.length,
|
|
822
|
+
message: 'Clicking submit...',
|
|
823
|
+
});
|
|
824
|
+
});
|
|
825
|
+
});
|
|
826
|
+
});
|
|
827
|
+
//# sourceMappingURL=mcp-tool.test.js.map
|