@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,872 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { createDebugLogger } from '../utils/debugLogger.js';
|
|
7
|
+
const debugLogger = createDebugLogger('TOOL_SCHEDULER');
|
|
8
|
+
import { ToolConfirmationOutcome, ApprovalMode, logToolCall, ReadFileTool, ToolErrorType, ToolCallEvent, ShellTool, logToolOutputTruncated, ToolOutputTruncatedEvent, InputFormat, Kind, SkillTool, } from '../index.js';
|
|
9
|
+
import { ToolNames } from '../tools/tool-names.js';
|
|
10
|
+
import { getResponseTextFromParts } from '../utils/generateContentResponseUtilities.js';
|
|
11
|
+
import { isModifiableDeclarativeTool, modifyWithEditor, } from '../tools/modifiable-tool.js';
|
|
12
|
+
import * as Diff from 'diff';
|
|
13
|
+
import * as fs from 'node:fs/promises';
|
|
14
|
+
import * as path from 'node:path';
|
|
15
|
+
import { doesToolInvocationMatch } from '../utils/tool-utils.js';
|
|
16
|
+
import levenshtein from 'fast-levenshtein';
|
|
17
|
+
import { getPlanModeSystemReminder } from './prompts.js';
|
|
18
|
+
import { ShellToolInvocation } from '../tools/shell.js';
|
|
19
|
+
const TRUNCATION_PARAM_GUIDANCE = 'Note: Your previous response was truncated due to max_tokens limit, ' +
|
|
20
|
+
'which likely caused incomplete tool call parameters. ' +
|
|
21
|
+
'Please retry the tool call with complete parameters. ' +
|
|
22
|
+
'If the content is too large for a single response, ' +
|
|
23
|
+
'consider splitting it into smaller parts.';
|
|
24
|
+
const TRUNCATION_EDIT_REJECTION = 'Your previous response was truncated due to max_tokens limit, ' +
|
|
25
|
+
'which likely produced incomplete file content. ' +
|
|
26
|
+
'The tool call has been rejected to prevent writing ' +
|
|
27
|
+
'truncated content to the file. ' +
|
|
28
|
+
'Please retry the tool call with complete content. ' +
|
|
29
|
+
'If the content is too large for a single response, ' +
|
|
30
|
+
'consider splitting it into smaller parts ' +
|
|
31
|
+
'(e.g., write_file for initial content, then edit for additions).';
|
|
32
|
+
/**
|
|
33
|
+
* Formats tool output for a Gemini FunctionResponse.
|
|
34
|
+
*/
|
|
35
|
+
function createFunctionResponsePart(callId, toolName, output, mediaParts) {
|
|
36
|
+
const functionResponse = {
|
|
37
|
+
id: callId,
|
|
38
|
+
name: toolName,
|
|
39
|
+
response: { output },
|
|
40
|
+
...(mediaParts && mediaParts.length > 0 ? { parts: mediaParts } : {}),
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
functionResponse,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function convertToFunctionResponse(toolName, callId, llmContent) {
|
|
47
|
+
const contentToProcess = Array.isArray(llmContent) && llmContent.length === 1
|
|
48
|
+
? llmContent[0]
|
|
49
|
+
: llmContent;
|
|
50
|
+
if (typeof contentToProcess === 'string') {
|
|
51
|
+
return [createFunctionResponsePart(callId, toolName, contentToProcess)];
|
|
52
|
+
}
|
|
53
|
+
if (Array.isArray(contentToProcess)) {
|
|
54
|
+
// Extract text and media from all parts so that EVERYTHING is inside
|
|
55
|
+
// the FunctionResponse.
|
|
56
|
+
const textParts = [];
|
|
57
|
+
const mediaParts = [];
|
|
58
|
+
for (const part of toParts(contentToProcess)) {
|
|
59
|
+
if (part.text !== undefined) {
|
|
60
|
+
textParts.push(part.text);
|
|
61
|
+
}
|
|
62
|
+
else if (part.inlineData) {
|
|
63
|
+
mediaParts.push({ inlineData: part.inlineData });
|
|
64
|
+
}
|
|
65
|
+
else if (part.fileData) {
|
|
66
|
+
mediaParts.push({ fileData: part.fileData });
|
|
67
|
+
}
|
|
68
|
+
// Other exotic part types (e.g. functionCall) are intentionally
|
|
69
|
+
// dropped here – they should not appear inside tool results.
|
|
70
|
+
}
|
|
71
|
+
const output = textParts.length > 0 ? textParts.join('\n') : 'Tool execution succeeded.';
|
|
72
|
+
return [createFunctionResponsePart(callId, toolName, output, mediaParts)];
|
|
73
|
+
}
|
|
74
|
+
// After this point, contentToProcess is a single Part object.
|
|
75
|
+
if (contentToProcess.functionResponse) {
|
|
76
|
+
if (contentToProcess.functionResponse.response?.['content']) {
|
|
77
|
+
const stringifiedOutput = getResponseTextFromParts(contentToProcess.functionResponse.response['content']) || '';
|
|
78
|
+
return [createFunctionResponsePart(callId, toolName, stringifiedOutput)];
|
|
79
|
+
}
|
|
80
|
+
// It's a functionResponse that we should pass through as is.
|
|
81
|
+
return [contentToProcess];
|
|
82
|
+
}
|
|
83
|
+
if (contentToProcess.inlineData || contentToProcess.fileData) {
|
|
84
|
+
const mediaParts = [];
|
|
85
|
+
if (contentToProcess.inlineData) {
|
|
86
|
+
mediaParts.push({ inlineData: contentToProcess.inlineData });
|
|
87
|
+
}
|
|
88
|
+
if (contentToProcess.fileData) {
|
|
89
|
+
mediaParts.push({ fileData: contentToProcess.fileData });
|
|
90
|
+
}
|
|
91
|
+
const functionResponse = createFunctionResponsePart(callId, toolName, '', mediaParts);
|
|
92
|
+
return [functionResponse];
|
|
93
|
+
}
|
|
94
|
+
if (contentToProcess.text !== undefined) {
|
|
95
|
+
return [
|
|
96
|
+
createFunctionResponsePart(callId, toolName, contentToProcess.text),
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
// Default case for other kinds of parts.
|
|
100
|
+
return [
|
|
101
|
+
createFunctionResponsePart(callId, toolName, 'Tool execution succeeded.'),
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
function toParts(input) {
|
|
105
|
+
const parts = [];
|
|
106
|
+
for (const part of Array.isArray(input) ? input : [input]) {
|
|
107
|
+
if (typeof part === 'string') {
|
|
108
|
+
parts.push({ text: part });
|
|
109
|
+
}
|
|
110
|
+
else if (part) {
|
|
111
|
+
parts.push(part);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return parts;
|
|
115
|
+
}
|
|
116
|
+
const createErrorResponse = (request, error, errorType) => ({
|
|
117
|
+
callId: request.callId,
|
|
118
|
+
error,
|
|
119
|
+
responseParts: [
|
|
120
|
+
{
|
|
121
|
+
functionResponse: {
|
|
122
|
+
id: request.callId,
|
|
123
|
+
name: request.name,
|
|
124
|
+
response: { error: error.message },
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
resultDisplay: error.message,
|
|
129
|
+
errorType,
|
|
130
|
+
contentLength: error.message.length,
|
|
131
|
+
});
|
|
132
|
+
export async function truncateAndSaveToFile(content, callId, projectTempDir, threshold, truncateLines) {
|
|
133
|
+
if (content.length <= threshold) {
|
|
134
|
+
return { content };
|
|
135
|
+
}
|
|
136
|
+
let lines = content.split('\n');
|
|
137
|
+
let fileContent = content;
|
|
138
|
+
// If the content is long but has few lines, wrap it to enable line-based truncation.
|
|
139
|
+
if (lines.length <= truncateLines) {
|
|
140
|
+
const wrapWidth = 120; // A reasonable width for wrapping.
|
|
141
|
+
const wrappedLines = [];
|
|
142
|
+
for (const line of lines) {
|
|
143
|
+
if (line.length > wrapWidth) {
|
|
144
|
+
for (let i = 0; i < line.length; i += wrapWidth) {
|
|
145
|
+
wrappedLines.push(line.substring(i, i + wrapWidth));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
wrappedLines.push(line);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
lines = wrappedLines;
|
|
153
|
+
fileContent = lines.join('\n');
|
|
154
|
+
}
|
|
155
|
+
const head = Math.floor(truncateLines / 5);
|
|
156
|
+
const beginning = lines.slice(0, head);
|
|
157
|
+
const end = lines.slice(-(truncateLines - head));
|
|
158
|
+
const truncatedContent = beginning.join('\n') + '\n... [CONTENT TRUNCATED] ...\n' + end.join('\n');
|
|
159
|
+
// Sanitize callId to prevent path traversal.
|
|
160
|
+
const safeFileName = `${path.basename(callId)}.output`;
|
|
161
|
+
const outputFile = path.join(projectTempDir, safeFileName);
|
|
162
|
+
try {
|
|
163
|
+
await fs.writeFile(outputFile, fileContent);
|
|
164
|
+
return {
|
|
165
|
+
content: `Tool output was too large and has been truncated.
|
|
166
|
+
The full output has been saved to: ${outputFile}
|
|
167
|
+
To read the complete output, use the ${ReadFileTool.Name} tool with the absolute file path above.
|
|
168
|
+
The truncated output below shows the beginning and end of the content. The marker '... [CONTENT TRUNCATED] ...' indicates where content was removed.
|
|
169
|
+
This allows you to efficiently examine different parts of the output without loading the entire file.
|
|
170
|
+
Truncated part of the output:
|
|
171
|
+
${truncatedContent}`,
|
|
172
|
+
outputFile,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
catch (_error) {
|
|
176
|
+
return {
|
|
177
|
+
content: truncatedContent + `\n[Note: Could not save full output to file]`,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
export class CoreToolScheduler {
|
|
182
|
+
toolRegistry;
|
|
183
|
+
toolCalls = [];
|
|
184
|
+
outputUpdateHandler;
|
|
185
|
+
onAllToolCallsComplete;
|
|
186
|
+
onToolCallsUpdate;
|
|
187
|
+
getPreferredEditor;
|
|
188
|
+
config;
|
|
189
|
+
onEditorClose;
|
|
190
|
+
chatRecordingService;
|
|
191
|
+
isFinalizingToolCalls = false;
|
|
192
|
+
isScheduling = false;
|
|
193
|
+
requestQueue = [];
|
|
194
|
+
constructor(options) {
|
|
195
|
+
this.config = options.config;
|
|
196
|
+
this.toolRegistry = options.config.getToolRegistry();
|
|
197
|
+
this.outputUpdateHandler = options.outputUpdateHandler;
|
|
198
|
+
this.onAllToolCallsComplete = options.onAllToolCallsComplete;
|
|
199
|
+
this.onToolCallsUpdate = options.onToolCallsUpdate;
|
|
200
|
+
this.getPreferredEditor = options.getPreferredEditor;
|
|
201
|
+
this.onEditorClose = options.onEditorClose;
|
|
202
|
+
this.chatRecordingService = options.chatRecordingService;
|
|
203
|
+
}
|
|
204
|
+
setStatusInternal(targetCallId, newStatus, auxiliaryData) {
|
|
205
|
+
this.toolCalls = this.toolCalls.map((currentCall) => {
|
|
206
|
+
if (currentCall.request.callId !== targetCallId ||
|
|
207
|
+
currentCall.status === 'success' ||
|
|
208
|
+
currentCall.status === 'error' ||
|
|
209
|
+
currentCall.status === 'cancelled') {
|
|
210
|
+
return currentCall;
|
|
211
|
+
}
|
|
212
|
+
// currentCall is a non-terminal state here and should have startTime and tool.
|
|
213
|
+
const existingStartTime = currentCall.startTime;
|
|
214
|
+
const toolInstance = currentCall.tool;
|
|
215
|
+
const invocation = currentCall.invocation;
|
|
216
|
+
const outcome = currentCall.outcome;
|
|
217
|
+
switch (newStatus) {
|
|
218
|
+
case 'success': {
|
|
219
|
+
const durationMs = existingStartTime
|
|
220
|
+
? Date.now() - existingStartTime
|
|
221
|
+
: undefined;
|
|
222
|
+
return {
|
|
223
|
+
request: currentCall.request,
|
|
224
|
+
tool: toolInstance,
|
|
225
|
+
invocation,
|
|
226
|
+
status: 'success',
|
|
227
|
+
response: auxiliaryData,
|
|
228
|
+
durationMs,
|
|
229
|
+
outcome,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
case 'error': {
|
|
233
|
+
const durationMs = existingStartTime
|
|
234
|
+
? Date.now() - existingStartTime
|
|
235
|
+
: undefined;
|
|
236
|
+
return {
|
|
237
|
+
request: currentCall.request,
|
|
238
|
+
status: 'error',
|
|
239
|
+
tool: toolInstance,
|
|
240
|
+
response: auxiliaryData,
|
|
241
|
+
durationMs,
|
|
242
|
+
outcome,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
case 'awaiting_approval':
|
|
246
|
+
return {
|
|
247
|
+
request: currentCall.request,
|
|
248
|
+
tool: toolInstance,
|
|
249
|
+
status: 'awaiting_approval',
|
|
250
|
+
confirmationDetails: auxiliaryData,
|
|
251
|
+
startTime: existingStartTime,
|
|
252
|
+
outcome,
|
|
253
|
+
invocation,
|
|
254
|
+
};
|
|
255
|
+
case 'scheduled':
|
|
256
|
+
return {
|
|
257
|
+
request: currentCall.request,
|
|
258
|
+
tool: toolInstance,
|
|
259
|
+
status: 'scheduled',
|
|
260
|
+
startTime: existingStartTime,
|
|
261
|
+
outcome,
|
|
262
|
+
invocation,
|
|
263
|
+
};
|
|
264
|
+
case 'cancelled': {
|
|
265
|
+
const durationMs = existingStartTime
|
|
266
|
+
? Date.now() - existingStartTime
|
|
267
|
+
: undefined;
|
|
268
|
+
// Preserve diff for cancelled edit operations
|
|
269
|
+
let resultDisplay = undefined;
|
|
270
|
+
if (currentCall.status === 'awaiting_approval') {
|
|
271
|
+
const waitingCall = currentCall;
|
|
272
|
+
if (waitingCall.confirmationDetails.type === 'edit') {
|
|
273
|
+
resultDisplay = {
|
|
274
|
+
fileDiff: waitingCall.confirmationDetails.fileDiff,
|
|
275
|
+
fileName: waitingCall.confirmationDetails.fileName,
|
|
276
|
+
originalContent: waitingCall.confirmationDetails.originalContent,
|
|
277
|
+
newContent: waitingCall.confirmationDetails.newContent,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
else if (currentCall.status === 'executing') {
|
|
282
|
+
// If the tool was streaming live output, preserve the latest
|
|
283
|
+
// output so the UI can continue to show it after cancellation.
|
|
284
|
+
const executingCall = currentCall;
|
|
285
|
+
if (executingCall.liveOutput !== undefined) {
|
|
286
|
+
resultDisplay = executingCall.liveOutput;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
const errorMessage = `[Operation Cancelled] Reason: ${auxiliaryData}`;
|
|
290
|
+
return {
|
|
291
|
+
request: currentCall.request,
|
|
292
|
+
tool: toolInstance,
|
|
293
|
+
invocation,
|
|
294
|
+
status: 'cancelled',
|
|
295
|
+
response: {
|
|
296
|
+
callId: currentCall.request.callId,
|
|
297
|
+
responseParts: [
|
|
298
|
+
{
|
|
299
|
+
functionResponse: {
|
|
300
|
+
id: currentCall.request.callId,
|
|
301
|
+
name: currentCall.request.name,
|
|
302
|
+
response: {
|
|
303
|
+
error: errorMessage,
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
resultDisplay,
|
|
309
|
+
error: undefined,
|
|
310
|
+
errorType: undefined,
|
|
311
|
+
contentLength: errorMessage.length,
|
|
312
|
+
},
|
|
313
|
+
durationMs,
|
|
314
|
+
outcome,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
case 'validating':
|
|
318
|
+
return {
|
|
319
|
+
request: currentCall.request,
|
|
320
|
+
tool: toolInstance,
|
|
321
|
+
status: 'validating',
|
|
322
|
+
startTime: existingStartTime,
|
|
323
|
+
outcome,
|
|
324
|
+
invocation,
|
|
325
|
+
};
|
|
326
|
+
case 'executing':
|
|
327
|
+
return {
|
|
328
|
+
request: currentCall.request,
|
|
329
|
+
tool: toolInstance,
|
|
330
|
+
status: 'executing',
|
|
331
|
+
startTime: existingStartTime,
|
|
332
|
+
outcome,
|
|
333
|
+
invocation,
|
|
334
|
+
};
|
|
335
|
+
default: {
|
|
336
|
+
const exhaustiveCheck = newStatus;
|
|
337
|
+
return exhaustiveCheck;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
this.notifyToolCallsUpdate();
|
|
342
|
+
this.checkAndNotifyCompletion();
|
|
343
|
+
}
|
|
344
|
+
setArgsInternal(targetCallId, args) {
|
|
345
|
+
this.toolCalls = this.toolCalls.map((call) => {
|
|
346
|
+
// We should never be asked to set args on an ErroredToolCall, but
|
|
347
|
+
// we guard for the case anyways.
|
|
348
|
+
if (call.request.callId !== targetCallId || call.status === 'error') {
|
|
349
|
+
return call;
|
|
350
|
+
}
|
|
351
|
+
const invocationOrError = this.buildInvocation(call.tool, args);
|
|
352
|
+
if (invocationOrError instanceof Error) {
|
|
353
|
+
const response = createErrorResponse(call.request, invocationOrError, ToolErrorType.INVALID_TOOL_PARAMS);
|
|
354
|
+
return {
|
|
355
|
+
request: { ...call.request, args: args },
|
|
356
|
+
status: 'error',
|
|
357
|
+
tool: call.tool,
|
|
358
|
+
response,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
return {
|
|
362
|
+
...call,
|
|
363
|
+
request: { ...call.request, args: args },
|
|
364
|
+
invocation: invocationOrError,
|
|
365
|
+
};
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
isRunning() {
|
|
369
|
+
return (this.isFinalizingToolCalls ||
|
|
370
|
+
this.toolCalls.some((call) => call.status === 'executing' || call.status === 'awaiting_approval'));
|
|
371
|
+
}
|
|
372
|
+
buildInvocation(tool, args) {
|
|
373
|
+
try {
|
|
374
|
+
return tool.build(args);
|
|
375
|
+
}
|
|
376
|
+
catch (e) {
|
|
377
|
+
if (e instanceof Error) {
|
|
378
|
+
return e;
|
|
379
|
+
}
|
|
380
|
+
return new Error(String(e));
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Generates error message for unknown tool. Returns early with skill-specific
|
|
385
|
+
* message if the name matches a skill, otherwise uses Levenshtein suggestions.
|
|
386
|
+
*/
|
|
387
|
+
getToolNotFoundMessage(unknownToolName, topN = 3) {
|
|
388
|
+
// Check if the unknown tool name matches an available skill name.
|
|
389
|
+
// This handles the case where the model tries to invoke a skill as a tool
|
|
390
|
+
// (e.g., Tool: "pdf" instead of Tool: "Skill" with skill: "pdf")
|
|
391
|
+
const skillTool = this.toolRegistry.getTool(ToolNames.SKILL);
|
|
392
|
+
if (skillTool instanceof SkillTool) {
|
|
393
|
+
const availableSkillNames = skillTool.getAvailableSkillNames();
|
|
394
|
+
if (availableSkillNames.includes(unknownToolName)) {
|
|
395
|
+
return `"${unknownToolName}" is a skill name, not a tool name. To use this skill, invoke the "${ToolNames.SKILL}" tool with parameter: skill: "${unknownToolName}"`;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
// Standard "not found" message with Levenshtein suggestions
|
|
399
|
+
const suggestion = this.getToolSuggestion(unknownToolName, topN);
|
|
400
|
+
return `Tool "${unknownToolName}" not found in registry. Tools must use the exact names that are registered.${suggestion}`;
|
|
401
|
+
}
|
|
402
|
+
/** Suggests similar tool names using Levenshtein distance. */
|
|
403
|
+
getToolSuggestion(unknownToolName, topN = 3) {
|
|
404
|
+
const allToolNames = this.toolRegistry.getAllToolNames();
|
|
405
|
+
const matches = allToolNames.map((toolName) => ({
|
|
406
|
+
name: toolName,
|
|
407
|
+
distance: levenshtein.get(unknownToolName, toolName),
|
|
408
|
+
}));
|
|
409
|
+
matches.sort((a, b) => a.distance - b.distance);
|
|
410
|
+
const topNResults = matches.slice(0, topN);
|
|
411
|
+
if (topNResults.length === 0) {
|
|
412
|
+
return '';
|
|
413
|
+
}
|
|
414
|
+
const suggestedNames = topNResults
|
|
415
|
+
.map((match) => `"${match.name}"`)
|
|
416
|
+
.join(', ');
|
|
417
|
+
if (topNResults.length > 1) {
|
|
418
|
+
return ` Did you mean one of: ${suggestedNames}?`;
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
return ` Did you mean ${suggestedNames}?`;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
schedule(request, signal) {
|
|
425
|
+
if (this.isRunning() || this.isScheduling) {
|
|
426
|
+
return new Promise((resolve, reject) => {
|
|
427
|
+
const abortHandler = () => {
|
|
428
|
+
// Find and remove the request from the queue
|
|
429
|
+
const index = this.requestQueue.findIndex((item) => item.request === request);
|
|
430
|
+
if (index > -1) {
|
|
431
|
+
this.requestQueue.splice(index, 1);
|
|
432
|
+
reject(new Error('Tool call cancelled while in queue.'));
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
signal.addEventListener('abort', abortHandler, { once: true });
|
|
436
|
+
this.requestQueue.push({
|
|
437
|
+
request,
|
|
438
|
+
signal,
|
|
439
|
+
resolve: () => {
|
|
440
|
+
signal.removeEventListener('abort', abortHandler);
|
|
441
|
+
resolve();
|
|
442
|
+
},
|
|
443
|
+
reject: (reason) => {
|
|
444
|
+
signal.removeEventListener('abort', abortHandler);
|
|
445
|
+
reject(reason);
|
|
446
|
+
},
|
|
447
|
+
});
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
return this._schedule(request, signal);
|
|
451
|
+
}
|
|
452
|
+
async _schedule(request, signal) {
|
|
453
|
+
this.isScheduling = true;
|
|
454
|
+
try {
|
|
455
|
+
if (this.isRunning()) {
|
|
456
|
+
throw new Error('Cannot schedule new tool calls while other tool calls are actively running (executing or awaiting approval).');
|
|
457
|
+
}
|
|
458
|
+
const requestsToProcess = Array.isArray(request) ? request : [request];
|
|
459
|
+
const newToolCalls = requestsToProcess.map((reqInfo) => {
|
|
460
|
+
// Check if the tool is excluded due to permissions/environment restrictions
|
|
461
|
+
// This check should happen before registry lookup to provide a clear permission error
|
|
462
|
+
const excludeTools = this.config.getExcludeTools?.() ?? undefined;
|
|
463
|
+
if (excludeTools && excludeTools.length > 0) {
|
|
464
|
+
const normalizedToolName = reqInfo.name.toLowerCase().trim();
|
|
465
|
+
const excludedMatch = excludeTools.find((excludedTool) => excludedTool.toLowerCase().trim() === normalizedToolName);
|
|
466
|
+
if (excludedMatch) {
|
|
467
|
+
// The tool exists but is excluded - return permission error directly
|
|
468
|
+
const permissionErrorMessage = `Qwen Code requires permission to use ${excludedMatch}, but that permission was declined.`;
|
|
469
|
+
return {
|
|
470
|
+
status: 'error',
|
|
471
|
+
request: reqInfo,
|
|
472
|
+
response: createErrorResponse(reqInfo, new Error(permissionErrorMessage), ToolErrorType.EXECUTION_DENIED),
|
|
473
|
+
durationMs: 0,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
const toolInstance = this.toolRegistry.getTool(reqInfo.name);
|
|
478
|
+
if (!toolInstance) {
|
|
479
|
+
// Tool is not in registry and not excluded - likely hallucinated or typo
|
|
480
|
+
const errorMessage = this.getToolNotFoundMessage(reqInfo.name);
|
|
481
|
+
return {
|
|
482
|
+
status: 'error',
|
|
483
|
+
request: reqInfo,
|
|
484
|
+
response: createErrorResponse(reqInfo, new Error(errorMessage), ToolErrorType.TOOL_NOT_REGISTERED),
|
|
485
|
+
durationMs: 0,
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
const invocationOrError = this.buildInvocation(toolInstance, reqInfo.args);
|
|
489
|
+
if (invocationOrError instanceof Error) {
|
|
490
|
+
const error = reqInfo.wasOutputTruncated
|
|
491
|
+
? new Error(`${invocationOrError.message} ${TRUNCATION_PARAM_GUIDANCE}`)
|
|
492
|
+
: invocationOrError;
|
|
493
|
+
return {
|
|
494
|
+
status: 'error',
|
|
495
|
+
request: reqInfo,
|
|
496
|
+
tool: toolInstance,
|
|
497
|
+
response: createErrorResponse(reqInfo, error, ToolErrorType.INVALID_TOOL_PARAMS),
|
|
498
|
+
durationMs: 0,
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
// Reject file-modifying calls when truncated to prevent
|
|
502
|
+
// writing incomplete content.
|
|
503
|
+
if (reqInfo.wasOutputTruncated && toolInstance.kind === Kind.Edit) {
|
|
504
|
+
const truncationError = new Error(TRUNCATION_EDIT_REJECTION);
|
|
505
|
+
return {
|
|
506
|
+
status: 'error',
|
|
507
|
+
request: reqInfo,
|
|
508
|
+
tool: toolInstance,
|
|
509
|
+
response: createErrorResponse(reqInfo, truncationError, ToolErrorType.OUTPUT_TRUNCATED),
|
|
510
|
+
durationMs: 0,
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
return {
|
|
514
|
+
status: 'validating',
|
|
515
|
+
request: reqInfo,
|
|
516
|
+
tool: toolInstance,
|
|
517
|
+
invocation: invocationOrError,
|
|
518
|
+
startTime: Date.now(),
|
|
519
|
+
};
|
|
520
|
+
});
|
|
521
|
+
this.toolCalls = this.toolCalls.concat(newToolCalls);
|
|
522
|
+
this.notifyToolCallsUpdate();
|
|
523
|
+
for (const toolCall of newToolCalls) {
|
|
524
|
+
if (toolCall.status !== 'validating') {
|
|
525
|
+
continue;
|
|
526
|
+
}
|
|
527
|
+
const { request: reqInfo, invocation } = toolCall;
|
|
528
|
+
try {
|
|
529
|
+
if (signal.aborted) {
|
|
530
|
+
this.setStatusInternal(reqInfo.callId, 'cancelled', 'Tool call cancelled by user.');
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
const confirmationDetails = await invocation.shouldConfirmExecute(signal);
|
|
534
|
+
if (!confirmationDetails) {
|
|
535
|
+
this.setToolCallOutcome(reqInfo.callId, ToolConfirmationOutcome.ProceedAlways);
|
|
536
|
+
this.setStatusInternal(reqInfo.callId, 'scheduled');
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
const allowedTools = this.config.getAllowedTools() || [];
|
|
540
|
+
const isPlanMode = this.config.getApprovalMode() === ApprovalMode.PLAN;
|
|
541
|
+
const isExitPlanModeTool = reqInfo.name === 'exit_plan_mode';
|
|
542
|
+
// ask_user_question needs the confirmation flow even in plan mode
|
|
543
|
+
// so the user can actually answer the questions
|
|
544
|
+
const isAskUserQuestionTool = confirmationDetails &&
|
|
545
|
+
confirmationDetails.type === 'ask_user_question';
|
|
546
|
+
if (isPlanMode && !isExitPlanModeTool && !isAskUserQuestionTool) {
|
|
547
|
+
if (confirmationDetails) {
|
|
548
|
+
this.setStatusInternal(reqInfo.callId, 'error', {
|
|
549
|
+
callId: reqInfo.callId,
|
|
550
|
+
responseParts: convertToFunctionResponse(reqInfo.name, reqInfo.callId, getPlanModeSystemReminder()),
|
|
551
|
+
resultDisplay: 'Plan mode blocked a non-read-only tool call.',
|
|
552
|
+
error: undefined,
|
|
553
|
+
errorType: undefined,
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
else {
|
|
557
|
+
this.setStatusInternal(reqInfo.callId, 'scheduled');
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
else if ((this.config.getApprovalMode() === ApprovalMode.YOLO ||
|
|
561
|
+
doesToolInvocationMatch(toolCall.tool, invocation, allowedTools)) &&
|
|
562
|
+
// Even in YOLO mode, ask_user_question tool requires user confirmation to ensure the user always has a chance to respond to questions
|
|
563
|
+
confirmationDetails.type !== 'ask_user_question') {
|
|
564
|
+
this.setToolCallOutcome(reqInfo.callId, ToolConfirmationOutcome.ProceedAlways);
|
|
565
|
+
this.setStatusInternal(reqInfo.callId, 'scheduled');
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
/**
|
|
569
|
+
* In non-interactive mode where no user will respond to approval prompts,
|
|
570
|
+
* and not running as IDE companion or Zed integration, automatically deny approval.
|
|
571
|
+
* This is intended to create an explicit denial of the tool call,
|
|
572
|
+
* rather than silently waiting for approval and hanging forever.
|
|
573
|
+
*/
|
|
574
|
+
const shouldAutoDeny = !this.config.isInteractive() &&
|
|
575
|
+
!this.config.getExperimentalZedIntegration() &&
|
|
576
|
+
this.config.getInputFormat() !== InputFormat.STREAM_JSON;
|
|
577
|
+
if (shouldAutoDeny) {
|
|
578
|
+
const errorMessage = `Qwen Code requires permission to use "${reqInfo.name}", but that permission was declined.`;
|
|
579
|
+
this.setStatusInternal(reqInfo.callId, 'error', createErrorResponse(reqInfo, new Error(errorMessage), ToolErrorType.EXECUTION_DENIED));
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
// Allow IDE to resolve confirmation
|
|
583
|
+
if (confirmationDetails.type === 'edit' &&
|
|
584
|
+
confirmationDetails.ideConfirmation) {
|
|
585
|
+
confirmationDetails.ideConfirmation.then((resolution) => {
|
|
586
|
+
if (resolution.status === 'accepted') {
|
|
587
|
+
this.handleConfirmationResponse(reqInfo.callId, confirmationDetails.onConfirm, ToolConfirmationOutcome.ProceedOnce, signal);
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
this.handleConfirmationResponse(reqInfo.callId, confirmationDetails.onConfirm, ToolConfirmationOutcome.Cancel, signal);
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
const originalOnConfirm = confirmationDetails.onConfirm;
|
|
595
|
+
const wrappedConfirmationDetails = {
|
|
596
|
+
...confirmationDetails,
|
|
597
|
+
onConfirm: (outcome, payload) => this.handleConfirmationResponse(reqInfo.callId, originalOnConfirm, outcome, signal, payload),
|
|
598
|
+
};
|
|
599
|
+
this.setStatusInternal(reqInfo.callId, 'awaiting_approval', wrappedConfirmationDetails);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
catch (error) {
|
|
603
|
+
if (signal.aborted) {
|
|
604
|
+
this.setStatusInternal(reqInfo.callId, 'cancelled', 'Tool call cancelled by user.');
|
|
605
|
+
continue;
|
|
606
|
+
}
|
|
607
|
+
this.setStatusInternal(reqInfo.callId, 'error', createErrorResponse(reqInfo, error instanceof Error ? error : new Error(String(error)), ToolErrorType.UNHANDLED_EXCEPTION));
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
await this.attemptExecutionOfScheduledCalls(signal);
|
|
611
|
+
void this.checkAndNotifyCompletion();
|
|
612
|
+
}
|
|
613
|
+
finally {
|
|
614
|
+
this.isScheduling = false;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
async handleConfirmationResponse(callId, originalOnConfirm, outcome, signal, payload) {
|
|
618
|
+
const toolCall = this.toolCalls.find((c) => c.request.callId === callId && c.status === 'awaiting_approval');
|
|
619
|
+
await originalOnConfirm(outcome, payload);
|
|
620
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
621
|
+
await this.autoApproveCompatiblePendingTools(signal, callId);
|
|
622
|
+
}
|
|
623
|
+
this.setToolCallOutcome(callId, outcome);
|
|
624
|
+
if (outcome === ToolConfirmationOutcome.Cancel || signal.aborted) {
|
|
625
|
+
// Use custom cancel message from payload if provided, otherwise use default
|
|
626
|
+
const cancelMessage = payload?.cancelMessage || 'User did not allow tool call';
|
|
627
|
+
this.setStatusInternal(callId, 'cancelled', cancelMessage);
|
|
628
|
+
}
|
|
629
|
+
else if (outcome === ToolConfirmationOutcome.ModifyWithEditor) {
|
|
630
|
+
const waitingToolCall = toolCall;
|
|
631
|
+
if (isModifiableDeclarativeTool(waitingToolCall.tool)) {
|
|
632
|
+
const modifyContext = waitingToolCall.tool.getModifyContext(signal);
|
|
633
|
+
const editorType = this.getPreferredEditor();
|
|
634
|
+
if (!editorType) {
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
this.setStatusInternal(callId, 'awaiting_approval', {
|
|
638
|
+
...waitingToolCall.confirmationDetails,
|
|
639
|
+
isModifying: true,
|
|
640
|
+
});
|
|
641
|
+
const { updatedParams, updatedDiff } = await modifyWithEditor(waitingToolCall.request.args, modifyContext, editorType, signal, this.onEditorClose);
|
|
642
|
+
this.setArgsInternal(callId, updatedParams);
|
|
643
|
+
this.setStatusInternal(callId, 'awaiting_approval', {
|
|
644
|
+
...waitingToolCall.confirmationDetails,
|
|
645
|
+
fileDiff: updatedDiff,
|
|
646
|
+
isModifying: false,
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
651
|
+
// If the client provided new content, apply it before scheduling.
|
|
652
|
+
if (payload?.newContent && toolCall) {
|
|
653
|
+
await this._applyInlineModify(toolCall, payload, signal);
|
|
654
|
+
}
|
|
655
|
+
this.setStatusInternal(callId, 'scheduled');
|
|
656
|
+
}
|
|
657
|
+
await this.attemptExecutionOfScheduledCalls(signal);
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* Applies user-provided content changes to a tool call that is awaiting confirmation.
|
|
661
|
+
* This method updates the tool's arguments and refreshes the confirmation prompt with a new diff
|
|
662
|
+
* before the tool is scheduled for execution.
|
|
663
|
+
* @private
|
|
664
|
+
*/
|
|
665
|
+
async _applyInlineModify(toolCall, payload, signal) {
|
|
666
|
+
if (toolCall.confirmationDetails.type !== 'edit' ||
|
|
667
|
+
!isModifiableDeclarativeTool(toolCall.tool) ||
|
|
668
|
+
!payload.newContent) {
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
const modifyContext = toolCall.tool.getModifyContext(signal);
|
|
672
|
+
const currentContent = await modifyContext.getCurrentContent(toolCall.request.args);
|
|
673
|
+
const updatedParams = modifyContext.createUpdatedParams(currentContent, payload.newContent, toolCall.request.args);
|
|
674
|
+
const updatedDiff = Diff.createPatch(modifyContext.getFilePath(toolCall.request.args), currentContent, payload.newContent, 'Current', 'Proposed');
|
|
675
|
+
this.setArgsInternal(toolCall.request.callId, updatedParams);
|
|
676
|
+
this.setStatusInternal(toolCall.request.callId, 'awaiting_approval', {
|
|
677
|
+
...toolCall.confirmationDetails,
|
|
678
|
+
fileDiff: updatedDiff,
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
async attemptExecutionOfScheduledCalls(signal) {
|
|
682
|
+
const allCallsFinalOrScheduled = this.toolCalls.every((call) => call.status === 'scheduled' ||
|
|
683
|
+
call.status === 'cancelled' ||
|
|
684
|
+
call.status === 'success' ||
|
|
685
|
+
call.status === 'error');
|
|
686
|
+
if (allCallsFinalOrScheduled) {
|
|
687
|
+
const callsToExecute = this.toolCalls.filter((call) => call.status === 'scheduled');
|
|
688
|
+
for (const toolCall of callsToExecute) {
|
|
689
|
+
await this.executeSingleToolCall(toolCall, signal);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
async executeSingleToolCall(toolCall, signal) {
|
|
694
|
+
if (toolCall.status !== 'scheduled')
|
|
695
|
+
return;
|
|
696
|
+
const scheduledCall = toolCall;
|
|
697
|
+
const { callId, name: toolName } = scheduledCall.request;
|
|
698
|
+
const invocation = scheduledCall.invocation;
|
|
699
|
+
this.setStatusInternal(callId, 'executing');
|
|
700
|
+
const liveOutputCallback = scheduledCall.tool.canUpdateOutput
|
|
701
|
+
? (outputChunk) => {
|
|
702
|
+
if (this.outputUpdateHandler) {
|
|
703
|
+
this.outputUpdateHandler(callId, outputChunk);
|
|
704
|
+
}
|
|
705
|
+
this.toolCalls = this.toolCalls.map((tc) => tc.request.callId === callId && tc.status === 'executing'
|
|
706
|
+
? { ...tc, liveOutput: outputChunk }
|
|
707
|
+
: tc);
|
|
708
|
+
this.notifyToolCallsUpdate();
|
|
709
|
+
}
|
|
710
|
+
: undefined;
|
|
711
|
+
const shellExecutionConfig = this.config.getShellExecutionConfig();
|
|
712
|
+
// TODO: Refactor to remove special casing for ShellToolInvocation.
|
|
713
|
+
// Introduce a generic callbacks object for the execute method to handle
|
|
714
|
+
// things like `onPid` and `onLiveOutput`. This will make the scheduler
|
|
715
|
+
// agnostic to the invocation type.
|
|
716
|
+
let promise;
|
|
717
|
+
if (invocation instanceof ShellToolInvocation) {
|
|
718
|
+
const setPidCallback = (pid) => {
|
|
719
|
+
this.toolCalls = this.toolCalls.map((tc) => tc.request.callId === callId && tc.status === 'executing'
|
|
720
|
+
? { ...tc, pid }
|
|
721
|
+
: tc);
|
|
722
|
+
this.notifyToolCallsUpdate();
|
|
723
|
+
};
|
|
724
|
+
promise = invocation.execute(signal, liveOutputCallback, shellExecutionConfig, setPidCallback);
|
|
725
|
+
}
|
|
726
|
+
else {
|
|
727
|
+
promise = invocation.execute(signal, liveOutputCallback, shellExecutionConfig);
|
|
728
|
+
}
|
|
729
|
+
try {
|
|
730
|
+
const toolResult = await promise;
|
|
731
|
+
if (signal.aborted) {
|
|
732
|
+
this.setStatusInternal(callId, 'cancelled', 'User cancelled tool execution.');
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
if (toolResult.error === undefined) {
|
|
736
|
+
let content = toolResult.llmContent;
|
|
737
|
+
let outputFile = undefined;
|
|
738
|
+
const contentLength = typeof content === 'string' ? content.length : undefined;
|
|
739
|
+
if (typeof content === 'string' &&
|
|
740
|
+
toolName === ShellTool.Name &&
|
|
741
|
+
this.config.getEnableToolOutputTruncation() &&
|
|
742
|
+
this.config.getTruncateToolOutputThreshold() > 0 &&
|
|
743
|
+
this.config.getTruncateToolOutputLines() > 0) {
|
|
744
|
+
const originalContentLength = content.length;
|
|
745
|
+
const threshold = this.config.getTruncateToolOutputThreshold();
|
|
746
|
+
const lines = this.config.getTruncateToolOutputLines();
|
|
747
|
+
const truncatedResult = await truncateAndSaveToFile(content, callId, this.config.storage.getProjectTempDir(), threshold, lines);
|
|
748
|
+
content = truncatedResult.content;
|
|
749
|
+
outputFile = truncatedResult.outputFile;
|
|
750
|
+
if (outputFile) {
|
|
751
|
+
logToolOutputTruncated(this.config, new ToolOutputTruncatedEvent(scheduledCall.request.prompt_id, {
|
|
752
|
+
toolName,
|
|
753
|
+
originalContentLength,
|
|
754
|
+
truncatedContentLength: content.length,
|
|
755
|
+
threshold,
|
|
756
|
+
lines,
|
|
757
|
+
}));
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
const response = convertToFunctionResponse(toolName, callId, content);
|
|
761
|
+
const successResponse = {
|
|
762
|
+
callId,
|
|
763
|
+
responseParts: response,
|
|
764
|
+
resultDisplay: toolResult.returnDisplay,
|
|
765
|
+
error: undefined,
|
|
766
|
+
errorType: undefined,
|
|
767
|
+
outputFile,
|
|
768
|
+
contentLength,
|
|
769
|
+
};
|
|
770
|
+
this.setStatusInternal(callId, 'success', successResponse);
|
|
771
|
+
}
|
|
772
|
+
else {
|
|
773
|
+
// It is a failure
|
|
774
|
+
const error = new Error(toolResult.error.message);
|
|
775
|
+
const errorResponse = createErrorResponse(scheduledCall.request, error, toolResult.error.type);
|
|
776
|
+
this.setStatusInternal(callId, 'error', errorResponse);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
catch (executionError) {
|
|
780
|
+
if (signal.aborted) {
|
|
781
|
+
this.setStatusInternal(callId, 'cancelled', 'User cancelled tool execution.');
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
this.setStatusInternal(callId, 'error', createErrorResponse(scheduledCall.request, executionError instanceof Error
|
|
785
|
+
? executionError
|
|
786
|
+
: new Error(String(executionError)), ToolErrorType.UNHANDLED_EXCEPTION));
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
async checkAndNotifyCompletion() {
|
|
791
|
+
const allCallsAreTerminal = this.toolCalls.every((call) => call.status === 'success' ||
|
|
792
|
+
call.status === 'error' ||
|
|
793
|
+
call.status === 'cancelled');
|
|
794
|
+
if (this.toolCalls.length > 0 && allCallsAreTerminal) {
|
|
795
|
+
const completedCalls = [...this.toolCalls];
|
|
796
|
+
this.toolCalls = [];
|
|
797
|
+
for (const call of completedCalls) {
|
|
798
|
+
logToolCall(this.config, new ToolCallEvent(call));
|
|
799
|
+
}
|
|
800
|
+
// Record tool results before notifying completion
|
|
801
|
+
this.recordToolResults(completedCalls);
|
|
802
|
+
if (this.onAllToolCallsComplete) {
|
|
803
|
+
this.isFinalizingToolCalls = true;
|
|
804
|
+
await this.onAllToolCallsComplete(completedCalls);
|
|
805
|
+
this.isFinalizingToolCalls = false;
|
|
806
|
+
}
|
|
807
|
+
this.notifyToolCallsUpdate();
|
|
808
|
+
// After completion, process the next item in the queue.
|
|
809
|
+
if (this.requestQueue.length > 0) {
|
|
810
|
+
const next = this.requestQueue.shift();
|
|
811
|
+
this._schedule(next.request, next.signal)
|
|
812
|
+
.then(next.resolve)
|
|
813
|
+
.catch(next.reject);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Records tool results to the chat recording service.
|
|
819
|
+
* This captures both the raw Content (for API reconstruction) and
|
|
820
|
+
* enriched metadata (for UI recovery).
|
|
821
|
+
*/
|
|
822
|
+
recordToolResults(completedCalls) {
|
|
823
|
+
if (!this.chatRecordingService)
|
|
824
|
+
return;
|
|
825
|
+
// Collect all response parts from completed calls
|
|
826
|
+
const responseParts = completedCalls.flatMap((call) => call.response.responseParts);
|
|
827
|
+
if (responseParts.length === 0)
|
|
828
|
+
return;
|
|
829
|
+
// Record each tool result individually
|
|
830
|
+
for (const call of completedCalls) {
|
|
831
|
+
this.chatRecordingService.recordToolResult(call.response.responseParts, {
|
|
832
|
+
callId: call.request.callId,
|
|
833
|
+
status: call.status,
|
|
834
|
+
resultDisplay: call.response.resultDisplay,
|
|
835
|
+
error: call.response.error,
|
|
836
|
+
errorType: call.response.errorType,
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
notifyToolCallsUpdate() {
|
|
841
|
+
if (this.onToolCallsUpdate) {
|
|
842
|
+
this.onToolCallsUpdate([...this.toolCalls]);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
setToolCallOutcome(callId, outcome) {
|
|
846
|
+
this.toolCalls = this.toolCalls.map((call) => {
|
|
847
|
+
if (call.request.callId !== callId)
|
|
848
|
+
return call;
|
|
849
|
+
return {
|
|
850
|
+
...call,
|
|
851
|
+
outcome,
|
|
852
|
+
};
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
async autoApproveCompatiblePendingTools(signal, triggeringCallId) {
|
|
856
|
+
const pendingTools = this.toolCalls.filter((call) => call.status === 'awaiting_approval' &&
|
|
857
|
+
call.request.callId !== triggeringCallId);
|
|
858
|
+
for (const pendingTool of pendingTools) {
|
|
859
|
+
try {
|
|
860
|
+
const stillNeedsConfirmation = await pendingTool.invocation.shouldConfirmExecute(signal);
|
|
861
|
+
if (!stillNeedsConfirmation) {
|
|
862
|
+
this.setToolCallOutcome(pendingTool.request.callId, ToolConfirmationOutcome.ProceedAlways);
|
|
863
|
+
this.setStatusInternal(pendingTool.request.callId, 'scheduled');
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
catch (error) {
|
|
867
|
+
debugLogger.error(`Error checking confirmation for tool ${pendingTool.request.callId}:`, error);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
//# sourceMappingURL=coreToolScheduler.js.map
|