@machina.ai/cell-cli-core 1.0.13-rc3
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/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 +9 -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 +20 -0
- package/dist/src/code_assist/oauth2.js +329 -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 +244 -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 +131 -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 +70 -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 +65 -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/config.d.ts +239 -0
- package/dist/src/config/config.js +484 -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 +304 -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 +60 -0
- package/dist/src/core/client.js +502 -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 +853 -0
- package/dist/src/core/client.test.js.map +1 -0
- package/dist/src/core/contentGenerator.d.ts +36 -0
- package/dist/src/core/contentGenerator.js +110 -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 +225 -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 +410 -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 +402 -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 +511 -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 +424 -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 +62 -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 +97 -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 +189 -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 +335 -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 +111 -0
- package/dist/src/core/turn.js +139 -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 +365 -0
- package/dist/src/core/turn.test.js.map +1 -0
- package/dist/src/index.d.ts +57 -0
- package/dist/src/index.js +64 -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/oauth-provider.d.ts +142 -0
- package/dist/src/mcp/oauth-provider.js +446 -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 +520 -0
- package/dist/src/mcp/oauth-provider.test.js.map +1 -0
- package/dist/src/mcp/oauth-token-storage.d.ts +81 -0
- package/dist/src/mcp/oauth-token-storage.js +149 -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 +205 -0
- package/dist/src/mcp/oauth-token-storage.test.js.map +1 -0
- package/dist/src/mcp/oauth-utils.d.ts +109 -0
- package/dist/src/mcp/oauth-utils.js +183 -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 +144 -0
- package/dist/src/mcp/oauth-utils.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 +101 -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 +228 -0
- package/dist/src/services/gitService.test.js.map +1 -0
- package/dist/src/services/ideContext.d.ts +178 -0
- package/dist/src/services/ideContext.js +105 -0
- package/dist/src/services/ideContext.js.map +1 -0
- package/dist/src/services/ideContext.test.d.ts +6 -0
- package/dist/src/services/ideContext.test.js +111 -0
- package/dist/src/services/ideContext.test.js.map +1 -0
- package/dist/src/services/loopDetectionService.d.ts +51 -0
- package/dist/src/services/loopDetectionService.js +232 -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 +339 -0
- package/dist/src/services/loopDetectionService.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +37 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +456 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +49 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +127 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +20 -0
- package/dist/src/telemetry/constants.js +21 -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/integration.test.circular.d.ts +6 -0
- package/dist/src/telemetry/integration.test.circular.js +53 -0
- package/dist/src/telemetry/integration.test.circular.js.map +1 -0
- package/dist/src/telemetry/loggers.d.ts +15 -0
- package/dist/src/telemetry/loggers.js +220 -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 +100 -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 +558 -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 +116 -0
- package/dist/src/telemetry/types.js +218 -0
- package/dist/src/telemetry/types.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.d.ts +68 -0
- package/dist/src/telemetry/uiTelemetry.js +138 -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 +504 -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 +79 -0
- package/dist/src/tools/edit.js +362 -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 +512 -0
- package/dist/src/tools/edit.test.js.map +1 -0
- package/dist/src/tools/glob.d.ts +58 -0
- package/dist/src/tools/glob.js +193 -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 +294 -0
- package/dist/src/tools/glob.test.js.map +1 -0
- package/dist/src/tools/grep.d.ts +78 -0
- package/dist/src/tools/grep.js +422 -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 +188 -0
- package/dist/src/tools/grep.test.js.map +1 -0
- package/dist/src/tools/ls.d.ts +86 -0
- package/dist/src/tools/ls.js +223 -0
- package/dist/src/tools/ls.js.map +1 -0
- package/dist/src/tools/mcp-client.d.ts +110 -0
- package/dist/src/tools/mcp-client.js +319 -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 +156 -0
- package/dist/src/tools/mcp-client.test.js.map +1 -0
- package/dist/src/tools/mcp-tool.d.ts +29 -0
- package/dist/src/tools/mcp-tool.js +143 -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 +189 -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 +172 -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 +102 -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 +181 -0
- package/dist/src/tools/read-file.test.js.map +1 -0
- package/dist/src/tools/read-many-files.d.ts +62 -0
- package/dist/src/tools/read-many-files.js +362 -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 +315 -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 +435 -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 +406 -0
- package/dist/src/tools/shell.test.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +66 -0
- package/dist/src/tools/tool-registry.js +329 -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 +424 -0
- package/dist/src/tools/tool-registry.test.js.map +1 -0
- package/dist/src/tools/tools.d.ts +219 -0
- package/dist/src/tools/tools.js +111 -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 +246 -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 +71 -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 +120 -0
- package/dist/src/tools/web-search.js.map +1 -0
- package/dist/src/tools/write-file.d.ts +42 -0
- package/dist/src/tools/write-file.js +253 -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 +24 -0
- package/dist/src/utils/bfsFileSearch.js +65 -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 +162 -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 +49 -0
- package/dist/src/utils/browser.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 +564 -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 +169 -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 +393 -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 +300 -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 +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 +284 -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 +67 -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 +157 -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 +15 -0
- package/dist/src/utils/memoryDiscovery.js +226 -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 +112 -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/paths.d.ts +59 -0
- package/dist/src/utils/paths.js +153 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/quotaErrorDetection.d.ts +22 -0
- package/dist/src/utils/quotaErrorDetection.js +65 -0
- package/dist/src/utils/quotaErrorDetection.js.map +1 -0
- package/dist/src/utils/retry.d.ts +27 -0
- package/dist/src/utils/retry.js +276 -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/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 +22 -0
- package/dist/src/utils/schemaValidator.js +65 -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/stripJsonCodeBlock.d.ts +13 -0
- package/dist/src/utils/stripJsonCodeBlock.js +21 -0
- package/dist/src/utils/stripJsonCodeBlock.js.map +1 -0
- package/dist/src/utils/summarizer.d.ts +25 -0
- package/dist/src/utils/summarizer.js +80 -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/user_account.d.ts +9 -0
- package/dist/src/utils/user_account.js +99 -0
- package/dist/src/utils/user_account.js.map +1 -0
- package/dist/src/utils/user_account.test.d.ts +6 -0
- package/dist/src/utils/user_account.test.js +153 -0
- package/dist/src/utils/user_account.test.js.map +1 -0
- package/dist/src/utils/user_id.d.ts +11 -0
- package/dist/src/utils/user_id.js +49 -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 +21 -0
- package/dist/src/utils/user_id.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { DEFAULT_GEMINI_FLASH_MODEL } from '../config/models.js';
|
|
7
|
+
/**
|
|
8
|
+
* The default summarizer for tool results.
|
|
9
|
+
*
|
|
10
|
+
* @param result The result of the tool execution.
|
|
11
|
+
* @param geminiClient The Gemini client to use for summarization.
|
|
12
|
+
* @param abortSignal The abort signal to use for summarization.
|
|
13
|
+
* @returns The summary of the result.
|
|
14
|
+
*/
|
|
15
|
+
export const defaultSummarizer = (result, _geminiClient, _abortSignal) => Promise.resolve(JSON.stringify(result.llmContent));
|
|
16
|
+
// TODO: Move both these functions to utils
|
|
17
|
+
function partToString(part) {
|
|
18
|
+
if (!part) {
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
if (typeof part === 'string') {
|
|
22
|
+
return part;
|
|
23
|
+
}
|
|
24
|
+
if (Array.isArray(part)) {
|
|
25
|
+
return part.map(partToString).join('');
|
|
26
|
+
}
|
|
27
|
+
if ('text' in part) {
|
|
28
|
+
return part.text ?? '';
|
|
29
|
+
}
|
|
30
|
+
return '';
|
|
31
|
+
}
|
|
32
|
+
function getResponseText(response) {
|
|
33
|
+
if (response.candidates && response.candidates.length > 0) {
|
|
34
|
+
const candidate = response.candidates[0];
|
|
35
|
+
if (candidate.content &&
|
|
36
|
+
candidate.content.parts &&
|
|
37
|
+
candidate.content.parts.length > 0) {
|
|
38
|
+
return candidate.content.parts
|
|
39
|
+
.filter((part) => part.text)
|
|
40
|
+
.map((part) => part.text)
|
|
41
|
+
.join('');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const SUMMARIZE_TOOL_OUTPUT_PROMPT = `Summarize the following tool output to be a maximum of {maxOutputTokens} tokens. The summary should be concise and capture the main points of the tool output.
|
|
47
|
+
|
|
48
|
+
The summarization should be done based on the content that is provided. Here are the basic rules to follow:
|
|
49
|
+
1. If the text is a directory listing or any output that is structural, use the history of the conversation to understand the context. Using this context try to understand what information we need from the tool output and return that as a response.
|
|
50
|
+
2. If the text is text content and there is nothing structural that we need, summarize the text.
|
|
51
|
+
3. If the text is the output of a shell command, use the history of the conversation to understand the context. Using this context try to understand what information we need from the tool output and return a summarization along with the stack trace of any error within the <error></error> tags. The stack trace should be complete and not truncated. If there are warnings, you should include them in the summary within <warning></warning> tags.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
Text to summarize:
|
|
55
|
+
"{textToSummarize}"
|
|
56
|
+
|
|
57
|
+
Return the summary string which should first contain an overall summarization of text followed by the full stack trace of errors and warnings in the tool output.
|
|
58
|
+
`;
|
|
59
|
+
export const llmSummarizer = (result, geminiClient, abortSignal) => summarizeToolOutput(partToString(result.llmContent), geminiClient, abortSignal);
|
|
60
|
+
export async function summarizeToolOutput(textToSummarize, geminiClient, abortSignal, maxOutputTokens = 2000) {
|
|
61
|
+
// There is going to be a slight difference here since we are comparing length of string with maxOutputTokens.
|
|
62
|
+
// This is meant to be a ballpark estimation of if we need to summarize the tool output.
|
|
63
|
+
if (!textToSummarize || textToSummarize.length < maxOutputTokens) {
|
|
64
|
+
return textToSummarize;
|
|
65
|
+
}
|
|
66
|
+
const prompt = SUMMARIZE_TOOL_OUTPUT_PROMPT.replace('{maxOutputTokens}', String(maxOutputTokens)).replace('{textToSummarize}', textToSummarize);
|
|
67
|
+
const contents = [{ role: 'user', parts: [{ text: prompt }] }];
|
|
68
|
+
const toolOutputSummarizerConfig = {
|
|
69
|
+
maxOutputTokens,
|
|
70
|
+
};
|
|
71
|
+
try {
|
|
72
|
+
const parsedResponse = (await geminiClient.generateContent(contents, toolOutputSummarizerConfig, abortSignal, DEFAULT_GEMINI_FLASH_MODEL));
|
|
73
|
+
return getResponseText(parsedResponse) || textToSummarize;
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.error('Failed to summarize tool output.', error);
|
|
77
|
+
return textToSummarize;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=summarizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summarizer.js","sourceRoot":"","sources":["../../../src/utils/summarizer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAejE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAe,CAC3C,MAAkB,EAClB,aAA2B,EAC3B,YAAyB,EACzB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AAExD,2CAA2C;AAC3C,SAAS,YAAY,CAAC,IAAmB;IACvC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzC,CAA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MAAM,GAAG,4BAA4B,CAAC,OAAO,CACjD,mBAAmB,EACnB,MAAM,CAAC,eAAe,CAAC,CACxB,CAAC,OAAO,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;IAEhD,MAAM,QAAQ,GAAc,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1E,MAAM,0BAA0B,GAA0B;QACxD,eAAe;KAChB,CAAC;IACF,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,CAAC,MAAM,YAAY,CAAC,eAAe,CACxD,QAAQ,EACR,0BAA0B,EAC1B,WAAW,EACX,0BAA0B,CAC3B,CAAuC,CAAC;QACzC,OAAO,eAAe,CAAC,cAAc,CAAC,IAAI,eAAe,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,eAAe,CAAC;IACzB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
7
|
+
import { GeminiClient } from '../core/client.js';
|
|
8
|
+
import { Config } from '../config/config.js';
|
|
9
|
+
import { summarizeToolOutput, llmSummarizer, defaultSummarizer, } from './summarizer.js';
|
|
10
|
+
// Mock GeminiClient and Config constructor
|
|
11
|
+
vi.mock('../core/client.js');
|
|
12
|
+
vi.mock('../config/config.js');
|
|
13
|
+
describe('summarizers', () => {
|
|
14
|
+
let mockGeminiClient;
|
|
15
|
+
let MockConfig;
|
|
16
|
+
const abortSignal = new AbortController().signal;
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
MockConfig = vi.mocked(Config);
|
|
19
|
+
const mockConfigInstance = new MockConfig('test-api-key', 'gemini-pro', false, '.', false, undefined, false, undefined, undefined, undefined);
|
|
20
|
+
mockGeminiClient = new GeminiClient(mockConfigInstance);
|
|
21
|
+
mockGeminiClient.generateContent = vi.fn();
|
|
22
|
+
vi.spyOn(console, 'error').mockImplementation(() => { });
|
|
23
|
+
});
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
vi.clearAllMocks();
|
|
26
|
+
console.error.mockRestore();
|
|
27
|
+
});
|
|
28
|
+
describe('summarizeToolOutput', () => {
|
|
29
|
+
it('should return original text if it is shorter than maxLength', async () => {
|
|
30
|
+
const shortText = 'This is a short text.';
|
|
31
|
+
const result = await summarizeToolOutput(shortText, mockGeminiClient, abortSignal, 2000);
|
|
32
|
+
expect(result).toBe(shortText);
|
|
33
|
+
expect(mockGeminiClient.generateContent).not.toHaveBeenCalled();
|
|
34
|
+
});
|
|
35
|
+
it('should return original text if it is empty', async () => {
|
|
36
|
+
const emptyText = '';
|
|
37
|
+
const result = await summarizeToolOutput(emptyText, mockGeminiClient, abortSignal, 2000);
|
|
38
|
+
expect(result).toBe(emptyText);
|
|
39
|
+
expect(mockGeminiClient.generateContent).not.toHaveBeenCalled();
|
|
40
|
+
});
|
|
41
|
+
it('should call generateContent if text is longer than maxLength', async () => {
|
|
42
|
+
const longText = 'This is a very long text.'.repeat(200);
|
|
43
|
+
const summary = 'This is a summary.';
|
|
44
|
+
mockGeminiClient.generateContent.mockResolvedValue({
|
|
45
|
+
candidates: [{ content: { parts: [{ text: summary }] } }],
|
|
46
|
+
});
|
|
47
|
+
const result = await summarizeToolOutput(longText, mockGeminiClient, abortSignal, 2000);
|
|
48
|
+
expect(mockGeminiClient.generateContent).toHaveBeenCalledTimes(1);
|
|
49
|
+
expect(result).toBe(summary);
|
|
50
|
+
});
|
|
51
|
+
it('should return original text if generateContent throws an error', async () => {
|
|
52
|
+
const longText = 'This is a very long text.'.repeat(200);
|
|
53
|
+
const error = new Error('API Error');
|
|
54
|
+
mockGeminiClient.generateContent.mockRejectedValue(error);
|
|
55
|
+
const result = await summarizeToolOutput(longText, mockGeminiClient, abortSignal, 2000);
|
|
56
|
+
expect(mockGeminiClient.generateContent).toHaveBeenCalledTimes(1);
|
|
57
|
+
expect(result).toBe(longText);
|
|
58
|
+
expect(console.error).toHaveBeenCalledWith('Failed to summarize tool output.', error);
|
|
59
|
+
});
|
|
60
|
+
it('should construct the correct prompt for summarization', async () => {
|
|
61
|
+
const longText = 'This is a very long text.'.repeat(200);
|
|
62
|
+
const summary = 'This is a summary.';
|
|
63
|
+
mockGeminiClient.generateContent.mockResolvedValue({
|
|
64
|
+
candidates: [{ content: { parts: [{ text: summary }] } }],
|
|
65
|
+
});
|
|
66
|
+
await summarizeToolOutput(longText, mockGeminiClient, abortSignal, 1000);
|
|
67
|
+
const expectedPrompt = `Summarize the following tool output to be a maximum of 1000 tokens. The summary should be concise and capture the main points of the tool output.
|
|
68
|
+
|
|
69
|
+
The summarization should be done based on the content that is provided. Here are the basic rules to follow:
|
|
70
|
+
1. If the text is a directory listing or any output that is structural, use the history of the conversation to understand the context. Using this context try to understand what information we need from the tool output and return that as a response.
|
|
71
|
+
2. If the text is text content and there is nothing structural that we need, summarize the text.
|
|
72
|
+
3. If the text is the output of a shell command, use the history of the conversation to understand the context. Using this context try to understand what information we need from the tool output and return a summarization along with the stack trace of any error within the <error></error> tags. The stack trace should be complete and not truncated. If there are warnings, you should include them in the summary within <warning></warning> tags.
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
Text to summarize:
|
|
76
|
+
"${longText}"
|
|
77
|
+
|
|
78
|
+
Return the summary string which should first contain an overall summarization of text followed by the full stack trace of errors and warnings in the tool output.
|
|
79
|
+
`;
|
|
80
|
+
const calledWith = mockGeminiClient.generateContent.mock
|
|
81
|
+
.calls[0];
|
|
82
|
+
const contents = calledWith[0];
|
|
83
|
+
expect(contents[0].parts[0].text).toBe(expectedPrompt);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
describe('llmSummarizer', () => {
|
|
87
|
+
it('should summarize tool output using summarizeToolOutput', async () => {
|
|
88
|
+
const toolResult = {
|
|
89
|
+
llmContent: 'This is a very long text.'.repeat(200),
|
|
90
|
+
returnDisplay: '',
|
|
91
|
+
};
|
|
92
|
+
const summary = 'This is a summary.';
|
|
93
|
+
mockGeminiClient.generateContent.mockResolvedValue({
|
|
94
|
+
candidates: [{ content: { parts: [{ text: summary }] } }],
|
|
95
|
+
});
|
|
96
|
+
const result = await llmSummarizer(toolResult, mockGeminiClient, abortSignal);
|
|
97
|
+
expect(mockGeminiClient.generateContent).toHaveBeenCalledTimes(1);
|
|
98
|
+
expect(result).toBe(summary);
|
|
99
|
+
});
|
|
100
|
+
it('should handle different llmContent types', async () => {
|
|
101
|
+
const longText = 'This is a very long text.'.repeat(200);
|
|
102
|
+
const toolResult = {
|
|
103
|
+
llmContent: [{ text: longText }],
|
|
104
|
+
returnDisplay: '',
|
|
105
|
+
};
|
|
106
|
+
const summary = 'This is a summary.';
|
|
107
|
+
mockGeminiClient.generateContent.mockResolvedValue({
|
|
108
|
+
candidates: [{ content: { parts: [{ text: summary }] } }],
|
|
109
|
+
});
|
|
110
|
+
const result = await llmSummarizer(toolResult, mockGeminiClient, abortSignal);
|
|
111
|
+
expect(mockGeminiClient.generateContent).toHaveBeenCalledTimes(1);
|
|
112
|
+
const calledWith = mockGeminiClient.generateContent.mock
|
|
113
|
+
.calls[0];
|
|
114
|
+
const contents = calledWith[0];
|
|
115
|
+
expect(contents[0].parts[0].text).toContain(`"${longText}"`);
|
|
116
|
+
expect(result).toBe(summary);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
describe('defaultSummarizer', () => {
|
|
120
|
+
it('should stringify the llmContent', async () => {
|
|
121
|
+
const toolResult = {
|
|
122
|
+
llmContent: { text: 'some data' },
|
|
123
|
+
returnDisplay: '',
|
|
124
|
+
};
|
|
125
|
+
const result = await defaultSummarizer(toolResult, mockGeminiClient, abortSignal);
|
|
126
|
+
expect(result).toBe(JSON.stringify({ text: 'some data' }));
|
|
127
|
+
expect(mockGeminiClient.generateContent).not.toHaveBeenCalled();
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
//# sourceMappingURL=summarizer.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summarizer.test.js","sourceRoot":"","sources":["../../../src/utils/summarizer.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAQ,MAAM,QAAQ,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,2CAA2C;AAC3C,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAC7B,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAE/B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,gBAA8B,CAAC;IACnC,IAAI,UAAgB,CAAC;IACrB,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC,MAAM,CAAC;IAEjD,UAAU,CAAC,GAAG,EAAE;QACd,UAAU,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC/B,MAAM,kBAAkB,GAAG,IAAI,UAAU,CACvC,cAAc,EACd,YAAY,EACZ,KAAK,EACL,GAAG,EACH,KAAK,EACL,SAAS,EACT,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,CACV,CAAC;QAEF,gBAAgB,GAAG,IAAI,YAAY,CAAC,kBAAkB,CAAC,CAAC;QACvD,gBAAgB,CAAC,eAAwB,GAAG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AAE;QACjC,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;YAC/C,MAAM,UAAU,GAAe;gBAC7B,UAAU,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;gBACjC,aAAa,EAAE,EAAE;aAClB,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CACpC,UAAU,EACV,gBAAgB,EAChB,WAAW,CACZ,CAAC;YAEF,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;YAC3D,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Reset the encoding cache - useful for testing
|
|
8
|
+
*/
|
|
9
|
+
export declare function resetEncodingCache(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the system encoding, caching the result to avoid repeated system calls.
|
|
12
|
+
* If system encoding detection fails, falls back to detecting from the provided buffer.
|
|
13
|
+
* Note: Only the system encoding is cached - buffer-based detection runs for each buffer
|
|
14
|
+
* since different buffers may have different encodings.
|
|
15
|
+
* @param buffer A buffer to use for detecting encoding if system detection fails.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getCachedEncodingForBuffer(buffer: Buffer): string;
|
|
18
|
+
/**
|
|
19
|
+
* Detects the system encoding based on the platform.
|
|
20
|
+
* For Windows, it uses the 'chcp' command to get the current code page.
|
|
21
|
+
* For Unix-like systems, it checks environment variables like LC_ALL, LC_CTYPE, and LANG.
|
|
22
|
+
* If those are not set, it tries to run 'locale charmap' to get the encoding.
|
|
23
|
+
* If detection fails, it returns null.
|
|
24
|
+
* @returns The system encoding as a string, or null if detection fails.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getSystemEncoding(): string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Converts a Windows code page number to a corresponding encoding name.
|
|
29
|
+
* @param cp The Windows code page number (e.g., 437, 850, etc.)
|
|
30
|
+
* @returns The corresponding encoding name as a string, or null if no mapping exists.
|
|
31
|
+
*/
|
|
32
|
+
export declare function windowsCodePageToEncoding(cp: number): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Attempts to detect encoding from a buffer using chardet.
|
|
35
|
+
* This is useful when system encoding detection fails.
|
|
36
|
+
* Returns the detected encoding in lowercase, or null if detection fails.
|
|
37
|
+
* @param buffer The buffer to analyze for encoding.
|
|
38
|
+
* @return The detected encoding as a lowercase string, or null if detection fails.
|
|
39
|
+
*/
|
|
40
|
+
export declare function detectEncodingFromBuffer(buffer: Buffer): string | null;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { execSync } from 'child_process';
|
|
7
|
+
import os from 'os';
|
|
8
|
+
import { detect as chardetDetect } from 'chardet';
|
|
9
|
+
// Cache for system encoding to avoid repeated detection
|
|
10
|
+
// Use undefined to indicate "not yet checked" vs null meaning "checked but failed"
|
|
11
|
+
let cachedSystemEncoding = undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Reset the encoding cache - useful for testing
|
|
14
|
+
*/
|
|
15
|
+
export function resetEncodingCache() {
|
|
16
|
+
cachedSystemEncoding = undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Returns the system encoding, caching the result to avoid repeated system calls.
|
|
20
|
+
* If system encoding detection fails, falls back to detecting from the provided buffer.
|
|
21
|
+
* Note: Only the system encoding is cached - buffer-based detection runs for each buffer
|
|
22
|
+
* since different buffers may have different encodings.
|
|
23
|
+
* @param buffer A buffer to use for detecting encoding if system detection fails.
|
|
24
|
+
*/
|
|
25
|
+
export function getCachedEncodingForBuffer(buffer) {
|
|
26
|
+
// Cache system encoding detection since it's system-wide
|
|
27
|
+
if (cachedSystemEncoding === undefined) {
|
|
28
|
+
cachedSystemEncoding = getSystemEncoding();
|
|
29
|
+
}
|
|
30
|
+
// If we have a cached system encoding, use it
|
|
31
|
+
if (cachedSystemEncoding) {
|
|
32
|
+
return cachedSystemEncoding;
|
|
33
|
+
}
|
|
34
|
+
// Otherwise, detect from this specific buffer (don't cache this result)
|
|
35
|
+
return detectEncodingFromBuffer(buffer) || 'utf-8';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Detects the system encoding based on the platform.
|
|
39
|
+
* For Windows, it uses the 'chcp' command to get the current code page.
|
|
40
|
+
* For Unix-like systems, it checks environment variables like LC_ALL, LC_CTYPE, and LANG.
|
|
41
|
+
* If those are not set, it tries to run 'locale charmap' to get the encoding.
|
|
42
|
+
* If detection fails, it returns null.
|
|
43
|
+
* @returns The system encoding as a string, or null if detection fails.
|
|
44
|
+
*/
|
|
45
|
+
export function getSystemEncoding() {
|
|
46
|
+
// Windows
|
|
47
|
+
if (os.platform() === 'win32') {
|
|
48
|
+
try {
|
|
49
|
+
const output = execSync('chcp', { encoding: 'utf8' });
|
|
50
|
+
const match = output.match(/:\s*(\d+)/);
|
|
51
|
+
if (match) {
|
|
52
|
+
const codePage = parseInt(match[1], 10);
|
|
53
|
+
if (!isNaN(codePage)) {
|
|
54
|
+
return windowsCodePageToEncoding(codePage);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Only warn if we can't parse the output format, not if windowsCodePageToEncoding fails
|
|
58
|
+
throw new Error(`Unable to parse Windows code page from 'chcp' output "${output.trim()}". `);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.warn(`Failed to get Windows code page using 'chcp' command: ${error instanceof Error ? error.message : String(error)}. ` +
|
|
62
|
+
`Will attempt to detect encoding from command output instead.`);
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
// Unix-like
|
|
67
|
+
// Use environment variables LC_ALL, LC_CTYPE, and LANG to determine the
|
|
68
|
+
// system encoding. However, these environment variables might not always
|
|
69
|
+
// be set or accurate. Handle cases where none of these variables are set.
|
|
70
|
+
const env = process.env;
|
|
71
|
+
let locale = env.LC_ALL || env.LC_CTYPE || env.LANG || '';
|
|
72
|
+
// Fallback to querying the system directly when environment variables are missing
|
|
73
|
+
if (!locale) {
|
|
74
|
+
try {
|
|
75
|
+
locale = execSync('locale charmap', { encoding: 'utf8' })
|
|
76
|
+
.toString()
|
|
77
|
+
.trim();
|
|
78
|
+
}
|
|
79
|
+
catch (_e) {
|
|
80
|
+
console.warn('Failed to get locale charmap.');
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const match = locale.match(/\.(.+)/); // e.g., "en_US.UTF-8"
|
|
85
|
+
if (match && match[1]) {
|
|
86
|
+
return match[1].toLowerCase();
|
|
87
|
+
}
|
|
88
|
+
// Handle cases where locale charmap returns just the encoding name (e.g., "UTF-8")
|
|
89
|
+
if (locale && !locale.includes('.')) {
|
|
90
|
+
return locale.toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Converts a Windows code page number to a corresponding encoding name.
|
|
96
|
+
* @param cp The Windows code page number (e.g., 437, 850, etc.)
|
|
97
|
+
* @returns The corresponding encoding name as a string, or null if no mapping exists.
|
|
98
|
+
*/
|
|
99
|
+
export function windowsCodePageToEncoding(cp) {
|
|
100
|
+
// Most common mappings; extend as needed
|
|
101
|
+
const map = {
|
|
102
|
+
437: 'cp437',
|
|
103
|
+
850: 'cp850',
|
|
104
|
+
852: 'cp852',
|
|
105
|
+
866: 'cp866',
|
|
106
|
+
874: 'windows-874',
|
|
107
|
+
932: 'shift_jis',
|
|
108
|
+
936: 'gb2312',
|
|
109
|
+
949: 'euc-kr',
|
|
110
|
+
950: 'big5',
|
|
111
|
+
1200: 'utf-16le',
|
|
112
|
+
1201: 'utf-16be',
|
|
113
|
+
1250: 'windows-1250',
|
|
114
|
+
1251: 'windows-1251',
|
|
115
|
+
1252: 'windows-1252',
|
|
116
|
+
1253: 'windows-1253',
|
|
117
|
+
1254: 'windows-1254',
|
|
118
|
+
1255: 'windows-1255',
|
|
119
|
+
1256: 'windows-1256',
|
|
120
|
+
1257: 'windows-1257',
|
|
121
|
+
1258: 'windows-1258',
|
|
122
|
+
65001: 'utf-8',
|
|
123
|
+
};
|
|
124
|
+
if (map[cp]) {
|
|
125
|
+
return map[cp];
|
|
126
|
+
}
|
|
127
|
+
console.warn(`Unable to determine encoding for windows code page ${cp}.`);
|
|
128
|
+
return null; // Return null if no mapping found
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Attempts to detect encoding from a buffer using chardet.
|
|
132
|
+
* This is useful when system encoding detection fails.
|
|
133
|
+
* Returns the detected encoding in lowercase, or null if detection fails.
|
|
134
|
+
* @param buffer The buffer to analyze for encoding.
|
|
135
|
+
* @return The detected encoding as a lowercase string, or null if detection fails.
|
|
136
|
+
*/
|
|
137
|
+
export function detectEncodingFromBuffer(buffer) {
|
|
138
|
+
try {
|
|
139
|
+
const detected = chardetDetect(buffer);
|
|
140
|
+
if (detected && typeof detected === 'string') {
|
|
141
|
+
return detected.toLowerCase();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
console.warn('Failed to detect encoding with chardet:', error);
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=systemEncoding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemEncoding.js","sourceRoot":"","sources":["../../../src/utils/systemEncoding.ts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