@anh3d0nic/qwen-code-termux-ice 21.1.0 → 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/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 +2 -1
- package/scripts/postinstall.cjs +32 -6
|
@@ -0,0 +1,957 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import process from 'node:process';
|
|
7
|
+
import { AuthType } from '../core/contentGenerator.js';
|
|
8
|
+
import { DEFAULT_QWEN_MODEL } from '../config/models.js';
|
|
9
|
+
import { tokenLimit } from '../core/tokenLimits.js';
|
|
10
|
+
import { defaultModalities } from '../core/modalityDefaults.js';
|
|
11
|
+
import { ModelRegistry } from './modelRegistry.js';
|
|
12
|
+
import {} from './types.js';
|
|
13
|
+
import { MODEL_GENERATION_CONFIG_FIELDS, CREDENTIAL_FIELDS, PROVIDER_SOURCED_FIELDS, } from './constants.js';
|
|
14
|
+
export { MODEL_GENERATION_CONFIG_FIELDS, CREDENTIAL_FIELDS, PROVIDER_SOURCED_FIELDS, };
|
|
15
|
+
/**
|
|
16
|
+
* ModelsConfig manages all model selection logic and state.
|
|
17
|
+
*
|
|
18
|
+
* This class encapsulates:
|
|
19
|
+
* - ModelRegistry for model configuration storage
|
|
20
|
+
* - Current authType and modelId selection
|
|
21
|
+
* - Generation config management
|
|
22
|
+
* - Model switching logic
|
|
23
|
+
*
|
|
24
|
+
* Config uses this as a thin entry point for all model-related operations.
|
|
25
|
+
*/
|
|
26
|
+
export class ModelsConfig {
|
|
27
|
+
modelRegistry;
|
|
28
|
+
// Current selection state
|
|
29
|
+
currentAuthType;
|
|
30
|
+
// Generation config state
|
|
31
|
+
_generationConfig;
|
|
32
|
+
generationConfigSources;
|
|
33
|
+
// Flag for strict model provider selection
|
|
34
|
+
strictModelProviderSelection = false;
|
|
35
|
+
// One-shot flag for qwen-oauth credential caching
|
|
36
|
+
requireCachedQwenCredentialsOnce = false;
|
|
37
|
+
// One-shot flag indicating credentials were manually set via updateCredentials()
|
|
38
|
+
// When true, syncAfterAuthRefresh should NOT override these credentials with
|
|
39
|
+
// modelProviders defaults (even if the model ID matches a registry entry).
|
|
40
|
+
//
|
|
41
|
+
// This must be persistent across auth refreshes, because refreshAuth() can be
|
|
42
|
+
// triggered multiple times after a credential prompt flow. We only clear this
|
|
43
|
+
// flag when we explicitly apply modelProvider defaults (i.e. when the user
|
|
44
|
+
// switches to a registry model via switchModel).
|
|
45
|
+
hasManualCredentials = false;
|
|
46
|
+
// Callback for notifying Config of model changes
|
|
47
|
+
onModelChange;
|
|
48
|
+
// Flag indicating whether authType was explicitly provided (not defaulted)
|
|
49
|
+
authTypeWasExplicitlyProvided;
|
|
50
|
+
/**
|
|
51
|
+
* Runtime model snapshot storage.
|
|
52
|
+
*
|
|
53
|
+
* These snapshots store runtime-resolved model configurations that are NOT from
|
|
54
|
+
* modelProviders registry (e.g., models with manually set credentials).
|
|
55
|
+
*
|
|
56
|
+
* Key: snapshotId (format: `$runtime|${authType}|${modelId}`)
|
|
57
|
+
* Uses `$runtime|` prefix since `$` and `|` are unlikely to appear in real model IDs.
|
|
58
|
+
* This prevents conflicts with model IDs containing `-` or `:` characters.
|
|
59
|
+
* Value: RuntimeModelSnapshot containing the model's configuration
|
|
60
|
+
*
|
|
61
|
+
* Note: This is different from state snapshots used for rollback during model switching.
|
|
62
|
+
* RuntimeModelSnapshot stores persistent model configurations, while state snapshots
|
|
63
|
+
* are temporary and used only for error recovery.
|
|
64
|
+
*/
|
|
65
|
+
runtimeModelSnapshots = new Map();
|
|
66
|
+
/**
|
|
67
|
+
* Currently active RuntimeModelSnapshot ID.
|
|
68
|
+
*
|
|
69
|
+
* When set, indicates that the current model is a runtime model (not from registry).
|
|
70
|
+
* This ID is included in state snapshots for rollback purposes.
|
|
71
|
+
*/
|
|
72
|
+
activeRuntimeModelSnapshotId;
|
|
73
|
+
static deepClone(value) {
|
|
74
|
+
if (value === null || typeof value !== 'object') {
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
if (Array.isArray(value)) {
|
|
78
|
+
return value.map((v) => ModelsConfig.deepClone(v));
|
|
79
|
+
}
|
|
80
|
+
const out = {};
|
|
81
|
+
for (const key of Object.keys(value)) {
|
|
82
|
+
out[key] = ModelsConfig.deepClone(value[key]);
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
constructor(options = {}) {
|
|
87
|
+
this.modelRegistry = new ModelRegistry(options.modelProvidersConfig);
|
|
88
|
+
this.onModelChange = options.onModelChange;
|
|
89
|
+
// Initialize generation config
|
|
90
|
+
// Note: generationConfig.model should already be fully resolved by ModelConfigResolver
|
|
91
|
+
// before ModelsConfig is instantiated, so we use it as the single source of truth
|
|
92
|
+
this._generationConfig = {
|
|
93
|
+
...(options.generationConfig || {}),
|
|
94
|
+
};
|
|
95
|
+
this.generationConfigSources = options.generationConfigSources || {};
|
|
96
|
+
// Track if authType was explicitly provided
|
|
97
|
+
this.authTypeWasExplicitlyProvided = options.initialAuthType !== undefined;
|
|
98
|
+
// Initialize selection state
|
|
99
|
+
this.currentAuthType = options.initialAuthType;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Create a snapshot of the current ModelsConfig state for rollback purposes.
|
|
103
|
+
* Used before model switching operations to enable recovery on errors.
|
|
104
|
+
*
|
|
105
|
+
* Note: This is different from RuntimeModelSnapshot which stores runtime model configs.
|
|
106
|
+
*/
|
|
107
|
+
createStateSnapshotForRollback() {
|
|
108
|
+
return {
|
|
109
|
+
currentAuthType: this.currentAuthType,
|
|
110
|
+
generationConfig: ModelsConfig.deepClone(this._generationConfig),
|
|
111
|
+
generationConfigSources: ModelsConfig.deepClone(this.generationConfigSources),
|
|
112
|
+
strictModelProviderSelection: this.strictModelProviderSelection,
|
|
113
|
+
requireCachedQwenCredentialsOnce: this.requireCachedQwenCredentialsOnce,
|
|
114
|
+
hasManualCredentials: this.hasManualCredentials,
|
|
115
|
+
activeRuntimeModelSnapshotId: this.activeRuntimeModelSnapshotId,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Restore ModelsConfig state from a previously created state snapshot.
|
|
120
|
+
* Used for rollback when model switching operations fail.
|
|
121
|
+
*
|
|
122
|
+
* @param snapshot - The state snapshot to restore
|
|
123
|
+
*/
|
|
124
|
+
rollbackToStateSnapshot(snapshot) {
|
|
125
|
+
this.currentAuthType = snapshot.currentAuthType;
|
|
126
|
+
this._generationConfig = snapshot.generationConfig;
|
|
127
|
+
this.generationConfigSources = snapshot.generationConfigSources;
|
|
128
|
+
this.strictModelProviderSelection = snapshot.strictModelProviderSelection;
|
|
129
|
+
this.requireCachedQwenCredentialsOnce =
|
|
130
|
+
snapshot.requireCachedQwenCredentialsOnce;
|
|
131
|
+
this.hasManualCredentials = snapshot.hasManualCredentials;
|
|
132
|
+
this.activeRuntimeModelSnapshotId = snapshot.activeRuntimeModelSnapshotId;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Get current model ID
|
|
136
|
+
*/
|
|
137
|
+
getModel() {
|
|
138
|
+
return this._generationConfig.model || DEFAULT_QWEN_MODEL;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Get current authType
|
|
142
|
+
*/
|
|
143
|
+
getCurrentAuthType() {
|
|
144
|
+
return this.currentAuthType;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Check if authType was explicitly provided (via CLI or settings).
|
|
148
|
+
* If false, no authType was provided yet (fresh user).
|
|
149
|
+
*/
|
|
150
|
+
wasAuthTypeExplicitlyProvided() {
|
|
151
|
+
return this.authTypeWasExplicitlyProvided;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get available models for current authType
|
|
155
|
+
*/
|
|
156
|
+
getAvailableModels() {
|
|
157
|
+
return this.currentAuthType
|
|
158
|
+
? this.modelRegistry.getModelsForAuthType(this.currentAuthType)
|
|
159
|
+
: [];
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Get available models for a specific authType
|
|
163
|
+
*/
|
|
164
|
+
getAvailableModelsForAuthType(authType) {
|
|
165
|
+
return this.modelRegistry.getModelsForAuthType(authType);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Get all configured models across authTypes.
|
|
169
|
+
*
|
|
170
|
+
* Notes:
|
|
171
|
+
* - By default, returns models across all authTypes.
|
|
172
|
+
* - qwen-oauth models are always ordered first.
|
|
173
|
+
* - Runtime model option (if active) is included before registry models of the same authType.
|
|
174
|
+
*/
|
|
175
|
+
getAllConfiguredModels(authTypes) {
|
|
176
|
+
const inputAuthTypes = authTypes && authTypes.length > 0 ? authTypes : Object.values(AuthType);
|
|
177
|
+
// De-duplicate while preserving the original order.
|
|
178
|
+
const seen = new Set();
|
|
179
|
+
const uniqueAuthTypes = [];
|
|
180
|
+
for (const authType of inputAuthTypes) {
|
|
181
|
+
if (!seen.has(authType)) {
|
|
182
|
+
seen.add(authType);
|
|
183
|
+
uniqueAuthTypes.push(authType);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// Force qwen-oauth to the front (if requested / defaulted in).
|
|
187
|
+
const orderedAuthTypes = [];
|
|
188
|
+
if (uniqueAuthTypes.includes(AuthType.QWEN_OAUTH)) {
|
|
189
|
+
orderedAuthTypes.push(AuthType.QWEN_OAUTH);
|
|
190
|
+
}
|
|
191
|
+
for (const authType of uniqueAuthTypes) {
|
|
192
|
+
if (authType !== AuthType.QWEN_OAUTH) {
|
|
193
|
+
orderedAuthTypes.push(authType);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Get runtime model option
|
|
197
|
+
const runtimeOption = this.getRuntimeModelOption();
|
|
198
|
+
const allModels = [];
|
|
199
|
+
for (const authType of orderedAuthTypes) {
|
|
200
|
+
// Add runtime option first if it matches this authType
|
|
201
|
+
if (runtimeOption && runtimeOption.authType === authType) {
|
|
202
|
+
allModels.push(runtimeOption);
|
|
203
|
+
}
|
|
204
|
+
// Add registry models
|
|
205
|
+
allModels.push(...this.modelRegistry.getModelsForAuthType(authType));
|
|
206
|
+
}
|
|
207
|
+
return allModels;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Check if a model exists for the given authType
|
|
211
|
+
*/
|
|
212
|
+
hasModel(authType, modelId) {
|
|
213
|
+
return this.modelRegistry.hasModel(authType, modelId);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Set model programmatically (e.g., VLM auto-switch, fallback).
|
|
217
|
+
* Supports both registry models and raw model IDs.
|
|
218
|
+
*/
|
|
219
|
+
async setModel(newModel, metadata) {
|
|
220
|
+
// Special case: qwen-oauth model switch - hot update in place
|
|
221
|
+
// coder-model supports vision capabilities and can be hot-updated
|
|
222
|
+
if (this.currentAuthType === AuthType.QWEN_OAUTH &&
|
|
223
|
+
newModel === DEFAULT_QWEN_MODEL) {
|
|
224
|
+
this.strictModelProviderSelection = false;
|
|
225
|
+
this._generationConfig.model = newModel;
|
|
226
|
+
this.generationConfigSources['model'] = {
|
|
227
|
+
kind: 'programmatic',
|
|
228
|
+
detail: metadata?.reason || 'setModel',
|
|
229
|
+
};
|
|
230
|
+
// Notify Config to update contentGeneratorConfig
|
|
231
|
+
if (this.onModelChange) {
|
|
232
|
+
await this.onModelChange(AuthType.QWEN_OAUTH, false);
|
|
233
|
+
}
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
// If model exists in registry, use full switch logic
|
|
237
|
+
if (this.currentAuthType &&
|
|
238
|
+
this.modelRegistry.hasModel(this.currentAuthType, newModel)) {
|
|
239
|
+
await this.switchModel(this.currentAuthType, newModel);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
// Raw model override: update generation config in-place
|
|
243
|
+
this.strictModelProviderSelection = false;
|
|
244
|
+
this._generationConfig.model = newModel;
|
|
245
|
+
this.generationConfigSources['model'] = {
|
|
246
|
+
kind: 'programmatic',
|
|
247
|
+
detail: metadata?.reason || 'setModel',
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Switch model (and optionally authType).
|
|
252
|
+
* Supports both registry-backed models and RuntimeModelSnapshots.
|
|
253
|
+
*
|
|
254
|
+
* For runtime models, the modelId can be:
|
|
255
|
+
* - A RuntimeModelSnapshot ID (format: `$runtime|${authType}|${modelId}`)
|
|
256
|
+
* - With explicit `$runtime|` prefix (format: `$runtime|${authType}|${modelId}`)
|
|
257
|
+
*
|
|
258
|
+
* When called from ACP integration, the modelId has already been parsed
|
|
259
|
+
* by parseAcpModelOption, which strips any (${authType}) suffix.
|
|
260
|
+
*/
|
|
261
|
+
async switchModel(authType, modelId, options) {
|
|
262
|
+
// Check if this is a RuntimeModelSnapshot reference
|
|
263
|
+
const runtimeModelSnapshotId = this.extractRuntimeModelSnapshotId(modelId);
|
|
264
|
+
if (runtimeModelSnapshotId) {
|
|
265
|
+
await this.switchToRuntimeModel(runtimeModelSnapshotId);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const rollbackSnapshot = this.createStateSnapshotForRollback();
|
|
269
|
+
if (authType === AuthType.QWEN_OAUTH && options?.requireCachedCredentials) {
|
|
270
|
+
this.requireCachedQwenCredentialsOnce = true;
|
|
271
|
+
}
|
|
272
|
+
try {
|
|
273
|
+
const isAuthTypeChange = authType !== this.currentAuthType;
|
|
274
|
+
this.currentAuthType = authType;
|
|
275
|
+
const model = this.modelRegistry.getModel(authType, modelId);
|
|
276
|
+
if (!model) {
|
|
277
|
+
throw new Error(`Model '${modelId}' not found for authType '${authType}'`);
|
|
278
|
+
}
|
|
279
|
+
// Apply model defaults
|
|
280
|
+
this.applyResolvedModelDefaults(model);
|
|
281
|
+
// Clear active runtime model snapshot since we're now using a registry model
|
|
282
|
+
this.activeRuntimeModelSnapshotId = undefined;
|
|
283
|
+
const requiresRefresh = isAuthTypeChange
|
|
284
|
+
? true
|
|
285
|
+
: this.checkRequiresRefresh(rollbackSnapshot.generationConfig.model || '');
|
|
286
|
+
if (this.onModelChange) {
|
|
287
|
+
await this.onModelChange(authType, requiresRefresh);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
// Rollback on error
|
|
292
|
+
this.rollbackToStateSnapshot(rollbackSnapshot);
|
|
293
|
+
throw error;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Prefix used to identify RuntimeModelSnapshot IDs.
|
|
298
|
+
* Chosen to avoid conflicts with real model IDs which may contain `-` or `:`.
|
|
299
|
+
*/
|
|
300
|
+
static RUNTIME_SNAPSHOT_PREFIX = '$runtime|';
|
|
301
|
+
/**
|
|
302
|
+
* Build a RuntimeModelSnapshot ID from authType and modelId.
|
|
303
|
+
* The format is: `$runtime|${authType}|${modelId}`
|
|
304
|
+
*
|
|
305
|
+
* This is the canonical way to construct snapshot IDs, ensuring
|
|
306
|
+
* consistency across creation and lookup.
|
|
307
|
+
*
|
|
308
|
+
* @param authType - The authentication type
|
|
309
|
+
* @param modelId - The model ID
|
|
310
|
+
* @returns The snapshot ID in format `$runtime|${authType}|${modelId}`
|
|
311
|
+
*/
|
|
312
|
+
buildRuntimeModelSnapshotId(authType, modelId) {
|
|
313
|
+
return `${ModelsConfig.RUNTIME_SNAPSHOT_PREFIX}${authType}|${modelId}`;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Extract RuntimeModelSnapshot ID from modelId if it's a runtime model reference.
|
|
317
|
+
*
|
|
318
|
+
* Supports the following formats:
|
|
319
|
+
* - Direct snapshot ID: `$runtime|${authType}|${modelId}` → returns as-is if exists in Map
|
|
320
|
+
* - Direct snapshot ID match: returns if exists in Map
|
|
321
|
+
*
|
|
322
|
+
* Note: When called from ACP integration via setModel, the modelId has already
|
|
323
|
+
* been parsed by parseAcpModelOption which strips any (${authType}) suffix.
|
|
324
|
+
* So we don't need to handle ACP format here - the ACP layer handles that.
|
|
325
|
+
*
|
|
326
|
+
* @param modelId - The model ID to parse
|
|
327
|
+
* @returns The RuntimeModelSnapshot ID if found, undefined otherwise
|
|
328
|
+
*/
|
|
329
|
+
extractRuntimeModelSnapshotId(modelId) {
|
|
330
|
+
// Check if modelId starts with the runtime snapshot prefix
|
|
331
|
+
if (modelId.startsWith(ModelsConfig.RUNTIME_SNAPSHOT_PREFIX)) {
|
|
332
|
+
// Verify the snapshot exists
|
|
333
|
+
if (this.runtimeModelSnapshots.has(modelId)) {
|
|
334
|
+
return modelId;
|
|
335
|
+
}
|
|
336
|
+
// Even with prefix, if it doesn't exist, don't return it
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
339
|
+
// Check if modelId itself is a valid snapshot ID (exists in Map)
|
|
340
|
+
if (this.runtimeModelSnapshots.has(modelId)) {
|
|
341
|
+
return modelId;
|
|
342
|
+
}
|
|
343
|
+
return undefined;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Get generation config for ContentGenerator creation
|
|
347
|
+
*/
|
|
348
|
+
getGenerationConfig() {
|
|
349
|
+
return this._generationConfig;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Get generation config sources for debugging/UI
|
|
353
|
+
*/
|
|
354
|
+
getGenerationConfigSources() {
|
|
355
|
+
return this.generationConfigSources;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Merge settings generation config, preserving existing values.
|
|
359
|
+
* Used when provider-sourced config is cleared but settings should still apply.
|
|
360
|
+
*/
|
|
361
|
+
mergeSettingsGenerationConfig(settingsGenerationConfig) {
|
|
362
|
+
if (!settingsGenerationConfig) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
for (const field of MODEL_GENERATION_CONFIG_FIELDS) {
|
|
366
|
+
if (!(field in this._generationConfig) &&
|
|
367
|
+
field in settingsGenerationConfig) {
|
|
368
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
369
|
+
this._generationConfig[field] =
|
|
370
|
+
settingsGenerationConfig[field];
|
|
371
|
+
this.generationConfigSources[field] = {
|
|
372
|
+
kind: 'settings',
|
|
373
|
+
detail: `model.generationConfig.${field}`,
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Update credentials in generation config.
|
|
380
|
+
* Sets a flag to prevent syncAfterAuthRefresh from overriding these credentials.
|
|
381
|
+
*
|
|
382
|
+
* When credentials are manually set, we clear all provider-sourced configuration
|
|
383
|
+
* to maintain provider atomicity (either fully applied or not at all).
|
|
384
|
+
* Other layers (CLI, env, settings, defaults) will participate in resolve.
|
|
385
|
+
*
|
|
386
|
+
* Also updates or creates a RuntimeModelSnapshot when credentials form a complete config
|
|
387
|
+
* for a model not in the registry. This allows the runtime model to be reused later.
|
|
388
|
+
*
|
|
389
|
+
* @param settingsGenerationConfig Optional generation config from settings.json
|
|
390
|
+
* to merge after clearing provider-sourced config.
|
|
391
|
+
* This ensures settings.model.generationConfig fields
|
|
392
|
+
* (e.g., samplingParams, timeout) are preserved.
|
|
393
|
+
*/
|
|
394
|
+
updateCredentials(credentials, settingsGenerationConfig) {
|
|
395
|
+
/**
|
|
396
|
+
* If any fields are updated here, we treat the resulting config as manually overridden
|
|
397
|
+
* and avoid applying modelProvider defaults during the next auth refresh.
|
|
398
|
+
*
|
|
399
|
+
* Clear all provider-sourced configuration to maintain provider atomicity.
|
|
400
|
+
* This ensures that when user manually sets credentials, the provider config
|
|
401
|
+
* is either fully applied (via switchModel) or not at all.
|
|
402
|
+
*/
|
|
403
|
+
if (credentials.apiKey || credentials.baseUrl || credentials.model) {
|
|
404
|
+
this.hasManualCredentials = true;
|
|
405
|
+
this.clearProviderSourcedConfig();
|
|
406
|
+
}
|
|
407
|
+
if (credentials.apiKey) {
|
|
408
|
+
this._generationConfig.apiKey = credentials.apiKey;
|
|
409
|
+
this.generationConfigSources['apiKey'] = {
|
|
410
|
+
kind: 'programmatic',
|
|
411
|
+
detail: 'updateCredentials',
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
if (credentials.baseUrl) {
|
|
415
|
+
this._generationConfig.baseUrl = credentials.baseUrl;
|
|
416
|
+
this.generationConfigSources['baseUrl'] = {
|
|
417
|
+
kind: 'programmatic',
|
|
418
|
+
detail: 'updateCredentials',
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
if (credentials.model) {
|
|
422
|
+
this._generationConfig.model = credentials.model;
|
|
423
|
+
this.generationConfigSources['model'] = {
|
|
424
|
+
kind: 'programmatic',
|
|
425
|
+
detail: 'updateCredentials',
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
// When credentials are manually set, disable strict model provider selection
|
|
429
|
+
// so validation doesn't require envKey-based credentials
|
|
430
|
+
this.strictModelProviderSelection = false;
|
|
431
|
+
// Clear apiKeyEnvKey to prevent validation from requiring environment variable
|
|
432
|
+
this._generationConfig.apiKeyEnvKey = undefined;
|
|
433
|
+
// After clearing provider-sourced config, merge settings.model.generationConfig
|
|
434
|
+
// to ensure fields like samplingParams, timeout, etc. are preserved.
|
|
435
|
+
// This follows the resolution strategy where settings.model.generationConfig
|
|
436
|
+
// has lower priority than programmatic overrides but should still be applied.
|
|
437
|
+
if (settingsGenerationConfig) {
|
|
438
|
+
this.mergeSettingsGenerationConfig(settingsGenerationConfig);
|
|
439
|
+
}
|
|
440
|
+
// Sync with runtime model snapshot if we have a complete configuration
|
|
441
|
+
this.syncRuntimeModelSnapshotWithCredentials();
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Sync RuntimeModelSnapshot with current credentials.
|
|
445
|
+
*
|
|
446
|
+
* Creates or updates a RuntimeModelSnapshot when current credentials form a complete
|
|
447
|
+
* configuration for a model not in the registry. This enables:
|
|
448
|
+
* - Reusing the runtime model configuration later
|
|
449
|
+
* - Showing the runtime model as an available option in model lists
|
|
450
|
+
*
|
|
451
|
+
* Only creates snapshots for models NOT in the registry (to avoid duplication).
|
|
452
|
+
*/
|
|
453
|
+
syncRuntimeModelSnapshotWithCredentials() {
|
|
454
|
+
const currentAuthType = this.currentAuthType;
|
|
455
|
+
const { model, apiKey, baseUrl } = this._generationConfig;
|
|
456
|
+
// Early return if missing required fields
|
|
457
|
+
if (!model || !currentAuthType || !apiKey || !baseUrl) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
// Check if model exists in registry - if so, don't create RuntimeModelSnapshot
|
|
461
|
+
if (this.modelRegistry.hasModel(currentAuthType, model)) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
// If we have an active snapshot, update it
|
|
465
|
+
if (this.activeRuntimeModelSnapshotId &&
|
|
466
|
+
this.runtimeModelSnapshots.has(this.activeRuntimeModelSnapshotId)) {
|
|
467
|
+
const snapshot = this.runtimeModelSnapshots.get(this.activeRuntimeModelSnapshotId);
|
|
468
|
+
// Update snapshot with current values (already verified to exist above)
|
|
469
|
+
snapshot.apiKey = apiKey;
|
|
470
|
+
snapshot.baseUrl = baseUrl;
|
|
471
|
+
snapshot.modelId = model;
|
|
472
|
+
// Update ID if model changed
|
|
473
|
+
const newSnapshotId = this.buildRuntimeModelSnapshotId(snapshot.authType, snapshot.modelId);
|
|
474
|
+
if (newSnapshotId !== snapshot.id) {
|
|
475
|
+
this.runtimeModelSnapshots.delete(snapshot.id);
|
|
476
|
+
snapshot.id = newSnapshotId;
|
|
477
|
+
this.runtimeModelSnapshots.set(newSnapshotId, snapshot);
|
|
478
|
+
this.activeRuntimeModelSnapshotId = newSnapshotId;
|
|
479
|
+
}
|
|
480
|
+
snapshot.createdAt = Date.now();
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
// Create new snapshot
|
|
484
|
+
this.detectAndCaptureRuntimeModel();
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Clear configuration fields that were sourced from modelProviders.
|
|
489
|
+
* This ensures provider config atomicity when user manually sets credentials.
|
|
490
|
+
* Other layers (CLI, env, settings, defaults) will participate in resolve.
|
|
491
|
+
*/
|
|
492
|
+
clearProviderSourcedConfig() {
|
|
493
|
+
for (const field of PROVIDER_SOURCED_FIELDS) {
|
|
494
|
+
const source = this.generationConfigSources[field];
|
|
495
|
+
if (source?.kind === 'modelProviders') {
|
|
496
|
+
// Clear the value - let other layers resolve it
|
|
497
|
+
delete this._generationConfig[field];
|
|
498
|
+
delete this.generationConfigSources[field];
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Get whether strict model provider selection is enabled
|
|
504
|
+
*/
|
|
505
|
+
isStrictModelProviderSelection() {
|
|
506
|
+
return this.strictModelProviderSelection;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Reset strict model provider selection flag
|
|
510
|
+
*/
|
|
511
|
+
resetStrictModelProviderSelection() {
|
|
512
|
+
this.strictModelProviderSelection = false;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Check and consume the one-shot cached credentials flag
|
|
516
|
+
*/
|
|
517
|
+
consumeRequireCachedCredentialsFlag() {
|
|
518
|
+
const value = this.requireCachedQwenCredentialsOnce;
|
|
519
|
+
this.requireCachedQwenCredentialsOnce = false;
|
|
520
|
+
return value;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Apply resolved model config to generation config
|
|
524
|
+
*/
|
|
525
|
+
applyResolvedModelDefaults(model) {
|
|
526
|
+
this.strictModelProviderSelection = true;
|
|
527
|
+
// We're explicitly applying modelProvider defaults now, so manual overrides
|
|
528
|
+
// should no longer block syncAfterAuthRefresh from applying provider defaults.
|
|
529
|
+
this.hasManualCredentials = false;
|
|
530
|
+
this._generationConfig.model = model.id;
|
|
531
|
+
this.generationConfigSources['model'] = {
|
|
532
|
+
kind: 'modelProviders',
|
|
533
|
+
authType: model.authType,
|
|
534
|
+
modelId: model.id,
|
|
535
|
+
detail: 'model.id',
|
|
536
|
+
};
|
|
537
|
+
// Clear credentials to avoid reusing previous model's API key
|
|
538
|
+
// For Qwen OAuth, apiKey must always be a placeholder. It will be dynamically
|
|
539
|
+
// replaced when building requests. Do not preserve any previous key or read
|
|
540
|
+
// from envKey.
|
|
541
|
+
//
|
|
542
|
+
// (OpenAI client instantiation requires an apiKey even though it will be
|
|
543
|
+
// replaced later.)
|
|
544
|
+
if (this.currentAuthType === AuthType.QWEN_OAUTH) {
|
|
545
|
+
this._generationConfig.apiKey = 'QWEN_OAUTH_DYNAMIC_TOKEN';
|
|
546
|
+
this.generationConfigSources['apiKey'] = {
|
|
547
|
+
kind: 'computed',
|
|
548
|
+
detail: 'Qwen OAuth placeholder token',
|
|
549
|
+
};
|
|
550
|
+
this._generationConfig.apiKeyEnvKey = undefined;
|
|
551
|
+
delete this.generationConfigSources['apiKeyEnvKey'];
|
|
552
|
+
}
|
|
553
|
+
else {
|
|
554
|
+
this._generationConfig.apiKey = undefined;
|
|
555
|
+
this._generationConfig.apiKeyEnvKey = undefined;
|
|
556
|
+
}
|
|
557
|
+
// Read API key from environment variable if envKey is specified
|
|
558
|
+
if (model.envKey !== undefined) {
|
|
559
|
+
const apiKey = process.env[model.envKey];
|
|
560
|
+
if (apiKey) {
|
|
561
|
+
this._generationConfig.apiKey = apiKey;
|
|
562
|
+
this.generationConfigSources['apiKey'] = {
|
|
563
|
+
kind: 'env',
|
|
564
|
+
envKey: model.envKey,
|
|
565
|
+
via: {
|
|
566
|
+
kind: 'modelProviders',
|
|
567
|
+
authType: model.authType,
|
|
568
|
+
modelId: model.id,
|
|
569
|
+
detail: 'envKey',
|
|
570
|
+
},
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
this._generationConfig.apiKeyEnvKey = model.envKey;
|
|
574
|
+
this.generationConfigSources['apiKeyEnvKey'] = {
|
|
575
|
+
kind: 'modelProviders',
|
|
576
|
+
authType: model.authType,
|
|
577
|
+
modelId: model.id,
|
|
578
|
+
detail: 'envKey',
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
// Base URL
|
|
582
|
+
this._generationConfig.baseUrl = model.baseUrl;
|
|
583
|
+
this.generationConfigSources['baseUrl'] = {
|
|
584
|
+
kind: 'modelProviders',
|
|
585
|
+
authType: model.authType,
|
|
586
|
+
modelId: model.id,
|
|
587
|
+
detail: 'baseUrl',
|
|
588
|
+
};
|
|
589
|
+
// Generation config: apply all fields from MODEL_GENERATION_CONFIG_FIELDS
|
|
590
|
+
const gc = model.generationConfig;
|
|
591
|
+
for (const field of MODEL_GENERATION_CONFIG_FIELDS) {
|
|
592
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
593
|
+
this._generationConfig[field] = gc[field];
|
|
594
|
+
this.generationConfigSources[field] = {
|
|
595
|
+
kind: 'modelProviders',
|
|
596
|
+
authType: model.authType,
|
|
597
|
+
modelId: model.id,
|
|
598
|
+
detail: `generationConfig.${field}`,
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
// contextWindowSize fallback: auto-detect from model when not set by provider
|
|
602
|
+
if (gc.contextWindowSize === undefined) {
|
|
603
|
+
this._generationConfig.contextWindowSize = tokenLimit(model.id, 'input');
|
|
604
|
+
this.generationConfigSources['contextWindowSize'] = {
|
|
605
|
+
kind: 'computed',
|
|
606
|
+
detail: 'auto-detected from model',
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
// modalities fallback: auto-detect from model when not set by provider
|
|
610
|
+
if (gc.modalities === undefined) {
|
|
611
|
+
this._generationConfig.modalities = defaultModalities(model.id);
|
|
612
|
+
this.generationConfigSources['modalities'] = {
|
|
613
|
+
kind: 'computed',
|
|
614
|
+
detail: 'auto-detected from model',
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Check if model switch requires ContentGenerator refresh.
|
|
620
|
+
*
|
|
621
|
+
* Note: This method is ONLY called by switchModel() for same-authType model switches.
|
|
622
|
+
* Cross-authType switches use switchModel(authType, modelId), which always requires full refresh.
|
|
623
|
+
*
|
|
624
|
+
* When this method is called:
|
|
625
|
+
* - this.currentAuthType is already the target authType
|
|
626
|
+
* - We're checking if switching between two models within the SAME authType needs refresh
|
|
627
|
+
*
|
|
628
|
+
* Examples:
|
|
629
|
+
* - Qwen OAuth: coder-model switches (same authType, hot-update safe)
|
|
630
|
+
* - OpenAI: model-a -> model-b with same envKey (same authType, hot-update safe)
|
|
631
|
+
* - OpenAI: gpt-4 -> deepseek-chat with different envKey (same authType, needs refresh)
|
|
632
|
+
*
|
|
633
|
+
* Cross-authType scenarios:
|
|
634
|
+
* - OpenAI -> Qwen OAuth: handled by switchModel(authType, modelId), always refreshes
|
|
635
|
+
* - Qwen OAuth -> OpenAI: handled by switchModel(authType, modelId), always refreshes
|
|
636
|
+
*/
|
|
637
|
+
checkRequiresRefresh(previousModelId) {
|
|
638
|
+
// Defensive: this method is only called after switchModel() sets currentAuthType,
|
|
639
|
+
// but keep type safety for any future callsites.
|
|
640
|
+
const authType = this.currentAuthType;
|
|
641
|
+
if (!authType) {
|
|
642
|
+
return true;
|
|
643
|
+
}
|
|
644
|
+
// For Qwen OAuth, model switches within the same authType can always be hot-updated
|
|
645
|
+
// (coder-model supports vision capabilities and doesn't require ContentGenerator recreation)
|
|
646
|
+
if (authType === AuthType.QWEN_OAUTH) {
|
|
647
|
+
return false;
|
|
648
|
+
}
|
|
649
|
+
// Get previous and current model configs
|
|
650
|
+
const previousModel = this.modelRegistry.getModel(authType, previousModelId);
|
|
651
|
+
const currentModel = this.modelRegistry.getModel(authType, this._generationConfig.model || '');
|
|
652
|
+
// If either model is not in registry, require refresh to be safe
|
|
653
|
+
if (!previousModel || !currentModel) {
|
|
654
|
+
return true;
|
|
655
|
+
}
|
|
656
|
+
// Check if critical fields changed that require ContentGenerator recreation
|
|
657
|
+
const criticalFieldsChanged = previousModel.envKey !== currentModel.envKey ||
|
|
658
|
+
previousModel.baseUrl !== currentModel.baseUrl;
|
|
659
|
+
if (criticalFieldsChanged) {
|
|
660
|
+
return true;
|
|
661
|
+
}
|
|
662
|
+
// For other auth types with strict model provider selection,
|
|
663
|
+
// if no critical fields changed, we can still hot-update
|
|
664
|
+
// (e.g., switching between two OpenAI models with same envKey and baseUrl)
|
|
665
|
+
return false;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Sync state after auth refresh with fallback strategy:
|
|
669
|
+
* 1. If modelId can be found in modelRegistry, use the config from modelRegistry.
|
|
670
|
+
* 2. Otherwise, if existing credentials exist in resolved generationConfig from other sources
|
|
671
|
+
* (not modelProviders), preserve them and update authType/modelId only.
|
|
672
|
+
* 3. Otherwise, fall back to default model for the authType.
|
|
673
|
+
* 4. If no default is available, leave the generationConfig incomplete and let
|
|
674
|
+
* resolveContentGeneratorConfigWithSources throw exceptions as expected.
|
|
675
|
+
*/
|
|
676
|
+
syncAfterAuthRefresh(authType, modelId) {
|
|
677
|
+
this.strictModelProviderSelection = false;
|
|
678
|
+
const previousAuthType = this.currentAuthType;
|
|
679
|
+
this.currentAuthType = authType;
|
|
680
|
+
// Step 1: If modelId exists in registry, always use config from modelRegistry
|
|
681
|
+
// Manual credentials won't have a modelId that matches a provider model (handleAuthSelect prevents it),
|
|
682
|
+
// so if modelId exists in registry, we should always use provider config.
|
|
683
|
+
// This handles provider switching even within the same authType.
|
|
684
|
+
if (modelId && this.modelRegistry.hasModel(authType, modelId)) {
|
|
685
|
+
const resolved = this.modelRegistry.getModel(authType, modelId);
|
|
686
|
+
if (resolved) {
|
|
687
|
+
this.applyResolvedModelDefaults(resolved);
|
|
688
|
+
this.strictModelProviderSelection = true;
|
|
689
|
+
// Clear active runtime model snapshot since we're now using a registry model
|
|
690
|
+
this.activeRuntimeModelSnapshotId = undefined;
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
// Step 2: Check if there are existing credentials from other sources (not modelProviders)
|
|
695
|
+
const apiKeySource = this.generationConfigSources['apiKey'];
|
|
696
|
+
const baseUrlSource = this.generationConfigSources['baseUrl'];
|
|
697
|
+
const hasExistingCredentials = (this._generationConfig.apiKey &&
|
|
698
|
+
apiKeySource?.kind !== 'modelProviders') ||
|
|
699
|
+
(this._generationConfig.baseUrl &&
|
|
700
|
+
baseUrlSource?.kind !== 'modelProviders');
|
|
701
|
+
// Only preserve credentials if:
|
|
702
|
+
// 1. AuthType hasn't changed (credentials are authType-specific), AND
|
|
703
|
+
// 2. The modelId doesn't exist in the registry (if it did, we would have used provider config in Step 1), AND
|
|
704
|
+
// 3. Either:
|
|
705
|
+
// a. We have manual credentials (set via updateCredentials), OR
|
|
706
|
+
// b. We have existing credentials
|
|
707
|
+
// Note: Even if authType hasn't changed, switching to a different provider model (that exists in registry)
|
|
708
|
+
// will use provider config (Step 1), not preserve old credentials. This ensures credentials change when
|
|
709
|
+
// switching providers, independent of authType changes.
|
|
710
|
+
const isAuthTypeChange = previousAuthType !== authType;
|
|
711
|
+
const shouldPreserveCredentials = !isAuthTypeChange &&
|
|
712
|
+
(modelId === undefined ||
|
|
713
|
+
!this.modelRegistry.hasModel(authType, modelId)) &&
|
|
714
|
+
(this.hasManualCredentials || hasExistingCredentials);
|
|
715
|
+
if (shouldPreserveCredentials) {
|
|
716
|
+
// Preserve existing credentials, just update authType and modelId if provided
|
|
717
|
+
if (modelId) {
|
|
718
|
+
this._generationConfig.model = modelId;
|
|
719
|
+
if (!this.generationConfigSources['model']) {
|
|
720
|
+
this.generationConfigSources['model'] = {
|
|
721
|
+
kind: 'programmatic',
|
|
722
|
+
detail: 'auth refresh (preserved credentials)',
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
// Step 3: Fall back to default model for the authType
|
|
729
|
+
const defaultModel = this.modelRegistry.getDefaultModelForAuthType(authType);
|
|
730
|
+
if (defaultModel) {
|
|
731
|
+
this.applyResolvedModelDefaults(defaultModel);
|
|
732
|
+
// Clear active runtime model snapshot since we're now using a registry model
|
|
733
|
+
this.activeRuntimeModelSnapshotId = undefined;
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
// Step 4: No default available - leave generationConfig incomplete
|
|
737
|
+
// resolveContentGeneratorConfigWithSources will throw exceptions as expected
|
|
738
|
+
if (modelId) {
|
|
739
|
+
this._generationConfig.model = modelId;
|
|
740
|
+
if (!this.generationConfigSources['model']) {
|
|
741
|
+
this.generationConfigSources['model'] = {
|
|
742
|
+
kind: 'programmatic',
|
|
743
|
+
detail: 'auth refresh (no default model)',
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Update callback for model changes
|
|
750
|
+
*/
|
|
751
|
+
setOnModelChange(callback) {
|
|
752
|
+
this.onModelChange = callback;
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Detect and capture RuntimeModelSnapshot during initialization.
|
|
756
|
+
*
|
|
757
|
+
* Checks if the current configuration represents a runtime model (not from
|
|
758
|
+
* modelProviders registry) and captures it as a RuntimeModelSnapshot.
|
|
759
|
+
*
|
|
760
|
+
* This enables runtime models to persist across sessions and appear in model lists.
|
|
761
|
+
*
|
|
762
|
+
* @returns Created snapshot ID, or undefined if current config is a registry model
|
|
763
|
+
*/
|
|
764
|
+
detectAndCaptureRuntimeModel() {
|
|
765
|
+
const { model: currentModel, apiKey, baseUrl, apiKeyEnvKey, ...generationConfig } = this._generationConfig;
|
|
766
|
+
const currentAuthType = this.currentAuthType;
|
|
767
|
+
if (!currentModel || !currentAuthType) {
|
|
768
|
+
return undefined;
|
|
769
|
+
}
|
|
770
|
+
// Check if model exists in registry - if so, it's not a runtime model
|
|
771
|
+
if (this.modelRegistry.hasModel(currentAuthType, currentModel)) {
|
|
772
|
+
// Current is a registry model, clear any previous RuntimeModelSnapshot for this authType
|
|
773
|
+
this.clearRuntimeModelSnapshotForAuthType(currentAuthType);
|
|
774
|
+
return undefined;
|
|
775
|
+
}
|
|
776
|
+
// Check if we have valid credentials (apiKey + baseUrl)
|
|
777
|
+
const hasValidCredentials = this._generationConfig.apiKey && this._generationConfig.baseUrl;
|
|
778
|
+
if (!hasValidCredentials) {
|
|
779
|
+
return undefined;
|
|
780
|
+
}
|
|
781
|
+
// Create or update RuntimeModelSnapshot
|
|
782
|
+
const snapshotId = this.buildRuntimeModelSnapshotId(currentAuthType, currentModel);
|
|
783
|
+
const snapshot = {
|
|
784
|
+
id: snapshotId,
|
|
785
|
+
authType: currentAuthType,
|
|
786
|
+
modelId: currentModel,
|
|
787
|
+
apiKey,
|
|
788
|
+
baseUrl,
|
|
789
|
+
apiKeyEnvKey,
|
|
790
|
+
generationConfig,
|
|
791
|
+
sources: { ...this.generationConfigSources },
|
|
792
|
+
createdAt: Date.now(),
|
|
793
|
+
};
|
|
794
|
+
this.runtimeModelSnapshots.set(snapshotId, snapshot);
|
|
795
|
+
this.activeRuntimeModelSnapshotId = snapshotId;
|
|
796
|
+
// Enforce per-authType limit
|
|
797
|
+
this.cleanupOldRuntimeModelSnapshots();
|
|
798
|
+
return snapshotId;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Get the currently active RuntimeModelSnapshot.
|
|
802
|
+
*
|
|
803
|
+
* @returns The active RuntimeModelSnapshot, or undefined if no runtime model is active
|
|
804
|
+
*/
|
|
805
|
+
getActiveRuntimeModelSnapshot() {
|
|
806
|
+
if (!this.activeRuntimeModelSnapshotId) {
|
|
807
|
+
return undefined;
|
|
808
|
+
}
|
|
809
|
+
return this.runtimeModelSnapshots.get(this.activeRuntimeModelSnapshotId);
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Get the ID of the currently active RuntimeModelSnapshot.
|
|
813
|
+
*
|
|
814
|
+
* @returns The active snapshot ID, or undefined if no runtime model is active
|
|
815
|
+
*/
|
|
816
|
+
getActiveRuntimeModelSnapshotId() {
|
|
817
|
+
return this.activeRuntimeModelSnapshotId;
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Switch to a RuntimeModelSnapshot.
|
|
821
|
+
*
|
|
822
|
+
* Applies the configuration from a previously captured RuntimeModelSnapshot.
|
|
823
|
+
* Uses state rollback pattern: creates a state snapshot before switching and
|
|
824
|
+
* restores it on error.
|
|
825
|
+
*
|
|
826
|
+
* @param snapshotId - The ID of the RuntimeModelSnapshot to switch to
|
|
827
|
+
*/
|
|
828
|
+
async switchToRuntimeModel(snapshotId) {
|
|
829
|
+
const runtimeModelSnapshot = this.runtimeModelSnapshots.get(snapshotId);
|
|
830
|
+
if (!runtimeModelSnapshot) {
|
|
831
|
+
throw new Error(`Runtime model snapshot '${snapshotId}' not found`);
|
|
832
|
+
}
|
|
833
|
+
const rollbackSnapshot = this.createStateSnapshotForRollback();
|
|
834
|
+
try {
|
|
835
|
+
const isAuthTypeChange = runtimeModelSnapshot.authType !== this.currentAuthType;
|
|
836
|
+
this.currentAuthType = runtimeModelSnapshot.authType;
|
|
837
|
+
this.activeRuntimeModelSnapshotId = snapshotId;
|
|
838
|
+
// Apply runtime configuration
|
|
839
|
+
this.strictModelProviderSelection = false;
|
|
840
|
+
this.hasManualCredentials = true; // Mark as manual to prevent provider override
|
|
841
|
+
this._generationConfig.model = runtimeModelSnapshot.modelId;
|
|
842
|
+
this.generationConfigSources['model'] = {
|
|
843
|
+
kind: 'programmatic',
|
|
844
|
+
detail: 'runtimeModelSwitch',
|
|
845
|
+
};
|
|
846
|
+
if (runtimeModelSnapshot.apiKey) {
|
|
847
|
+
this._generationConfig.apiKey = runtimeModelSnapshot.apiKey;
|
|
848
|
+
this.generationConfigSources['apiKey'] = runtimeModelSnapshot.sources['apiKey'] || {
|
|
849
|
+
kind: 'programmatic',
|
|
850
|
+
detail: 'runtimeModelSwitch',
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
if (runtimeModelSnapshot.baseUrl) {
|
|
854
|
+
this._generationConfig.baseUrl = runtimeModelSnapshot.baseUrl;
|
|
855
|
+
this.generationConfigSources['baseUrl'] = runtimeModelSnapshot.sources['baseUrl'] || {
|
|
856
|
+
kind: 'programmatic',
|
|
857
|
+
detail: 'runtimeModelSwitch',
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
if (runtimeModelSnapshot.apiKeyEnvKey) {
|
|
861
|
+
this._generationConfig.apiKeyEnvKey = runtimeModelSnapshot.apiKeyEnvKey;
|
|
862
|
+
}
|
|
863
|
+
// Apply generation config
|
|
864
|
+
if (runtimeModelSnapshot.generationConfig) {
|
|
865
|
+
Object.assign(this._generationConfig, runtimeModelSnapshot.generationConfig);
|
|
866
|
+
}
|
|
867
|
+
const requiresRefresh = isAuthTypeChange;
|
|
868
|
+
if (this.onModelChange) {
|
|
869
|
+
await this.onModelChange(runtimeModelSnapshot.authType, requiresRefresh);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
catch (error) {
|
|
873
|
+
this.rollbackToStateSnapshot(rollbackSnapshot);
|
|
874
|
+
throw error;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* Get the active RuntimeModelSnapshot as an AvailableModel option.
|
|
879
|
+
*
|
|
880
|
+
* Converts the active RuntimeModelSnapshot to an AvailableModel format for display
|
|
881
|
+
* in model lists. Returns undefined if no runtime model is active.
|
|
882
|
+
*
|
|
883
|
+
* @returns The runtime model as an AvailableModel option, or undefined
|
|
884
|
+
*/
|
|
885
|
+
getRuntimeModelOption() {
|
|
886
|
+
const snapshot = this.getActiveRuntimeModelSnapshot();
|
|
887
|
+
if (!snapshot) {
|
|
888
|
+
return undefined;
|
|
889
|
+
}
|
|
890
|
+
return {
|
|
891
|
+
id: snapshot.modelId,
|
|
892
|
+
label: snapshot.modelId,
|
|
893
|
+
authType: snapshot.authType,
|
|
894
|
+
/**
|
|
895
|
+
* `isVision` is for automatic switching of qwen-oauth vision model.
|
|
896
|
+
* Runtime models are basically specified via CLI arguments, env variables,
|
|
897
|
+
* or settings for other auth types.
|
|
898
|
+
*/
|
|
899
|
+
isVision: false,
|
|
900
|
+
contextWindowSize: snapshot.generationConfig?.contextWindowSize,
|
|
901
|
+
isRuntimeModel: true,
|
|
902
|
+
runtimeSnapshotId: snapshot.id,
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Clear all RuntimeModelSnapshots for a specific authType.
|
|
907
|
+
*
|
|
908
|
+
* Removes all RuntimeModelSnapshots associated with the given authType.
|
|
909
|
+
* Called when switching to a registry model to avoid stale RuntimeModelSnapshots.
|
|
910
|
+
*
|
|
911
|
+
* @param authType - The authType whose snapshots should be cleared
|
|
912
|
+
*/
|
|
913
|
+
clearRuntimeModelSnapshotForAuthType(authType) {
|
|
914
|
+
for (const [id, snapshot] of this.runtimeModelSnapshots.entries()) {
|
|
915
|
+
if (snapshot.authType === authType) {
|
|
916
|
+
this.runtimeModelSnapshots.delete(id);
|
|
917
|
+
if (this.activeRuntimeModelSnapshotId === id) {
|
|
918
|
+
this.activeRuntimeModelSnapshotId = undefined;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Cleanup old RuntimeModelSnapshots to enforce per-authType limit.
|
|
925
|
+
*
|
|
926
|
+
* Keeps only the latest RuntimeModelSnapshot for each authType.
|
|
927
|
+
* Older snapshots are removed to prevent unbounded growth.
|
|
928
|
+
*/
|
|
929
|
+
cleanupOldRuntimeModelSnapshots() {
|
|
930
|
+
const snapshotsByAuthType = new Map();
|
|
931
|
+
for (const snapshot of this.runtimeModelSnapshots.values()) {
|
|
932
|
+
const existing = snapshotsByAuthType.get(snapshot.authType);
|
|
933
|
+
if (!existing || snapshot.createdAt > existing.createdAt) {
|
|
934
|
+
snapshotsByAuthType.set(snapshot.authType, snapshot);
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
this.runtimeModelSnapshots.clear();
|
|
938
|
+
for (const snapshot of snapshotsByAuthType.values()) {
|
|
939
|
+
this.runtimeModelSnapshots.set(snapshot.id, snapshot);
|
|
940
|
+
}
|
|
941
|
+
// Update active snapshot ID if it was removed
|
|
942
|
+
if (this.activeRuntimeModelSnapshotId &&
|
|
943
|
+
!this.runtimeModelSnapshots.has(this.activeRuntimeModelSnapshotId)) {
|
|
944
|
+
this.activeRuntimeModelSnapshotId = undefined;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Reload model providers configuration at runtime.
|
|
949
|
+
* This enables hot-reloading of modelProviders settings without restarting the CLI.
|
|
950
|
+
*
|
|
951
|
+
* @param modelProvidersConfig - The updated model providers configuration
|
|
952
|
+
*/
|
|
953
|
+
reloadModelProvidersConfig(modelProvidersConfig) {
|
|
954
|
+
this.modelRegistry.reloadModels(modelProvidersConfig);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
//# sourceMappingURL=modelsConfig.js.map
|