@google/gemini-cli-core 0.1.0-development.1
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 +202 -0
- package/README.md +156 -0
- package/dist/.last_build +0 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -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/code_assist/codeAssist.d.ts +8 -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 +68 -0
- package/dist/src/code_assist/converter.js +125 -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 +229 -0
- package/dist/src/code_assist/converter.test.js.map +1 -0
- package/dist/src/code_assist/oauth2.d.ts +26 -0
- package/dist/src/code_assist/oauth2.js +277 -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 +195 -0
- package/dist/src/code_assist/oauth2.test.js.map +1 -0
- package/dist/src/code_assist/server.d.ts +35 -0
- package/dist/src/code_assist/server.js +123 -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 +123 -0
- package/dist/src/code_assist/server.test.js.map +1 -0
- package/dist/src/code_assist/setup.d.ts +15 -0
- package/dist/src/code_assist/setup.js +67 -0
- package/dist/src/code_assist/setup.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/config.d.ts +175 -0
- package/dist/src/config/config.js +385 -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 +263 -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 +115 -0
- package/dist/src/config/flashFallback.test.js.map +1 -0
- package/dist/src/config/models.d.ts +8 -0
- package/dist/src/config/models.js +9 -0
- package/dist/src/config/models.js.map +1 -0
- package/dist/src/core/client.d.ts +39 -0
- package/dist/src/core/client.js +386 -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 +630 -0
- package/dist/src/core/client.test.js.map +1 -0
- package/dist/src/core/contentGenerator.d.ts +29 -0
- package/dist/src/core/contentGenerator.js +71 -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 +45 -0
- package/dist/src/core/contentGenerator.test.js.map +1 -0
- package/dist/src/core/coreToolScheduler.d.ts +104 -0
- package/dist/src/core/coreToolScheduler.js +397 -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 +318 -0
- package/dist/src/core/coreToolScheduler.test.js.map +1 -0
- package/dist/src/core/geminiChat.d.ts +116 -0
- package/dist/src/core/geminiChat.js +491 -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 +422 -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 +45 -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 +72 -0
- package/dist/src/core/geminiRequest.test.js.map +1 -0
- package/dist/src/core/logger.d.ts +35 -0
- package/dist/src/core/logger.js +235 -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 +387 -0
- package/dist/src/core/logger.test.js.map +1 -0
- package/dist/src/core/modelCheck.d.ts +14 -0
- package/dist/src/core/modelCheck.js +55 -0
- package/dist/src/core/modelCheck.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.d.ts +12 -0
- package/dist/src/core/nonInteractiveToolExecutor.js +92 -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 +181 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
- package/dist/src/core/prompts.d.ts +12 -0
- package/dist/src/core/prompts.js +334 -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 +97 -0
- package/dist/src/core/prompts.test.js.map +1 -0
- package/dist/src/core/tokenLimits.d.ts +10 -0
- package/dist/src/core/tokenLimits.js +27 -0
- package/dist/src/core/tokenLimits.js.map +1 -0
- package/dist/src/core/turn.d.ts +96 -0
- package/dist/src/core/turn.js +125 -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 +236 -0
- package/dist/src/core/turn.test.js.map +1 -0
- package/dist/src/index.d.ts +46 -0
- package/dist/src/index.js +54 -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/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 +102 -0
- package/dist/src/services/fileDiscoveryService.test.js.map +1 -0
- package/dist/src/services/gitService.d.ts +21 -0
- package/dist/src/services/gitService.js +105 -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 +233 -0
- package/dist/src/services/gitService.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +33 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +364 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +43 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +109 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +19 -0
- package/dist/src/telemetry/constants.js +20 -0
- package/dist/src/telemetry/constants.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +18 -0
- package/dist/src/telemetry/index.js +20 -0
- package/dist/src/telemetry/index.js.map +1 -0
- package/dist/src/telemetry/loggers.d.ts +13 -0
- package/dist/src/telemetry/loggers.js +187 -0
- package/dist/src/telemetry/loggers.js.map +1 -0
- package/dist/src/telemetry/loggers.test.d.ts +6 -0
- package/dist/src/telemetry/loggers.test.js +525 -0
- package/dist/src/telemetry/loggers.test.js.map +1 -0
- package/dist/src/telemetry/metrics.d.ts +19 -0
- package/dist/src/telemetry/metrics.js +144 -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 +162 -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 +116 -0
- package/dist/src/telemetry/sdk.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/types.d.ts +91 -0
- package/dist/src/telemetry/types.js +176 -0
- package/dist/src/telemetry/types.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.d.ts +67 -0
- package/dist/src/telemetry/uiTelemetry.js +131 -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 +411 -0
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -0
- package/dist/src/tools/diffOptions.d.ts +7 -0
- package/dist/src/tools/diffOptions.js +10 -0
- package/dist/src/tools/diffOptions.js.map +1 -0
- package/dist/src/tools/edit.d.ts +84 -0
- package/dist/src/tools/edit.js +359 -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 +500 -0
- package/dist/src/tools/edit.test.js.map +1 -0
- package/dist/src/tools/glob.d.ts +71 -0
- package/dist/src/tools/glob.js +215 -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 +293 -0
- package/dist/src/tools/glob.test.js.map +1 -0
- package/dist/src/tools/grep.d.ts +81 -0
- package/dist/src/tools/grep.js +427 -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 +185 -0
- package/dist/src/tools/grep.test.js.map +1 -0
- package/dist/src/tools/ls.d.ts +94 -0
- package/dist/src/tools/ls.js +215 -0
- package/dist/src/tools/ls.js.map +1 -0
- package/dist/src/tools/mcp-client.d.ts +56 -0
- package/dist/src/tools/mcp-client.js +302 -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 +608 -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 +119 -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 +173 -0
- package/dist/src/tools/mcp-tool.test.js.map +1 -0
- package/dist/src/tools/memoryTool.d.ts +28 -0
- package/dist/src/tools/memoryTool.js +171 -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 +181 -0
- package/dist/src/tools/memoryTool.test.js.map +1 -0
- package/dist/src/tools/modifiable-tool.d.ts +29 -0
- package/dist/src/tools/modifiable-tool.js +85 -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 +204 -0
- package/dist/src/tools/modifiable-tool.test.js.map +1 -0
- package/dist/src/tools/read-file.d.ts +36 -0
- package/dist/src/tools/read-file.js +103 -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 +180 -0
- package/dist/src/tools/read-file.test.js.map +1 -0
- package/dist/src/tools/read-many-files.d.ts +65 -0
- package/dist/src/tools/read-many-files.js +344 -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 +300 -0
- package/dist/src/tools/read-many-files.test.js.map +1 -0
- package/dist/src/tools/shell.d.ts +43 -0
- package/dist/src/tools/shell.js +421 -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 +321 -0
- package/dist/src/tools/shell.test.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +67 -0
- package/dist/src/tools/tool-registry.js +326 -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 +353 -0
- package/dist/src/tools/tool-registry.test.js.map +1 -0
- package/dist/src/tools/tools.d.ts +179 -0
- package/dist/src/tools/tools.js +88 -0
- package/dist/src/tools/tools.js.map +1 -0
- package/dist/src/tools/web-fetch.d.ts +29 -0
- package/dist/src/tools/web-fetch.js +240 -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 +70 -0
- package/dist/src/tools/web-fetch.test.js.map +1 -0
- package/dist/src/tools/web-search.d.ts +49 -0
- package/dist/src/tools/web-search.js +119 -0
- package/dist/src/tools/web-search.js.map +1 -0
- package/dist/src/tools/write-file.d.ts +50 -0
- package/dist/src/tools/write-file.js +261 -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 +413 -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 +22 -0
- package/dist/src/utils/bfsFileSearch.js +62 -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 +129 -0
- package/dist/src/utils/bfsFileSearch.test.js.map +1 -0
- package/dist/src/utils/editCorrector.d.ts +53 -0
- package/dist/src/utils/editCorrector.js +546 -0
- package/dist/src/utils/editCorrector.js.map +1 -0
- package/dist/src/utils/editCorrector.test.d.ts +6 -0
- package/dist/src/utils/editCorrector.test.js +560 -0
- package/dist/src/utils/editCorrector.test.js.map +1 -0
- package/dist/src/utils/editor.d.ts +28 -0
- package/dist/src/utils/editor.js +163 -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 +293 -0
- package/dist/src/utils/editor.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 +124 -0
- package/dist/src/utils/errorReporting.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +14 -0
- package/dist/src/utils/errors.js +54 -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 +49 -0
- package/dist/src/utils/fileUtils.js +284 -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 +321 -0
- package/dist/src/utils/fileUtils.test.js.map +1 -0
- package/dist/src/utils/flashFallback.integration.test.d.ts +6 -0
- package/dist/src/utils/flashFallback.integration.test.js +112 -0
- package/dist/src/utils/flashFallback.integration.test.js.map +1 -0
- package/dist/src/utils/generateContentResponseUtilities.d.ts +14 -0
- package/dist/src/utils/generateContentResponseUtilities.js +92 -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 +273 -0
- package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -0
- package/dist/src/utils/getFolderStructure.d.ts +30 -0
- package/dist/src/utils/getFolderStructure.js +247 -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 +300 -0
- package/dist/src/utils/getFolderStructure.test.js.map +1 -0
- package/dist/src/utils/gitIgnoreParser.d.ts +20 -0
- package/dist/src/utils/gitIgnoreParser.js +64 -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 +145 -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/memoryDiscovery.d.ts +14 -0
- package/dist/src/utils/memoryDiscovery.js +219 -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 +432 -0
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -0
- package/dist/src/utils/memoryImportProcessor.d.ts +35 -0
- package/dist/src/utils/memoryImportProcessor.js +141 -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 +170 -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 +111 -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 +152 -0
- package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -0
- package/dist/src/utils/paths.d.ts +47 -0
- package/dist/src/utils/paths.js +136 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/retry.d.ts +21 -0
- package/dist/src/utils/retry.js +220 -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 +322 -0
- package/dist/src/utils/retry.test.js.map +1 -0
- package/dist/src/utils/schemaValidator.d.ts +17 -0
- package/dist/src/utils/schemaValidator.js +50 -0
- package/dist/src/utils/schemaValidator.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/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/user_id.d.ts +17 -0
- package/dist/src/utils/user_id.js +70 -0
- package/dist/src/utils/user_id.js.map +1 -0
- package/dist/src/utils/user_id.test.d.ts +6 -0
- package/dist/src/utils/user_id.test.js +42 -0
- package/dist/src/utils/user_id.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { expect, describe, it } from 'vitest';
|
|
7
|
+
import { ShellTool } from './shell.js';
|
|
8
|
+
describe('ShellTool', () => {
|
|
9
|
+
it('should allow a command if no restrictions are provided', async () => {
|
|
10
|
+
const config = {
|
|
11
|
+
getCoreTools: () => undefined,
|
|
12
|
+
getExcludeTools: () => undefined,
|
|
13
|
+
};
|
|
14
|
+
const shellTool = new ShellTool(config);
|
|
15
|
+
const result = shellTool.isCommandAllowed('ls -l');
|
|
16
|
+
expect(result.allowed).toBe(true);
|
|
17
|
+
});
|
|
18
|
+
it('should allow a command if it is in the allowed list', async () => {
|
|
19
|
+
const config = {
|
|
20
|
+
getCoreTools: () => ['ShellTool(ls -l)'],
|
|
21
|
+
getExcludeTools: () => undefined,
|
|
22
|
+
};
|
|
23
|
+
const shellTool = new ShellTool(config);
|
|
24
|
+
const result = shellTool.isCommandAllowed('ls -l');
|
|
25
|
+
expect(result.allowed).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
it('should block a command if it is not in the allowed list', async () => {
|
|
28
|
+
const config = {
|
|
29
|
+
getCoreTools: () => ['ShellTool(ls -l)'],
|
|
30
|
+
getExcludeTools: () => undefined,
|
|
31
|
+
};
|
|
32
|
+
const shellTool = new ShellTool(config);
|
|
33
|
+
const result = shellTool.isCommandAllowed('rm -rf /');
|
|
34
|
+
expect(result.allowed).toBe(false);
|
|
35
|
+
expect(result.reason).toBe("Command 'rm -rf /' is not in the allowed commands list");
|
|
36
|
+
});
|
|
37
|
+
it('should block a command if it is in the blocked list', async () => {
|
|
38
|
+
const config = {
|
|
39
|
+
getCoreTools: () => undefined,
|
|
40
|
+
getExcludeTools: () => ['ShellTool(rm -rf /)'],
|
|
41
|
+
};
|
|
42
|
+
const shellTool = new ShellTool(config);
|
|
43
|
+
const result = shellTool.isCommandAllowed('rm -rf /');
|
|
44
|
+
expect(result.allowed).toBe(false);
|
|
45
|
+
expect(result.reason).toBe("Command 'rm -rf /' is blocked by configuration");
|
|
46
|
+
});
|
|
47
|
+
it('should allow a command if it is not in the blocked list', async () => {
|
|
48
|
+
const config = {
|
|
49
|
+
getCoreTools: () => undefined,
|
|
50
|
+
getExcludeTools: () => ['ShellTool(rm -rf /)'],
|
|
51
|
+
};
|
|
52
|
+
const shellTool = new ShellTool(config);
|
|
53
|
+
const result = shellTool.isCommandAllowed('ls -l');
|
|
54
|
+
expect(result.allowed).toBe(true);
|
|
55
|
+
});
|
|
56
|
+
it('should block a command if it is in both the allowed and blocked lists', async () => {
|
|
57
|
+
const config = {
|
|
58
|
+
getCoreTools: () => ['ShellTool(rm -rf /)'],
|
|
59
|
+
getExcludeTools: () => ['ShellTool(rm -rf /)'],
|
|
60
|
+
};
|
|
61
|
+
const shellTool = new ShellTool(config);
|
|
62
|
+
const result = shellTool.isCommandAllowed('rm -rf /');
|
|
63
|
+
expect(result.allowed).toBe(false);
|
|
64
|
+
expect(result.reason).toBe("Command 'rm -rf /' is blocked by configuration");
|
|
65
|
+
});
|
|
66
|
+
it('should allow any command when ShellTool is in coreTools without specific commands', async () => {
|
|
67
|
+
const config = {
|
|
68
|
+
getCoreTools: () => ['ShellTool'],
|
|
69
|
+
getExcludeTools: () => [],
|
|
70
|
+
};
|
|
71
|
+
const shellTool = new ShellTool(config);
|
|
72
|
+
const result = shellTool.isCommandAllowed('any command');
|
|
73
|
+
expect(result.allowed).toBe(true);
|
|
74
|
+
});
|
|
75
|
+
it('should block any command when ShellTool is in excludeTools without specific commands', async () => {
|
|
76
|
+
const config = {
|
|
77
|
+
getCoreTools: () => [],
|
|
78
|
+
getExcludeTools: () => ['ShellTool'],
|
|
79
|
+
};
|
|
80
|
+
const shellTool = new ShellTool(config);
|
|
81
|
+
const result = shellTool.isCommandAllowed('any command');
|
|
82
|
+
expect(result.allowed).toBe(false);
|
|
83
|
+
expect(result.reason).toBe('Shell tool is globally disabled in configuration');
|
|
84
|
+
});
|
|
85
|
+
it('should allow a command if it is in the allowed list using the public-facing name', async () => {
|
|
86
|
+
const config = {
|
|
87
|
+
getCoreTools: () => ['run_shell_command(ls -l)'],
|
|
88
|
+
getExcludeTools: () => undefined,
|
|
89
|
+
};
|
|
90
|
+
const shellTool = new ShellTool(config);
|
|
91
|
+
const result = shellTool.isCommandAllowed('ls -l');
|
|
92
|
+
expect(result.allowed).toBe(true);
|
|
93
|
+
});
|
|
94
|
+
it('should block a command if it is in the blocked list using the public-facing name', async () => {
|
|
95
|
+
const config = {
|
|
96
|
+
getCoreTools: () => undefined,
|
|
97
|
+
getExcludeTools: () => ['run_shell_command(rm -rf /)'],
|
|
98
|
+
};
|
|
99
|
+
const shellTool = new ShellTool(config);
|
|
100
|
+
const result = shellTool.isCommandAllowed('rm -rf /');
|
|
101
|
+
expect(result.allowed).toBe(false);
|
|
102
|
+
expect(result.reason).toBe("Command 'rm -rf /' is blocked by configuration");
|
|
103
|
+
});
|
|
104
|
+
it('should block any command when ShellTool is in excludeTools using the public-facing name', async () => {
|
|
105
|
+
const config = {
|
|
106
|
+
getCoreTools: () => [],
|
|
107
|
+
getExcludeTools: () => ['run_shell_command'],
|
|
108
|
+
};
|
|
109
|
+
const shellTool = new ShellTool(config);
|
|
110
|
+
const result = shellTool.isCommandAllowed('any command');
|
|
111
|
+
expect(result.allowed).toBe(false);
|
|
112
|
+
expect(result.reason).toBe('Shell tool is globally disabled in configuration');
|
|
113
|
+
});
|
|
114
|
+
it('should block any command if coreTools contains an empty ShellTool command list using the public-facing name', async () => {
|
|
115
|
+
const config = {
|
|
116
|
+
getCoreTools: () => ['run_shell_command()'],
|
|
117
|
+
getExcludeTools: () => [],
|
|
118
|
+
};
|
|
119
|
+
const shellTool = new ShellTool(config);
|
|
120
|
+
const result = shellTool.isCommandAllowed('any command');
|
|
121
|
+
expect(result.allowed).toBe(false);
|
|
122
|
+
expect(result.reason).toBe("Command 'any command' is not in the allowed commands list");
|
|
123
|
+
});
|
|
124
|
+
it('should block any command if coreTools contains an empty ShellTool command list', async () => {
|
|
125
|
+
const config = {
|
|
126
|
+
getCoreTools: () => ['ShellTool()'],
|
|
127
|
+
getExcludeTools: () => [],
|
|
128
|
+
};
|
|
129
|
+
const shellTool = new ShellTool(config);
|
|
130
|
+
const result = shellTool.isCommandAllowed('any command');
|
|
131
|
+
expect(result.allowed).toBe(false);
|
|
132
|
+
expect(result.reason).toBe("Command 'any command' is not in the allowed commands list");
|
|
133
|
+
});
|
|
134
|
+
it('should block a command with extra whitespace if it is in the blocked list', async () => {
|
|
135
|
+
const config = {
|
|
136
|
+
getCoreTools: () => undefined,
|
|
137
|
+
getExcludeTools: () => ['ShellTool(rm -rf /)'],
|
|
138
|
+
};
|
|
139
|
+
const shellTool = new ShellTool(config);
|
|
140
|
+
const result = shellTool.isCommandAllowed(' rm -rf / ');
|
|
141
|
+
expect(result.allowed).toBe(false);
|
|
142
|
+
expect(result.reason).toBe("Command 'rm -rf /' is blocked by configuration");
|
|
143
|
+
});
|
|
144
|
+
it('should allow any command when ShellTool is present with specific commands', async () => {
|
|
145
|
+
const config = {
|
|
146
|
+
getCoreTools: () => ['ShellTool', 'ShellTool(ls)'],
|
|
147
|
+
getExcludeTools: () => [],
|
|
148
|
+
};
|
|
149
|
+
const shellTool = new ShellTool(config);
|
|
150
|
+
const result = shellTool.isCommandAllowed('any command');
|
|
151
|
+
expect(result.allowed).toBe(true);
|
|
152
|
+
});
|
|
153
|
+
it('should block a command on the blocklist even with a wildcard allow', async () => {
|
|
154
|
+
const config = {
|
|
155
|
+
getCoreTools: () => ['ShellTool'],
|
|
156
|
+
getExcludeTools: () => ['ShellTool(rm -rf /)'],
|
|
157
|
+
};
|
|
158
|
+
const shellTool = new ShellTool(config);
|
|
159
|
+
const result = shellTool.isCommandAllowed('rm -rf /');
|
|
160
|
+
expect(result.allowed).toBe(false);
|
|
161
|
+
expect(result.reason).toBe("Command 'rm -rf /' is blocked by configuration");
|
|
162
|
+
});
|
|
163
|
+
it('should allow a command that starts with an allowed command prefix', async () => {
|
|
164
|
+
const config = {
|
|
165
|
+
getCoreTools: () => ['ShellTool(gh issue edit)'],
|
|
166
|
+
getExcludeTools: () => [],
|
|
167
|
+
};
|
|
168
|
+
const shellTool = new ShellTool(config);
|
|
169
|
+
const result = shellTool.isCommandAllowed('gh issue edit 1 --add-label "kind/feature"');
|
|
170
|
+
expect(result.allowed).toBe(true);
|
|
171
|
+
});
|
|
172
|
+
it('should allow a command that starts with an allowed command prefix using the public-facing name', async () => {
|
|
173
|
+
const config = {
|
|
174
|
+
getCoreTools: () => ['run_shell_command(gh issue edit)'],
|
|
175
|
+
getExcludeTools: () => [],
|
|
176
|
+
};
|
|
177
|
+
const shellTool = new ShellTool(config);
|
|
178
|
+
const result = shellTool.isCommandAllowed('gh issue edit 1 --add-label "kind/feature"');
|
|
179
|
+
expect(result.allowed).toBe(true);
|
|
180
|
+
});
|
|
181
|
+
it('should not allow a command that starts with an allowed command prefix but is chained with another command', async () => {
|
|
182
|
+
const config = {
|
|
183
|
+
getCoreTools: () => ['run_shell_command(gh issue edit)'],
|
|
184
|
+
getExcludeTools: () => [],
|
|
185
|
+
};
|
|
186
|
+
const shellTool = new ShellTool(config);
|
|
187
|
+
const result = shellTool.isCommandAllowed('gh issue edit&&rm -rf /');
|
|
188
|
+
expect(result.allowed).toBe(false);
|
|
189
|
+
expect(result.reason).toBe("Command 'rm -rf /' is not in the allowed commands list");
|
|
190
|
+
});
|
|
191
|
+
it('should not allow a command that is a prefix of an allowed command', async () => {
|
|
192
|
+
const config = {
|
|
193
|
+
getCoreTools: () => ['run_shell_command(gh issue edit)'],
|
|
194
|
+
getExcludeTools: () => [],
|
|
195
|
+
};
|
|
196
|
+
const shellTool = new ShellTool(config);
|
|
197
|
+
const result = shellTool.isCommandAllowed('gh issue');
|
|
198
|
+
expect(result.allowed).toBe(false);
|
|
199
|
+
expect(result.reason).toBe("Command 'gh issue' is not in the allowed commands list");
|
|
200
|
+
});
|
|
201
|
+
it('should not allow a command that is a prefix of a blocked command', async () => {
|
|
202
|
+
const config = {
|
|
203
|
+
getCoreTools: () => [],
|
|
204
|
+
getExcludeTools: () => ['run_shell_command(gh issue edit)'],
|
|
205
|
+
};
|
|
206
|
+
const shellTool = new ShellTool(config);
|
|
207
|
+
const result = shellTool.isCommandAllowed('gh issue');
|
|
208
|
+
expect(result.allowed).toBe(true);
|
|
209
|
+
});
|
|
210
|
+
it('should not allow a command that is chained with a pipe', async () => {
|
|
211
|
+
const config = {
|
|
212
|
+
getCoreTools: () => ['run_shell_command(gh issue list)'],
|
|
213
|
+
getExcludeTools: () => [],
|
|
214
|
+
};
|
|
215
|
+
const shellTool = new ShellTool(config);
|
|
216
|
+
const result = shellTool.isCommandAllowed('gh issue list | rm -rf /');
|
|
217
|
+
expect(result.allowed).toBe(false);
|
|
218
|
+
expect(result.reason).toBe("Command 'rm -rf /' is not in the allowed commands list");
|
|
219
|
+
});
|
|
220
|
+
it('should not allow a command that is chained with a semicolon', async () => {
|
|
221
|
+
const config = {
|
|
222
|
+
getCoreTools: () => ['run_shell_command(gh issue list)'],
|
|
223
|
+
getExcludeTools: () => [],
|
|
224
|
+
};
|
|
225
|
+
const shellTool = new ShellTool(config);
|
|
226
|
+
const result = shellTool.isCommandAllowed('gh issue list; rm -rf /');
|
|
227
|
+
expect(result.allowed).toBe(false);
|
|
228
|
+
expect(result.reason).toBe("Command 'rm -rf /' is not in the allowed commands list");
|
|
229
|
+
});
|
|
230
|
+
it('should block a chained command if any part is blocked', async () => {
|
|
231
|
+
const config = {
|
|
232
|
+
getCoreTools: () => ['run_shell_command(echo "hello")'],
|
|
233
|
+
getExcludeTools: () => ['run_shell_command(rm)'],
|
|
234
|
+
};
|
|
235
|
+
const shellTool = new ShellTool(config);
|
|
236
|
+
const result = shellTool.isCommandAllowed('echo "hello" && rm -rf /');
|
|
237
|
+
expect(result.allowed).toBe(false);
|
|
238
|
+
expect(result.reason).toBe("Command 'rm -rf /' is blocked by configuration");
|
|
239
|
+
});
|
|
240
|
+
it('should block a command if its prefix is on the blocklist, even if the command itself is on the allowlist', async () => {
|
|
241
|
+
const config = {
|
|
242
|
+
getCoreTools: () => ['run_shell_command(git push)'],
|
|
243
|
+
getExcludeTools: () => ['run_shell_command(git)'],
|
|
244
|
+
};
|
|
245
|
+
const shellTool = new ShellTool(config);
|
|
246
|
+
const result = shellTool.isCommandAllowed('git push');
|
|
247
|
+
expect(result.allowed).toBe(false);
|
|
248
|
+
expect(result.reason).toBe("Command 'git push' is blocked by configuration");
|
|
249
|
+
});
|
|
250
|
+
it('should be case-sensitive in its matching', async () => {
|
|
251
|
+
const config = {
|
|
252
|
+
getCoreTools: () => ['run_shell_command(echo)'],
|
|
253
|
+
getExcludeTools: () => [],
|
|
254
|
+
};
|
|
255
|
+
const shellTool = new ShellTool(config);
|
|
256
|
+
const result = shellTool.isCommandAllowed('ECHO "hello"');
|
|
257
|
+
expect(result.allowed).toBe(false);
|
|
258
|
+
expect(result.reason).toBe('Command \'ECHO "hello"\' is not in the allowed commands list');
|
|
259
|
+
});
|
|
260
|
+
it('should correctly handle commands with extra whitespace around chaining operators', async () => {
|
|
261
|
+
const config = {
|
|
262
|
+
getCoreTools: () => ['run_shell_command(ls -l)'],
|
|
263
|
+
getExcludeTools: () => ['run_shell_command(rm)'],
|
|
264
|
+
};
|
|
265
|
+
const shellTool = new ShellTool(config);
|
|
266
|
+
const result = shellTool.isCommandAllowed('ls -l ; rm -rf /');
|
|
267
|
+
expect(result.allowed).toBe(false);
|
|
268
|
+
expect(result.reason).toBe("Command 'rm -rf /' is blocked by configuration");
|
|
269
|
+
});
|
|
270
|
+
it('should allow a chained command if all parts are allowed', async () => {
|
|
271
|
+
const config = {
|
|
272
|
+
getCoreTools: () => [
|
|
273
|
+
'run_shell_command(echo)',
|
|
274
|
+
'run_shell_command(ls -l)',
|
|
275
|
+
],
|
|
276
|
+
getExcludeTools: () => [],
|
|
277
|
+
};
|
|
278
|
+
const shellTool = new ShellTool(config);
|
|
279
|
+
const result = shellTool.isCommandAllowed('echo "hello" && ls -l');
|
|
280
|
+
expect(result.allowed).toBe(true);
|
|
281
|
+
});
|
|
282
|
+
it('should allow a command with command substitution using backticks', async () => {
|
|
283
|
+
const config = {
|
|
284
|
+
getCoreTools: () => ['run_shell_command(echo)'],
|
|
285
|
+
getExcludeTools: () => [],
|
|
286
|
+
};
|
|
287
|
+
const shellTool = new ShellTool(config);
|
|
288
|
+
const result = shellTool.isCommandAllowed('echo `rm -rf /`');
|
|
289
|
+
expect(result.allowed).toBe(true);
|
|
290
|
+
});
|
|
291
|
+
it('should block a command with command substitution using $()', async () => {
|
|
292
|
+
const config = {
|
|
293
|
+
getCoreTools: () => ['run_shell_command(echo)'],
|
|
294
|
+
getExcludeTools: () => [],
|
|
295
|
+
};
|
|
296
|
+
const shellTool = new ShellTool(config);
|
|
297
|
+
const result = shellTool.isCommandAllowed('echo $(rm -rf /)');
|
|
298
|
+
expect(result.allowed).toBe(false);
|
|
299
|
+
expect(result.reason).toBe('Command substitution using $() is not allowed for security reasons');
|
|
300
|
+
});
|
|
301
|
+
it('should allow a command with I/O redirection', async () => {
|
|
302
|
+
const config = {
|
|
303
|
+
getCoreTools: () => ['run_shell_command(echo)'],
|
|
304
|
+
getExcludeTools: () => [],
|
|
305
|
+
};
|
|
306
|
+
const shellTool = new ShellTool(config);
|
|
307
|
+
const result = shellTool.isCommandAllowed('echo "hello" > file.txt');
|
|
308
|
+
expect(result.allowed).toBe(true);
|
|
309
|
+
});
|
|
310
|
+
it('should not allow a command that is chained with a double pipe', async () => {
|
|
311
|
+
const config = {
|
|
312
|
+
getCoreTools: () => ['run_shell_command(gh issue list)'],
|
|
313
|
+
getExcludeTools: () => [],
|
|
314
|
+
};
|
|
315
|
+
const shellTool = new ShellTool(config);
|
|
316
|
+
const result = shellTool.isCommandAllowed('gh issue list || rm -rf /');
|
|
317
|
+
expect(result.allowed).toBe(false);
|
|
318
|
+
expect(result.reason).toBe("Command 'rm -rf /' is not in the allowed commands list");
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
//# sourceMappingURL=shell.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.test.js","sourceRoot":"","sources":["../../../src/tools/shell.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,MAAM,GAAG;YACb,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS;YAC7B,eAAe,EAAE,GAAG,EAAE,CAAC,SAAS;SACvB,CAAC;QACZ,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,MAAM,GAAG,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACnD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC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C
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { FunctionDeclaration, Schema } from '@google/genai';
|
|
7
|
+
import { Tool, ToolResult, BaseTool } from './tools.js';
|
|
8
|
+
import { Config } from '../config/config.js';
|
|
9
|
+
type ToolParams = Record<string, unknown>;
|
|
10
|
+
export declare class DiscoveredTool extends BaseTool<ToolParams, ToolResult> {
|
|
11
|
+
private readonly config;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly description: string;
|
|
14
|
+
readonly parameterSchema: Record<string, unknown>;
|
|
15
|
+
constructor(config: Config, name: string, description: string, parameterSchema: Record<string, unknown>);
|
|
16
|
+
execute(params: ToolParams): Promise<ToolResult>;
|
|
17
|
+
}
|
|
18
|
+
export declare class ToolRegistry {
|
|
19
|
+
private tools;
|
|
20
|
+
private config;
|
|
21
|
+
constructor(config: Config);
|
|
22
|
+
/**
|
|
23
|
+
* Registers a tool definition.
|
|
24
|
+
* @param tool - The tool object containing schema and execution logic.
|
|
25
|
+
*/
|
|
26
|
+
registerTool(tool: Tool): void;
|
|
27
|
+
/**
|
|
28
|
+
* Discovers tools from project (if available and configured).
|
|
29
|
+
* Can be called multiple times to update discovered tools.
|
|
30
|
+
*/
|
|
31
|
+
discoverTools(): Promise<void>;
|
|
32
|
+
private discoverAndRegisterToolsFromCommand;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves the list of tool schemas (FunctionDeclaration array).
|
|
35
|
+
* Extracts the declarations from the ToolListUnion structure.
|
|
36
|
+
* Includes discovered (vs registered) tools if configured.
|
|
37
|
+
* @returns An array of FunctionDeclarations.
|
|
38
|
+
*/
|
|
39
|
+
getFunctionDeclarations(): FunctionDeclaration[];
|
|
40
|
+
/**
|
|
41
|
+
* Returns an array of all registered and discovered tool instances.
|
|
42
|
+
*/
|
|
43
|
+
getAllTools(): Tool[];
|
|
44
|
+
/**
|
|
45
|
+
* Returns an array of tools registered from a specific MCP server.
|
|
46
|
+
*/
|
|
47
|
+
getToolsByServer(serverName: string): Tool[];
|
|
48
|
+
/**
|
|
49
|
+
* Get the definition of a specific tool.
|
|
50
|
+
*/
|
|
51
|
+
getTool(name: string): Tool | undefined;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Sanitizes a schema object in-place to ensure compatibility with the Gemini API.
|
|
55
|
+
*
|
|
56
|
+
* NOTE: This function mutates the passed schema object.
|
|
57
|
+
*
|
|
58
|
+
* It performs the following actions:
|
|
59
|
+
* - Removes the `default` property when `anyOf` is present.
|
|
60
|
+
* - Removes unsupported `format` values from string properties, keeping only 'enum' and 'date-time'.
|
|
61
|
+
* - Recursively sanitizes nested schemas within `anyOf`, `items`, and `properties`.
|
|
62
|
+
* - Handles circular references within the schema to prevent infinite loops.
|
|
63
|
+
*
|
|
64
|
+
* @param schema The schema object to sanitize. It will be modified directly.
|
|
65
|
+
*/
|
|
66
|
+
export declare function sanitizeParameters(schema?: Schema): void;
|
|
67
|
+
export {};
|