@blackbox_ai/blackbox-cli-core 0.0.4
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/LICENSE +203 -0
- package/README.md +420 -0
- package/dist/.last_build +0 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/src/__mocks__/fs/promises.d.ts +11 -0
- package/dist/src/__mocks__/fs/promises.js +17 -0
- package/dist/src/__mocks__/fs/promises.js.map +1 -0
- package/dist/src/blackbox/blackboxContentGenerator.d.ts +70 -0
- package/dist/src/blackbox/blackboxContentGenerator.js +180 -0
- package/dist/src/blackbox/blackboxContentGenerator.js.map +1 -0
- package/dist/src/blackbox/blackboxContentGenerator.test.d.ts +6 -0
- package/dist/src/blackbox/blackboxContentGenerator.test.js +1178 -0
- package/dist/src/blackbox/blackboxContentGenerator.test.js.map +1 -0
- package/dist/src/blackbox/blackboxOAuth2.d.ts +191 -0
- package/dist/src/blackbox/blackboxOAuth2.js +566 -0
- package/dist/src/blackbox/blackboxOAuth2.js.map +1 -0
- package/dist/src/blackbox/blackboxOAuth2.test.d.ts +6 -0
- package/dist/src/blackbox/blackboxOAuth2.test.js +1718 -0
- package/dist/src/blackbox/blackboxOAuth2.test.js.map +1 -0
- package/dist/src/blackbox/sharedTokenManager.d.ts +196 -0
- package/dist/src/blackbox/sharedTokenManager.js +647 -0
- package/dist/src/blackbox/sharedTokenManager.js.map +1 -0
- package/dist/src/blackbox/sharedTokenManager.test.d.ts +7 -0
- package/dist/src/blackbox/sharedTokenManager.test.js +662 -0
- package/dist/src/blackbox/sharedTokenManager.test.js.map +1 -0
- package/dist/src/code_assist/codeAssist.d.ts +10 -0
- package/dist/src/code_assist/codeAssist.js +19 -0
- package/dist/src/code_assist/codeAssist.js.map +1 -0
- package/dist/src/code_assist/converter.d.ts +72 -0
- package/dist/src/code_assist/converter.js +159 -0
- package/dist/src/code_assist/converter.js.map +1 -0
- package/dist/src/code_assist/converter.test.d.ts +6 -0
- package/dist/src/code_assist/converter.test.js +362 -0
- package/dist/src/code_assist/converter.test.js.map +1 -0
- package/dist/src/code_assist/oauth2.d.ts +22 -0
- package/dist/src/code_assist/oauth2.js +368 -0
- package/dist/src/code_assist/oauth2.js.map +1 -0
- package/dist/src/code_assist/oauth2.test.d.ts +6 -0
- package/dist/src/code_assist/oauth2.test.js +436 -0
- package/dist/src/code_assist/oauth2.test.js.map +1 -0
- package/dist/src/code_assist/server.d.ts +37 -0
- package/dist/src/code_assist/server.js +125 -0
- package/dist/src/code_assist/server.js.map +1 -0
- package/dist/src/code_assist/server.test.d.ts +6 -0
- package/dist/src/code_assist/server.test.js +134 -0
- package/dist/src/code_assist/server.test.js.map +1 -0
- package/dist/src/code_assist/setup.d.ts +20 -0
- package/dist/src/code_assist/setup.js +101 -0
- package/dist/src/code_assist/setup.js.map +1 -0
- package/dist/src/code_assist/setup.test.d.ts +6 -0
- package/dist/src/code_assist/setup.test.js +171 -0
- package/dist/src/code_assist/setup.test.js.map +1 -0
- package/dist/src/code_assist/types.d.ts +148 -0
- package/dist/src/code_assist/types.js +46 -0
- package/dist/src/code_assist/types.js.map +1 -0
- package/dist/src/config/blackboxModels.d.ts +28 -0
- package/dist/src/config/blackboxModels.js +148 -0
- package/dist/src/config/blackboxModels.js.map +1 -0
- package/dist/src/config/config.d.ts +381 -0
- package/dist/src/config/config.js +753 -0
- package/dist/src/config/config.js.map +1 -0
- package/dist/src/config/config.test.d.ts +6 -0
- package/dist/src/config/config.test.js +674 -0
- package/dist/src/config/config.test.js.map +1 -0
- package/dist/src/config/flashFallback.test.d.ts +6 -0
- package/dist/src/config/flashFallback.test.js +87 -0
- package/dist/src/config/flashFallback.test.js.map +1 -0
- package/dist/src/config/models.d.ts +12 -0
- package/dist/src/config/models.js +13 -0
- package/dist/src/config/models.js.map +1 -0
- package/dist/src/config/storage.d.ts +32 -0
- package/dist/src/config/storage.js +90 -0
- package/dist/src/config/storage.js.map +1 -0
- package/dist/src/config/storage.test.d.ts +6 -0
- package/dist/src/config/storage.test.js +43 -0
- package/dist/src/config/storage.test.js.map +1 -0
- package/dist/src/core/__tests__/openaiTimeoutHandling.test.d.ts +6 -0
- package/dist/src/core/__tests__/openaiTimeoutHandling.test.js +292 -0
- package/dist/src/core/__tests__/openaiTimeoutHandling.test.js.map +1 -0
- package/dist/src/core/__tests__/orphanedToolCallsTest.d.ts +64 -0
- package/dist/src/core/__tests__/orphanedToolCallsTest.js +122 -0
- package/dist/src/core/__tests__/orphanedToolCallsTest.js.map +1 -0
- package/dist/src/core/client.d.ts +75 -0
- package/dist/src/core/client.js +826 -0
- package/dist/src/core/client.js.map +1 -0
- package/dist/src/core/client.test.d.ts +6 -0
- package/dist/src/core/client.test.js +2059 -0
- package/dist/src/core/client.test.js.map +1 -0
- package/dist/src/core/contentGenerator.d.ts +51 -0
- package/dist/src/core/contentGenerator.js +149 -0
- package/dist/src/core/contentGenerator.js.map +1 -0
- package/dist/src/core/contentGenerator.test.d.ts +6 -0
- package/dist/src/core/contentGenerator.test.js +133 -0
- package/dist/src/core/contentGenerator.test.js.map +1 -0
- package/dist/src/core/coreToolScheduler.d.ts +126 -0
- package/dist/src/core/coreToolScheduler.js +630 -0
- package/dist/src/core/coreToolScheduler.js.map +1 -0
- package/dist/src/core/coreToolScheduler.test.d.ts +6 -0
- package/dist/src/core/coreToolScheduler.test.js +1228 -0
- package/dist/src/core/coreToolScheduler.test.js.map +1 -0
- package/dist/src/core/geminiChat.d.ts +139 -0
- package/dist/src/core/geminiChat.js +636 -0
- package/dist/src/core/geminiChat.js.map +1 -0
- package/dist/src/core/geminiChat.test.d.ts +6 -0
- package/dist/src/core/geminiChat.test.js +1178 -0
- package/dist/src/core/geminiChat.test.js.map +1 -0
- package/dist/src/core/geminiRequest.d.ts +13 -0
- package/dist/src/core/geminiRequest.js +11 -0
- package/dist/src/core/geminiRequest.js.map +1 -0
- package/dist/src/core/geminiRequest.test.d.ts +6 -0
- package/dist/src/core/geminiRequest.test.js +73 -0
- package/dist/src/core/geminiRequest.test.js.map +1 -0
- package/dist/src/core/logger.d.ts +68 -0
- package/dist/src/core/logger.js +370 -0
- package/dist/src/core/logger.js.map +1 -0
- package/dist/src/core/logger.test.d.ts +6 -0
- package/dist/src/core/logger.test.js +591 -0
- package/dist/src/core/logger.test.js.map +1 -0
- package/dist/src/core/loggingContentGenerator.d.ts +25 -0
- package/dist/src/core/loggingContentGenerator.js +97 -0
- package/dist/src/core/loggingContentGenerator.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.d.ts +10 -0
- package/dist/src/core/nonInteractiveToolExecutor.js +24 -0
- package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.d.ts +6 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.js +236 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/constants.d.ts +2 -0
- package/dist/src/core/openaiContentGenerator/constants.js +3 -0
- package/dist/src/core/openaiContentGenerator/constants.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/converter.d.ts +107 -0
- package/dist/src/core/openaiContentGenerator/converter.js +802 -0
- package/dist/src/core/openaiContentGenerator/converter.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/converter.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/converter.test.js +47 -0
- package/dist/src/core/openaiContentGenerator/converter.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.d.ts +20 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.js +82 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.test.js +287 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/index.d.ts +22 -0
- package/dist/src/core/openaiContentGenerator/index.js +41 -0
- package/dist/src/core/openaiContentGenerator/index.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.d.ts +21 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.js +105 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.test.js +230 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/pipeline.d.ts +66 -0
- package/dist/src/core/openaiContentGenerator/pipeline.js +256 -0
- package/dist/src/core/openaiContentGenerator/pipeline.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/pipeline.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/pipeline.test.js +977 -0
- package/dist/src/core/openaiContentGenerator/pipeline.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/README.md +61 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.d.ts +63 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.js +241 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.test.js +707 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.d.ts +14 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.js +52 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.test.js +103 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/default.d.ts +15 -0
- package/dist/src/core/openaiContentGenerator/provider/default.js +38 -0
- package/dist/src/core/openaiContentGenerator/provider/default.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/default.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/provider/default.test.js +176 -0
- package/dist/src/core/openaiContentGenerator/provider/default.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/index.d.ts +5 -0
- package/dist/src/core/openaiContentGenerator/provider/index.js +5 -0
- package/dist/src/core/openaiContentGenerator/provider/index.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.d.ts +8 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.js +21 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.test.js +152 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/types.d.ts +23 -0
- package/dist/src/core/openaiContentGenerator/provider/types.js +2 -0
- package/dist/src/core/openaiContentGenerator/provider/types.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.d.ts +142 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.js +363 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.test.js +537 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.d.ts +35 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.js +146 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.test.js +978 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.test.js.map +1 -0
- package/dist/src/core/prompts.d.ts +76 -0
- package/dist/src/core/prompts.js +860 -0
- package/dist/src/core/prompts.js.map +1 -0
- package/dist/src/core/prompts.test.d.ts +6 -0
- package/dist/src/core/prompts.test.js +436 -0
- package/dist/src/core/prompts.test.js.map +1 -0
- package/dist/src/core/tokenLimits.d.ts +25 -0
- package/dist/src/core/tokenLimits.js +175 -0
- package/dist/src/core/tokenLimits.js.map +1 -0
- package/dist/src/core/tokenLimits.test.d.ts +1 -0
- package/dist/src/core/tokenLimits.test.js +261 -0
- package/dist/src/core/tokenLimits.test.js.map +1 -0
- package/dist/src/core/turn.d.ts +140 -0
- package/dist/src/core/turn.js +168 -0
- package/dist/src/core/turn.js.map +1 -0
- package/dist/src/core/turn.test.d.ts +6 -0
- package/dist/src/core/turn.test.js +450 -0
- package/dist/src/core/turn.test.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +7 -0
- package/dist/src/generated/git-commit.js +10 -0
- package/dist/src/generated/git-commit.js.map +1 -0
- package/dist/src/ide/constants.d.ts +6 -0
- package/dist/src/ide/constants.js +7 -0
- package/dist/src/ide/constants.js.map +1 -0
- package/dist/src/ide/detect-ide.d.ts +25 -0
- package/dist/src/ide/detect-ide.js +104 -0
- package/dist/src/ide/detect-ide.js.map +1 -0
- package/dist/src/ide/detect-ide.test.d.ts +6 -0
- package/dist/src/ide/detect-ide.test.js +120 -0
- package/dist/src/ide/detect-ide.test.js.map +1 -0
- package/dist/src/ide/ide-client.d.ts +67 -0
- package/dist/src/ide/ide-client.js +424 -0
- package/dist/src/ide/ide-client.js.map +1 -0
- package/dist/src/ide/ide-client.test.d.ts +6 -0
- package/dist/src/ide/ide-client.test.js +165 -0
- package/dist/src/ide/ide-client.test.js.map +1 -0
- package/dist/src/ide/ide-installer.d.ts +14 -0
- package/dist/src/ide/ide-installer.js +107 -0
- package/dist/src/ide/ide-installer.js.map +1 -0
- package/dist/src/ide/ide-installer.test.d.ts +6 -0
- package/dist/src/ide/ide-installer.test.js +113 -0
- package/dist/src/ide/ide-installer.test.js.map +1 -0
- package/dist/src/ide/ideContext.d.ts +374 -0
- package/dist/src/ide/ideContext.js +147 -0
- package/dist/src/ide/ideContext.js.map +1 -0
- package/dist/src/ide/ideContext.test.d.ts +6 -0
- package/dist/src/ide/ideContext.test.js +265 -0
- package/dist/src/ide/ideContext.test.js.map +1 -0
- package/dist/src/ide/process-utils.d.ts +21 -0
- package/dist/src/ide/process-utils.js +164 -0
- package/dist/src/ide/process-utils.js.map +1 -0
- package/dist/src/ide/process-utils.test.d.ts +6 -0
- package/dist/src/ide/process-utils.test.js +158 -0
- package/dist/src/ide/process-utils.test.js.map +1 -0
- package/dist/src/index.d.ts +86 -0
- package/dist/src/index.js +97 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.test.d.ts +6 -0
- package/dist/src/index.test.js +12 -0
- package/dist/src/index.test.js.map +1 -0
- package/dist/src/mcp/google-auth-provider.d.ts +23 -0
- package/dist/src/mcp/google-auth-provider.js +72 -0
- package/dist/src/mcp/google-auth-provider.js.map +1 -0
- package/dist/src/mcp/google-auth-provider.test.d.ts +6 -0
- package/dist/src/mcp/google-auth-provider.test.js +89 -0
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -0
- package/dist/src/mcp/oauth-provider.d.ts +146 -0
- package/dist/src/mcp/oauth-provider.js +601 -0
- package/dist/src/mcp/oauth-provider.js.map +1 -0
- package/dist/src/mcp/oauth-provider.test.d.ts +6 -0
- package/dist/src/mcp/oauth-provider.test.js +672 -0
- package/dist/src/mcp/oauth-provider.test.js.map +1 -0
- package/dist/src/mcp/oauth-token-storage.d.ts +61 -0
- package/dist/src/mcp/oauth-token-storage.js +148 -0
- package/dist/src/mcp/oauth-token-storage.js.map +1 -0
- package/dist/src/mcp/oauth-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/oauth-token-storage.test.js +208 -0
- package/dist/src/mcp/oauth-token-storage.test.js.map +1 -0
- package/dist/src/mcp/oauth-utils.d.ts +119 -0
- package/dist/src/mcp/oauth-utils.js +235 -0
- package/dist/src/mcp/oauth-utils.js.map +1 -0
- package/dist/src/mcp/oauth-utils.test.d.ts +6 -0
- package/dist/src/mcp/oauth-utils.test.js +199 -0
- package/dist/src/mcp/oauth-utils.test.js.map +1 -0
- package/dist/src/mcp/token-storage/base-token-storage.d.ts +19 -0
- package/dist/src/mcp/token-storage/base-token-storage.js +36 -0
- package/dist/src/mcp/token-storage/base-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/base-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/token-storage/base-token-storage.test.js +160 -0
- package/dist/src/mcp/token-storage/base-token-storage.test.js.map +1 -0
- package/dist/src/mcp/token-storage/types.d.ts +34 -0
- package/dist/src/mcp/token-storage/types.js +7 -0
- package/dist/src/mcp/token-storage/types.js.map +1 -0
- package/dist/src/mocks/msw.d.ts +6 -0
- package/dist/src/mocks/msw.js +8 -0
- package/dist/src/mocks/msw.js.map +1 -0
- package/dist/src/prompts/mcp-prompts.d.ts +8 -0
- package/dist/src/prompts/mcp-prompts.js +13 -0
- package/dist/src/prompts/mcp-prompts.js.map +1 -0
- package/dist/src/prompts/prompt-registry.d.ts +34 -0
- package/dist/src/prompts/prompt-registry.js +63 -0
- package/dist/src/prompts/prompt-registry.js.map +1 -0
- package/dist/src/services/chatRecordingService.d.ts +150 -0
- package/dist/src/services/chatRecordingService.js +321 -0
- package/dist/src/services/chatRecordingService.js.map +1 -0
- package/dist/src/services/chatRecordingService.test.d.ts +6 -0
- package/dist/src/services/chatRecordingService.test.js +290 -0
- package/dist/src/services/chatRecordingService.test.js.map +1 -0
- package/dist/src/services/fileDiscoveryService.d.ts +35 -0
- package/dist/src/services/fileDiscoveryService.js +91 -0
- package/dist/src/services/fileDiscoveryService.js.map +1 -0
- package/dist/src/services/fileDiscoveryService.test.d.ts +6 -0
- package/dist/src/services/fileDiscoveryService.test.js +143 -0
- package/dist/src/services/fileDiscoveryService.test.js.map +1 -0
- package/dist/src/services/fileSystemService.d.ts +31 -0
- package/dist/src/services/fileSystemService.js +18 -0
- package/dist/src/services/fileSystemService.js.map +1 -0
- package/dist/src/services/fileSystemService.test.d.ts +6 -0
- package/dist/src/services/fileSystemService.test.js +41 -0
- package/dist/src/services/fileSystemService.test.js.map +1 -0
- package/dist/src/services/gitService.d.ts +23 -0
- package/dist/src/services/gitService.js +110 -0
- package/dist/src/services/gitService.js.map +1 -0
- package/dist/src/services/gitService.test.d.ts +6 -0
- package/dist/src/services/gitService.test.js +212 -0
- package/dist/src/services/gitService.test.js.map +1 -0
- package/dist/src/services/loopDetectionService.d.ts +98 -0
- package/dist/src/services/loopDetectionService.js +363 -0
- package/dist/src/services/loopDetectionService.js.map +1 -0
- package/dist/src/services/loopDetectionService.test.d.ts +6 -0
- package/dist/src/services/loopDetectionService.test.js +560 -0
- package/dist/src/services/loopDetectionService.test.js.map +1 -0
- package/dist/src/services/shellExecutionService.d.ts +68 -0
- package/dist/src/services/shellExecutionService.js +332 -0
- package/dist/src/services/shellExecutionService.js.map +1 -0
- package/dist/src/services/shellExecutionService.test.d.ts +6 -0
- package/dist/src/services/shellExecutionService.test.js +517 -0
- package/dist/src/services/shellExecutionService.test.js.map +1 -0
- package/dist/src/subagents/builtin-agents.d.ts +35 -0
- package/dist/src/subagents/builtin-agents.js +85 -0
- package/dist/src/subagents/builtin-agents.js.map +1 -0
- package/dist/src/subagents/builtin-agents.test.d.ts +6 -0
- package/dist/src/subagents/builtin-agents.test.js +78 -0
- package/dist/src/subagents/builtin-agents.test.js.map +1 -0
- package/dist/src/subagents/index.d.ts +29 -0
- package/dist/src/subagents/index.js +15 -0
- package/dist/src/subagents/index.js.map +1 -0
- package/dist/src/subagents/subagent-events.d.ts +93 -0
- package/dist/src/subagents/subagent-events.js +31 -0
- package/dist/src/subagents/subagent-events.js.map +1 -0
- package/dist/src/subagents/subagent-hooks.d.ts +29 -0
- package/dist/src/subagents/subagent-hooks.js +7 -0
- package/dist/src/subagents/subagent-hooks.js.map +1 -0
- package/dist/src/subagents/subagent-manager.d.ts +170 -0
- package/dist/src/subagents/subagent-manager.js +593 -0
- package/dist/src/subagents/subagent-manager.js.map +1 -0
- package/dist/src/subagents/subagent-manager.test.d.ts +6 -0
- package/dist/src/subagents/subagent-manager.test.js +822 -0
- package/dist/src/subagents/subagent-manager.test.js.map +1 -0
- package/dist/src/subagents/subagent-statistics.d.ts +46 -0
- package/dist/src/subagents/subagent-statistics.js +193 -0
- package/dist/src/subagents/subagent-statistics.js.map +1 -0
- package/dist/src/subagents/subagent-statistics.test.d.ts +6 -0
- package/dist/src/subagents/subagent-statistics.test.js +231 -0
- package/dist/src/subagents/subagent-statistics.test.js.map +1 -0
- package/dist/src/subagents/subagent.d.ts +161 -0
- package/dist/src/subagents/subagent.js +667 -0
- package/dist/src/subagents/subagent.js.map +1 -0
- package/dist/src/subagents/subagent.test.d.ts +6 -0
- package/dist/src/subagents/subagent.test.js +487 -0
- package/dist/src/subagents/subagent.test.js.map +1 -0
- package/dist/src/subagents/types.d.ts +218 -0
- package/dist/src/subagents/types.js +58 -0
- package/dist/src/subagents/types.js.map +1 -0
- package/dist/src/subagents/types.test.d.ts +6 -0
- package/dist/src/subagents/types.test.js +31 -0
- package/dist/src/subagents/types.test.js.map +1 -0
- package/dist/src/subagents/validation.d.ts +63 -0
- package/dist/src/subagents/validation.js +293 -0
- package/dist/src/subagents/validation.js.map +1 -0
- package/dist/src/subagents/validation.test.d.ts +6 -0
- package/dist/src/subagents/validation.test.js +330 -0
- package/dist/src/subagents/validation.test.js.map +1 -0
- package/dist/src/telemetry/blackbox-logger/blackbox-logger.d.ts +80 -0
- package/dist/src/telemetry/blackbox-logger/blackbox-logger.js +583 -0
- package/dist/src/telemetry/blackbox-logger/blackbox-logger.js.map +1 -0
- package/dist/src/telemetry/blackbox-logger/blackbox-logger.test.d.ts +6 -0
- package/dist/src/telemetry/blackbox-logger/blackbox-logger.test.js +301 -0
- package/dist/src/telemetry/blackbox-logger/blackbox-logger.test.js.map +1 -0
- package/dist/src/telemetry/blackbox-logger/event-types.d.ts +73 -0
- package/dist/src/telemetry/blackbox-logger/event-types.js +2 -0
- package/dist/src/telemetry/blackbox-logger/event-types.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +121 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +773 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +17 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +420 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +90 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +229 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +34 -0
- package/dist/src/telemetry/constants.js +35 -0
- package/dist/src/telemetry/constants.js.map +1 -0
- package/dist/src/telemetry/file-exporters.d.ts +29 -0
- package/dist/src/telemetry/file-exporters.js +62 -0
- package/dist/src/telemetry/file-exporters.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +20 -0
- package/dist/src/telemetry/index.js +21 -0
- package/dist/src/telemetry/index.js.map +1 -0
- package/dist/src/telemetry/integration.test.circular.d.ts +6 -0
- package/dist/src/telemetry/integration.test.circular.js +95 -0
- package/dist/src/telemetry/integration.test.circular.js.map +1 -0
- package/dist/src/telemetry/loggers.d.ts +26 -0
- package/dist/src/telemetry/loggers.js +406 -0
- package/dist/src/telemetry/loggers.js.map +1 -0
- package/dist/src/telemetry/loggers.test.circular.d.ts +6 -0
- package/dist/src/telemetry/loggers.test.circular.js +107 -0
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -0
- package/dist/src/telemetry/loggers.test.d.ts +6 -0
- package/dist/src/telemetry/loggers.test.js +638 -0
- package/dist/src/telemetry/loggers.test.js.map +1 -0
- package/dist/src/telemetry/metrics.d.ts +40 -0
- package/dist/src/telemetry/metrics.js +229 -0
- package/dist/src/telemetry/metrics.js.map +1 -0
- package/dist/src/telemetry/metrics.test.d.ts +6 -0
- package/dist/src/telemetry/metrics.test.js +242 -0
- package/dist/src/telemetry/metrics.test.js.map +1 -0
- package/dist/src/telemetry/sdk.d.ts +9 -0
- package/dist/src/telemetry/sdk.js +161 -0
- package/dist/src/telemetry/sdk.js.map +1 -0
- package/dist/src/telemetry/sdk.test.d.ts +6 -0
- package/dist/src/telemetry/sdk.test.js +82 -0
- package/dist/src/telemetry/sdk.test.js.map +1 -0
- package/dist/src/telemetry/telemetry-utils.d.ts +6 -0
- package/dist/src/telemetry/telemetry-utils.js +14 -0
- package/dist/src/telemetry/telemetry-utils.js.map +1 -0
- package/dist/src/telemetry/telemetry-utils.test.d.ts +6 -0
- package/dist/src/telemetry/telemetry-utils.test.js +40 -0
- package/dist/src/telemetry/telemetry-utils.test.js.map +1 -0
- package/dist/src/telemetry/telemetry.test.d.ts +6 -0
- package/dist/src/telemetry/telemetry.test.js +50 -0
- package/dist/src/telemetry/telemetry.test.js.map +1 -0
- package/dist/src/telemetry/tool-call-decision.d.ts +13 -0
- package/dist/src/telemetry/tool-call-decision.js +29 -0
- package/dist/src/telemetry/tool-call-decision.js.map +1 -0
- package/dist/src/telemetry/types.d.ts +236 -0
- package/dist/src/telemetry/types.js +405 -0
- package/dist/src/telemetry/types.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.d.ts +75 -0
- package/dist/src/telemetry/uiTelemetry.js +153 -0
- package/dist/src/telemetry/uiTelemetry.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.test.d.ts +6 -0
- package/dist/src/telemetry/uiTelemetry.test.js +558 -0
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -0
- package/dist/src/test-utils/config.d.ts +17 -0
- package/dist/src/test-utils/config.js +32 -0
- package/dist/src/test-utils/config.js.map +1 -0
- package/dist/src/test-utils/mockWorkspaceContext.d.ts +13 -0
- package/dist/src/test-utils/mockWorkspaceContext.js +24 -0
- package/dist/src/test-utils/mockWorkspaceContext.js.map +1 -0
- package/dist/src/test-utils/tools.d.ts +45 -0
- package/dist/src/test-utils/tools.js +105 -0
- package/dist/src/test-utils/tools.js.map +1 -0
- package/dist/src/tools/diffOptions.d.ts +9 -0
- package/dist/src/tools/diffOptions.js +38 -0
- package/dist/src/tools/diffOptions.js.map +1 -0
- package/dist/src/tools/diffOptions.test.d.ts +6 -0
- package/dist/src/tools/diffOptions.test.js +119 -0
- package/dist/src/tools/diffOptions.test.js.map +1 -0
- package/dist/src/tools/edit.d.ts +56 -0
- package/dist/src/tools/edit.js +434 -0
- package/dist/src/tools/edit.js.map +1 -0
- package/dist/src/tools/edit.test.d.ts +6 -0
- package/dist/src/tools/edit.test.js +569 -0
- package/dist/src/tools/edit.test.js.map +1 -0
- package/dist/src/tools/exitPlanMode.d.ts +28 -0
- package/dist/src/tools/exitPlanMode.js +137 -0
- package/dist/src/tools/exitPlanMode.js.map +1 -0
- package/dist/src/tools/exitPlanMode.test.d.ts +6 -0
- package/dist/src/tools/exitPlanMode.test.js +219 -0
- package/dist/src/tools/exitPlanMode.test.js.map +1 -0
- package/dist/src/tools/glob.d.ts +52 -0
- package/dist/src/tools/glob.js +237 -0
- package/dist/src/tools/glob.js.map +1 -0
- package/dist/src/tools/glob.test.d.ts +6 -0
- package/dist/src/tools/glob.test.js +375 -0
- package/dist/src/tools/glob.test.js.map +1 -0
- package/dist/src/tools/grep.d.ts +51 -0
- package/dist/src/tools/grep.js +566 -0
- package/dist/src/tools/grep.js.map +1 -0
- package/dist/src/tools/grep.test.d.ts +6 -0
- package/dist/src/tools/grep.test.js +356 -0
- package/dist/src/tools/grep.test.js.map +1 -0
- package/dist/src/tools/ls.d.ts +68 -0
- package/dist/src/tools/ls.js +227 -0
- package/dist/src/tools/ls.js.map +1 -0
- package/dist/src/tools/ls.test.d.ts +6 -0
- package/dist/src/tools/ls.test.js +389 -0
- package/dist/src/tools/ls.test.js.map +1 -0
- package/dist/src/tools/mcp-client-manager.d.ts +38 -0
- package/dist/src/tools/mcp-client-manager.js +74 -0
- package/dist/src/tools/mcp-client-manager.js.map +1 -0
- package/dist/src/tools/mcp-client-manager.test.d.ts +6 -0
- package/dist/src/tools/mcp-client-manager.test.js +39 -0
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -0
- package/dist/src/tools/mcp-client.d.ts +199 -0
- package/dist/src/tools/mcp-client.js +995 -0
- package/dist/src/tools/mcp-client.js.map +1 -0
- package/dist/src/tools/mcp-client.test.d.ts +6 -0
- package/dist/src/tools/mcp-client.test.js +454 -0
- package/dist/src/tools/mcp-client.test.js.map +1 -0
- package/dist/src/tools/mcp-tool.d.ts +23 -0
- package/dist/src/tools/mcp-tool.js +240 -0
- package/dist/src/tools/mcp-tool.js.map +1 -0
- package/dist/src/tools/mcp-tool.test.d.ts +6 -0
- package/dist/src/tools/mcp-tool.test.js +576 -0
- package/dist/src/tools/mcp-tool.test.js.map +1 -0
- package/dist/src/tools/memoryTool.d.ts +41 -0
- package/dist/src/tools/memoryTool.js +435 -0
- package/dist/src/tools/memoryTool.js.map +1 -0
- package/dist/src/tools/memoryTool.test.d.ts +6 -0
- package/dist/src/tools/memoryTool.test.js +420 -0
- package/dist/src/tools/memoryTool.test.js.map +1 -0
- package/dist/src/tools/modifiable-tool.d.ts +32 -0
- package/dist/src/tools/modifiable-tool.js +88 -0
- package/dist/src/tools/modifiable-tool.js.map +1 -0
- package/dist/src/tools/modifiable-tool.test.d.ts +6 -0
- package/dist/src/tools/modifiable-tool.test.js +193 -0
- package/dist/src/tools/modifiable-tool.test.js.map +1 -0
- package/dist/src/tools/read-file.d.ts +35 -0
- package/dist/src/tools/read-file.js +128 -0
- package/dist/src/tools/read-file.js.map +1 -0
- package/dist/src/tools/read-file.test.d.ts +6 -0
- package/dist/src/tools/read-file.test.js +311 -0
- package/dist/src/tools/read-file.test.js.map +1 -0
- package/dist/src/tools/read-many-files.d.ts +60 -0
- package/dist/src/tools/read-many-files.js +416 -0
- package/dist/src/tools/read-many-files.js.map +1 -0
- package/dist/src/tools/read-many-files.test.d.ts +6 -0
- package/dist/src/tools/read-many-files.test.js +565 -0
- package/dist/src/tools/read-many-files.test.js.map +1 -0
- package/dist/src/tools/ripGrep.d.ts +47 -0
- package/dist/src/tools/ripGrep.js +375 -0
- package/dist/src/tools/ripGrep.js.map +1 -0
- package/dist/src/tools/ripGrep.test.d.ts +6 -0
- package/dist/src/tools/ripGrep.test.js +874 -0
- package/dist/src/tools/ripGrep.test.js.map +1 -0
- package/dist/src/tools/shell.d.ts +23 -0
- package/dist/src/tools/shell.js +387 -0
- package/dist/src/tools/shell.js.map +1 -0
- package/dist/src/tools/shell.test.d.ts +6 -0
- package/dist/src/tools/shell.test.js +632 -0
- package/dist/src/tools/shell.test.js.map +1 -0
- package/dist/src/tools/task.d.ts +59 -0
- package/dist/src/tools/task.js +412 -0
- package/dist/src/tools/task.js.map +1 -0
- package/dist/src/tools/task.test.d.ts +6 -0
- package/dist/src/tools/task.test.js +369 -0
- package/dist/src/tools/task.test.js.map +1 -0
- package/dist/src/tools/todoWrite.d.ts +42 -0
- package/dist/src/tools/todoWrite.js +385 -0
- package/dist/src/tools/todoWrite.js.map +1 -0
- package/dist/src/tools/todoWrite.test.d.ts +6 -0
- package/dist/src/tools/todoWrite.test.js +222 -0
- package/dist/src/tools/todoWrite.test.js.map +1 -0
- package/dist/src/tools/tool-error.d.ts +43 -0
- package/dist/src/tools/tool-error.js +58 -0
- package/dist/src/tools/tool-error.js.map +1 -0
- package/dist/src/tools/tool-names.d.ts +23 -0
- package/dist/src/tools/tool-names.js +24 -0
- package/dist/src/tools/tool-names.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +86 -0
- package/dist/src/tools/tool-registry.js +369 -0
- package/dist/src/tools/tool-registry.js.map +1 -0
- package/dist/src/tools/tool-registry.test.d.ts +6 -0
- package/dist/src/tools/tool-registry.test.js +332 -0
- package/dist/src/tools/tool-registry.test.js.map +1 -0
- package/dist/src/tools/tools.d.ts +316 -0
- package/dist/src/tools/tools.js +251 -0
- package/dist/src/tools/tools.js.map +1 -0
- package/dist/src/tools/tools.test.d.ts +6 -0
- package/dist/src/tools/tools.test.js +205 -0
- package/dist/src/tools/tools.test.js.map +1 -0
- package/dist/src/tools/web-fetch.d.ts +31 -0
- package/dist/src/tools/web-fetch.js +161 -0
- package/dist/src/tools/web-fetch.js.map +1 -0
- package/dist/src/tools/web-fetch.test.d.ts +6 -0
- package/dist/src/tools/web-fetch.test.js +133 -0
- package/dist/src/tools/web-fetch.test.js.map +1 -0
- package/dist/src/tools/web-search.d.ts +40 -0
- package/dist/src/tools/web-search.js +134 -0
- package/dist/src/tools/web-search.js.map +1 -0
- package/dist/src/tools/web-search.test.d.ts +6 -0
- package/dist/src/tools/web-search.test.js +125 -0
- package/dist/src/tools/web-search.test.js.map +1 -0
- package/dist/src/tools/write-file.d.ts +52 -0
- package/dist/src/tools/write-file.js +298 -0
- package/dist/src/tools/write-file.js.map +1 -0
- package/dist/src/tools/write-file.test.d.ts +6 -0
- package/dist/src/tools/write-file.test.js +436 -0
- package/dist/src/tools/write-file.test.js.map +1 -0
- package/dist/src/utils/LruCache.d.ts +13 -0
- package/dist/src/utils/LruCache.js +38 -0
- package/dist/src/utils/LruCache.js.map +1 -0
- package/dist/src/utils/bfsFileSearch.d.ts +24 -0
- package/dist/src/utils/bfsFileSearch.js +89 -0
- package/dist/src/utils/bfsFileSearch.js.map +1 -0
- package/dist/src/utils/bfsFileSearch.test.d.ts +6 -0
- package/dist/src/utils/bfsFileSearch.test.js +163 -0
- package/dist/src/utils/bfsFileSearch.test.js.map +1 -0
- package/dist/src/utils/browser.d.ts +13 -0
- package/dist/src/utils/browser.js +50 -0
- package/dist/src/utils/browser.js.map +1 -0
- package/dist/src/utils/editor.d.ts +28 -0
- package/dist/src/utils/editor.js +186 -0
- package/dist/src/utils/editor.js.map +1 -0
- package/dist/src/utils/editor.test.d.ts +6 -0
- package/dist/src/utils/editor.test.js +445 -0
- package/dist/src/utils/editor.test.js.map +1 -0
- package/dist/src/utils/environmentContext.d.ts +21 -0
- package/dist/src/utils/environmentContext.js +90 -0
- package/dist/src/utils/environmentContext.js.map +1 -0
- package/dist/src/utils/environmentContext.test.d.ts +6 -0
- package/dist/src/utils/environmentContext.test.js +148 -0
- package/dist/src/utils/environmentContext.test.js.map +1 -0
- package/dist/src/utils/errorParsing.d.ts +8 -0
- package/dist/src/utils/errorParsing.js +93 -0
- package/dist/src/utils/errorParsing.js.map +1 -0
- package/dist/src/utils/errorParsing.test.d.ts +6 -0
- package/dist/src/utils/errorParsing.test.js +172 -0
- package/dist/src/utils/errorParsing.test.js.map +1 -0
- package/dist/src/utils/errorReporting.d.ts +14 -0
- package/dist/src/utils/errorReporting.js +88 -0
- package/dist/src/utils/errorReporting.js.map +1 -0
- package/dist/src/utils/errorReporting.test.d.ts +6 -0
- package/dist/src/utils/errorReporting.test.js +130 -0
- package/dist/src/utils/errorReporting.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +33 -0
- package/dist/src/utils/errors.js +86 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/fetch.d.ts +11 -0
- package/dist/src/utils/fetch.js +51 -0
- package/dist/src/utils/fetch.js.map +1 -0
- package/dist/src/utils/fileUtils.d.ts +53 -0
- package/dist/src/utils/fileUtils.js +283 -0
- package/dist/src/utils/fileUtils.js.map +1 -0
- package/dist/src/utils/fileUtils.test.d.ts +6 -0
- package/dist/src/utils/fileUtils.test.js +364 -0
- package/dist/src/utils/fileUtils.test.js.map +1 -0
- package/dist/src/utils/filesearch/crawlCache.d.ts +25 -0
- package/dist/src/utils/filesearch/crawlCache.js +57 -0
- package/dist/src/utils/filesearch/crawlCache.js.map +1 -0
- package/dist/src/utils/filesearch/crawlCache.test.d.ts +6 -0
- package/dist/src/utils/filesearch/crawlCache.test.js +103 -0
- package/dist/src/utils/filesearch/crawlCache.test.js.map +1 -0
- package/dist/src/utils/filesearch/crawler.d.ts +15 -0
- package/dist/src/utils/filesearch/crawler.js +50 -0
- package/dist/src/utils/filesearch/crawler.js.map +1 -0
- package/dist/src/utils/filesearch/crawler.test.d.ts +6 -0
- package/dist/src/utils/filesearch/crawler.test.js +468 -0
- package/dist/src/utils/filesearch/crawler.test.js.map +1 -0
- package/dist/src/utils/filesearch/fileSearch.d.ts +38 -0
- package/dist/src/utils/filesearch/fileSearch.js +191 -0
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -0
- package/dist/src/utils/filesearch/fileSearch.test.d.ts +6 -0
- package/dist/src/utils/filesearch/fileSearch.test.js +642 -0
- package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -0
- package/dist/src/utils/filesearch/ignore.d.ts +42 -0
- package/dist/src/utils/filesearch/ignore.js +106 -0
- package/dist/src/utils/filesearch/ignore.js.map +1 -0
- package/dist/src/utils/filesearch/ignore.test.d.ts +6 -0
- package/dist/src/utils/filesearch/ignore.test.js +144 -0
- package/dist/src/utils/filesearch/ignore.test.js.map +1 -0
- package/dist/src/utils/filesearch/result-cache.d.ts +33 -0
- package/dist/src/utils/filesearch/result-cache.js +59 -0
- package/dist/src/utils/filesearch/result-cache.js.map +1 -0
- package/dist/src/utils/filesearch/result-cache.test.d.ts +6 -0
- package/dist/src/utils/filesearch/result-cache.test.js +46 -0
- package/dist/src/utils/filesearch/result-cache.test.js.map +1 -0
- package/dist/src/utils/flashFallback.integration.test.d.ts +6 -0
- package/dist/src/utils/flashFallback.integration.test.js +119 -0
- package/dist/src/utils/flashFallback.integration.test.js.map +1 -0
- package/dist/src/utils/formatters.d.ts +6 -0
- package/dist/src/utils/formatters.js +16 -0
- package/dist/src/utils/formatters.js.map +1 -0
- package/dist/src/utils/generateContentResponseUtilities.d.ts +13 -0
- package/dist/src/utils/generateContentResponseUtilities.js +80 -0
- package/dist/src/utils/generateContentResponseUtilities.js.map +1 -0
- package/dist/src/utils/generateContentResponseUtilities.test.d.ts +6 -0
- package/dist/src/utils/generateContentResponseUtilities.test.js +235 -0
- package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -0
- package/dist/src/utils/getFolderStructure.d.ts +31 -0
- package/dist/src/utils/getFolderStructure.js +246 -0
- package/dist/src/utils/getFolderStructure.js.map +1 -0
- package/dist/src/utils/getFolderStructure.test.d.ts +6 -0
- package/dist/src/utils/getFolderStructure.test.js +282 -0
- package/dist/src/utils/getFolderStructure.test.js.map +1 -0
- package/dist/src/utils/getPty.d.ts +19 -0
- package/dist/src/utils/getPty.js +23 -0
- package/dist/src/utils/getPty.js.map +1 -0
- package/dist/src/utils/gitIgnoreParser.d.ts +20 -0
- package/dist/src/utils/gitIgnoreParser.js +61 -0
- package/dist/src/utils/gitIgnoreParser.js.map +1 -0
- package/dist/src/utils/gitIgnoreParser.test.d.ts +6 -0
- package/dist/src/utils/gitIgnoreParser.test.js +154 -0
- package/dist/src/utils/gitIgnoreParser.test.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +17 -0
- package/dist/src/utils/gitUtils.js +61 -0
- package/dist/src/utils/gitUtils.js.map +1 -0
- package/dist/src/utils/ignorePatterns.d.ts +103 -0
- package/dist/src/utils/ignorePatterns.js +220 -0
- package/dist/src/utils/ignorePatterns.js.map +1 -0
- package/dist/src/utils/ignorePatterns.test.d.ts +6 -0
- package/dist/src/utils/ignorePatterns.test.js +250 -0
- package/dist/src/utils/ignorePatterns.test.js.map +1 -0
- package/dist/src/utils/installationManager.d.ts +16 -0
- package/dist/src/utils/installationManager.js +50 -0
- package/dist/src/utils/installationManager.js.map +1 -0
- package/dist/src/utils/installationManager.test.d.ts +6 -0
- package/dist/src/utils/installationManager.test.js +83 -0
- package/dist/src/utils/installationManager.test.js.map +1 -0
- package/dist/src/utils/language-detection.d.ts +6 -0
- package/dist/src/utils/language-detection.js +101 -0
- package/dist/src/utils/language-detection.js.map +1 -0
- package/dist/src/utils/memoryDiscovery.d.ts +15 -0
- package/dist/src/utils/memoryDiscovery.js +271 -0
- package/dist/src/utils/memoryDiscovery.js.map +1 -0
- package/dist/src/utils/memoryDiscovery.test.d.ts +6 -0
- package/dist/src/utils/memoryDiscovery.test.js +219 -0
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -0
- package/dist/src/utils/memoryImportProcessor.d.ts +42 -0
- package/dist/src/utils/memoryImportProcessor.js +296 -0
- package/dist/src/utils/memoryImportProcessor.js.map +1 -0
- package/dist/src/utils/memoryImportProcessor.test.d.ts +6 -0
- package/dist/src/utils/memoryImportProcessor.test.js +573 -0
- package/dist/src/utils/memoryImportProcessor.test.js.map +1 -0
- package/dist/src/utils/messageInspectors.d.ts +8 -0
- package/dist/src/utils/messageInspectors.js +16 -0
- package/dist/src/utils/messageInspectors.js.map +1 -0
- package/dist/src/utils/nextSpeakerChecker.d.ts +12 -0
- package/dist/src/utils/nextSpeakerChecker.js +91 -0
- package/dist/src/utils/nextSpeakerChecker.js.map +1 -0
- package/dist/src/utils/nextSpeakerChecker.test.d.ts +6 -0
- package/dist/src/utils/nextSpeakerChecker.test.js +168 -0
- package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -0
- package/dist/src/utils/openaiLogger.d.ts +42 -0
- package/dist/src/utils/openaiLogger.js +123 -0
- package/dist/src/utils/openaiLogger.js.map +1 -0
- package/dist/src/utils/partUtils.d.ts +35 -0
- package/dist/src/utils/partUtils.js +133 -0
- package/dist/src/utils/partUtils.js.map +1 -0
- package/dist/src/utils/partUtils.test.d.ts +6 -0
- package/dist/src/utils/partUtils.test.js +241 -0
- package/dist/src/utils/partUtils.test.js.map +1 -0
- package/dist/src/utils/pathReader.d.ts +17 -0
- package/dist/src/utils/pathReader.js +92 -0
- package/dist/src/utils/pathReader.js.map +1 -0
- package/dist/src/utils/pathReader.test.d.ts +6 -0
- package/dist/src/utils/pathReader.test.js +363 -0
- package/dist/src/utils/pathReader.test.js.map +1 -0
- package/dist/src/utils/paths.d.ts +58 -0
- package/dist/src/utils/paths.js +159 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/paths.test.d.ts +6 -0
- package/dist/src/utils/paths.test.js +225 -0
- package/dist/src/utils/paths.test.js.map +1 -0
- package/dist/src/utils/projectSummary.d.ts +22 -0
- package/dist/src/utils/projectSummary.js +86 -0
- package/dist/src/utils/projectSummary.js.map +1 -0
- package/dist/src/utils/quotaErrorDetection.d.ts +20 -0
- package/dist/src/utils/quotaErrorDetection.js +114 -0
- package/dist/src/utils/quotaErrorDetection.js.map +1 -0
- package/dist/src/utils/quotaErrorDetection.test.d.ts +6 -0
- package/dist/src/utils/quotaErrorDetection.test.js +153 -0
- package/dist/src/utils/quotaErrorDetection.test.js.map +1 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.d.ts +112 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.js +401 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.js.map +1 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.test.d.ts +6 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.test.js +114 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.test.js.map +1 -0
- package/dist/src/utils/request-tokenizer/index.d.ts +18 -0
- package/dist/src/utils/request-tokenizer/index.js +30 -0
- package/dist/src/utils/request-tokenizer/index.js.map +1 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.d.ts +56 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.js +263 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.js.map +1 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.test.d.ts +6 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.test.js +245 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.test.js.map +1 -0
- package/dist/src/utils/request-tokenizer/supportedImageFormats.d.ts +30 -0
- package/dist/src/utils/request-tokenizer/supportedImageFormats.js +41 -0
- package/dist/src/utils/request-tokenizer/supportedImageFormats.js.map +1 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.d.ts +29 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.js +88 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.js.map +1 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.test.d.ts +6 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.test.js +253 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.test.js.map +1 -0
- package/dist/src/utils/request-tokenizer/types.d.ts +55 -0
- package/dist/src/utils/request-tokenizer/types.js +7 -0
- package/dist/src/utils/request-tokenizer/types.js.map +1 -0
- package/dist/src/utils/retry.d.ts +30 -0
- package/dist/src/utils/retry.js +288 -0
- package/dist/src/utils/retry.js.map +1 -0
- package/dist/src/utils/retry.test.d.ts +6 -0
- package/dist/src/utils/retry.test.js +452 -0
- package/dist/src/utils/retry.test.js.map +1 -0
- package/dist/src/utils/safeJsonParse.d.ts +15 -0
- package/dist/src/utils/safeJsonParse.js +41 -0
- package/dist/src/utils/safeJsonParse.js.map +1 -0
- package/dist/src/utils/safeJsonParse.test.d.ts +6 -0
- package/dist/src/utils/safeJsonParse.test.js +112 -0
- package/dist/src/utils/safeJsonParse.test.js.map +1 -0
- package/dist/src/utils/safeJsonStringify.d.ts +13 -0
- package/dist/src/utils/safeJsonStringify.js +25 -0
- package/dist/src/utils/safeJsonStringify.js.map +1 -0
- package/dist/src/utils/safeJsonStringify.test.d.ts +6 -0
- package/dist/src/utils/safeJsonStringify.test.js +61 -0
- package/dist/src/utils/safeJsonStringify.test.js.map +1 -0
- package/dist/src/utils/schemaValidator.d.ts +15 -0
- package/dist/src/utils/schemaValidator.js +57 -0
- package/dist/src/utils/schemaValidator.js.map +1 -0
- package/dist/src/utils/secure-browser-launcher.d.ts +23 -0
- package/dist/src/utils/secure-browser-launcher.js +165 -0
- package/dist/src/utils/secure-browser-launcher.js.map +1 -0
- package/dist/src/utils/secure-browser-launcher.test.d.ts +6 -0
- package/dist/src/utils/secure-browser-launcher.test.js +149 -0
- package/dist/src/utils/secure-browser-launcher.test.js.map +1 -0
- package/dist/src/utils/session.d.ts +6 -0
- package/dist/src/utils/session.js +8 -0
- package/dist/src/utils/session.js.map +1 -0
- package/dist/src/utils/shell-utils.d.ts +121 -0
- package/dist/src/utils/shell-utils.js +381 -0
- package/dist/src/utils/shell-utils.js.map +1 -0
- package/dist/src/utils/shell-utils.test.d.ts +6 -0
- package/dist/src/utils/shell-utils.test.js +346 -0
- package/dist/src/utils/shell-utils.test.js.map +1 -0
- package/dist/src/utils/shellReadOnlyChecker.d.ts +6 -0
- package/dist/src/utils/shellReadOnlyChecker.js +247 -0
- package/dist/src/utils/shellReadOnlyChecker.js.map +1 -0
- package/dist/src/utils/shellReadOnlyChecker.test.d.ts +6 -0
- package/dist/src/utils/shellReadOnlyChecker.test.js +47 -0
- package/dist/src/utils/shellReadOnlyChecker.test.js.map +1 -0
- package/dist/src/utils/subagentGenerator.d.ts +20 -0
- package/dist/src/utils/subagentGenerator.js +116 -0
- package/dist/src/utils/subagentGenerator.js.map +1 -0
- package/dist/src/utils/subagentGenerator.test.d.ts +6 -0
- package/dist/src/utils/subagentGenerator.test.js +158 -0
- package/dist/src/utils/subagentGenerator.test.js.map +1 -0
- package/dist/src/utils/summarizer.d.ts +25 -0
- package/dist/src/utils/summarizer.js +51 -0
- package/dist/src/utils/summarizer.js.map +1 -0
- package/dist/src/utils/summarizer.test.d.ts +6 -0
- package/dist/src/utils/summarizer.test.js +131 -0
- package/dist/src/utils/summarizer.test.js.map +1 -0
- package/dist/src/utils/systemEncoding.d.ts +40 -0
- package/dist/src/utils/systemEncoding.js +149 -0
- package/dist/src/utils/systemEncoding.js.map +1 -0
- package/dist/src/utils/systemEncoding.test.d.ts +6 -0
- package/dist/src/utils/systemEncoding.test.js +368 -0
- package/dist/src/utils/systemEncoding.test.js.map +1 -0
- package/dist/src/utils/testUtils.d.ts +29 -0
- package/dist/src/utils/testUtils.js +70 -0
- package/dist/src/utils/testUtils.js.map +1 -0
- package/dist/src/utils/textUtils.d.ts +13 -0
- package/dist/src/utils/textUtils.js +28 -0
- package/dist/src/utils/textUtils.js.map +1 -0
- package/dist/src/utils/tool-utils.d.ts +19 -0
- package/dist/src/utils/tool-utils.js +58 -0
- package/dist/src/utils/tool-utils.js.map +1 -0
- package/dist/src/utils/tool-utils.test.d.ts +6 -0
- package/dist/src/utils/tool-utils.test.js +61 -0
- package/dist/src/utils/tool-utils.test.js.map +1 -0
- package/dist/src/utils/userAccountManager.d.ts +20 -0
- package/dist/src/utils/userAccountManager.js +114 -0
- package/dist/src/utils/userAccountManager.js.map +1 -0
- package/dist/src/utils/userAccountManager.test.d.ts +6 -0
- package/dist/src/utils/userAccountManager.test.js +223 -0
- package/dist/src/utils/userAccountManager.test.js.map +1 -0
- package/dist/src/utils/workspaceContext.d.ts +66 -0
- package/dist/src/utils/workspaceContext.js +171 -0
- package/dist/src/utils/workspaceContext.js.map +1 -0
- package/dist/src/utils/workspaceContext.test.d.ts +6 -0
- package/dist/src/utils/workspaceContext.test.js +318 -0
- package/dist/src/utils/workspaceContext.test.js.map +1 -0
- package/dist/src/utils/yaml-parser.d.ts +29 -0
- package/dist/src/utils/yaml-parser.js +172 -0
- package/dist/src/utils/yaml-parser.js.map +1 -0
- package/dist/src/utils/yaml-parser.test.d.ts +6 -0
- package/dist/src/utils/yaml-parser.test.js +170 -0
- package/dist/src/utils/yaml-parser.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { vi, describe, it, expect, beforeEach, afterEach, } from 'vitest';
|
|
7
|
+
const mockShellExecutionService = vi.hoisted(() => vi.fn());
|
|
8
|
+
vi.mock('../services/shellExecutionService.js', () => ({
|
|
9
|
+
ShellExecutionService: { execute: mockShellExecutionService },
|
|
10
|
+
}));
|
|
11
|
+
vi.mock('fs');
|
|
12
|
+
vi.mock('os');
|
|
13
|
+
vi.mock('crypto');
|
|
14
|
+
vi.mock('../utils/summarizer.js');
|
|
15
|
+
import { isCommandAllowed } from '../utils/shell-utils.js';
|
|
16
|
+
import { ShellTool } from './shell.js';
|
|
17
|
+
import {} from '../config/config.js';
|
|
18
|
+
import {} from '../services/shellExecutionService.js';
|
|
19
|
+
import * as fs from 'node:fs';
|
|
20
|
+
import * as os from 'node:os';
|
|
21
|
+
import { EOL } from 'node:os';
|
|
22
|
+
import * as path from 'node:path';
|
|
23
|
+
import * as crypto from 'node:crypto';
|
|
24
|
+
import * as summarizer from '../utils/summarizer.js';
|
|
25
|
+
import { ToolErrorType } from './tool-error.js';
|
|
26
|
+
import { ToolConfirmationOutcome } from './tools.js';
|
|
27
|
+
import { OUTPUT_UPDATE_INTERVAL_MS } from './shell.js';
|
|
28
|
+
import { createMockWorkspaceContext } from '../test-utils/mockWorkspaceContext.js';
|
|
29
|
+
describe('ShellTool', () => {
|
|
30
|
+
let shellTool;
|
|
31
|
+
let mockConfig;
|
|
32
|
+
let mockShellOutputCallback;
|
|
33
|
+
let resolveExecutionPromise;
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
vi.clearAllMocks();
|
|
36
|
+
mockConfig = {
|
|
37
|
+
getCoreTools: vi.fn().mockReturnValue([]),
|
|
38
|
+
getExcludeTools: vi.fn().mockReturnValue([]),
|
|
39
|
+
getDebugMode: vi.fn().mockReturnValue(false),
|
|
40
|
+
getTargetDir: vi.fn().mockReturnValue('/test/dir'),
|
|
41
|
+
getSummarizeToolOutputConfig: vi.fn().mockReturnValue(undefined),
|
|
42
|
+
getWorkspaceContext: () => createMockWorkspaceContext('.'),
|
|
43
|
+
getGeminiClient: vi.fn(),
|
|
44
|
+
getGitCoAuthor: vi.fn().mockReturnValue({
|
|
45
|
+
enabled: true,
|
|
46
|
+
name: 'BlackboxAI',
|
|
47
|
+
email: 'code@blackbox.ai',
|
|
48
|
+
}),
|
|
49
|
+
getShouldUseNodePtyShell: vi.fn().mockReturnValue(false),
|
|
50
|
+
};
|
|
51
|
+
shellTool = new ShellTool(mockConfig);
|
|
52
|
+
vi.mocked(os.platform).mockReturnValue('linux');
|
|
53
|
+
vi.mocked(os.tmpdir).mockReturnValue('/tmp');
|
|
54
|
+
vi.mocked(crypto.randomBytes).mockReturnValue(Buffer.from('abcdef', 'hex'));
|
|
55
|
+
// Capture the output callback to simulate streaming events from the service
|
|
56
|
+
mockShellExecutionService.mockImplementation((_cmd, _cwd, callback) => {
|
|
57
|
+
mockShellOutputCallback = callback;
|
|
58
|
+
return {
|
|
59
|
+
pid: 12345,
|
|
60
|
+
result: new Promise((resolve) => {
|
|
61
|
+
resolveExecutionPromise = resolve;
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
describe('isCommandAllowed', () => {
|
|
67
|
+
it('should allow a command if no restrictions are provided', () => {
|
|
68
|
+
mockConfig.getCoreTools.mockReturnValue(undefined);
|
|
69
|
+
mockConfig.getExcludeTools.mockReturnValue(undefined);
|
|
70
|
+
expect(isCommandAllowed('ls -l', mockConfig).allowed).toBe(true);
|
|
71
|
+
});
|
|
72
|
+
it('should block a command with command substitution using $()', () => {
|
|
73
|
+
expect(isCommandAllowed('echo $(rm -rf /)', mockConfig).allowed).toBe(false);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('build', () => {
|
|
77
|
+
it('should return an invocation for a valid command', () => {
|
|
78
|
+
const invocation = shellTool.build({
|
|
79
|
+
command: 'ls -l',
|
|
80
|
+
is_background: false,
|
|
81
|
+
});
|
|
82
|
+
expect(invocation).toBeDefined();
|
|
83
|
+
});
|
|
84
|
+
it('should throw an error for an empty command', () => {
|
|
85
|
+
expect(() => shellTool.build({ command: ' ', is_background: false })).toThrow('Command cannot be empty.');
|
|
86
|
+
});
|
|
87
|
+
it('should throw an error for a non-existent directory', () => {
|
|
88
|
+
vi.mocked(fs.existsSync).mockReturnValue(false);
|
|
89
|
+
expect(() => shellTool.build({
|
|
90
|
+
command: 'ls',
|
|
91
|
+
directory: 'rel/path',
|
|
92
|
+
is_background: false,
|
|
93
|
+
})).toThrow("Directory 'rel/path' is not a registered workspace directory.");
|
|
94
|
+
});
|
|
95
|
+
it('should include background indicator in description when is_background is true', () => {
|
|
96
|
+
const invocation = shellTool.build({
|
|
97
|
+
command: 'npm start',
|
|
98
|
+
is_background: true,
|
|
99
|
+
});
|
|
100
|
+
expect(invocation.getDescription()).toContain('[background]');
|
|
101
|
+
});
|
|
102
|
+
it('should not include background indicator in description when is_background is false', () => {
|
|
103
|
+
const invocation = shellTool.build({
|
|
104
|
+
command: 'npm test',
|
|
105
|
+
is_background: false,
|
|
106
|
+
});
|
|
107
|
+
expect(invocation.getDescription()).not.toContain('[background]');
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
describe('execute', () => {
|
|
111
|
+
const mockAbortSignal = new AbortController().signal;
|
|
112
|
+
const resolveShellExecution = (result = {}) => {
|
|
113
|
+
const fullResult = {
|
|
114
|
+
rawOutput: Buffer.from(result.output || ''),
|
|
115
|
+
output: 'Success',
|
|
116
|
+
exitCode: 0,
|
|
117
|
+
signal: null,
|
|
118
|
+
error: null,
|
|
119
|
+
aborted: false,
|
|
120
|
+
pid: 12345,
|
|
121
|
+
executionMethod: 'child_process',
|
|
122
|
+
...result,
|
|
123
|
+
};
|
|
124
|
+
resolveExecutionPromise(fullResult);
|
|
125
|
+
};
|
|
126
|
+
it('should wrap command on linux and parse pgrep output', async () => {
|
|
127
|
+
const invocation = shellTool.build({
|
|
128
|
+
command: 'my-command &',
|
|
129
|
+
is_background: false,
|
|
130
|
+
});
|
|
131
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
132
|
+
resolveShellExecution({ pid: 54321 });
|
|
133
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
134
|
+
vi.mocked(fs.readFileSync).mockReturnValue(`54321${EOL}54322${EOL}`); // Service PID and background PID
|
|
135
|
+
const result = await promise;
|
|
136
|
+
const tmpFile = path.join(os.tmpdir(), 'shell_pgrep_abcdef.tmp');
|
|
137
|
+
const wrappedCommand = `{ my-command & }; __code=$?; pgrep -g 0 >${tmpFile} 2>&1; exit $__code;`;
|
|
138
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(wrappedCommand, expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
139
|
+
expect(result.llmContent).toContain('Background PIDs: 54322');
|
|
140
|
+
expect(vi.mocked(fs.unlinkSync)).toHaveBeenCalledWith(tmpFile);
|
|
141
|
+
});
|
|
142
|
+
it('should add ampersand to command when is_background is true and command does not end with &', async () => {
|
|
143
|
+
const invocation = shellTool.build({
|
|
144
|
+
command: 'npm start',
|
|
145
|
+
is_background: true,
|
|
146
|
+
});
|
|
147
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
148
|
+
resolveShellExecution({ pid: 54321 });
|
|
149
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
150
|
+
vi.mocked(fs.readFileSync).mockReturnValue('54321\n54322\n');
|
|
151
|
+
await promise;
|
|
152
|
+
const tmpFile = path.join(os.tmpdir(), 'shell_pgrep_abcdef.tmp');
|
|
153
|
+
const wrappedCommand = `{ npm start & }; __code=$?; pgrep -g 0 >${tmpFile} 2>&1; exit $__code;`;
|
|
154
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(wrappedCommand, expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
155
|
+
});
|
|
156
|
+
it('should not add extra ampersand when is_background is true and command already ends with &', async () => {
|
|
157
|
+
const invocation = shellTool.build({
|
|
158
|
+
command: 'npm start &',
|
|
159
|
+
is_background: true,
|
|
160
|
+
});
|
|
161
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
162
|
+
resolveShellExecution({ pid: 54321 });
|
|
163
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
164
|
+
vi.mocked(fs.readFileSync).mockReturnValue('54321\n54322\n');
|
|
165
|
+
await promise;
|
|
166
|
+
const tmpFile = path.join(os.tmpdir(), 'shell_pgrep_abcdef.tmp');
|
|
167
|
+
const wrappedCommand = `{ npm start & }; __code=$?; pgrep -g 0 >${tmpFile} 2>&1; exit $__code;`;
|
|
168
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(wrappedCommand, expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
169
|
+
});
|
|
170
|
+
it('should not add ampersand when is_background is false', async () => {
|
|
171
|
+
const invocation = shellTool.build({
|
|
172
|
+
command: 'npm test',
|
|
173
|
+
is_background: false,
|
|
174
|
+
});
|
|
175
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
176
|
+
resolveShellExecution({ pid: 54321 });
|
|
177
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
178
|
+
vi.mocked(fs.readFileSync).mockReturnValue('54321\n54322\n');
|
|
179
|
+
await promise;
|
|
180
|
+
const tmpFile = path.join(os.tmpdir(), 'shell_pgrep_abcdef.tmp');
|
|
181
|
+
const wrappedCommand = `{ npm test; }; __code=$?; pgrep -g 0 >${tmpFile} 2>&1; exit $__code;`;
|
|
182
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(wrappedCommand, expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
183
|
+
});
|
|
184
|
+
it('should not wrap command on windows', async () => {
|
|
185
|
+
vi.mocked(os.platform).mockReturnValue('win32');
|
|
186
|
+
const invocation = shellTool.build({
|
|
187
|
+
command: 'dir',
|
|
188
|
+
is_background: false,
|
|
189
|
+
});
|
|
190
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
191
|
+
resolveShellExecution({
|
|
192
|
+
rawOutput: Buffer.from(''),
|
|
193
|
+
output: '',
|
|
194
|
+
exitCode: 0,
|
|
195
|
+
signal: null,
|
|
196
|
+
error: null,
|
|
197
|
+
aborted: false,
|
|
198
|
+
pid: 12345,
|
|
199
|
+
executionMethod: 'child_process',
|
|
200
|
+
});
|
|
201
|
+
await promise;
|
|
202
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith('dir', expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
203
|
+
});
|
|
204
|
+
it('should format error messages correctly', async () => {
|
|
205
|
+
const error = new Error('wrapped command failed');
|
|
206
|
+
const invocation = shellTool.build({
|
|
207
|
+
command: 'user-command',
|
|
208
|
+
is_background: false,
|
|
209
|
+
});
|
|
210
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
211
|
+
resolveShellExecution({
|
|
212
|
+
error,
|
|
213
|
+
exitCode: 1,
|
|
214
|
+
output: 'err',
|
|
215
|
+
rawOutput: Buffer.from('err'),
|
|
216
|
+
signal: null,
|
|
217
|
+
aborted: false,
|
|
218
|
+
pid: 12345,
|
|
219
|
+
executionMethod: 'child_process',
|
|
220
|
+
});
|
|
221
|
+
const result = await promise;
|
|
222
|
+
expect(result.llmContent).toContain('Error: wrapped command failed');
|
|
223
|
+
expect(result.llmContent).not.toContain('pgrep');
|
|
224
|
+
});
|
|
225
|
+
it('should return a SHELL_EXECUTE_ERROR for a command failure', async () => {
|
|
226
|
+
const error = new Error('command failed');
|
|
227
|
+
const invocation = shellTool.build({
|
|
228
|
+
command: 'user-command',
|
|
229
|
+
is_background: false,
|
|
230
|
+
});
|
|
231
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
232
|
+
resolveShellExecution({
|
|
233
|
+
error,
|
|
234
|
+
exitCode: 1,
|
|
235
|
+
});
|
|
236
|
+
const result = await promise;
|
|
237
|
+
expect(result.error).toBeDefined();
|
|
238
|
+
expect(result.error?.type).toBe(ToolErrorType.SHELL_EXECUTE_ERROR);
|
|
239
|
+
expect(result.error?.message).toBe('command failed');
|
|
240
|
+
});
|
|
241
|
+
it('should throw an error for invalid parameters', () => {
|
|
242
|
+
expect(() => shellTool.build({ command: '', is_background: false })).toThrow('Command cannot be empty.');
|
|
243
|
+
});
|
|
244
|
+
it('should throw an error for invalid directory', () => {
|
|
245
|
+
vi.mocked(fs.existsSync).mockReturnValue(false);
|
|
246
|
+
expect(() => shellTool.build({
|
|
247
|
+
command: 'ls',
|
|
248
|
+
directory: 'nonexistent',
|
|
249
|
+
is_background: false,
|
|
250
|
+
})).toThrow(`Directory 'nonexistent' is not a registered workspace directory.`);
|
|
251
|
+
});
|
|
252
|
+
it('should summarize output when configured', async () => {
|
|
253
|
+
mockConfig.getSummarizeToolOutputConfig.mockReturnValue({
|
|
254
|
+
[shellTool.name]: { tokenBudget: 1000 },
|
|
255
|
+
});
|
|
256
|
+
vi.mocked(summarizer.summarizeToolOutput).mockResolvedValue('summarized output');
|
|
257
|
+
const invocation = shellTool.build({
|
|
258
|
+
command: 'ls',
|
|
259
|
+
is_background: false,
|
|
260
|
+
});
|
|
261
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
262
|
+
resolveExecutionPromise({
|
|
263
|
+
output: 'long output',
|
|
264
|
+
rawOutput: Buffer.from('long output'),
|
|
265
|
+
exitCode: 0,
|
|
266
|
+
signal: null,
|
|
267
|
+
error: null,
|
|
268
|
+
aborted: false,
|
|
269
|
+
pid: 12345,
|
|
270
|
+
executionMethod: 'child_process',
|
|
271
|
+
});
|
|
272
|
+
const result = await promise;
|
|
273
|
+
expect(summarizer.summarizeToolOutput).toHaveBeenCalledWith(expect.any(String), mockConfig.getGeminiClient(), mockAbortSignal, 1000);
|
|
274
|
+
expect(result.llmContent).toBe('summarized output');
|
|
275
|
+
expect(result.returnDisplay).toBe('long output');
|
|
276
|
+
});
|
|
277
|
+
it('should clean up the temp file on synchronous execution error', async () => {
|
|
278
|
+
const error = new Error('sync spawn error');
|
|
279
|
+
mockShellExecutionService.mockImplementation(() => {
|
|
280
|
+
throw error;
|
|
281
|
+
});
|
|
282
|
+
vi.mocked(fs.existsSync).mockReturnValue(true); // Pretend the file exists
|
|
283
|
+
const invocation = shellTool.build({
|
|
284
|
+
command: 'a-command',
|
|
285
|
+
is_background: false,
|
|
286
|
+
});
|
|
287
|
+
await expect(invocation.execute(mockAbortSignal)).rejects.toThrow(error);
|
|
288
|
+
const tmpFile = path.join(os.tmpdir(), 'shell_pgrep_abcdef.tmp');
|
|
289
|
+
expect(vi.mocked(fs.unlinkSync)).toHaveBeenCalledWith(tmpFile);
|
|
290
|
+
});
|
|
291
|
+
describe('Streaming to `updateOutput`', () => {
|
|
292
|
+
let updateOutputMock;
|
|
293
|
+
beforeEach(() => {
|
|
294
|
+
vi.useFakeTimers({ toFake: ['Date'] });
|
|
295
|
+
updateOutputMock = vi.fn();
|
|
296
|
+
});
|
|
297
|
+
afterEach(() => {
|
|
298
|
+
vi.useRealTimers();
|
|
299
|
+
});
|
|
300
|
+
it('should throttle text output updates', async () => {
|
|
301
|
+
const invocation = shellTool.build({
|
|
302
|
+
command: 'stream',
|
|
303
|
+
is_background: false,
|
|
304
|
+
});
|
|
305
|
+
const promise = invocation.execute(mockAbortSignal, updateOutputMock);
|
|
306
|
+
// First chunk, should be throttled.
|
|
307
|
+
mockShellOutputCallback({
|
|
308
|
+
type: 'data',
|
|
309
|
+
chunk: 'hello ',
|
|
310
|
+
});
|
|
311
|
+
expect(updateOutputMock).not.toHaveBeenCalled();
|
|
312
|
+
// Advance time past the throttle interval.
|
|
313
|
+
await vi.advanceTimersByTimeAsync(OUTPUT_UPDATE_INTERVAL_MS + 1);
|
|
314
|
+
// Send a second chunk. THIS event triggers the update with the CUMULATIVE content.
|
|
315
|
+
mockShellOutputCallback({
|
|
316
|
+
type: 'data',
|
|
317
|
+
chunk: 'hello world',
|
|
318
|
+
});
|
|
319
|
+
// It should have been called once now with the combined output.
|
|
320
|
+
expect(updateOutputMock).toHaveBeenCalledOnce();
|
|
321
|
+
expect(updateOutputMock).toHaveBeenCalledWith('hello world');
|
|
322
|
+
resolveExecutionPromise({
|
|
323
|
+
rawOutput: Buffer.from(''),
|
|
324
|
+
output: '',
|
|
325
|
+
exitCode: 0,
|
|
326
|
+
signal: null,
|
|
327
|
+
error: null,
|
|
328
|
+
aborted: false,
|
|
329
|
+
pid: 12345,
|
|
330
|
+
executionMethod: 'child_process',
|
|
331
|
+
});
|
|
332
|
+
await promise;
|
|
333
|
+
});
|
|
334
|
+
it('should immediately show binary detection message and throttle progress', async () => {
|
|
335
|
+
const invocation = shellTool.build({
|
|
336
|
+
command: 'cat img',
|
|
337
|
+
is_background: false,
|
|
338
|
+
});
|
|
339
|
+
const promise = invocation.execute(mockAbortSignal, updateOutputMock);
|
|
340
|
+
mockShellOutputCallback({ type: 'binary_detected' });
|
|
341
|
+
expect(updateOutputMock).toHaveBeenCalledOnce();
|
|
342
|
+
expect(updateOutputMock).toHaveBeenCalledWith('[Binary output detected. Halting stream...]');
|
|
343
|
+
mockShellOutputCallback({
|
|
344
|
+
type: 'binary_progress',
|
|
345
|
+
bytesReceived: 1024,
|
|
346
|
+
});
|
|
347
|
+
expect(updateOutputMock).toHaveBeenCalledOnce();
|
|
348
|
+
// Advance time past the throttle interval.
|
|
349
|
+
await vi.advanceTimersByTimeAsync(OUTPUT_UPDATE_INTERVAL_MS + 1);
|
|
350
|
+
// Send a SECOND progress event. This one will trigger the flush.
|
|
351
|
+
mockShellOutputCallback({
|
|
352
|
+
type: 'binary_progress',
|
|
353
|
+
bytesReceived: 2048,
|
|
354
|
+
});
|
|
355
|
+
// Now it should be called a second time with the latest progress.
|
|
356
|
+
expect(updateOutputMock).toHaveBeenCalledTimes(2);
|
|
357
|
+
expect(updateOutputMock).toHaveBeenLastCalledWith('[Receiving binary output... 2.0 KB received]');
|
|
358
|
+
resolveExecutionPromise({
|
|
359
|
+
rawOutput: Buffer.from(''),
|
|
360
|
+
output: '',
|
|
361
|
+
exitCode: 0,
|
|
362
|
+
signal: null,
|
|
363
|
+
error: null,
|
|
364
|
+
aborted: false,
|
|
365
|
+
pid: 12345,
|
|
366
|
+
executionMethod: 'child_process',
|
|
367
|
+
});
|
|
368
|
+
await promise;
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
describe('addCoAuthorToGitCommit', () => {
|
|
372
|
+
it('should add co-author to git commit with double quotes', async () => {
|
|
373
|
+
const command = 'git commit -m "Initial commit"';
|
|
374
|
+
const invocation = shellTool.build({ command, is_background: false });
|
|
375
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
376
|
+
// Mock the shell execution to return success
|
|
377
|
+
resolveExecutionPromise({
|
|
378
|
+
rawOutput: Buffer.from(''),
|
|
379
|
+
output: '',
|
|
380
|
+
exitCode: 0,
|
|
381
|
+
signal: null,
|
|
382
|
+
error: null,
|
|
383
|
+
aborted: false,
|
|
384
|
+
pid: 12345,
|
|
385
|
+
executionMethod: 'child_process',
|
|
386
|
+
});
|
|
387
|
+
await promise;
|
|
388
|
+
// Verify that the command was executed with co-author added
|
|
389
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(expect.stringContaining('Co-authored-by: BlackboxAI <code@blackbox.ai>'), expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
390
|
+
});
|
|
391
|
+
it('should add co-author to git commit with single quotes', async () => {
|
|
392
|
+
const command = "git commit -m 'Fix bug'";
|
|
393
|
+
const invocation = shellTool.build({ command, is_background: false });
|
|
394
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
395
|
+
resolveExecutionPromise({
|
|
396
|
+
rawOutput: Buffer.from(''),
|
|
397
|
+
output: '',
|
|
398
|
+
exitCode: 0,
|
|
399
|
+
signal: null,
|
|
400
|
+
error: null,
|
|
401
|
+
aborted: false,
|
|
402
|
+
pid: 12345,
|
|
403
|
+
executionMethod: 'child_process',
|
|
404
|
+
});
|
|
405
|
+
await promise;
|
|
406
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(expect.stringContaining('Co-authored-by: BlackboxAI <code@blackbox.ai>'), expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
407
|
+
});
|
|
408
|
+
it('should handle git commit with additional flags', async () => {
|
|
409
|
+
const command = 'git commit -a -m "Add feature"';
|
|
410
|
+
const invocation = shellTool.build({ command, is_background: false });
|
|
411
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
412
|
+
resolveExecutionPromise({
|
|
413
|
+
rawOutput: Buffer.from(''),
|
|
414
|
+
output: '',
|
|
415
|
+
exitCode: 0,
|
|
416
|
+
signal: null,
|
|
417
|
+
error: null,
|
|
418
|
+
aborted: false,
|
|
419
|
+
pid: 12345,
|
|
420
|
+
executionMethod: 'child_process',
|
|
421
|
+
});
|
|
422
|
+
await promise;
|
|
423
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(expect.stringContaining('Co-authored-by: BlackboxAI <code@blackbox.ai>'), expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
424
|
+
});
|
|
425
|
+
it('should not modify non-git commands', async () => {
|
|
426
|
+
const command = 'npm install';
|
|
427
|
+
const invocation = shellTool.build({ command, is_background: false });
|
|
428
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
429
|
+
resolveExecutionPromise({
|
|
430
|
+
rawOutput: Buffer.from(''),
|
|
431
|
+
output: '',
|
|
432
|
+
exitCode: 0,
|
|
433
|
+
signal: null,
|
|
434
|
+
error: null,
|
|
435
|
+
aborted: false,
|
|
436
|
+
pid: 12345,
|
|
437
|
+
executionMethod: 'child_process',
|
|
438
|
+
});
|
|
439
|
+
await promise;
|
|
440
|
+
// On Linux, commands are wrapped with pgrep functionality
|
|
441
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(expect.stringContaining('npm install'), expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
442
|
+
});
|
|
443
|
+
it('should not modify git commands without -m flag', async () => {
|
|
444
|
+
const command = 'git commit';
|
|
445
|
+
const invocation = shellTool.build({ command, is_background: false });
|
|
446
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
447
|
+
resolveExecutionPromise({
|
|
448
|
+
rawOutput: Buffer.from(''),
|
|
449
|
+
output: '',
|
|
450
|
+
exitCode: 0,
|
|
451
|
+
signal: null,
|
|
452
|
+
error: null,
|
|
453
|
+
aborted: false,
|
|
454
|
+
pid: 12345,
|
|
455
|
+
executionMethod: 'child_process',
|
|
456
|
+
});
|
|
457
|
+
await promise;
|
|
458
|
+
// On Linux, commands are wrapped with pgrep functionality
|
|
459
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(expect.stringContaining('git commit'), expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
460
|
+
});
|
|
461
|
+
it('should handle git commit with escaped quotes in message', async () => {
|
|
462
|
+
const command = 'git commit -m "Fix \\"quoted\\" text"';
|
|
463
|
+
const invocation = shellTool.build({ command, is_background: false });
|
|
464
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
465
|
+
resolveExecutionPromise({
|
|
466
|
+
rawOutput: Buffer.from(''),
|
|
467
|
+
output: '',
|
|
468
|
+
exitCode: 0,
|
|
469
|
+
signal: null,
|
|
470
|
+
error: null,
|
|
471
|
+
aborted: false,
|
|
472
|
+
pid: 12345,
|
|
473
|
+
executionMethod: 'child_process',
|
|
474
|
+
});
|
|
475
|
+
await promise;
|
|
476
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(expect.stringContaining('Co-authored-by: BlackboxAI <code@blackbox.ai>'), expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
477
|
+
});
|
|
478
|
+
it('should not add co-author when disabled in config', async () => {
|
|
479
|
+
// Mock config with disabled co-author
|
|
480
|
+
mockConfig.getGitCoAuthor.mockReturnValue({
|
|
481
|
+
enabled: false,
|
|
482
|
+
name: 'BlackboxAI',
|
|
483
|
+
email: 'code@blackbox.ai',
|
|
484
|
+
});
|
|
485
|
+
const command = 'git commit -m "Initial commit"';
|
|
486
|
+
const invocation = shellTool.build({ command, is_background: false });
|
|
487
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
488
|
+
resolveExecutionPromise({
|
|
489
|
+
rawOutput: Buffer.from(''),
|
|
490
|
+
output: '',
|
|
491
|
+
exitCode: 0,
|
|
492
|
+
signal: null,
|
|
493
|
+
error: null,
|
|
494
|
+
aborted: false,
|
|
495
|
+
pid: 12345,
|
|
496
|
+
executionMethod: 'child_process',
|
|
497
|
+
});
|
|
498
|
+
await promise;
|
|
499
|
+
// On Linux, commands are wrapped with pgrep functionality
|
|
500
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(expect.stringContaining('git commit -m "Initial commit"'), expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
501
|
+
});
|
|
502
|
+
it('should use custom name and email from config', async () => {
|
|
503
|
+
// Mock config with custom co-author details
|
|
504
|
+
mockConfig.getGitCoAuthor.mockReturnValue({
|
|
505
|
+
enabled: true,
|
|
506
|
+
name: 'Custom Bot',
|
|
507
|
+
email: 'custom@example.com',
|
|
508
|
+
});
|
|
509
|
+
const command = 'git commit -m "Test commit"';
|
|
510
|
+
const invocation = shellTool.build({ command, is_background: false });
|
|
511
|
+
const promise = invocation.execute(mockAbortSignal);
|
|
512
|
+
resolveExecutionPromise({
|
|
513
|
+
rawOutput: Buffer.from(''),
|
|
514
|
+
output: '',
|
|
515
|
+
exitCode: 0,
|
|
516
|
+
signal: null,
|
|
517
|
+
error: null,
|
|
518
|
+
aborted: false,
|
|
519
|
+
pid: 12345,
|
|
520
|
+
executionMethod: 'child_process',
|
|
521
|
+
});
|
|
522
|
+
await promise;
|
|
523
|
+
expect(mockShellExecutionService).toHaveBeenCalledWith(expect.stringContaining('Co-authored-by: Custom Bot <custom@example.com>'), expect.any(String), expect.any(Function), mockAbortSignal, false, undefined, undefined);
|
|
524
|
+
});
|
|
525
|
+
});
|
|
526
|
+
});
|
|
527
|
+
describe('shouldConfirmExecute', () => {
|
|
528
|
+
it('should not request confirmation for read-only commands', async () => {
|
|
529
|
+
const invocation = shellTool.build({
|
|
530
|
+
command: 'ls -la',
|
|
531
|
+
is_background: false,
|
|
532
|
+
});
|
|
533
|
+
const confirmation = await invocation.shouldConfirmExecute(new AbortController().signal);
|
|
534
|
+
expect(confirmation).toBe(false);
|
|
535
|
+
});
|
|
536
|
+
it('should request confirmation for a new command and whitelist it on "Always"', async () => {
|
|
537
|
+
const params = { command: 'npm install', is_background: false };
|
|
538
|
+
const invocation = shellTool.build(params);
|
|
539
|
+
const confirmation = await invocation.shouldConfirmExecute(new AbortController().signal);
|
|
540
|
+
expect(confirmation).not.toBe(false);
|
|
541
|
+
expect(confirmation && confirmation.type).toBe('exec');
|
|
542
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
543
|
+
await confirmation.onConfirm(ToolConfirmationOutcome.ProceedAlways);
|
|
544
|
+
// Should now be whitelisted
|
|
545
|
+
const secondInvocation = shellTool.build({
|
|
546
|
+
command: 'npm test',
|
|
547
|
+
is_background: false,
|
|
548
|
+
});
|
|
549
|
+
const secondConfirmation = await secondInvocation.shouldConfirmExecute(new AbortController().signal);
|
|
550
|
+
expect(secondConfirmation).toBe(false);
|
|
551
|
+
});
|
|
552
|
+
it('should throw an error if validation fails', () => {
|
|
553
|
+
expect(() => shellTool.build({ command: '', is_background: false })).toThrow();
|
|
554
|
+
});
|
|
555
|
+
});
|
|
556
|
+
describe('getDescription', () => {
|
|
557
|
+
it('should return the windows description when on windows', () => {
|
|
558
|
+
vi.mocked(os.platform).mockReturnValue('win32');
|
|
559
|
+
const shellTool = new ShellTool(mockConfig);
|
|
560
|
+
expect(shellTool.description).toMatchSnapshot();
|
|
561
|
+
});
|
|
562
|
+
it('should return the non-windows description when not on windows', () => {
|
|
563
|
+
vi.mocked(os.platform).mockReturnValue('linux');
|
|
564
|
+
const shellTool = new ShellTool(mockConfig);
|
|
565
|
+
expect(shellTool.description).toMatchSnapshot();
|
|
566
|
+
});
|
|
567
|
+
});
|
|
568
|
+
});
|
|
569
|
+
describe('validateToolParams', () => {
|
|
570
|
+
it('should return null for valid directory', () => {
|
|
571
|
+
const config = {
|
|
572
|
+
getCoreTools: () => undefined,
|
|
573
|
+
getExcludeTools: () => undefined,
|
|
574
|
+
getTargetDir: () => '/root',
|
|
575
|
+
getWorkspaceContext: () => createMockWorkspaceContext('/root', ['/users/test']),
|
|
576
|
+
};
|
|
577
|
+
const shellTool = new ShellTool(config);
|
|
578
|
+
const result = shellTool.validateToolParams({
|
|
579
|
+
command: 'ls',
|
|
580
|
+
directory: 'test',
|
|
581
|
+
is_background: false,
|
|
582
|
+
});
|
|
583
|
+
expect(result).toBeNull();
|
|
584
|
+
});
|
|
585
|
+
it('should return error for directory outside workspace', () => {
|
|
586
|
+
const config = {
|
|
587
|
+
getCoreTools: () => undefined,
|
|
588
|
+
getExcludeTools: () => undefined,
|
|
589
|
+
getTargetDir: () => '/root',
|
|
590
|
+
getWorkspaceContext: () => createMockWorkspaceContext('/root', ['/users/test']),
|
|
591
|
+
};
|
|
592
|
+
const shellTool = new ShellTool(config);
|
|
593
|
+
const result = shellTool.validateToolParams({
|
|
594
|
+
command: 'ls',
|
|
595
|
+
directory: 'test2',
|
|
596
|
+
is_background: false,
|
|
597
|
+
});
|
|
598
|
+
expect(result).toContain('is not a registered workspace directory');
|
|
599
|
+
});
|
|
600
|
+
});
|
|
601
|
+
describe('build', () => {
|
|
602
|
+
it('should return an invocation for valid directory', () => {
|
|
603
|
+
const config = {
|
|
604
|
+
getCoreTools: () => undefined,
|
|
605
|
+
getExcludeTools: () => undefined,
|
|
606
|
+
getTargetDir: () => '/root',
|
|
607
|
+
getWorkspaceContext: () => createMockWorkspaceContext('/root', ['/users/test']),
|
|
608
|
+
};
|
|
609
|
+
const shellTool = new ShellTool(config);
|
|
610
|
+
const invocation = shellTool.build({
|
|
611
|
+
command: 'ls',
|
|
612
|
+
directory: 'test',
|
|
613
|
+
is_background: false,
|
|
614
|
+
});
|
|
615
|
+
expect(invocation).toBeDefined();
|
|
616
|
+
});
|
|
617
|
+
it('should throw an error for directory outside workspace', () => {
|
|
618
|
+
const config = {
|
|
619
|
+
getCoreTools: () => undefined,
|
|
620
|
+
getExcludeTools: () => undefined,
|
|
621
|
+
getTargetDir: () => '/root',
|
|
622
|
+
getWorkspaceContext: () => createMockWorkspaceContext('/root', ['/users/test']),
|
|
623
|
+
};
|
|
624
|
+
const shellTool = new ShellTool(config);
|
|
625
|
+
expect(() => shellTool.build({
|
|
626
|
+
command: 'ls',
|
|
627
|
+
directory: 'test2',
|
|
628
|
+
is_background: false,
|
|
629
|
+
})).toThrow('is not a registered workspace directory');
|
|
630
|
+
});
|
|
631
|
+
});
|
|
632
|
+
//# sourceMappingURL=shell.test.js.map
|