@anh3d0nic/qwen-code-termux-ice 21.0.1 → 21.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/qwen-ice +127 -331
- package/core/ice-core.js +101 -0
- package/core-dist/index.d.ts +6 -0
- package/core-dist/index.js +7 -0
- package/core-dist/index.js.map +1 -0
- package/core-dist/src/__mocks__/fs/promises.d.ts +11 -0
- package/core-dist/src/__mocks__/fs/promises.js +17 -0
- package/core-dist/src/__mocks__/fs/promises.js.map +1 -0
- package/core-dist/src/config/config.d.ts +648 -0
- package/core-dist/src/config/config.js +1374 -0
- package/core-dist/src/config/config.js.map +1 -0
- package/core-dist/src/config/config.test.d.ts +6 -0
- package/core-dist/src/config/config.test.js +1116 -0
- package/core-dist/src/config/config.test.js.map +1 -0
- package/core-dist/src/config/constants.d.ts +11 -0
- package/core-dist/src/config/constants.js +16 -0
- package/core-dist/src/config/constants.js.map +1 -0
- package/core-dist/src/config/models.d.ts +9 -0
- package/core-dist/src/config/models.js +10 -0
- package/core-dist/src/config/models.js.map +1 -0
- package/core-dist/src/config/storage.d.ts +38 -0
- package/core-dist/src/config/storage.js +114 -0
- package/core-dist/src/config/storage.js.map +1 -0
- package/core-dist/src/config/storage.test.d.ts +6 -0
- package/core-dist/src/config/storage.test.js +36 -0
- package/core-dist/src/config/storage.test.js.map +1 -0
- package/core-dist/src/confirmation-bus/message-bus.d.ts +22 -0
- package/core-dist/src/confirmation-bus/message-bus.js +98 -0
- package/core-dist/src/confirmation-bus/message-bus.js.map +1 -0
- package/core-dist/src/confirmation-bus/types.d.ts +104 -0
- package/core-dist/src/confirmation-bus/types.js +16 -0
- package/core-dist/src/confirmation-bus/types.js.map +1 -0
- package/core-dist/src/core/__tests__/openaiTimeoutHandling.test.d.ts +6 -0
- package/core-dist/src/core/__tests__/openaiTimeoutHandling.test.js +298 -0
- package/core-dist/src/core/__tests__/openaiTimeoutHandling.test.js.map +1 -0
- package/core-dist/src/core/__tests__/orphanedToolCallsTest.d.ts +64 -0
- package/core-dist/src/core/__tests__/orphanedToolCallsTest.js +122 -0
- package/core-dist/src/core/__tests__/orphanedToolCallsTest.js.map +1 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.d.ts +28 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.js +349 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.js.map +1 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.test.d.ts +6 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.test.js +396 -0
- package/core-dist/src/core/anthropicContentGenerator/anthropicContentGenerator.test.js.map +1 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.d.ts +48 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.js +449 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.js.map +1 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.test.d.ts +6 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.test.js +843 -0
- package/core-dist/src/core/anthropicContentGenerator/converter.test.js.map +1 -0
- package/core-dist/src/core/anthropicContentGenerator/index.d.ts +9 -0
- package/core-dist/src/core/anthropicContentGenerator/index.js +11 -0
- package/core-dist/src/core/anthropicContentGenerator/index.js.map +1 -0
- package/core-dist/src/core/baseLlmClient.d.ts +48 -0
- package/core-dist/src/core/baseLlmClient.js +98 -0
- package/core-dist/src/core/baseLlmClient.js.map +1 -0
- package/core-dist/src/core/baseLlmClient.test.d.ts +6 -0
- package/core-dist/src/core/baseLlmClient.test.js +319 -0
- package/core-dist/src/core/baseLlmClient.test.js.map +1 -0
- package/core-dist/src/core/client.d.ts +48 -0
- package/core-dist/src/core/client.js +547 -0
- package/core-dist/src/core/client.js.map +1 -0
- package/core-dist/src/core/client.test.d.ts +6 -0
- package/core-dist/src/core/client.test.js +1885 -0
- package/core-dist/src/core/client.test.js.map +1 -0
- package/core-dist/src/core/contentGenerator.d.ts +100 -0
- package/core-dist/src/core/contentGenerator.js +162 -0
- package/core-dist/src/core/contentGenerator.js.map +1 -0
- package/core-dist/src/core/contentGenerator.test.d.ts +6 -0
- package/core-dist/src/core/contentGenerator.test.js +95 -0
- package/core-dist/src/core/contentGenerator.test.js.map +1 -0
- package/core-dist/src/core/coreToolScheduler.d.ts +142 -0
- package/core-dist/src/core/coreToolScheduler.js +872 -0
- package/core-dist/src/core/coreToolScheduler.js.map +1 -0
- package/core-dist/src/core/coreToolScheduler.test.d.ts +6 -0
- package/core-dist/src/core/coreToolScheduler.test.js +2221 -0
- package/core-dist/src/core/coreToolScheduler.test.js.map +1 -0
- package/core-dist/src/core/geminiChat.d.ts +122 -0
- package/core-dist/src/core/geminiChat.js +571 -0
- package/core-dist/src/core/geminiChat.js.map +1 -0
- package/core-dist/src/core/geminiChat.test.d.ts +6 -0
- package/core-dist/src/core/geminiChat.test.js +1276 -0
- package/core-dist/src/core/geminiChat.test.js.map +1 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.d.ts +38 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.js +193 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.js.map +1 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.test.d.ts +6 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.test.js +304 -0
- package/core-dist/src/core/geminiContentGenerator/geminiContentGenerator.test.js.map +1 -0
- package/core-dist/src/core/geminiContentGenerator/index.d.ts +12 -0
- package/core-dist/src/core/geminiContentGenerator/index.js +36 -0
- package/core-dist/src/core/geminiContentGenerator/index.js.map +1 -0
- package/core-dist/src/core/geminiContentGenerator/index.test.d.ts +6 -0
- package/core-dist/src/core/geminiContentGenerator/index.test.js +34 -0
- package/core-dist/src/core/geminiContentGenerator/index.test.js.map +1 -0
- package/core-dist/src/core/geminiRequest.d.ts +13 -0
- package/core-dist/src/core/geminiRequest.js +11 -0
- package/core-dist/src/core/geminiRequest.js.map +1 -0
- package/core-dist/src/core/geminiRequest.test.d.ts +6 -0
- package/core-dist/src/core/geminiRequest.test.js +73 -0
- package/core-dist/src/core/geminiRequest.test.js.map +1 -0
- package/core-dist/src/core/logger.d.ts +68 -0
- package/core-dist/src/core/logger.js +364 -0
- package/core-dist/src/core/logger.js.map +1 -0
- package/core-dist/src/core/logger.test.d.ts +6 -0
- package/core-dist/src/core/logger.test.js +520 -0
- package/core-dist/src/core/logger.test.js.map +1 -0
- package/core-dist/src/core/loggingContentGenerator/index.d.ts +6 -0
- package/core-dist/src/core/loggingContentGenerator/index.js +7 -0
- package/core-dist/src/core/loggingContentGenerator/index.js.map +1 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.d.ts +36 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.js +321 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.js.map +1 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.test.d.ts +6 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.test.js +287 -0
- package/core-dist/src/core/loggingContentGenerator/loggingContentGenerator.test.js.map +1 -0
- package/core-dist/src/core/modalityDefaults.d.ts +14 -0
- package/core-dist/src/core/modalityDefaults.js +81 -0
- package/core-dist/src/core/modalityDefaults.js.map +1 -0
- package/core-dist/src/core/modalityDefaults.test.d.ts +6 -0
- package/core-dist/src/core/modalityDefaults.test.js +181 -0
- package/core-dist/src/core/modalityDefaults.test.js.map +1 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.d.ts +16 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.js +30 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.js.map +1 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.test.d.ts +6 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.test.js +296 -0
- package/core-dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/constants.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/constants.js +7 -0
- package/core-dist/src/core/openaiContentGenerator/constants.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/converter.d.ts +133 -0
- package/core-dist/src/core/openaiContentGenerator/converter.js +1020 -0
- package/core-dist/src/core/openaiContentGenerator/converter.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/converter.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/converter.test.js +1966 -0
- package/core-dist/src/core/openaiContentGenerator/converter.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.d.ts +27 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.js +84 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.test.js +267 -0
- package/core-dist/src/core/openaiContentGenerator/errorHandler.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/index.d.ts +21 -0
- package/core-dist/src/core/openaiContentGenerator/index.js +43 -0
- package/core-dist/src/core/openaiContentGenerator/index.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.d.ts +22 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.js +117 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.test.js +298 -0
- package/core-dist/src/core/openaiContentGenerator/openaiContentGenerator.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.d.ts +74 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.js +327 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.test.js +1143 -0
- package/core-dist/src/core/openaiContentGenerator/pipeline.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/README.md +61 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.d.ts +70 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.js +258 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.test.js +781 -0
- package/core-dist/src/core/openaiContentGenerator/provider/dashscope.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.d.ts +14 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.js +21 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.test.js +51 -0
- package/core-dist/src/core/openaiContentGenerator/provider/deepseek.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.d.ts +17 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.js +52 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.test.js +227 -0
- package/core-dist/src/core/openaiContentGenerator/provider/default.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/index.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/index.js +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/index.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.d.ts +17 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.js +25 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.test.js +66 -0
- package/core-dist/src/core/openaiContentGenerator/provider/modelscope.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.d.ts +8 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.js +21 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.test.js +152 -0
- package/core-dist/src/core/openaiContentGenerator/provider/openrouter.test.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/provider/types.d.ts +26 -0
- package/core-dist/src/core/openaiContentGenerator/provider/types.js +2 -0
- package/core-dist/src/core/openaiContentGenerator/provider/types.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.d.ts +157 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.js +390 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.js.map +1 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.test.d.ts +6 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.test.js +585 -0
- package/core-dist/src/core/openaiContentGenerator/streamingToolCallParser.test.js.map +1 -0
- package/core-dist/src/core/prompts.d.ts +81 -0
- package/core-dist/src/core/prompts.js +996 -0
- package/core-dist/src/core/prompts.js.map +1 -0
- package/core-dist/src/core/prompts.test.d.ts +6 -0
- package/core-dist/src/core/prompts.test.js +485 -0
- package/core-dist/src/core/prompts.test.js.map +1 -0
- package/core-dist/src/core/tokenLimits.d.ts +29 -0
- package/core-dist/src/core/tokenLimits.js +171 -0
- package/core-dist/src/core/tokenLimits.js.map +1 -0
- package/core-dist/src/core/tokenLimits.test.d.ts +1 -0
- package/core-dist/src/core/tokenLimits.test.js +270 -0
- package/core-dist/src/core/tokenLimits.test.js.map +1 -0
- package/core-dist/src/core/turn.d.ts +161 -0
- package/core-dist/src/core/turn.js +197 -0
- package/core-dist/src/core/turn.js.map +1 -0
- package/core-dist/src/core/turn.test.d.ts +6 -0
- package/core-dist/src/core/turn.test.js +817 -0
- package/core-dist/src/core/turn.test.js.map +1 -0
- package/core-dist/src/extension/claude-converter.d.ts +121 -0
- package/core-dist/src/extension/claude-converter.js +572 -0
- package/core-dist/src/extension/claude-converter.js.map +1 -0
- package/core-dist/src/extension/claude-converter.test.d.ts +6 -0
- package/core-dist/src/extension/claude-converter.test.js +305 -0
- package/core-dist/src/extension/claude-converter.test.js.map +1 -0
- package/core-dist/src/extension/extensionManager.d.ts +159 -0
- package/core-dist/src/extension/extensionManager.js +829 -0
- package/core-dist/src/extension/extensionManager.js.map +1 -0
- package/core-dist/src/extension/extensionManager.test.d.ts +6 -0
- package/core-dist/src/extension/extensionManager.test.js +598 -0
- package/core-dist/src/extension/extensionManager.test.js.map +1 -0
- package/core-dist/src/extension/extensionSettings.d.ts +33 -0
- package/core-dist/src/extension/extensionSettings.js +186 -0
- package/core-dist/src/extension/extensionSettings.js.map +1 -0
- package/core-dist/src/extension/extensionSettings.test.d.ts +1 -0
- package/core-dist/src/extension/extensionSettings.test.js +488 -0
- package/core-dist/src/extension/extensionSettings.test.js.map +1 -0
- package/core-dist/src/extension/gemini-converter.d.ts +47 -0
- package/core-dist/src/extension/gemini-converter.js +185 -0
- package/core-dist/src/extension/gemini-converter.js.map +1 -0
- package/core-dist/src/extension/gemini-converter.test.d.ts +6 -0
- package/core-dist/src/extension/gemini-converter.test.js +128 -0
- package/core-dist/src/extension/gemini-converter.test.js.map +1 -0
- package/core-dist/src/extension/github.d.ts +30 -0
- package/core-dist/src/extension/github.js +330 -0
- package/core-dist/src/extension/github.js.map +1 -0
- package/core-dist/src/extension/github.test.d.ts +6 -0
- package/core-dist/src/extension/github.test.js +376 -0
- package/core-dist/src/extension/github.test.js.map +1 -0
- package/core-dist/src/extension/index.d.ts +6 -0
- package/core-dist/src/extension/index.js +7 -0
- package/core-dist/src/extension/index.js.map +1 -0
- package/core-dist/src/extension/marketplace.d.ts +19 -0
- package/core-dist/src/extension/marketplace.js +222 -0
- package/core-dist/src/extension/marketplace.js.map +1 -0
- package/core-dist/src/extension/marketplace.test.d.ts +6 -0
- package/core-dist/src/extension/marketplace.test.js +215 -0
- package/core-dist/src/extension/marketplace.test.js.map +1 -0
- package/core-dist/src/extension/override.d.ts +25 -0
- package/core-dist/src/extension/override.js +82 -0
- package/core-dist/src/extension/override.js.map +1 -0
- package/core-dist/src/extension/override.test.d.ts +6 -0
- package/core-dist/src/extension/override.test.js +94 -0
- package/core-dist/src/extension/override.test.js.map +1 -0
- package/core-dist/src/extension/settings.d.ts +39 -0
- package/core-dist/src/extension/settings.js +116 -0
- package/core-dist/src/extension/settings.js.map +1 -0
- package/core-dist/src/extension/settings.test.d.ts +6 -0
- package/core-dist/src/extension/settings.test.js +125 -0
- package/core-dist/src/extension/settings.test.js.map +1 -0
- package/core-dist/src/extension/storage.d.ts +9 -0
- package/core-dist/src/extension/storage.js +38 -0
- package/core-dist/src/extension/storage.js.map +1 -0
- package/core-dist/src/extension/storage.test.d.ts +6 -0
- package/core-dist/src/extension/storage.test.js +64 -0
- package/core-dist/src/extension/storage.test.js.map +1 -0
- package/core-dist/src/extension/variableSchema.d.ts +40 -0
- package/core-dist/src/extension/variableSchema.js +26 -0
- package/core-dist/src/extension/variableSchema.js.map +1 -0
- package/core-dist/src/extension/variables.d.ts +21 -0
- package/core-dist/src/extension/variables.js +46 -0
- package/core-dist/src/extension/variables.js.map +1 -0
- package/core-dist/src/extension/variables.test.d.ts +6 -0
- package/core-dist/src/extension/variables.test.js +17 -0
- package/core-dist/src/extension/variables.test.js.map +1 -0
- package/core-dist/src/hooks/hookAggregator.d.ts +66 -0
- package/core-dist/src/hooks/hookAggregator.js +280 -0
- package/core-dist/src/hooks/hookAggregator.js.map +1 -0
- package/core-dist/src/hooks/hookAggregator.test.d.ts +6 -0
- package/core-dist/src/hooks/hookAggregator.test.js +449 -0
- package/core-dist/src/hooks/hookAggregator.test.js.map +1 -0
- package/core-dist/src/hooks/hookEventHandler.d.ts +42 -0
- package/core-dist/src/hooks/hookEventHandler.js +127 -0
- package/core-dist/src/hooks/hookEventHandler.js.map +1 -0
- package/core-dist/src/hooks/hookEventHandler.test.d.ts +6 -0
- package/core-dist/src/hooks/hookEventHandler.test.js +183 -0
- package/core-dist/src/hooks/hookEventHandler.test.js.map +1 -0
- package/core-dist/src/hooks/hookPlanner.d.ts +42 -0
- package/core-dist/src/hooks/hookPlanner.js +101 -0
- package/core-dist/src/hooks/hookPlanner.js.map +1 -0
- package/core-dist/src/hooks/hookPlanner.test.d.ts +6 -0
- package/core-dist/src/hooks/hookPlanner.test.js +303 -0
- package/core-dist/src/hooks/hookPlanner.test.js.map +1 -0
- package/core-dist/src/hooks/hookRegistry.d.ts +106 -0
- package/core-dist/src/hooks/hookRegistry.js +225 -0
- package/core-dist/src/hooks/hookRegistry.js.map +1 -0
- package/core-dist/src/hooks/hookRegistry.test.d.ts +6 -0
- package/core-dist/src/hooks/hookRegistry.test.js +539 -0
- package/core-dist/src/hooks/hookRegistry.test.js.map +1 -0
- package/core-dist/src/hooks/hookRunner.d.ts +40 -0
- package/core-dist/src/hooks/hookRunner.js +318 -0
- package/core-dist/src/hooks/hookRunner.js.map +1 -0
- package/core-dist/src/hooks/hookRunner.test.d.ts +6 -0
- package/core-dist/src/hooks/hookRunner.test.js +466 -0
- package/core-dist/src/hooks/hookRunner.test.js.map +1 -0
- package/core-dist/src/hooks/hookSystem.d.ts +43 -0
- package/core-dist/src/hooks/hookSystem.js +75 -0
- package/core-dist/src/hooks/hookSystem.js.map +1 -0
- package/core-dist/src/hooks/hookSystem.test.d.ts +6 -0
- package/core-dist/src/hooks/hookSystem.test.js +237 -0
- package/core-dist/src/hooks/hookSystem.test.js.map +1 -0
- package/core-dist/src/hooks/index.d.ts +16 -0
- package/core-dist/src/hooks/index.js +16 -0
- package/core-dist/src/hooks/index.js.map +1 -0
- package/core-dist/src/hooks/trustedHooks.d.ts +28 -0
- package/core-dist/src/hooks/trustedHooks.js +91 -0
- package/core-dist/src/hooks/trustedHooks.js.map +1 -0
- package/core-dist/src/hooks/types.d.ts +498 -0
- package/core-dist/src/hooks/types.js +292 -0
- package/core-dist/src/hooks/types.js.map +1 -0
- package/core-dist/src/ide/constants.d.ts +9 -0
- package/core-dist/src/ide/constants.js +10 -0
- package/core-dist/src/ide/constants.js.map +1 -0
- package/core-dist/src/ide/detect-ide.d.ts +56 -0
- package/core-dist/src/ide/detect-ide.js +68 -0
- package/core-dist/src/ide/detect-ide.js.map +1 -0
- package/core-dist/src/ide/detect-ide.test.d.ts +6 -0
- package/core-dist/src/ide/detect-ide.test.js +113 -0
- package/core-dist/src/ide/detect-ide.test.js.map +1 -0
- package/core-dist/src/ide/ide-client.d.ts +132 -0
- package/core-dist/src/ide/ide-client.js +750 -0
- package/core-dist/src/ide/ide-client.js.map +1 -0
- package/core-dist/src/ide/ide-client.test.d.ts +6 -0
- package/core-dist/src/ide/ide-client.test.js +463 -0
- package/core-dist/src/ide/ide-client.test.js.map +1 -0
- package/core-dist/src/ide/ide-installer.d.ts +14 -0
- package/core-dist/src/ide/ide-installer.js +112 -0
- package/core-dist/src/ide/ide-installer.js.map +1 -0
- package/core-dist/src/ide/ide-installer.test.d.ts +6 -0
- package/core-dist/src/ide/ide-installer.test.js +134 -0
- package/core-dist/src/ide/ide-installer.test.js.map +1 -0
- package/core-dist/src/ide/ideContext.d.ts +44 -0
- package/core-dist/src/ide/ideContext.js +101 -0
- package/core-dist/src/ide/ideContext.js.map +1 -0
- package/core-dist/src/ide/ideContext.test.d.ts +6 -0
- package/core-dist/src/ide/ideContext.test.js +393 -0
- package/core-dist/src/ide/ideContext.test.js.map +1 -0
- package/core-dist/src/ide/process-utils.d.ts +21 -0
- package/core-dist/src/ide/process-utils.js +170 -0
- package/core-dist/src/ide/process-utils.js.map +1 -0
- package/core-dist/src/ide/process-utils.test.d.ts +6 -0
- package/core-dist/src/ide/process-utils.test.js +130 -0
- package/core-dist/src/ide/process-utils.test.js.map +1 -0
- package/core-dist/src/ide/types.d.ts +486 -0
- package/core-dist/src/ide/types.js +138 -0
- package/core-dist/src/ide/types.js.map +1 -0
- package/core-dist/src/index.d.ts +179 -0
- package/core-dist/src/index.js +225 -0
- package/core-dist/src/index.js.map +1 -0
- package/core-dist/src/index.test.d.ts +6 -0
- package/core-dist/src/index.test.js +12 -0
- package/core-dist/src/index.test.js.map +1 -0
- package/core-dist/src/lsp/LspConfigLoader.d.ts +46 -0
- package/core-dist/src/lsp/LspConfigLoader.js +381 -0
- package/core-dist/src/lsp/LspConfigLoader.js.map +1 -0
- package/core-dist/src/lsp/LspConfigLoader.test.d.ts +6 -0
- package/core-dist/src/lsp/LspConfigLoader.test.js +80 -0
- package/core-dist/src/lsp/LspConfigLoader.test.js.map +1 -0
- package/core-dist/src/lsp/LspConnectionFactory.d.ts +62 -0
- package/core-dist/src/lsp/LspConnectionFactory.js +305 -0
- package/core-dist/src/lsp/LspConnectionFactory.js.map +1 -0
- package/core-dist/src/lsp/LspLanguageDetector.d.ts +39 -0
- package/core-dist/src/lsp/LspLanguageDetector.js +199 -0
- package/core-dist/src/lsp/LspLanguageDetector.js.map +1 -0
- package/core-dist/src/lsp/LspResponseNormalizer.d.ts +122 -0
- package/core-dist/src/lsp/LspResponseNormalizer.js +710 -0
- package/core-dist/src/lsp/LspResponseNormalizer.js.map +1 -0
- package/core-dist/src/lsp/LspServerManager.d.ts +87 -0
- package/core-dist/src/lsp/LspServerManager.js +563 -0
- package/core-dist/src/lsp/LspServerManager.js.map +1 -0
- package/core-dist/src/lsp/NativeLspClient.d.ts +149 -0
- package/core-dist/src/lsp/NativeLspClient.js +169 -0
- package/core-dist/src/lsp/NativeLspClient.js.map +1 -0
- package/core-dist/src/lsp/NativeLspService.d.ts +106 -0
- package/core-dist/src/lsp/NativeLspService.integration.test.d.ts +6 -0
- package/core-dist/src/lsp/NativeLspService.integration.test.js +663 -0
- package/core-dist/src/lsp/NativeLspService.integration.test.js.map +1 -0
- package/core-dist/src/lsp/NativeLspService.js +623 -0
- package/core-dist/src/lsp/NativeLspService.js.map +1 -0
- package/core-dist/src/lsp/NativeLspService.test.d.ts +6 -0
- package/core-dist/src/lsp/NativeLspService.test.js +99 -0
- package/core-dist/src/lsp/NativeLspService.test.js.map +1 -0
- package/core-dist/src/lsp/constants.d.ts +35 -0
- package/core-dist/src/lsp/constants.js +86 -0
- package/core-dist/src/lsp/constants.js.map +1 -0
- package/core-dist/src/lsp/types.d.ts +409 -0
- package/core-dist/src/lsp/types.js +7 -0
- package/core-dist/src/lsp/types.js.map +1 -0
- package/core-dist/src/mcp/constants.d.ts +22 -0
- package/core-dist/src/mcp/constants.js +23 -0
- package/core-dist/src/mcp/constants.js.map +1 -0
- package/core-dist/src/mcp/google-auth-provider.d.ts +23 -0
- package/core-dist/src/mcp/google-auth-provider.js +75 -0
- package/core-dist/src/mcp/google-auth-provider.js.map +1 -0
- package/core-dist/src/mcp/google-auth-provider.test.d.ts +6 -0
- package/core-dist/src/mcp/google-auth-provider.test.js +89 -0
- package/core-dist/src/mcp/google-auth-provider.test.js.map +1 -0
- package/core-dist/src/mcp/oauth-provider.d.ts +150 -0
- package/core-dist/src/mcp/oauth-provider.js +617 -0
- package/core-dist/src/mcp/oauth-provider.js.map +1 -0
- package/core-dist/src/mcp/oauth-provider.test.d.ts +6 -0
- package/core-dist/src/mcp/oauth-provider.test.js +917 -0
- package/core-dist/src/mcp/oauth-provider.test.js.map +1 -0
- package/core-dist/src/mcp/oauth-token-storage.d.ts +65 -0
- package/core-dist/src/mcp/oauth-token-storage.js +182 -0
- package/core-dist/src/mcp/oauth-token-storage.js.map +1 -0
- package/core-dist/src/mcp/oauth-token-storage.test.d.ts +6 -0
- package/core-dist/src/mcp/oauth-token-storage.test.js +307 -0
- package/core-dist/src/mcp/oauth-token-storage.test.js.map +1 -0
- package/core-dist/src/mcp/oauth-utils.d.ts +124 -0
- package/core-dist/src/mcp/oauth-utils.js +252 -0
- package/core-dist/src/mcp/oauth-utils.js.map +1 -0
- package/core-dist/src/mcp/oauth-utils.test.d.ts +6 -0
- package/core-dist/src/mcp/oauth-utils.test.js +220 -0
- package/core-dist/src/mcp/oauth-utils.test.js.map +1 -0
- package/core-dist/src/mcp/sa-impersonation-provider.d.ts +33 -0
- package/core-dist/src/mcp/sa-impersonation-provider.js +133 -0
- package/core-dist/src/mcp/sa-impersonation-provider.js.map +1 -0
- package/core-dist/src/mcp/sa-impersonation-provider.test.d.ts +6 -0
- package/core-dist/src/mcp/sa-impersonation-provider.test.js +117 -0
- package/core-dist/src/mcp/sa-impersonation-provider.test.js.map +1 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.d.ts +19 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.js +36 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.js.map +1 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.test.d.ts +6 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.test.js +160 -0
- package/core-dist/src/mcp/token-storage/base-token-storage.test.js.map +1 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.d.ts +24 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.js +144 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.js.map +1 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.test.d.ts +6 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.test.js +235 -0
- package/core-dist/src/mcp/token-storage/file-token-storage.test.js.map +1 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.d.ts +23 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.js +78 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.js.map +1 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.test.d.ts +6 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.test.js +193 -0
- package/core-dist/src/mcp/token-storage/hybrid-token-storage.test.js.map +1 -0
- package/core-dist/src/mcp/token-storage/index.d.ts +11 -0
- package/core-dist/src/mcp/token-storage/index.js +12 -0
- package/core-dist/src/mcp/token-storage/index.js.map +1 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.d.ts +35 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.js +248 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.test.d.ts +6 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.test.js +254 -0
- package/core-dist/src/mcp/token-storage/keychain-token-storage.test.js.map +1 -0
- package/core-dist/src/mcp/token-storage/types.d.ts +38 -0
- package/core-dist/src/mcp/token-storage/types.js +11 -0
- package/core-dist/src/mcp/token-storage/types.js.map +1 -0
- package/core-dist/src/mocks/msw.d.ts +6 -0
- package/core-dist/src/mocks/msw.js +8 -0
- package/core-dist/src/mocks/msw.js.map +1 -0
- package/core-dist/src/models/constants.d.ts +71 -0
- package/core-dist/src/models/constants.js +92 -0
- package/core-dist/src/models/constants.js.map +1 -0
- package/core-dist/src/models/index.d.ts +10 -0
- package/core-dist/src/models/index.js +12 -0
- package/core-dist/src/models/index.js.map +1 -0
- package/core-dist/src/models/modelConfigErrors.d.ts +46 -0
- package/core-dist/src/models/modelConfigErrors.js +87 -0
- package/core-dist/src/models/modelConfigErrors.js.map +1 -0
- package/core-dist/src/models/modelConfigResolver.d.ts +84 -0
- package/core-dist/src/models/modelConfigResolver.js +204 -0
- package/core-dist/src/models/modelConfigResolver.js.map +1 -0
- package/core-dist/src/models/modelConfigResolver.test.d.ts +6 -0
- package/core-dist/src/models/modelConfigResolver.test.js +302 -0
- package/core-dist/src/models/modelConfigResolver.test.js.map +1 -0
- package/core-dist/src/models/modelRegistry.d.ts +55 -0
- package/core-dist/src/models/modelRegistry.js +182 -0
- package/core-dist/src/models/modelRegistry.js.map +1 -0
- package/core-dist/src/models/modelRegistry.test.d.ts +6 -0
- package/core-dist/src/models/modelRegistry.test.js +408 -0
- package/core-dist/src/models/modelRegistry.test.js.map +1 -0
- package/core-dist/src/models/modelsConfig.d.ts +343 -0
- package/core-dist/src/models/modelsConfig.js +957 -0
- package/core-dist/src/models/modelsConfig.js.map +1 -0
- package/core-dist/src/models/modelsConfig.test.d.ts +6 -0
- package/core-dist/src/models/modelsConfig.test.js +1242 -0
- package/core-dist/src/models/modelsConfig.test.js.map +1 -0
- package/core-dist/src/models/types.d.ts +114 -0
- package/core-dist/src/models/types.js +7 -0
- package/core-dist/src/models/types.js.map +1 -0
- package/core-dist/src/output/json-formatter.d.ts +11 -0
- package/core-dist/src/output/json-formatter.js +30 -0
- package/core-dist/src/output/json-formatter.js.map +1 -0
- package/core-dist/src/output/json-formatter.test.d.ts +6 -0
- package/core-dist/src/output/json-formatter.test.js +266 -0
- package/core-dist/src/output/json-formatter.test.js.map +1 -0
- package/core-dist/src/output/types.d.ts +25 -0
- package/core-dist/src/output/types.js +17 -0
- package/core-dist/src/output/types.js.map +1 -0
- package/core-dist/src/prompts/mcp-prompts.d.ts +8 -0
- package/core-dist/src/prompts/mcp-prompts.js +13 -0
- package/core-dist/src/prompts/mcp-prompts.js.map +1 -0
- package/core-dist/src/prompts/prompt-registry.d.ts +34 -0
- package/core-dist/src/prompts/prompt-registry.js +65 -0
- package/core-dist/src/prompts/prompt-registry.js.map +1 -0
- package/core-dist/src/qwen/qwenContentGenerator.d.ts +71 -0
- package/core-dist/src/qwen/qwenContentGenerator.js +182 -0
- package/core-dist/src/qwen/qwenContentGenerator.js.map +1 -0
- package/core-dist/src/qwen/qwenContentGenerator.test.d.ts +6 -0
- package/core-dist/src/qwen/qwenContentGenerator.test.js +1175 -0
- package/core-dist/src/qwen/qwenContentGenerator.test.js.map +1 -0
- package/core-dist/src/qwen/qwenOAuth2.d.ts +195 -0
- package/core-dist/src/qwen/qwenOAuth2.js +677 -0
- package/core-dist/src/qwen/qwenOAuth2.js.map +1 -0
- package/core-dist/src/qwen/qwenOAuth2.test.d.ts +6 -0
- package/core-dist/src/qwen/qwenOAuth2.test.js +1621 -0
- package/core-dist/src/qwen/qwenOAuth2.test.js.map +1 -0
- package/core-dist/src/qwen/sharedTokenManager.d.ts +196 -0
- package/core-dist/src/qwen/sharedTokenManager.js +649 -0
- package/core-dist/src/qwen/sharedTokenManager.js.map +1 -0
- package/core-dist/src/qwen/sharedTokenManager.test.d.ts +7 -0
- package/core-dist/src/qwen/sharedTokenManager.test.js +662 -0
- package/core-dist/src/qwen/sharedTokenManager.test.js.map +1 -0
- package/core-dist/src/services/chatCompressionService.d.ts +32 -0
- package/core-dist/src/services/chatCompressionService.js +213 -0
- package/core-dist/src/services/chatCompressionService.js.map +1 -0
- package/core-dist/src/services/chatCompressionService.test.d.ts +6 -0
- package/core-dist/src/services/chatCompressionService.test.js +343 -0
- package/core-dist/src/services/chatCompressionService.test.js.map +1 -0
- package/core-dist/src/services/chatRecordingService.d.ts +215 -0
- package/core-dist/src/services/chatRecordingService.js +285 -0
- package/core-dist/src/services/chatRecordingService.js.map +1 -0
- package/core-dist/src/services/chatRecordingService.test.d.ts +6 -0
- package/core-dist/src/services/chatRecordingService.test.js +299 -0
- package/core-dist/src/services/chatRecordingService.test.js.map +1 -0
- package/core-dist/src/services/fileDiscoveryService.d.ts +45 -0
- package/core-dist/src/services/fileDiscoveryService.js +104 -0
- package/core-dist/src/services/fileDiscoveryService.js.map +1 -0
- package/core-dist/src/services/fileDiscoveryService.test.d.ts +6 -0
- package/core-dist/src/services/fileDiscoveryService.test.js +143 -0
- package/core-dist/src/services/fileDiscoveryService.test.js.map +1 -0
- package/core-dist/src/services/fileSystemService.d.ts +88 -0
- package/core-dist/src/services/fileSystemService.js +131 -0
- package/core-dist/src/services/fileSystemService.js.map +1 -0
- package/core-dist/src/services/fileSystemService.test.d.ts +6 -0
- package/core-dist/src/services/fileSystemService.test.js +216 -0
- package/core-dist/src/services/fileSystemService.test.js.map +1 -0
- package/core-dist/src/services/gitService.d.ts +22 -0
- package/core-dist/src/services/gitService.js +98 -0
- package/core-dist/src/services/gitService.js.map +1 -0
- package/core-dist/src/services/gitService.test.d.ts +6 -0
- package/core-dist/src/services/gitService.test.js +187 -0
- package/core-dist/src/services/gitService.test.js.map +1 -0
- package/core-dist/src/services/loopDetectionService.d.ts +86 -0
- package/core-dist/src/services/loopDetectionService.js +239 -0
- package/core-dist/src/services/loopDetectionService.js.map +1 -0
- package/core-dist/src/services/loopDetectionService.test.d.ts +6 -0
- package/core-dist/src/services/loopDetectionService.test.js +478 -0
- package/core-dist/src/services/loopDetectionService.test.js.map +1 -0
- package/core-dist/src/services/sessionService.d.ts +200 -0
- package/core-dist/src/services/sessionService.js +527 -0
- package/core-dist/src/services/sessionService.js.map +1 -0
- package/core-dist/src/services/sessionService.test.d.ts +6 -0
- package/core-dist/src/services/sessionService.test.js +576 -0
- package/core-dist/src/services/sessionService.test.js.map +1 -0
- package/core-dist/src/services/shellExecutionService.d.ts +104 -0
- package/core-dist/src/services/shellExecutionService.js +626 -0
- package/core-dist/src/services/shellExecutionService.js.map +1 -0
- package/core-dist/src/services/shellExecutionService.test.d.ts +6 -0
- package/core-dist/src/services/shellExecutionService.test.js +684 -0
- package/core-dist/src/services/shellExecutionService.test.js.map +1 -0
- package/core-dist/src/skills/index.d.ts +19 -0
- package/core-dist/src/skills/index.js +9 -0
- package/core-dist/src/skills/index.js.map +1 -0
- package/core-dist/src/skills/skill-load.d.ts +4 -0
- package/core-dist/src/skills/skill-load.js +137 -0
- package/core-dist/src/skills/skill-load.js.map +1 -0
- package/core-dist/src/skills/skill-load.test.d.ts +6 -0
- package/core-dist/src/skills/skill-load.test.js +237 -0
- package/core-dist/src/skills/skill-load.test.js.map +1 -0
- package/core-dist/src/skills/skill-manager.d.ts +134 -0
- package/core-dist/src/skills/skill-manager.js +505 -0
- package/core-dist/src/skills/skill-manager.js.map +1 -0
- package/core-dist/src/skills/skill-manager.test.d.ts +6 -0
- package/core-dist/src/skills/skill-manager.test.js +527 -0
- package/core-dist/src/skills/skill-manager.test.js.map +1 -0
- package/core-dist/src/skills/types.d.ts +88 -0
- package/core-dist/src/skills/types.js +29 -0
- package/core-dist/src/skills/types.js.map +1 -0
- package/core-dist/src/subagents/builtin-agents.d.ts +35 -0
- package/core-dist/src/subagents/builtin-agents.js +85 -0
- package/core-dist/src/subagents/builtin-agents.js.map +1 -0
- package/core-dist/src/subagents/builtin-agents.test.d.ts +6 -0
- package/core-dist/src/subagents/builtin-agents.test.js +78 -0
- package/core-dist/src/subagents/builtin-agents.test.js.map +1 -0
- package/core-dist/src/subagents/index.d.ts +29 -0
- package/core-dist/src/subagents/index.js +15 -0
- package/core-dist/src/subagents/index.js.map +1 -0
- package/core-dist/src/subagents/subagent-events.d.ts +105 -0
- package/core-dist/src/subagents/subagent-events.js +32 -0
- package/core-dist/src/subagents/subagent-events.js.map +1 -0
- package/core-dist/src/subagents/subagent-hooks.d.ts +29 -0
- package/core-dist/src/subagents/subagent-hooks.js +7 -0
- package/core-dist/src/subagents/subagent-hooks.js.map +1 -0
- package/core-dist/src/subagents/subagent-manager.d.ts +178 -0
- package/core-dist/src/subagents/subagent-manager.js +711 -0
- package/core-dist/src/subagents/subagent-manager.js.map +1 -0
- package/core-dist/src/subagents/subagent-manager.test.d.ts +6 -0
- package/core-dist/src/subagents/subagent-manager.test.js +829 -0
- package/core-dist/src/subagents/subagent-manager.test.js.map +1 -0
- package/core-dist/src/subagents/subagent-statistics.d.ts +50 -0
- package/core-dist/src/subagents/subagent-statistics.js +210 -0
- package/core-dist/src/subagents/subagent-statistics.js.map +1 -0
- package/core-dist/src/subagents/subagent-statistics.test.d.ts +6 -0
- package/core-dist/src/subagents/subagent-statistics.test.js +238 -0
- package/core-dist/src/subagents/subagent-statistics.test.js.map +1 -0
- package/core-dist/src/subagents/subagent.d.ts +167 -0
- package/core-dist/src/subagents/subagent.js +758 -0
- package/core-dist/src/subagents/subagent.js.map +1 -0
- package/core-dist/src/subagents/subagent.test.d.ts +6 -0
- package/core-dist/src/subagents/subagent.test.js +819 -0
- package/core-dist/src/subagents/subagent.test.js.map +1 -0
- package/core-dist/src/subagents/types.d.ts +224 -0
- package/core-dist/src/subagents/types.js +58 -0
- package/core-dist/src/subagents/types.js.map +1 -0
- package/core-dist/src/subagents/types.test.d.ts +6 -0
- package/core-dist/src/subagents/types.test.js +31 -0
- package/core-dist/src/subagents/types.test.js.map +1 -0
- package/core-dist/src/subagents/validation.d.ts +63 -0
- package/core-dist/src/subagents/validation.js +293 -0
- package/core-dist/src/subagents/validation.js.map +1 -0
- package/core-dist/src/subagents/validation.test.d.ts +6 -0
- package/core-dist/src/subagents/validation.test.js +330 -0
- package/core-dist/src/subagents/validation.test.js.map +1 -0
- package/core-dist/src/telemetry/config.d.ts +31 -0
- package/core-dist/src/telemetry/config.js +74 -0
- package/core-dist/src/telemetry/config.js.map +1 -0
- package/core-dist/src/telemetry/config.test.d.ts +6 -0
- package/core-dist/src/telemetry/config.test.js +124 -0
- package/core-dist/src/telemetry/config.test.js.map +1 -0
- package/core-dist/src/telemetry/constants.d.ts +39 -0
- package/core-dist/src/telemetry/constants.js +41 -0
- package/core-dist/src/telemetry/constants.js.map +1 -0
- package/core-dist/src/telemetry/file-exporters.d.ts +29 -0
- package/core-dist/src/telemetry/file-exporters.js +62 -0
- package/core-dist/src/telemetry/file-exporters.js.map +1 -0
- package/core-dist/src/telemetry/index.d.ts +25 -0
- package/core-dist/src/telemetry/index.js +31 -0
- package/core-dist/src/telemetry/index.js.map +1 -0
- package/core-dist/src/telemetry/integration.test.circular.d.ts +6 -0
- package/core-dist/src/telemetry/integration.test.circular.js +95 -0
- package/core-dist/src/telemetry/integration.test.circular.js.map +1 -0
- package/core-dist/src/telemetry/loggers.d.ts +40 -0
- package/core-dist/src/telemetry/loggers.js +712 -0
- package/core-dist/src/telemetry/loggers.js.map +1 -0
- package/core-dist/src/telemetry/loggers.test.circular.d.ts +6 -0
- package/core-dist/src/telemetry/loggers.test.circular.js +107 -0
- package/core-dist/src/telemetry/loggers.test.circular.js.map +1 -0
- package/core-dist/src/telemetry/loggers.test.d.ts +6 -0
- package/core-dist/src/telemetry/loggers.test.js +961 -0
- package/core-dist/src/telemetry/loggers.test.js.map +1 -0
- package/core-dist/src/telemetry/metrics.d.ts +320 -0
- package/core-dist/src/telemetry/metrics.js +532 -0
- package/core-dist/src/telemetry/metrics.js.map +1 -0
- package/core-dist/src/telemetry/metrics.test.d.ts +6 -0
- package/core-dist/src/telemetry/metrics.test.js +746 -0
- package/core-dist/src/telemetry/metrics.test.js.map +1 -0
- package/core-dist/src/telemetry/qwen-logger/event-types.d.ts +89 -0
- package/core-dist/src/telemetry/qwen-logger/event-types.js +2 -0
- package/core-dist/src/telemetry/qwen-logger/event-types.js.map +1 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.d.ts +102 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.js +739 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.js.map +1 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.test.d.ts +6 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.test.js +380 -0
- package/core-dist/src/telemetry/qwen-logger/qwen-logger.test.js.map +1 -0
- package/core-dist/src/telemetry/sdk.d.ts +9 -0
- package/core-dist/src/telemetry/sdk.js +163 -0
- package/core-dist/src/telemetry/sdk.js.map +1 -0
- package/core-dist/src/telemetry/sdk.test.d.ts +6 -0
- package/core-dist/src/telemetry/sdk.test.js +116 -0
- package/core-dist/src/telemetry/sdk.test.js.map +1 -0
- package/core-dist/src/telemetry/telemetry-utils.d.ts +6 -0
- package/core-dist/src/telemetry/telemetry-utils.js +14 -0
- package/core-dist/src/telemetry/telemetry-utils.js.map +1 -0
- package/core-dist/src/telemetry/telemetry-utils.test.d.ts +6 -0
- package/core-dist/src/telemetry/telemetry-utils.test.js +40 -0
- package/core-dist/src/telemetry/telemetry-utils.test.js.map +1 -0
- package/core-dist/src/telemetry/telemetry.test.d.ts +6 -0
- package/core-dist/src/telemetry/telemetry.test.js +49 -0
- package/core-dist/src/telemetry/telemetry.test.js.map +1 -0
- package/core-dist/src/telemetry/tool-call-decision.d.ts +13 -0
- package/core-dist/src/telemetry/tool-call-decision.js +29 -0
- package/core-dist/src/telemetry/tool-call-decision.js.map +1 -0
- package/core-dist/src/telemetry/types.d.ts +363 -0
- package/core-dist/src/telemetry/types.js +635 -0
- package/core-dist/src/telemetry/types.js.map +1 -0
- package/core-dist/src/telemetry/uiTelemetry.d.ts +80 -0
- package/core-dist/src/telemetry/uiTelemetry.js +164 -0
- package/core-dist/src/telemetry/uiTelemetry.js.map +1 -0
- package/core-dist/src/telemetry/uiTelemetry.test.d.ts +6 -0
- package/core-dist/src/telemetry/uiTelemetry.test.js +625 -0
- package/core-dist/src/telemetry/uiTelemetry.test.js.map +1 -0
- package/core-dist/src/test-utils/config.d.ts +17 -0
- package/core-dist/src/test-utils/config.js +31 -0
- package/core-dist/src/test-utils/config.js.map +1 -0
- package/core-dist/src/test-utils/index.d.ts +6 -0
- package/core-dist/src/test-utils/index.js +7 -0
- package/core-dist/src/test-utils/index.js.map +1 -0
- package/core-dist/src/test-utils/mock-tool.d.ts +66 -0
- package/core-dist/src/test-utils/mock-tool.js +121 -0
- package/core-dist/src/test-utils/mock-tool.js.map +1 -0
- package/core-dist/src/test-utils/mockWorkspaceContext.d.ts +13 -0
- package/core-dist/src/test-utils/mockWorkspaceContext.js +24 -0
- package/core-dist/src/test-utils/mockWorkspaceContext.js.map +1 -0
- package/core-dist/src/tools/askUserQuestion.d.ts +41 -0
- package/core-dist/src/tools/askUserQuestion.js +247 -0
- package/core-dist/src/tools/askUserQuestion.js.map +1 -0
- package/core-dist/src/tools/askUserQuestion.test.d.ts +6 -0
- package/core-dist/src/tools/askUserQuestion.test.js +218 -0
- package/core-dist/src/tools/askUserQuestion.test.js.map +1 -0
- package/core-dist/src/tools/diffOptions.d.ts +9 -0
- package/core-dist/src/tools/diffOptions.js +46 -0
- package/core-dist/src/tools/diffOptions.js.map +1 -0
- package/core-dist/src/tools/diffOptions.test.d.ts +6 -0
- package/core-dist/src/tools/diffOptions.test.js +155 -0
- package/core-dist/src/tools/diffOptions.test.js.map +1 -0
- package/core-dist/src/tools/edit.d.ts +55 -0
- package/core-dist/src/tools/edit.js +446 -0
- package/core-dist/src/tools/edit.js.map +1 -0
- package/core-dist/src/tools/edit.test.d.ts +6 -0
- package/core-dist/src/tools/edit.test.js +742 -0
- package/core-dist/src/tools/edit.test.js.map +1 -0
- package/core-dist/src/tools/exitPlanMode.d.ts +28 -0
- package/core-dist/src/tools/exitPlanMode.js +144 -0
- package/core-dist/src/tools/exitPlanMode.js.map +1 -0
- package/core-dist/src/tools/exitPlanMode.test.d.ts +6 -0
- package/core-dist/src/tools/exitPlanMode.test.js +178 -0
- package/core-dist/src/tools/exitPlanMode.test.js.map +1 -0
- package/core-dist/src/tools/glob.d.ts +44 -0
- package/core-dist/src/tools/glob.js +195 -0
- package/core-dist/src/tools/glob.js.map +1 -0
- package/core-dist/src/tools/glob.test.d.ts +6 -0
- package/core-dist/src/tools/glob.test.js +481 -0
- package/core-dist/src/tools/glob.test.js.map +1 -0
- package/core-dist/src/tools/grep.d.ts +44 -0
- package/core-dist/src/tools/grep.js +427 -0
- package/core-dist/src/tools/grep.js.map +1 -0
- package/core-dist/src/tools/grep.test.d.ts +6 -0
- package/core-dist/src/tools/grep.test.js +360 -0
- package/core-dist/src/tools/grep.test.js.map +1 -0
- package/core-dist/src/tools/ls.d.ts +68 -0
- package/core-dist/src/tools/ls.js +221 -0
- package/core-dist/src/tools/ls.js.map +1 -0
- package/core-dist/src/tools/ls.test.d.ts +6 -0
- package/core-dist/src/tools/ls.test.js +246 -0
- package/core-dist/src/tools/ls.test.js.map +1 -0
- package/core-dist/src/tools/lsp.d.ts +66 -0
- package/core-dist/src/tools/lsp.js +894 -0
- package/core-dist/src/tools/lsp.js.map +1 -0
- package/core-dist/src/tools/lsp.test.d.ts +6 -0
- package/core-dist/src/tools/lsp.test.js +960 -0
- package/core-dist/src/tools/lsp.test.js.map +1 -0
- package/core-dist/src/tools/mcp-client-manager.d.ts +110 -0
- package/core-dist/src/tools/mcp-client-manager.js +381 -0
- package/core-dist/src/tools/mcp-client-manager.js.map +1 -0
- package/core-dist/src/tools/mcp-client-manager.test.d.ts +6 -0
- package/core-dist/src/tools/mcp-client-manager.test.js +207 -0
- package/core-dist/src/tools/mcp-client-manager.test.js.map +1 -0
- package/core-dist/src/tools/mcp-client.d.ts +199 -0
- package/core-dist/src/tools/mcp-client.js +1001 -0
- package/core-dist/src/tools/mcp-client.js.map +1 -0
- package/core-dist/src/tools/mcp-client.test.d.ts +6 -0
- package/core-dist/src/tools/mcp-client.test.js +307 -0
- package/core-dist/src/tools/mcp-client.test.js.map +1 -0
- package/core-dist/src/tools/mcp-tool.d.ts +69 -0
- package/core-dist/src/tools/mcp-tool.js +365 -0
- package/core-dist/src/tools/mcp-tool.js.map +1 -0
- package/core-dist/src/tools/mcp-tool.test.d.ts +6 -0
- package/core-dist/src/tools/mcp-tool.test.js +827 -0
- package/core-dist/src/tools/mcp-tool.test.js.map +1 -0
- package/core-dist/src/tools/memoryTool.d.ts +42 -0
- package/core-dist/src/tools/memoryTool.js +403 -0
- package/core-dist/src/tools/memoryTool.js.map +1 -0
- package/core-dist/src/tools/memoryTool.test.d.ts +6 -0
- package/core-dist/src/tools/memoryTool.test.js +416 -0
- package/core-dist/src/tools/memoryTool.test.js.map +1 -0
- package/core-dist/src/tools/modifiable-tool.d.ts +32 -0
- package/core-dist/src/tools/modifiable-tool.js +90 -0
- package/core-dist/src/tools/modifiable-tool.js.map +1 -0
- package/core-dist/src/tools/modifiable-tool.test.d.ts +6 -0
- package/core-dist/src/tools/modifiable-tool.test.js +188 -0
- package/core-dist/src/tools/modifiable-tool.test.js.map +1 -0
- package/core-dist/src/tools/read-file.d.ts +35 -0
- package/core-dist/src/tools/read-file.js +141 -0
- package/core-dist/src/tools/read-file.js.map +1 -0
- package/core-dist/src/tools/read-file.test.d.ts +6 -0
- package/core-dist/src/tools/read-file.test.js +333 -0
- package/core-dist/src/tools/read-file.test.js.map +1 -0
- package/core-dist/src/tools/ripGrep.d.ts +44 -0
- package/core-dist/src/tools/ripGrep.js +235 -0
- package/core-dist/src/tools/ripGrep.js.map +1 -0
- package/core-dist/src/tools/ripGrep.test.d.ts +6 -0
- package/core-dist/src/tools/ripGrep.test.js +529 -0
- package/core-dist/src/tools/ripGrep.test.js.map +1 -0
- package/core-dist/src/tools/sdk-control-client-transport.d.ts +67 -0
- package/core-dist/src/tools/sdk-control-client-transport.js +93 -0
- package/core-dist/src/tools/sdk-control-client-transport.js.map +1 -0
- package/core-dist/src/tools/shell.d.ts +34 -0
- package/core-dist/src/tools/shell.js +509 -0
- package/core-dist/src/tools/shell.js.map +1 -0
- package/core-dist/src/tools/shell.test.d.ts +6 -0
- package/core-dist/src/tools/shell.test.js +880 -0
- package/core-dist/src/tools/shell.test.js.map +1 -0
- package/core-dist/src/tools/skill.d.ts +45 -0
- package/core-dist/src/tools/skill.js +214 -0
- package/core-dist/src/tools/skill.js.map +1 -0
- package/core-dist/src/tools/skill.test.d.ts +6 -0
- package/core-dist/src/tools/skill.test.js +280 -0
- package/core-dist/src/tools/skill.test.js.map +1 -0
- package/core-dist/src/tools/task.d.ts +60 -0
- package/core-dist/src/tools/task.js +417 -0
- package/core-dist/src/tools/task.js.map +1 -0
- package/core-dist/src/tools/task.test.d.ts +6 -0
- package/core-dist/src/tools/task.test.js +367 -0
- package/core-dist/src/tools/task.test.js.map +1 -0
- package/core-dist/src/tools/todoWrite.d.ts +42 -0
- package/core-dist/src/tools/todoWrite.js +409 -0
- package/core-dist/src/tools/todoWrite.js.map +1 -0
- package/core-dist/src/tools/todoWrite.test.d.ts +6 -0
- package/core-dist/src/tools/todoWrite.test.js +234 -0
- package/core-dist/src/tools/todoWrite.test.js.map +1 -0
- package/core-dist/src/tools/tool-error.d.ts +45 -0
- package/core-dist/src/tools/tool-error.js +61 -0
- package/core-dist/src/tools/tool-error.js.map +1 -0
- package/core-dist/src/tools/tool-names.d.ts +60 -0
- package/core-dist/src/tools/tool-names.js +66 -0
- package/core-dist/src/tools/tool-names.js.map +1 -0
- package/core-dist/src/tools/tool-registry.d.ts +103 -0
- package/core-dist/src/tools/tool-registry.js +404 -0
- package/core-dist/src/tools/tool-registry.js.map +1 -0
- package/core-dist/src/tools/tool-registry.test.d.ts +6 -0
- package/core-dist/src/tools/tool-registry.test.js +331 -0
- package/core-dist/src/tools/tool-registry.test.js.map +1 -0
- package/core-dist/src/tools/tools.d.ts +364 -0
- package/core-dist/src/tools/tools.js +263 -0
- package/core-dist/src/tools/tools.js.map +1 -0
- package/core-dist/src/tools/tools.test.d.ts +6 -0
- package/core-dist/src/tools/tools.test.js +205 -0
- package/core-dist/src/tools/tools.test.js.map +1 -0
- package/core-dist/src/tools/web-fetch.d.ts +31 -0
- package/core-dist/src/tools/web-fetch.js +168 -0
- package/core-dist/src/tools/web-fetch.js.map +1 -0
- package/core-dist/src/tools/web-fetch.test.d.ts +6 -0
- package/core-dist/src/tools/web-fetch.test.js +134 -0
- package/core-dist/src/tools/web-fetch.test.js.map +1 -0
- package/core-dist/src/tools/web-search/base-provider.d.ts +31 -0
- package/core-dist/src/tools/web-search/base-provider.js +34 -0
- package/core-dist/src/tools/web-search/base-provider.js.map +1 -0
- package/core-dist/src/tools/web-search/index.d.ts +24 -0
- package/core-dist/src/tools/web-search/index.js +249 -0
- package/core-dist/src/tools/web-search/index.js.map +1 -0
- package/core-dist/src/tools/web-search/index.test.d.ts +6 -0
- package/core-dist/src/tools/web-search/index.test.js +237 -0
- package/core-dist/src/tools/web-search/index.test.js.map +1 -0
- package/core-dist/src/tools/web-search/providers/dashscope-provider.d.ts +23 -0
- package/core-dist/src/tools/web-search/providers/dashscope-provider.js +120 -0
- package/core-dist/src/tools/web-search/providers/dashscope-provider.js.map +1 -0
- package/core-dist/src/tools/web-search/providers/google-provider.d.ts +17 -0
- package/core-dist/src/tools/web-search/providers/google-provider.js +55 -0
- package/core-dist/src/tools/web-search/providers/google-provider.js.map +1 -0
- package/core-dist/src/tools/web-search/providers/tavily-provider.d.ts +17 -0
- package/core-dist/src/tools/web-search/providers/tavily-provider.js +54 -0
- package/core-dist/src/tools/web-search/providers/tavily-provider.js.map +1 -0
- package/core-dist/src/tools/web-search/types.d.ts +138 -0
- package/core-dist/src/tools/web-search/types.js +7 -0
- package/core-dist/src/tools/web-search/types.js.map +1 -0
- package/core-dist/src/tools/web-search/utils.d.ts +28 -0
- package/core-dist/src/tools/web-search/utils.js +35 -0
- package/core-dist/src/tools/web-search/utils.js.map +1 -0
- package/core-dist/src/tools/write-file.d.ts +52 -0
- package/core-dist/src/tools/write-file.js +316 -0
- package/core-dist/src/tools/write-file.js.map +1 -0
- package/core-dist/src/tools/write-file.test.d.ts +6 -0
- package/core-dist/src/tools/write-file.test.js +613 -0
- package/core-dist/src/tools/write-file.test.js.map +1 -0
- package/core-dist/src/utils/LruCache.d.ts +13 -0
- package/core-dist/src/utils/LruCache.js +38 -0
- package/core-dist/src/utils/LruCache.js.map +1 -0
- package/core-dist/src/utils/browser.d.ts +13 -0
- package/core-dist/src/utils/browser.js +50 -0
- package/core-dist/src/utils/browser.js.map +1 -0
- package/core-dist/src/utils/configResolver.d.ts +120 -0
- package/core-dist/src/utils/configResolver.js +125 -0
- package/core-dist/src/utils/configResolver.js.map +1 -0
- package/core-dist/src/utils/configResolver.test.d.ts +6 -0
- package/core-dist/src/utils/configResolver.test.js +99 -0
- package/core-dist/src/utils/configResolver.test.js.map +1 -0
- package/core-dist/src/utils/debugLogger.d.ts +46 -0
- package/core-dist/src/utils/debugLogger.js +159 -0
- package/core-dist/src/utils/debugLogger.js.map +1 -0
- package/core-dist/src/utils/debugLogger.test.d.ts +6 -0
- package/core-dist/src/utils/debugLogger.test.js +188 -0
- package/core-dist/src/utils/debugLogger.test.js.map +1 -0
- package/core-dist/src/utils/editHelper.d.ts +58 -0
- package/core-dist/src/utils/editHelper.js +342 -0
- package/core-dist/src/utils/editHelper.js.map +1 -0
- package/core-dist/src/utils/editHelper.test.d.ts +6 -0
- package/core-dist/src/utils/editHelper.test.js +127 -0
- package/core-dist/src/utils/editHelper.test.js.map +1 -0
- package/core-dist/src/utils/editor.d.ts +37 -0
- package/core-dist/src/utils/editor.js +179 -0
- package/core-dist/src/utils/editor.js.map +1 -0
- package/core-dist/src/utils/editor.test.d.ts +6 -0
- package/core-dist/src/utils/editor.test.js +434 -0
- package/core-dist/src/utils/editor.test.js.map +1 -0
- package/core-dist/src/utils/envVarResolver.d.ts +39 -0
- package/core-dist/src/utils/envVarResolver.js +100 -0
- package/core-dist/src/utils/envVarResolver.js.map +1 -0
- package/core-dist/src/utils/envVarResolver.test.d.ts +6 -0
- package/core-dist/src/utils/envVarResolver.test.js +221 -0
- package/core-dist/src/utils/envVarResolver.test.js.map +1 -0
- package/core-dist/src/utils/environmentContext.d.ts +21 -0
- package/core-dist/src/utils/environmentContext.js +73 -0
- package/core-dist/src/utils/environmentContext.js.map +1 -0
- package/core-dist/src/utils/environmentContext.test.d.ts +6 -0
- package/core-dist/src/utils/environmentContext.test.js +151 -0
- package/core-dist/src/utils/environmentContext.test.js.map +1 -0
- package/core-dist/src/utils/errorParsing.d.ts +7 -0
- package/core-dist/src/utils/errorParsing.js +72 -0
- package/core-dist/src/utils/errorParsing.js.map +1 -0
- package/core-dist/src/utils/errorParsing.test.d.ts +6 -0
- package/core-dist/src/utils/errorParsing.test.js +87 -0
- package/core-dist/src/utils/errorParsing.test.js.map +1 -0
- package/core-dist/src/utils/errorReporting.d.ts +14 -0
- package/core-dist/src/utils/errorReporting.js +56 -0
- package/core-dist/src/utils/errorReporting.js.map +1 -0
- package/core-dist/src/utils/errorReporting.test.d.ts +6 -0
- package/core-dist/src/utils/errorReporting.test.js +84 -0
- package/core-dist/src/utils/errorReporting.test.js.map +1 -0
- package/core-dist/src/utils/errors.d.ts +44 -0
- package/core-dist/src/utils/errors.js +114 -0
- package/core-dist/src/utils/errors.js.map +1 -0
- package/core-dist/src/utils/errors.test.d.ts +6 -0
- package/core-dist/src/utils/errors.test.js +70 -0
- package/core-dist/src/utils/errors.test.js.map +1 -0
- package/core-dist/src/utils/fetch.d.ts +14 -0
- package/core-dist/src/utils/fetch.js +152 -0
- package/core-dist/src/utils/fetch.js.map +1 -0
- package/core-dist/src/utils/fetch.test.d.ts +6 -0
- package/core-dist/src/utils/fetch.test.js +40 -0
- package/core-dist/src/utils/fetch.test.js.map +1 -0
- package/core-dist/src/utils/fileUtils.d.ts +102 -0
- package/core-dist/src/utils/fileUtils.js +584 -0
- package/core-dist/src/utils/fileUtils.js.map +1 -0
- package/core-dist/src/utils/fileUtils.test.d.ts +6 -0
- package/core-dist/src/utils/fileUtils.test.js +808 -0
- package/core-dist/src/utils/fileUtils.test.js.map +1 -0
- package/core-dist/src/utils/filesearch/crawlCache.d.ts +25 -0
- package/core-dist/src/utils/filesearch/crawlCache.js +57 -0
- package/core-dist/src/utils/filesearch/crawlCache.js.map +1 -0
- package/core-dist/src/utils/filesearch/crawlCache.test.d.ts +6 -0
- package/core-dist/src/utils/filesearch/crawlCache.test.js +103 -0
- package/core-dist/src/utils/filesearch/crawlCache.test.js.map +1 -0
- package/core-dist/src/utils/filesearch/crawler.d.ts +15 -0
- package/core-dist/src/utils/filesearch/crawler.js +50 -0
- package/core-dist/src/utils/filesearch/crawler.js.map +1 -0
- package/core-dist/src/utils/filesearch/crawler.test.d.ts +6 -0
- package/core-dist/src/utils/filesearch/crawler.test.js +468 -0
- package/core-dist/src/utils/filesearch/crawler.test.js.map +1 -0
- package/core-dist/src/utils/filesearch/fileSearch.d.ts +38 -0
- package/core-dist/src/utils/filesearch/fileSearch.js +194 -0
- package/core-dist/src/utils/filesearch/fileSearch.js.map +1 -0
- package/core-dist/src/utils/filesearch/fileSearch.test.d.ts +6 -0
- package/core-dist/src/utils/filesearch/fileSearch.test.js +642 -0
- package/core-dist/src/utils/filesearch/fileSearch.test.js.map +1 -0
- package/core-dist/src/utils/filesearch/ignore.d.ts +42 -0
- package/core-dist/src/utils/filesearch/ignore.js +106 -0
- package/core-dist/src/utils/filesearch/ignore.js.map +1 -0
- package/core-dist/src/utils/filesearch/ignore.test.d.ts +6 -0
- package/core-dist/src/utils/filesearch/ignore.test.js +144 -0
- package/core-dist/src/utils/filesearch/ignore.test.js.map +1 -0
- package/core-dist/src/utils/filesearch/result-cache.d.ts +33 -0
- package/core-dist/src/utils/filesearch/result-cache.js +59 -0
- package/core-dist/src/utils/filesearch/result-cache.js.map +1 -0
- package/core-dist/src/utils/filesearch/result-cache.test.d.ts +6 -0
- package/core-dist/src/utils/filesearch/result-cache.test.js +46 -0
- package/core-dist/src/utils/filesearch/result-cache.test.js.map +1 -0
- package/core-dist/src/utils/formatters.d.ts +6 -0
- package/core-dist/src/utils/formatters.js +16 -0
- package/core-dist/src/utils/formatters.js.map +1 -0
- package/core-dist/src/utils/generateContentResponseUtilities.d.ts +13 -0
- package/core-dist/src/utils/generateContentResponseUtilities.js +95 -0
- package/core-dist/src/utils/generateContentResponseUtilities.js.map +1 -0
- package/core-dist/src/utils/generateContentResponseUtilities.test.d.ts +6 -0
- package/core-dist/src/utils/generateContentResponseUtilities.test.js +235 -0
- package/core-dist/src/utils/generateContentResponseUtilities.test.js.map +1 -0
- package/core-dist/src/utils/getFolderStructure.d.ts +31 -0
- package/core-dist/src/utils/getFolderStructure.js +233 -0
- package/core-dist/src/utils/getFolderStructure.js.map +1 -0
- package/core-dist/src/utils/getFolderStructure.test.d.ts +6 -0
- package/core-dist/src/utils/getFolderStructure.test.js +282 -0
- package/core-dist/src/utils/getFolderStructure.test.js.map +1 -0
- package/core-dist/src/utils/getPty.d.ts +7 -0
- package/core-dist/src/utils/getPty.js +7 -0
- package/core-dist/src/utils/getPty.js.map +1 -0
- package/core-dist/src/utils/gitIgnoreParser.d.ts +16 -0
- package/core-dist/src/utils/gitIgnoreParser.js +152 -0
- package/core-dist/src/utils/gitIgnoreParser.js.map +1 -0
- package/core-dist/src/utils/gitIgnoreParser.test.d.ts +6 -0
- package/core-dist/src/utils/gitIgnoreParser.test.js +185 -0
- package/core-dist/src/utils/gitIgnoreParser.test.js.map +1 -0
- package/core-dist/src/utils/gitUtils.d.ts +21 -0
- package/core-dist/src/utils/gitUtils.js +78 -0
- package/core-dist/src/utils/gitUtils.js.map +1 -0
- package/core-dist/src/utils/iconvHelper.d.ts +33 -0
- package/core-dist/src/utils/iconvHelper.js +48 -0
- package/core-dist/src/utils/iconvHelper.js.map +1 -0
- package/core-dist/src/utils/ignorePatterns.d.ts +103 -0
- package/core-dist/src/utils/ignorePatterns.js +222 -0
- package/core-dist/src/utils/ignorePatterns.js.map +1 -0
- package/core-dist/src/utils/ignorePatterns.test.d.ts +6 -0
- package/core-dist/src/utils/ignorePatterns.test.js +255 -0
- package/core-dist/src/utils/ignorePatterns.test.js.map +1 -0
- package/core-dist/src/utils/installationManager.d.ts +16 -0
- package/core-dist/src/utils/installationManager.js +52 -0
- package/core-dist/src/utils/installationManager.js.map +1 -0
- package/core-dist/src/utils/installationManager.test.d.ts +6 -0
- package/core-dist/src/utils/installationManager.test.js +79 -0
- package/core-dist/src/utils/installationManager.test.js.map +1 -0
- package/core-dist/src/utils/jsonl-utils.d.ts +38 -0
- package/core-dist/src/utils/jsonl-utils.js +176 -0
- package/core-dist/src/utils/jsonl-utils.js.map +1 -0
- package/core-dist/src/utils/language-detection.d.ts +6 -0
- package/core-dist/src/utils/language-detection.js +101 -0
- package/core-dist/src/utils/language-detection.js.map +1 -0
- package/core-dist/src/utils/memoryDiscovery.d.ts +15 -0
- package/core-dist/src/utils/memoryDiscovery.js +238 -0
- package/core-dist/src/utils/memoryDiscovery.js.map +1 -0
- package/core-dist/src/utils/memoryDiscovery.test.d.ts +6 -0
- package/core-dist/src/utils/memoryDiscovery.test.js +212 -0
- package/core-dist/src/utils/memoryDiscovery.test.js.map +1 -0
- package/core-dist/src/utils/memoryImportProcessor.d.ts +41 -0
- package/core-dist/src/utils/memoryImportProcessor.js +296 -0
- package/core-dist/src/utils/memoryImportProcessor.js.map +1 -0
- package/core-dist/src/utils/memoryImportProcessor.test.d.ts +6 -0
- package/core-dist/src/utils/memoryImportProcessor.test.js +631 -0
- package/core-dist/src/utils/memoryImportProcessor.test.js.map +1 -0
- package/core-dist/src/utils/messageInspectors.d.ts +8 -0
- package/core-dist/src/utils/messageInspectors.js +16 -0
- package/core-dist/src/utils/messageInspectors.js.map +1 -0
- package/core-dist/src/utils/nextSpeakerChecker.d.ts +12 -0
- package/core-dist/src/utils/nextSpeakerChecker.js +99 -0
- package/core-dist/src/utils/nextSpeakerChecker.js.map +1 -0
- package/core-dist/src/utils/nextSpeakerChecker.test.d.ts +6 -0
- package/core-dist/src/utils/nextSpeakerChecker.test.js +183 -0
- package/core-dist/src/utils/nextSpeakerChecker.test.js.map +1 -0
- package/core-dist/src/utils/openaiLogger.d.ts +42 -0
- package/core-dist/src/utils/openaiLogger.js +140 -0
- package/core-dist/src/utils/openaiLogger.js.map +1 -0
- package/core-dist/src/utils/openaiLogger.test.d.ts +6 -0
- package/core-dist/src/utils/openaiLogger.test.js +314 -0
- package/core-dist/src/utils/openaiLogger.test.js.map +1 -0
- package/core-dist/src/utils/partUtils.d.ts +35 -0
- package/core-dist/src/utils/partUtils.js +133 -0
- package/core-dist/src/utils/partUtils.js.map +1 -0
- package/core-dist/src/utils/partUtils.test.d.ts +6 -0
- package/core-dist/src/utils/partUtils.test.js +241 -0
- package/core-dist/src/utils/partUtils.test.js.map +1 -0
- package/core-dist/src/utils/pathReader.d.ts +17 -0
- package/core-dist/src/utils/pathReader.js +92 -0
- package/core-dist/src/utils/pathReader.js.map +1 -0
- package/core-dist/src/utils/pathReader.test.d.ts +6 -0
- package/core-dist/src/utils/pathReader.test.js +367 -0
- package/core-dist/src/utils/pathReader.test.js.map +1 -0
- package/core-dist/src/utils/paths.d.ts +110 -0
- package/core-dist/src/utils/paths.js +269 -0
- package/core-dist/src/utils/paths.js.map +1 -0
- package/core-dist/src/utils/paths.test.d.ts +6 -0
- package/core-dist/src/utils/paths.test.js +633 -0
- package/core-dist/src/utils/paths.test.js.map +1 -0
- package/core-dist/src/utils/projectSummary.d.ts +22 -0
- package/core-dist/src/utils/projectSummary.js +86 -0
- package/core-dist/src/utils/projectSummary.js.map +1 -0
- package/core-dist/src/utils/promptIdContext.d.ts +7 -0
- package/core-dist/src/utils/promptIdContext.js +8 -0
- package/core-dist/src/utils/promptIdContext.js.map +1 -0
- package/core-dist/src/utils/quotaErrorDetection.d.ts +19 -0
- package/core-dist/src/utils/quotaErrorDetection.js +84 -0
- package/core-dist/src/utils/quotaErrorDetection.js.map +1 -0
- package/core-dist/src/utils/quotaErrorDetection.test.d.ts +6 -0
- package/core-dist/src/utils/quotaErrorDetection.test.js +104 -0
- package/core-dist/src/utils/quotaErrorDetection.test.js.map +1 -0
- package/core-dist/src/utils/qwenIgnoreParser.d.ts +18 -0
- package/core-dist/src/utils/qwenIgnoreParser.js +61 -0
- package/core-dist/src/utils/qwenIgnoreParser.js.map +1 -0
- package/core-dist/src/utils/qwenIgnoreParser.test.d.ts +6 -0
- package/core-dist/src/utils/qwenIgnoreParser.test.js +50 -0
- package/core-dist/src/utils/qwenIgnoreParser.test.js.map +1 -0
- package/core-dist/src/utils/rateLimit.d.ts +23 -0
- package/core-dist/src/utils/rateLimit.js +69 -0
- package/core-dist/src/utils/rateLimit.js.map +1 -0
- package/core-dist/src/utils/rateLimit.test.d.ts +6 -0
- package/core-dist/src/utils/rateLimit.test.js +72 -0
- package/core-dist/src/utils/rateLimit.test.js.map +1 -0
- package/core-dist/src/utils/readManyFiles.d.ts +67 -0
- package/core-dist/src/utils/readManyFiles.js +133 -0
- package/core-dist/src/utils/readManyFiles.js.map +1 -0
- package/core-dist/src/utils/readManyFiles.test.d.ts +6 -0
- package/core-dist/src/utils/readManyFiles.test.js +230 -0
- package/core-dist/src/utils/readManyFiles.test.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.d.ts +112 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.js +403 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.test.d.ts +6 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.test.js +114 -0
- package/core-dist/src/utils/request-tokenizer/imageTokenizer.test.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/index.d.ts +9 -0
- package/core-dist/src/utils/request-tokenizer/index.js +9 -0
- package/core-dist/src/utils/request-tokenizer/index.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.d.ts +52 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.js +252 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.test.d.ts +6 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.test.js +227 -0
- package/core-dist/src/utils/request-tokenizer/requestTokenizer.test.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/supportedImageFormats.d.ts +30 -0
- package/core-dist/src/utils/request-tokenizer/supportedImageFormats.js +41 -0
- package/core-dist/src/utils/request-tokenizer/supportedImageFormats.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.d.ts +32 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.js +54 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.test.d.ts +6 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.test.js +237 -0
- package/core-dist/src/utils/request-tokenizer/textTokenizer.test.js.map +1 -0
- package/core-dist/src/utils/request-tokenizer/types.d.ts +34 -0
- package/core-dist/src/utils/request-tokenizer/types.js +7 -0
- package/core-dist/src/utils/request-tokenizer/types.js.map +1 -0
- package/core-dist/src/utils/retry.d.ts +38 -0
- package/core-dist/src/utils/retry.js +180 -0
- package/core-dist/src/utils/retry.js.map +1 -0
- package/core-dist/src/utils/retry.test.d.ts +6 -0
- package/core-dist/src/utils/retry.test.js +402 -0
- package/core-dist/src/utils/retry.test.js.map +1 -0
- package/core-dist/src/utils/ripgrepUtils.d.ts +61 -0
- package/core-dist/src/utils/ripgrepUtils.js +227 -0
- package/core-dist/src/utils/ripgrepUtils.js.map +1 -0
- package/core-dist/src/utils/ripgrepUtils.test.d.ts +6 -0
- package/core-dist/src/utils/ripgrepUtils.test.js +101 -0
- package/core-dist/src/utils/ripgrepUtils.test.js.map +1 -0
- package/core-dist/src/utils/runtimeFetchOptions.d.ts +44 -0
- package/core-dist/src/utils/runtimeFetchOptions.js +92 -0
- package/core-dist/src/utils/runtimeFetchOptions.js.map +1 -0
- package/core-dist/src/utils/runtimeFetchOptions.test.d.ts +6 -0
- package/core-dist/src/utils/runtimeFetchOptions.test.js +70 -0
- package/core-dist/src/utils/runtimeFetchOptions.test.js.map +1 -0
- package/core-dist/src/utils/safeJsonParse.d.ts +15 -0
- package/core-dist/src/utils/safeJsonParse.js +43 -0
- package/core-dist/src/utils/safeJsonParse.js.map +1 -0
- package/core-dist/src/utils/safeJsonParse.test.d.ts +6 -0
- package/core-dist/src/utils/safeJsonParse.test.js +112 -0
- package/core-dist/src/utils/safeJsonParse.test.js.map +1 -0
- package/core-dist/src/utils/safeJsonStringify.d.ts +13 -0
- package/core-dist/src/utils/safeJsonStringify.js +25 -0
- package/core-dist/src/utils/safeJsonStringify.js.map +1 -0
- package/core-dist/src/utils/safeJsonStringify.test.d.ts +6 -0
- package/core-dist/src/utils/safeJsonStringify.test.js +61 -0
- package/core-dist/src/utils/safeJsonStringify.test.js.map +1 -0
- package/core-dist/src/utils/schemaConverter.d.ts +15 -0
- package/core-dist/src/utils/schemaConverter.js +109 -0
- package/core-dist/src/utils/schemaConverter.js.map +1 -0
- package/core-dist/src/utils/schemaConverter.test.d.ts +6 -0
- package/core-dist/src/utils/schemaConverter.test.js +106 -0
- package/core-dist/src/utils/schemaConverter.test.js.map +1 -0
- package/core-dist/src/utils/schemaValidator.d.ts +16 -0
- package/core-dist/src/utils/schemaValidator.js +123 -0
- package/core-dist/src/utils/schemaValidator.js.map +1 -0
- package/core-dist/src/utils/schemaValidator.test.d.ts +6 -0
- package/core-dist/src/utils/schemaValidator.test.js +266 -0
- package/core-dist/src/utils/schemaValidator.test.js.map +1 -0
- package/core-dist/src/utils/secure-browser-launcher.d.ts +23 -0
- package/core-dist/src/utils/secure-browser-launcher.js +165 -0
- package/core-dist/src/utils/secure-browser-launcher.js.map +1 -0
- package/core-dist/src/utils/secure-browser-launcher.test.d.ts +6 -0
- package/core-dist/src/utils/secure-browser-launcher.test.js +149 -0
- package/core-dist/src/utils/secure-browser-launcher.test.js.map +1 -0
- package/core-dist/src/utils/shell-utils.d.ts +158 -0
- package/core-dist/src/utils/shell-utils.js +739 -0
- package/core-dist/src/utils/shell-utils.js.map +1 -0
- package/core-dist/src/utils/shell-utils.test.d.ts +6 -0
- package/core-dist/src/utils/shell-utils.test.js +466 -0
- package/core-dist/src/utils/shell-utils.test.js.map +1 -0
- package/core-dist/src/utils/shellReadOnlyChecker.d.ts +6 -0
- package/core-dist/src/utils/shellReadOnlyChecker.js +290 -0
- package/core-dist/src/utils/shellReadOnlyChecker.js.map +1 -0
- package/core-dist/src/utils/shellReadOnlyChecker.test.d.ts +6 -0
- package/core-dist/src/utils/shellReadOnlyChecker.test.js +157 -0
- package/core-dist/src/utils/shellReadOnlyChecker.test.js.map +1 -0
- package/core-dist/src/utils/subagentGenerator.d.ts +20 -0
- package/core-dist/src/utils/subagentGenerator.js +120 -0
- package/core-dist/src/utils/subagentGenerator.js.map +1 -0
- package/core-dist/src/utils/subagentGenerator.test.d.ts +6 -0
- package/core-dist/src/utils/subagentGenerator.test.js +135 -0
- package/core-dist/src/utils/subagentGenerator.test.js.map +1 -0
- package/core-dist/src/utils/summarizer.d.ts +25 -0
- package/core-dist/src/utils/summarizer.js +53 -0
- package/core-dist/src/utils/summarizer.js.map +1 -0
- package/core-dist/src/utils/summarizer.test.d.ts +6 -0
- package/core-dist/src/utils/summarizer.test.js +128 -0
- package/core-dist/src/utils/summarizer.test.js.map +1 -0
- package/core-dist/src/utils/symlink.d.ts +26 -0
- package/core-dist/src/utils/symlink.js +43 -0
- package/core-dist/src/utils/symlink.js.map +1 -0
- package/core-dist/src/utils/systemEncoding.d.ts +40 -0
- package/core-dist/src/utils/systemEncoding.js +160 -0
- package/core-dist/src/utils/systemEncoding.js.map +1 -0
- package/core-dist/src/utils/systemEncoding.test.d.ts +6 -0
- package/core-dist/src/utils/systemEncoding.test.js +367 -0
- package/core-dist/src/utils/systemEncoding.test.js.map +1 -0
- package/core-dist/src/utils/terminalSerializer.d.ts +25 -0
- package/core-dist/src/utils/terminalSerializer.js +432 -0
- package/core-dist/src/utils/terminalSerializer.js.map +1 -0
- package/core-dist/src/utils/terminalSerializer.test.d.ts +6 -0
- package/core-dist/src/utils/terminalSerializer.test.js +176 -0
- package/core-dist/src/utils/terminalSerializer.test.js.map +1 -0
- package/core-dist/src/utils/testUtils.d.ts +29 -0
- package/core-dist/src/utils/testUtils.js +70 -0
- package/core-dist/src/utils/testUtils.js.map +1 -0
- package/core-dist/src/utils/textUtils.d.ts +29 -0
- package/core-dist/src/utils/textUtils.js +59 -0
- package/core-dist/src/utils/textUtils.js.map +1 -0
- package/core-dist/src/utils/textUtils.test.d.ts +6 -0
- package/core-dist/src/utils/textUtils.test.js +91 -0
- package/core-dist/src/utils/textUtils.test.js.map +1 -0
- package/core-dist/src/utils/thoughtUtils.d.ts +23 -0
- package/core-dist/src/utils/thoughtUtils.js +53 -0
- package/core-dist/src/utils/thoughtUtils.js.map +1 -0
- package/core-dist/src/utils/thoughtUtils.test.d.ts +6 -0
- package/core-dist/src/utils/thoughtUtils.test.js +78 -0
- package/core-dist/src/utils/thoughtUtils.test.js.map +1 -0
- package/core-dist/src/utils/toml-to-markdown-converter.d.ts +22 -0
- package/core-dist/src/utils/toml-to-markdown-converter.js +61 -0
- package/core-dist/src/utils/toml-to-markdown-converter.js.map +1 -0
- package/core-dist/src/utils/toml-to-markdown-converter.test.d.ts +6 -0
- package/core-dist/src/utils/toml-to-markdown-converter.test.js +73 -0
- package/core-dist/src/utils/toml-to-markdown-converter.test.js.map +1 -0
- package/core-dist/src/utils/tool-utils.d.ts +22 -0
- package/core-dist/src/utils/tool-utils.js +121 -0
- package/core-dist/src/utils/tool-utils.js.map +1 -0
- package/core-dist/src/utils/tool-utils.test.d.ts +6 -0
- package/core-dist/src/utils/tool-utils.test.js +100 -0
- package/core-dist/src/utils/tool-utils.test.js.map +1 -0
- package/core-dist/src/utils/workspaceContext.d.ts +66 -0
- package/core-dist/src/utils/workspaceContext.js +173 -0
- package/core-dist/src/utils/workspaceContext.js.map +1 -0
- package/core-dist/src/utils/workspaceContext.test.d.ts +6 -0
- package/core-dist/src/utils/workspaceContext.test.js +313 -0
- package/core-dist/src/utils/workspaceContext.test.js.map +1 -0
- package/core-dist/src/utils/yaml-parser.d.ts +29 -0
- package/core-dist/src/utils/yaml-parser.js +172 -0
- package/core-dist/src/utils/yaml-parser.js.map +1 -0
- package/core-dist/src/utils/yaml-parser.test.d.ts +6 -0
- package/core-dist/src/utils/yaml-parser.test.js +170 -0
- package/core-dist/src/utils/yaml-parser.test.js.map +1 -0
- package/core-dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -1
- package/scripts/postinstall.cjs +102 -203
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { IDE_MAX_OPEN_FILES, IDE_MAX_SELECTED_TEXT_LENGTH, } from './constants.js';
|
|
7
|
+
import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
|
|
8
|
+
import { IdeContextStore } from './ideContext.js';
|
|
9
|
+
import { FileSchema, IdeContextSchema, } from './types.js';
|
|
10
|
+
describe('ideContext', () => {
|
|
11
|
+
describe('createIdeContextStore', () => {
|
|
12
|
+
let ideContextStore;
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
// Create a fresh, isolated instance for each test
|
|
15
|
+
ideContextStore = new IdeContextStore();
|
|
16
|
+
});
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
vi.restoreAllMocks();
|
|
19
|
+
});
|
|
20
|
+
it('should return undefined initially for ide context', () => {
|
|
21
|
+
expect(ideContextStore.get()).toBeUndefined();
|
|
22
|
+
});
|
|
23
|
+
it('should set and retrieve the ide context', () => {
|
|
24
|
+
const testFile = {
|
|
25
|
+
workspaceState: {
|
|
26
|
+
openFiles: [
|
|
27
|
+
{
|
|
28
|
+
path: '/path/to/test/file.ts',
|
|
29
|
+
isActive: true,
|
|
30
|
+
selectedText: '1234',
|
|
31
|
+
timestamp: 0,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
ideContextStore.set(testFile);
|
|
37
|
+
const activeFile = ideContextStore.get();
|
|
38
|
+
expect(activeFile).toEqual(testFile);
|
|
39
|
+
});
|
|
40
|
+
it('should update the ide context when called multiple times', () => {
|
|
41
|
+
const firstFile = {
|
|
42
|
+
workspaceState: {
|
|
43
|
+
openFiles: [
|
|
44
|
+
{
|
|
45
|
+
path: '/path/to/first.js',
|
|
46
|
+
isActive: true,
|
|
47
|
+
selectedText: '1234',
|
|
48
|
+
timestamp: 0,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
ideContextStore.set(firstFile);
|
|
54
|
+
const secondFile = {
|
|
55
|
+
workspaceState: {
|
|
56
|
+
openFiles: [
|
|
57
|
+
{
|
|
58
|
+
path: '/path/to/second.py',
|
|
59
|
+
isActive: true,
|
|
60
|
+
cursor: { line: 20, character: 30 },
|
|
61
|
+
timestamp: 0,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
ideContextStore.set(secondFile);
|
|
67
|
+
const activeFile = ideContextStore.get();
|
|
68
|
+
expect(activeFile).toEqual(secondFile);
|
|
69
|
+
});
|
|
70
|
+
it('should handle empty string for file path', () => {
|
|
71
|
+
const testFile = {
|
|
72
|
+
workspaceState: {
|
|
73
|
+
openFiles: [
|
|
74
|
+
{
|
|
75
|
+
path: '',
|
|
76
|
+
isActive: true,
|
|
77
|
+
selectedText: '1234',
|
|
78
|
+
timestamp: 0,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
ideContextStore.set(testFile);
|
|
84
|
+
expect(ideContextStore.get()).toEqual(testFile);
|
|
85
|
+
});
|
|
86
|
+
it('should notify subscribers when ide context changes', () => {
|
|
87
|
+
const subscriber1 = vi.fn();
|
|
88
|
+
const subscriber2 = vi.fn();
|
|
89
|
+
ideContextStore.subscribe(subscriber1);
|
|
90
|
+
ideContextStore.subscribe(subscriber2);
|
|
91
|
+
const testFile = {
|
|
92
|
+
workspaceState: {
|
|
93
|
+
openFiles: [
|
|
94
|
+
{
|
|
95
|
+
path: '/path/to/subscribed.ts',
|
|
96
|
+
isActive: true,
|
|
97
|
+
cursor: { line: 15, character: 25 },
|
|
98
|
+
timestamp: 0,
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
ideContextStore.set(testFile);
|
|
104
|
+
expect(subscriber1).toHaveBeenCalledTimes(1);
|
|
105
|
+
expect(subscriber1).toHaveBeenCalledWith(testFile);
|
|
106
|
+
expect(subscriber2).toHaveBeenCalledTimes(1);
|
|
107
|
+
expect(subscriber2).toHaveBeenCalledWith(testFile);
|
|
108
|
+
// Test with another update
|
|
109
|
+
const newFile = {
|
|
110
|
+
workspaceState: {
|
|
111
|
+
openFiles: [
|
|
112
|
+
{
|
|
113
|
+
path: '/path/to/new.js',
|
|
114
|
+
isActive: true,
|
|
115
|
+
selectedText: '1234',
|
|
116
|
+
timestamp: 0,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
ideContextStore.set(newFile);
|
|
122
|
+
expect(subscriber1).toHaveBeenCalledTimes(2);
|
|
123
|
+
expect(subscriber1).toHaveBeenCalledWith(newFile);
|
|
124
|
+
expect(subscriber2).toHaveBeenCalledTimes(2);
|
|
125
|
+
expect(subscriber2).toHaveBeenCalledWith(newFile);
|
|
126
|
+
});
|
|
127
|
+
it('should stop notifying a subscriber after unsubscribe', () => {
|
|
128
|
+
const subscriber1 = vi.fn();
|
|
129
|
+
const subscriber2 = vi.fn();
|
|
130
|
+
const unsubscribe1 = ideContextStore.subscribe(subscriber1);
|
|
131
|
+
ideContextStore.subscribe(subscriber2);
|
|
132
|
+
ideContextStore.set({
|
|
133
|
+
workspaceState: {
|
|
134
|
+
openFiles: [
|
|
135
|
+
{
|
|
136
|
+
path: '/path/to/file1.txt',
|
|
137
|
+
isActive: true,
|
|
138
|
+
selectedText: '1234',
|
|
139
|
+
timestamp: 0,
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
expect(subscriber1).toHaveBeenCalledTimes(1);
|
|
145
|
+
expect(subscriber2).toHaveBeenCalledTimes(1);
|
|
146
|
+
unsubscribe1();
|
|
147
|
+
ideContextStore.set({
|
|
148
|
+
workspaceState: {
|
|
149
|
+
openFiles: [
|
|
150
|
+
{
|
|
151
|
+
path: '/path/to/file2.txt',
|
|
152
|
+
isActive: true,
|
|
153
|
+
selectedText: '1234',
|
|
154
|
+
timestamp: 0,
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
expect(subscriber1).toHaveBeenCalledTimes(1); // Should not be called again
|
|
160
|
+
expect(subscriber2).toHaveBeenCalledTimes(2);
|
|
161
|
+
});
|
|
162
|
+
it('should clear the ide context', () => {
|
|
163
|
+
const testFile = {
|
|
164
|
+
workspaceState: {
|
|
165
|
+
openFiles: [
|
|
166
|
+
{
|
|
167
|
+
path: '/path/to/test/file.ts',
|
|
168
|
+
isActive: true,
|
|
169
|
+
selectedText: '1234',
|
|
170
|
+
timestamp: 0,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
ideContextStore.set(testFile);
|
|
176
|
+
expect(ideContextStore.get()).toEqual(testFile);
|
|
177
|
+
ideContextStore.clear();
|
|
178
|
+
expect(ideContextStore.get()).toBeUndefined();
|
|
179
|
+
});
|
|
180
|
+
it('should set the context and notify subscribers when no workspaceState is present', () => {
|
|
181
|
+
const subscriber = vi.fn();
|
|
182
|
+
ideContextStore.subscribe(subscriber);
|
|
183
|
+
const context = {};
|
|
184
|
+
ideContextStore.set(context);
|
|
185
|
+
expect(ideContextStore.get()).toBe(context);
|
|
186
|
+
expect(subscriber).toHaveBeenCalledWith(context);
|
|
187
|
+
});
|
|
188
|
+
it('should handle an empty openFiles array', () => {
|
|
189
|
+
const context = {
|
|
190
|
+
workspaceState: {
|
|
191
|
+
openFiles: [],
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
ideContextStore.set(context);
|
|
195
|
+
expect(ideContextStore.get()?.workspaceState?.openFiles).toEqual([]);
|
|
196
|
+
});
|
|
197
|
+
it('should sort openFiles by timestamp in descending order', () => {
|
|
198
|
+
const context = {
|
|
199
|
+
workspaceState: {
|
|
200
|
+
openFiles: [
|
|
201
|
+
{ path: 'file1.ts', timestamp: 100, isActive: false },
|
|
202
|
+
{ path: 'file2.ts', timestamp: 300, isActive: true },
|
|
203
|
+
{ path: 'file3.ts', timestamp: 200, isActive: false },
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
ideContextStore.set(context);
|
|
208
|
+
const openFiles = ideContextStore.get()?.workspaceState?.openFiles;
|
|
209
|
+
expect(openFiles?.[0]?.path).toBe('file2.ts');
|
|
210
|
+
expect(openFiles?.[1]?.path).toBe('file3.ts');
|
|
211
|
+
expect(openFiles?.[2]?.path).toBe('file1.ts');
|
|
212
|
+
});
|
|
213
|
+
it('should mark only the most recent file as active and clear other active files', () => {
|
|
214
|
+
const context = {
|
|
215
|
+
workspaceState: {
|
|
216
|
+
openFiles: [
|
|
217
|
+
{
|
|
218
|
+
path: 'file1.ts',
|
|
219
|
+
timestamp: 100,
|
|
220
|
+
isActive: true,
|
|
221
|
+
selectedText: 'hello',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
path: 'file2.ts',
|
|
225
|
+
timestamp: 300,
|
|
226
|
+
isActive: true,
|
|
227
|
+
cursor: { line: 1, character: 1 },
|
|
228
|
+
selectedText: 'hello',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
path: 'file3.ts',
|
|
232
|
+
timestamp: 200,
|
|
233
|
+
isActive: false,
|
|
234
|
+
selectedText: 'hello',
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
ideContextStore.set(context);
|
|
240
|
+
const openFiles = ideContextStore.get()?.workspaceState?.openFiles;
|
|
241
|
+
expect(openFiles?.[0]?.isActive).toBe(true);
|
|
242
|
+
expect(openFiles?.[0]?.cursor).toBeDefined();
|
|
243
|
+
expect(openFiles?.[0]?.selectedText).toBeDefined();
|
|
244
|
+
expect(openFiles?.[1]?.isActive).toBe(false);
|
|
245
|
+
expect(openFiles?.[1]?.cursor).toBeUndefined();
|
|
246
|
+
expect(openFiles?.[1]?.selectedText).toBeUndefined();
|
|
247
|
+
expect(openFiles?.[2]?.isActive).toBe(false);
|
|
248
|
+
expect(openFiles?.[2]?.cursor).toBeUndefined();
|
|
249
|
+
expect(openFiles?.[2]?.selectedText).toBeUndefined();
|
|
250
|
+
});
|
|
251
|
+
it('should truncate selectedText if it exceeds the max length', () => {
|
|
252
|
+
const longText = 'a'.repeat(IDE_MAX_SELECTED_TEXT_LENGTH + 10);
|
|
253
|
+
const context = {
|
|
254
|
+
workspaceState: {
|
|
255
|
+
openFiles: [
|
|
256
|
+
{
|
|
257
|
+
path: 'file1.ts',
|
|
258
|
+
timestamp: 100,
|
|
259
|
+
isActive: true,
|
|
260
|
+
selectedText: longText,
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
ideContextStore.set(context);
|
|
266
|
+
const selectedText = ideContextStore.get()?.workspaceState?.openFiles?.[0]?.selectedText;
|
|
267
|
+
expect(selectedText).toHaveLength(IDE_MAX_SELECTED_TEXT_LENGTH + '... [TRUNCATED]'.length);
|
|
268
|
+
expect(selectedText?.endsWith('... [TRUNCATED]')).toBe(true);
|
|
269
|
+
});
|
|
270
|
+
it('should not truncate selectedText if it is within the max length', () => {
|
|
271
|
+
const shortText = 'a'.repeat(IDE_MAX_SELECTED_TEXT_LENGTH);
|
|
272
|
+
const context = {
|
|
273
|
+
workspaceState: {
|
|
274
|
+
openFiles: [
|
|
275
|
+
{
|
|
276
|
+
path: 'file1.ts',
|
|
277
|
+
timestamp: 100,
|
|
278
|
+
isActive: true,
|
|
279
|
+
selectedText: shortText,
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
},
|
|
283
|
+
};
|
|
284
|
+
ideContextStore.set(context);
|
|
285
|
+
const selectedText = ideContextStore.get()?.workspaceState?.openFiles?.[0]?.selectedText;
|
|
286
|
+
expect(selectedText).toBe(shortText);
|
|
287
|
+
});
|
|
288
|
+
it('should truncate the openFiles list if it exceeds the max length', () => {
|
|
289
|
+
const files = Array.from({ length: IDE_MAX_OPEN_FILES + 5 }, (_, i) => ({
|
|
290
|
+
path: `file${i}.ts`,
|
|
291
|
+
timestamp: i,
|
|
292
|
+
isActive: false,
|
|
293
|
+
}));
|
|
294
|
+
const context = {
|
|
295
|
+
workspaceState: {
|
|
296
|
+
openFiles: files,
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
ideContextStore.set(context);
|
|
300
|
+
const openFiles = ideContextStore.get()?.workspaceState?.openFiles;
|
|
301
|
+
expect(openFiles).toHaveLength(IDE_MAX_OPEN_FILES);
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
describe('FileSchema', () => {
|
|
305
|
+
it('should validate a file with only required fields', () => {
|
|
306
|
+
const file = {
|
|
307
|
+
path: '/path/to/file.ts',
|
|
308
|
+
timestamp: 12345,
|
|
309
|
+
};
|
|
310
|
+
const result = FileSchema.safeParse(file);
|
|
311
|
+
expect(result.success).toBe(true);
|
|
312
|
+
});
|
|
313
|
+
it('should validate a file with all fields', () => {
|
|
314
|
+
const file = {
|
|
315
|
+
path: '/path/to/file.ts',
|
|
316
|
+
timestamp: 12345,
|
|
317
|
+
isActive: true,
|
|
318
|
+
selectedText: 'const x = 1;',
|
|
319
|
+
cursor: {
|
|
320
|
+
line: 10,
|
|
321
|
+
character: 20,
|
|
322
|
+
},
|
|
323
|
+
};
|
|
324
|
+
const result = FileSchema.safeParse(file);
|
|
325
|
+
expect(result.success).toBe(true);
|
|
326
|
+
});
|
|
327
|
+
it('should fail validation if path is missing', () => {
|
|
328
|
+
const file = {
|
|
329
|
+
timestamp: 12345,
|
|
330
|
+
};
|
|
331
|
+
const result = FileSchema.safeParse(file);
|
|
332
|
+
expect(result.success).toBe(false);
|
|
333
|
+
});
|
|
334
|
+
it('should fail validation if timestamp is missing', () => {
|
|
335
|
+
const file = {
|
|
336
|
+
path: '/path/to/file.ts',
|
|
337
|
+
};
|
|
338
|
+
const result = FileSchema.safeParse(file);
|
|
339
|
+
expect(result.success).toBe(false);
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
describe('IdeContextSchema', () => {
|
|
343
|
+
it('should validate an empty context', () => {
|
|
344
|
+
const context = {};
|
|
345
|
+
const result = IdeContextSchema.safeParse(context);
|
|
346
|
+
expect(result.success).toBe(true);
|
|
347
|
+
});
|
|
348
|
+
it('should validate a context with an empty workspaceState', () => {
|
|
349
|
+
const context = {
|
|
350
|
+
workspaceState: {},
|
|
351
|
+
};
|
|
352
|
+
const result = IdeContextSchema.safeParse(context);
|
|
353
|
+
expect(result.success).toBe(true);
|
|
354
|
+
});
|
|
355
|
+
it('should validate a context with an empty openFiles array', () => {
|
|
356
|
+
const context = {
|
|
357
|
+
workspaceState: {
|
|
358
|
+
openFiles: [],
|
|
359
|
+
},
|
|
360
|
+
};
|
|
361
|
+
const result = IdeContextSchema.safeParse(context);
|
|
362
|
+
expect(result.success).toBe(true);
|
|
363
|
+
});
|
|
364
|
+
it('should validate a context with a valid file', () => {
|
|
365
|
+
const context = {
|
|
366
|
+
workspaceState: {
|
|
367
|
+
openFiles: [
|
|
368
|
+
{
|
|
369
|
+
path: '/path/to/file.ts',
|
|
370
|
+
timestamp: 12345,
|
|
371
|
+
},
|
|
372
|
+
],
|
|
373
|
+
},
|
|
374
|
+
};
|
|
375
|
+
const result = IdeContextSchema.safeParse(context);
|
|
376
|
+
expect(result.success).toBe(true);
|
|
377
|
+
});
|
|
378
|
+
it('should fail validation with an invalid file', () => {
|
|
379
|
+
const context = {
|
|
380
|
+
workspaceState: {
|
|
381
|
+
openFiles: [
|
|
382
|
+
{
|
|
383
|
+
timestamp: 12345, // path is missing
|
|
384
|
+
},
|
|
385
|
+
],
|
|
386
|
+
},
|
|
387
|
+
};
|
|
388
|
+
const result = IdeContextSchema.safeParse(context);
|
|
389
|
+
expect(result.success).toBe(false);
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
});
|
|
393
|
+
//# sourceMappingURL=ideContext.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ideContext.test.js","sourceRoot":"","sources":["../../../src/ide/ideContext.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE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AAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACrD,MAAM,OAAO,GAAG;gBACd,cAAc,EAAE;oBACd,SAAS,EAAE;wBACT;4BACE,IAAI,EAAE,kBAAkB;4BACxB,SAAS,EAAE,KAAK;yBACjB;qBACF;iBACF;aACF,CAAC;YACF,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACnD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACrD,MAAM,OAAO,GAAG;gBACd,cAAc,EAAE;oBACd,SAAS,EAAE;wBACT;4BACE,SAAS,EAAE,KAAK,EAAE,kBAAkB;yBACrC;qBACF;iBACF;aACF,CAAC;YACF,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACnD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Traverses up the process tree to find the process ID and command of the IDE.
|
|
8
|
+
*
|
|
9
|
+
* This function uses different strategies depending on the operating system
|
|
10
|
+
* to identify the main application process (e.g., the main VS Code window
|
|
11
|
+
* process).
|
|
12
|
+
*
|
|
13
|
+
* If the IDE process cannot be reliably identified, it will return the
|
|
14
|
+
* top-level ancestor process ID and command as a fallback.
|
|
15
|
+
*
|
|
16
|
+
* @returns A promise that resolves to the PID and command of the IDE process.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getIdeProcessInfo(): Promise<{
|
|
19
|
+
pid: number;
|
|
20
|
+
command: string;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { exec, execFile } from 'node:child_process';
|
|
7
|
+
import { promisify } from 'node:util';
|
|
8
|
+
import os from 'node:os';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
const execAsync = promisify(exec);
|
|
11
|
+
const execFileAsync = promisify(execFile);
|
|
12
|
+
const MAX_TRAVERSAL_DEPTH = 32;
|
|
13
|
+
async function getProcessInfo(pid) {
|
|
14
|
+
// Only used for Unix systems (macOS and Linux)
|
|
15
|
+
try {
|
|
16
|
+
const command = `ps -o ppid=,command= -p ${pid}`;
|
|
17
|
+
const { stdout } = await execAsync(command);
|
|
18
|
+
const trimmedStdout = stdout.trim();
|
|
19
|
+
if (!trimmedStdout) {
|
|
20
|
+
return { parentPid: 0, name: '', command: '' };
|
|
21
|
+
}
|
|
22
|
+
const parts = trimmedStdout.split(/\s+/);
|
|
23
|
+
const ppidString = parts[0];
|
|
24
|
+
const parentPid = parseInt(ppidString, 10);
|
|
25
|
+
const fullCommand = trimmedStdout.substring(ppidString.length).trim();
|
|
26
|
+
const processName = path.basename(fullCommand.split(' ')[0]);
|
|
27
|
+
return {
|
|
28
|
+
parentPid: isNaN(parentPid) ? 1 : parentPid,
|
|
29
|
+
name: processName,
|
|
30
|
+
command: fullCommand,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
catch (_e) {
|
|
34
|
+
return { parentPid: 0, name: '', command: '' };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Finds the IDE process info on Unix-like systems.
|
|
39
|
+
*
|
|
40
|
+
* The strategy is to find the shell process that spawned the CLI, and then
|
|
41
|
+
* find that shell's parent process (the IDE). To get the true IDE process,
|
|
42
|
+
* we traverse one level higher to get the grandparent.
|
|
43
|
+
*
|
|
44
|
+
* @returns A promise that resolves to the PID and command of the IDE process.
|
|
45
|
+
*/
|
|
46
|
+
async function getIdeProcessInfoForUnix() {
|
|
47
|
+
const shells = ['zsh', 'bash', 'sh', 'tcsh', 'csh', 'ksh', 'fish', 'dash'];
|
|
48
|
+
let currentPid = process.pid;
|
|
49
|
+
for (let i = 0; i < MAX_TRAVERSAL_DEPTH; i++) {
|
|
50
|
+
try {
|
|
51
|
+
const { parentPid, name } = await getProcessInfo(currentPid);
|
|
52
|
+
const isShell = shells.some((shell) => name === shell);
|
|
53
|
+
if (isShell) {
|
|
54
|
+
// The direct parent of the shell is often a utility process (e.g. VS
|
|
55
|
+
// Code's `ptyhost` process). To get the true IDE process, we need to
|
|
56
|
+
// traverse one level higher to get the grandparent.
|
|
57
|
+
let idePid = parentPid;
|
|
58
|
+
try {
|
|
59
|
+
const { parentPid: grandParentPid } = await getProcessInfo(parentPid);
|
|
60
|
+
if (grandParentPid > 1) {
|
|
61
|
+
idePid = grandParentPid;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// Ignore if getting grandparent fails, we'll just use the parent pid.
|
|
66
|
+
}
|
|
67
|
+
const { command: ideCommand } = await getProcessInfo(idePid);
|
|
68
|
+
return { pid: idePid, command: ideCommand };
|
|
69
|
+
}
|
|
70
|
+
if (parentPid <= 1) {
|
|
71
|
+
break; // Reached the root
|
|
72
|
+
}
|
|
73
|
+
currentPid = parentPid;
|
|
74
|
+
}
|
|
75
|
+
catch (_e) {
|
|
76
|
+
// Process in chain died
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const { command } = await getProcessInfo(currentPid);
|
|
81
|
+
return { pid: currentPid, command };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Fetches the entire process table on Windows.
|
|
85
|
+
*/
|
|
86
|
+
async function getProcessTableWindows() {
|
|
87
|
+
const processMap = new Map();
|
|
88
|
+
try {
|
|
89
|
+
const powershellCommand = 'Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,Name,CommandLine | ConvertTo-Json -Compress';
|
|
90
|
+
const { stdout } = await execFileAsync('powershell', ['-NoProfile', '-NonInteractive', '-Command', powershellCommand], { maxBuffer: 10 * 1024 * 1024 });
|
|
91
|
+
if (!stdout.trim()) {
|
|
92
|
+
return processMap;
|
|
93
|
+
}
|
|
94
|
+
let processes;
|
|
95
|
+
try {
|
|
96
|
+
processes = JSON.parse(stdout);
|
|
97
|
+
}
|
|
98
|
+
catch (_e) {
|
|
99
|
+
return processMap;
|
|
100
|
+
}
|
|
101
|
+
if (!Array.isArray(processes)) {
|
|
102
|
+
processes = [processes];
|
|
103
|
+
}
|
|
104
|
+
for (const p of processes) {
|
|
105
|
+
if (p && typeof p.ProcessId === 'number') {
|
|
106
|
+
processMap.set(p.ProcessId, {
|
|
107
|
+
pid: p.ProcessId,
|
|
108
|
+
parentPid: p.ParentProcessId || 0,
|
|
109
|
+
name: p.Name || '',
|
|
110
|
+
command: p.CommandLine || '',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (_e) {
|
|
116
|
+
// Fallback or error handling if PowerShell fails
|
|
117
|
+
}
|
|
118
|
+
return processMap;
|
|
119
|
+
}
|
|
120
|
+
async function getIdeProcessInfoForWindows() {
|
|
121
|
+
// Fetch the entire process table in one go.
|
|
122
|
+
const processMap = await getProcessTableWindows();
|
|
123
|
+
const myPid = process.pid;
|
|
124
|
+
const myProc = processMap.get(myPid);
|
|
125
|
+
if (!myProc) {
|
|
126
|
+
// Fallback: return current process info if snapshot fails
|
|
127
|
+
return { pid: myPid, command: '' };
|
|
128
|
+
}
|
|
129
|
+
// Perform tree traversal in memory
|
|
130
|
+
const ancestors = [];
|
|
131
|
+
let curr = myProc;
|
|
132
|
+
for (let i = 0; i < MAX_TRAVERSAL_DEPTH && curr; i++) {
|
|
133
|
+
ancestors.push(curr);
|
|
134
|
+
if (curr.parentPid === 0 || !processMap.has(curr.parentPid)) {
|
|
135
|
+
// Parent process not in map, stop traversal
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
curr = processMap.get(curr.parentPid);
|
|
139
|
+
}
|
|
140
|
+
// Use heuristic: return the great-grandparent (ancestors[length-3])
|
|
141
|
+
if (ancestors.length >= 3) {
|
|
142
|
+
const target = ancestors[ancestors.length - 3];
|
|
143
|
+
return { pid: target.pid, command: target.command };
|
|
144
|
+
}
|
|
145
|
+
else if (ancestors.length > 0) {
|
|
146
|
+
const target = ancestors[ancestors.length - 1];
|
|
147
|
+
return { pid: target.pid, command: target.command };
|
|
148
|
+
}
|
|
149
|
+
return { pid: myPid, command: myProc.command };
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Traverses up the process tree to find the process ID and command of the IDE.
|
|
153
|
+
*
|
|
154
|
+
* This function uses different strategies depending on the operating system
|
|
155
|
+
* to identify the main application process (e.g., the main VS Code window
|
|
156
|
+
* process).
|
|
157
|
+
*
|
|
158
|
+
* If the IDE process cannot be reliably identified, it will return the
|
|
159
|
+
* top-level ancestor process ID and command as a fallback.
|
|
160
|
+
*
|
|
161
|
+
* @returns A promise that resolves to the PID and command of the IDE process.
|
|
162
|
+
*/
|
|
163
|
+
export async function getIdeProcessInfo() {
|
|
164
|
+
const platform = os.platform();
|
|
165
|
+
if (platform === 'win32') {
|
|
166
|
+
return getIdeProcessInfoForWindows();
|
|
167
|
+
}
|
|
168
|
+
return getIdeProcessInfoForUnix();
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=process-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-utils.js","sourceRoot":"","sources":["../../../src/ide/process-utils.ts"],"names":[],"mappings":"AAAA;;;;G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