@office-ai/aioncli-core 0.1.1-8.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/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 +70 -0
- package/dist/src/code_assist/converter.js +126 -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 +279 -0
- package/dist/src/code_assist/converter.test.js.map +1 -0
- package/dist/src/code_assist/oauth2.d.ts +24 -0
- package/dist/src/code_assist/oauth2.js +373 -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 +334 -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 +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 +272 -0
- package/dist/src/config/config.js +554 -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 +365 -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 +9 -0
- package/dist/src/config/models.js +10 -0
- package/dist/src/config/models.js.map +1 -0
- package/dist/src/core/client.d.ts +61 -0
- package/dist/src/core/client.js +485 -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 +1008 -0
- package/dist/src/core/client.test.js.map +1 -0
- package/dist/src/core/contentGenerator.d.ts +45 -0
- package/dist/src/core/contentGenerator.js +85 -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 +100 -0
- package/dist/src/core/contentGenerator.test.js.map +1 -0
- package/dist/src/core/coreToolScheduler.d.ts +117 -0
- package/dist/src/core/coreToolScheduler.js +530 -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 +625 -0
- package/dist/src/core/coreToolScheduler.test.js.map +1 -0
- package/dist/src/core/geminiChat.d.ts +118 -0
- package/dist/src/core/geminiChat.js +509 -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 +10 -0
- package/dist/src/core/geminiRequest.js.map +1 -0
- package/dist/src/core/logger.d.ts +37 -0
- package/dist/src/core/logger.js +273 -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 +467 -0
- package/dist/src/core/logger.test.js.map +1 -0
- package/dist/src/core/loggingContentGenerator.d.ts +24 -0
- package/dist/src/core/loggingContentGenerator.js +89 -0
- package/dist/src/core/loggingContentGenerator.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 +124 -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 +165 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator.d.ts +77 -0
- package/dist/src/core/openaiContentGenerator.js +1395 -0
- package/dist/src/core/openaiContentGenerator.js.map +1 -0
- package/dist/src/core/openaiContentGenerator.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator.test.js +1904 -0
- package/dist/src/core/openaiContentGenerator.test.js.map +1 -0
- package/dist/src/core/prompts.d.ts +12 -0
- package/dist/src/core/prompts.js +359 -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 +214 -0
- package/dist/src/core/prompts.test.js.map +1 -0
- package/dist/src/core/subagent.d.ts +230 -0
- package/dist/src/core/subagent.js +447 -0
- package/dist/src/core/subagent.js.map +1 -0
- package/dist/src/core/subagent.test.d.ts +6 -0
- package/dist/src/core/subagent.test.js +515 -0
- package/dist/src/core/subagent.test.js.map +1 -0
- package/dist/src/core/tokenLimits.d.ts +10 -0
- package/dist/src/core/tokenLimits.js +28 -0
- package/dist/src/core/tokenLimits.js.map +1 -0
- package/dist/src/core/turn.d.ts +114 -0
- package/dist/src/core/turn.js +143 -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 +369 -0
- package/dist/src/core/turn.test.js.map +1 -0
- package/dist/src/ide/detect-ide.d.ts +10 -0
- package/dist/src/ide/detect-ide.js +27 -0
- package/dist/src/ide/detect-ide.js.map +1 -0
- package/dist/src/ide/ide-client.d.ts +56 -0
- package/dist/src/ide/ide-client.js +268 -0
- package/dist/src/ide/ide-client.js.map +1 -0
- package/dist/src/ide/ide-installer.d.ts +14 -0
- package/dist/src/ide/ide-installer.js +109 -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 +55 -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/index.d.ts +68 -0
- package/dist/src/index.js +78 -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 +63 -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 +54 -0
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -0
- package/dist/src/mcp/oauth-provider.d.ts +147 -0
- package/dist/src/mcp/oauth-provider.js +484 -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 +602 -0
- package/dist/src/mcp/oauth-provider.test.js.map +1 -0
- package/dist/src/mcp/oauth-token-storage.d.ts +83 -0
- package/dist/src/mcp/oauth-token-storage.js +151 -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/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/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/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 +209 -0
- package/dist/src/services/gitService.test.js.map +1 -0
- package/dist/src/services/loopDetectionService.d.ts +97 -0
- package/dist/src/services/loopDetectionService.js +340 -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 +484 -0
- package/dist/src/services/loopDetectionService.test.js.map +1 -0
- package/dist/src/services/shellExecutionService.d.ts +70 -0
- package/dist/src/services/shellExecutionService.js +175 -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 +272 -0
- package/dist/src/services/shellExecutionService.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +65 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +652 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +6 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +186 -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 +59 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +159 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +23 -0
- package/dist/src/telemetry/constants.js +24 -0
- package/dist/src/telemetry/constants.js.map +1 -0
- package/dist/src/telemetry/file-exporters.d.ts +28 -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 +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 +18 -0
- package/dist/src/telemetry/loggers.js +268 -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 +568 -0
- package/dist/src/telemetry/loggers.test.js.map +1 -0
- package/dist/src/telemetry/metrics.d.ts +20 -0
- package/dist/src/telemetry/metrics.js +150 -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 +212 -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 +127 -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/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 +145 -0
- package/dist/src/telemetry/types.js +267 -0
- package/dist/src/telemetry/types.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.d.ts +71 -0
- package/dist/src/telemetry/uiTelemetry.js +140 -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 +518 -0
- package/dist/src/telemetry/uiTelemetry.test.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 +23 -0
- package/dist/src/test-utils/tools.js +41 -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 +55 -0
- package/dist/src/tools/edit.js +398 -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 +681 -0
- package/dist/src/tools/edit.test.js.map +1 -0
- package/dist/src/tools/glob.d.ts +51 -0
- package/dist/src/tools/glob.js +226 -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 +330 -0
- package/dist/src/tools/glob.test.js.map +1 -0
- package/dist/src/tools/grep.d.ts +46 -0
- package/dist/src/tools/grep.js +503 -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 +272 -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 +224 -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 +356 -0
- package/dist/src/tools/ls.test.js.map +1 -0
- package/dist/src/tools/mcp-client.d.ts +149 -0
- package/dist/src/tools/mcp-client.js +844 -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 +643 -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 +202 -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 +501 -0
- package/dist/src/tools/mcp-tool.test.js.map +1 -0
- package/dist/src/tools/memoryTool.d.ts +43 -0
- package/dist/src/tools/memoryTool.js +290 -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 +266 -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 +34 -0
- package/dist/src/tools/read-file.js +152 -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 +300 -0
- package/dist/src/tools/read-file.test.js.map +1 -0
- package/dist/src/tools/read-many-files.d.ts +61 -0
- package/dist/src/tools/read-many-files.js +421 -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 +455 -0
- package/dist/src/tools/read-many-files.test.js.map +1 -0
- package/dist/src/tools/shell.d.ts +23 -0
- package/dist/src/tools/shell.js +313 -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-error.d.ts +26 -0
- package/dist/src/tools/tool-error.js +31 -0
- package/dist/src/tools/tool-error.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +85 -0
- package/dist/src/tools/tool-registry.js +390 -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 +417 -0
- package/dist/src/tools/tool-registry.test.js.map +1 -0
- package/dist/src/tools/tools.d.ts +328 -0
- package/dist/src/tools/tools.js +281 -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 +117 -0
- package/dist/src/tools/tools.test.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 +46 -0
- package/dist/src/tools/write-file.js +321 -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 +572 -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 +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 +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 +139 -0
- package/dist/src/utils/environmentContext.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 +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 +56 -0
- package/dist/src/utils/fileUtils.js +314 -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 +363 -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/fileSearch.d.ts +81 -0
- package/dist/src/utils/filesearch/fileSearch.js +241 -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 +654 -0
- package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -0
- package/dist/src/utils/filesearch/ignore.d.ts +35 -0
- package/dist/src/utils/filesearch/ignore.js +81 -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 +57 -0
- package/dist/src/utils/filesearch/ignore.test.js.map +1 -0
- package/dist/src/utils/filesearch/result-cache.d.ts +34 -0
- package/dist/src/utils/filesearch/result-cache.js +61 -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 +47 -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 +118 -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 +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 +282 -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 +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/memoryDiscovery.d.ts +15 -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 +181 -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 +300 -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 +715 -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 +92 -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/partUtils.d.ts +14 -0
- package/dist/src/utils/partUtils.js +65 -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 +130 -0
- package/dist/src/utils/partUtils.test.js.map +1 -0
- package/dist/src/utils/paths.d.ts +68 -0
- package/dist/src/utils/paths.js +170 -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 +153 -0
- package/dist/src/utils/paths.test.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 +30 -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/secure-browser-launcher.d.ts +23 -0
- package/dist/src/utils/secure-browser-launcher.js +164 -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 +78 -0
- package/dist/src/utils/shell-utils.js +306 -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 +200 -0
- package/dist/src/utils/shell-utils.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/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/src/utils/workspaceContext.d.ts +51 -0
- package/dist/src/utils/workspaceContext.js +139 -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 +209 -0
- package/dist/src/utils/workspaceContext.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Safely stringifies an object to JSON, handling circular references by replacing them with [Circular].
|
|
8
|
+
*
|
|
9
|
+
* @param obj - The object to stringify
|
|
10
|
+
* @param space - Optional space parameter for formatting (defaults to no formatting)
|
|
11
|
+
* @returns JSON string with circular references replaced by [Circular]
|
|
12
|
+
*/
|
|
13
|
+
export function safeJsonStringify(obj, space) {
|
|
14
|
+
const seen = new WeakSet();
|
|
15
|
+
return JSON.stringify(obj, (key, value) => {
|
|
16
|
+
if (typeof value === 'object' && value !== null) {
|
|
17
|
+
if (seen.has(value)) {
|
|
18
|
+
return '[Circular]';
|
|
19
|
+
}
|
|
20
|
+
seen.add(value);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}, space);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=safeJsonStringify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeJsonStringify.js","sourceRoot":"","sources":["../../../src/utils/safeJsonStringify.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAY,EACZ,KAAuB;IAEvB,MAAM,IAAI,GAAG,IAAI,OAAO,EAAE,CAAC;IAC3B,OAAO,IAAI,CAAC,SAAS,CACnB,GAAG,EACH,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACb,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAChD,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBACpB,OAAO,YAAY,CAAC;YACtB,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EACD,KAAK,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect } from 'vitest';
|
|
7
|
+
import { safeJsonStringify } from './safeJsonStringify.js';
|
|
8
|
+
describe('safeJsonStringify', () => {
|
|
9
|
+
it('should stringify normal objects without issues', () => {
|
|
10
|
+
const obj = { name: 'test', value: 42 };
|
|
11
|
+
const result = safeJsonStringify(obj);
|
|
12
|
+
expect(result).toBe('{"name":"test","value":42}');
|
|
13
|
+
});
|
|
14
|
+
it('should handle circular references by replacing them with [Circular]', () => {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
const obj = { name: 'test' };
|
|
17
|
+
obj.circular = obj; // Create circular reference
|
|
18
|
+
const result = safeJsonStringify(obj);
|
|
19
|
+
expect(result).toBe('{"name":"test","circular":"[Circular]"}');
|
|
20
|
+
});
|
|
21
|
+
it('should handle complex circular structures like HttpsProxyAgent', () => {
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
const agent = {
|
|
24
|
+
sockets: {},
|
|
25
|
+
options: { host: 'example.com' },
|
|
26
|
+
};
|
|
27
|
+
agent.sockets['example.com'] = [{ agent }];
|
|
28
|
+
const result = safeJsonStringify(agent);
|
|
29
|
+
expect(result).toContain('[Circular]');
|
|
30
|
+
expect(result).toContain('example.com');
|
|
31
|
+
});
|
|
32
|
+
it('should respect the space parameter for formatting', () => {
|
|
33
|
+
const obj = { name: 'test', value: 42 };
|
|
34
|
+
const result = safeJsonStringify(obj, 2);
|
|
35
|
+
expect(result).toBe('{\n "name": "test",\n "value": 42\n}');
|
|
36
|
+
});
|
|
37
|
+
it('should handle circular references with formatting', () => {
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
+
const obj = { name: 'test' };
|
|
40
|
+
obj.circular = obj;
|
|
41
|
+
const result = safeJsonStringify(obj, 2);
|
|
42
|
+
expect(result).toBe('{\n "name": "test",\n "circular": "[Circular]"\n}');
|
|
43
|
+
});
|
|
44
|
+
it('should handle arrays with circular references', () => {
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
const arr = [{ id: 1 }];
|
|
47
|
+
arr[0].parent = arr; // Create circular reference
|
|
48
|
+
const result = safeJsonStringify(arr);
|
|
49
|
+
expect(result).toBe('[{"id":1,"parent":"[Circular]"}]');
|
|
50
|
+
});
|
|
51
|
+
it('should handle null and undefined values', () => {
|
|
52
|
+
expect(safeJsonStringify(null)).toBe('null');
|
|
53
|
+
expect(safeJsonStringify(undefined)).toBe(undefined);
|
|
54
|
+
});
|
|
55
|
+
it('should handle primitive values', () => {
|
|
56
|
+
expect(safeJsonStringify('test')).toBe('"test"');
|
|
57
|
+
expect(safeJsonStringify(42)).toBe('42');
|
|
58
|
+
expect(safeJsonStringify(true)).toBe('true');
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=safeJsonStringify.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeJsonStringify.test.js","sourceRoot":"","sources":["../../../src/utils/safeJsonStringify.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,8DAA8D;QAC9D,MAAM,GAA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@google/genai';
|
|
7
|
+
/**
|
|
8
|
+
* Simple utility to validate objects against JSON Schemas
|
|
9
|
+
*/
|
|
10
|
+
export declare class SchemaValidator {
|
|
11
|
+
/**
|
|
12
|
+
* Returns null if the data confroms to the schema described by schema (or if schema
|
|
13
|
+
* is null). Otherwise, returns a string describing the error.
|
|
14
|
+
*/
|
|
15
|
+
static validate(schema: Schema | undefined, data: unknown): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Converts @google/genai's Schema to an object compatible with avj.
|
|
18
|
+
* This is necessary because it represents Types as an Enum (with
|
|
19
|
+
* UPPERCASE values) and minItems and minLength as strings, when they should be numbers.
|
|
20
|
+
*/
|
|
21
|
+
private static toObjectSchema;
|
|
22
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import AjvPkg from 'ajv';
|
|
7
|
+
// Ajv's ESM/CJS interop: use 'any' for compatibility as recommended by Ajv docs
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
const AjvClass = AjvPkg.default || AjvPkg;
|
|
10
|
+
const ajValidator = new AjvClass();
|
|
11
|
+
/**
|
|
12
|
+
* Simple utility to validate objects against JSON Schemas
|
|
13
|
+
*/
|
|
14
|
+
export class SchemaValidator {
|
|
15
|
+
/**
|
|
16
|
+
* Returns null if the data confroms to the schema described by schema (or if schema
|
|
17
|
+
* is null). Otherwise, returns a string describing the error.
|
|
18
|
+
*/
|
|
19
|
+
static validate(schema, data) {
|
|
20
|
+
if (!schema) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (typeof data !== 'object' || data === null) {
|
|
24
|
+
return 'Value of params must be an object';
|
|
25
|
+
}
|
|
26
|
+
const validate = ajValidator.compile(this.toObjectSchema(schema));
|
|
27
|
+
const valid = validate(data);
|
|
28
|
+
if (!valid && validate.errors) {
|
|
29
|
+
return ajValidator.errorsText(validate.errors, { dataVar: 'params' });
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Converts @google/genai's Schema to an object compatible with avj.
|
|
35
|
+
* This is necessary because it represents Types as an Enum (with
|
|
36
|
+
* UPPERCASE values) and minItems and minLength as strings, when they should be numbers.
|
|
37
|
+
*/
|
|
38
|
+
static toObjectSchema(schema) {
|
|
39
|
+
const newSchema = { ...schema };
|
|
40
|
+
if (newSchema.anyOf && Array.isArray(newSchema.anyOf)) {
|
|
41
|
+
newSchema.anyOf = newSchema.anyOf.map((v) => this.toObjectSchema(v));
|
|
42
|
+
}
|
|
43
|
+
if (newSchema.items) {
|
|
44
|
+
newSchema.items = this.toObjectSchema(newSchema.items);
|
|
45
|
+
}
|
|
46
|
+
if (newSchema.properties && typeof newSchema.properties === 'object') {
|
|
47
|
+
const newProperties = {};
|
|
48
|
+
for (const [key, value] of Object.entries(newSchema.properties)) {
|
|
49
|
+
newProperties[key] = this.toObjectSchema(value);
|
|
50
|
+
}
|
|
51
|
+
newSchema.properties = newProperties;
|
|
52
|
+
}
|
|
53
|
+
if (newSchema.type) {
|
|
54
|
+
newSchema.type = String(newSchema.type).toLowerCase();
|
|
55
|
+
}
|
|
56
|
+
if (newSchema.minItems) {
|
|
57
|
+
newSchema.minItems = Number(newSchema.minItems);
|
|
58
|
+
}
|
|
59
|
+
if (newSchema.minLength) {
|
|
60
|
+
newSchema.minLength = Number(newSchema.minLength);
|
|
61
|
+
}
|
|
62
|
+
return newSchema;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=schemaValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaValidator.js","sourceRoot":"","sources":["../../../src/utils/schemaValidator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,MAAM,MAAM,KAAK,CAAC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AC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACzD,CAAC;QACD,IAAI,SAAS,CAAC,UAAU,IAAI,OAAO,SAAS,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;YACrE,MAAM,aAAa,GAA4B,EAAE,CAAC;YAClD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;gBAChE,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,KAAe,CAAC,CAAC;YAC5D,CAAC;YACD,SAAS,CAAC,UAAU,GAAG,aAAa,CAAC;QACvC,CAAC;QACD,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;YACnB,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QACxD,CAAC;QACD,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;YACvB,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC;YACxB,SAAS,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Opens a URL in the default browser using platform-specific commands.
|
|
8
|
+
* This implementation avoids shell injection vulnerabilities by:
|
|
9
|
+
* 1. Validating the URL to ensure it's HTTP/HTTPS only
|
|
10
|
+
* 2. Using execFile instead of exec to avoid shell interpretation
|
|
11
|
+
* 3. Passing the URL as an argument rather than constructing a command string
|
|
12
|
+
*
|
|
13
|
+
* @param url The URL to open
|
|
14
|
+
* @throws Error if the URL is invalid or if opening the browser fails
|
|
15
|
+
*/
|
|
16
|
+
export declare function openBrowserSecurely(url: string): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Checks if the current environment should attempt to launch a browser.
|
|
19
|
+
* This is the same logic as in browser.ts for consistency.
|
|
20
|
+
*
|
|
21
|
+
* @returns True if the tool should attempt to launch a browser
|
|
22
|
+
*/
|
|
23
|
+
export declare function shouldLaunchBrowser(): boolean;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { execFile } from 'node:child_process';
|
|
7
|
+
import { promisify } from 'node:util';
|
|
8
|
+
import { platform } from 'node:os';
|
|
9
|
+
import { URL } from 'node:url';
|
|
10
|
+
const execFileAsync = promisify(execFile);
|
|
11
|
+
/**
|
|
12
|
+
* Validates that a URL is safe to open in a browser.
|
|
13
|
+
* Only allows HTTP and HTTPS URLs to prevent command injection.
|
|
14
|
+
*
|
|
15
|
+
* @param url The URL to validate
|
|
16
|
+
* @throws Error if the URL is invalid or uses an unsafe protocol
|
|
17
|
+
*/
|
|
18
|
+
function validateUrl(url) {
|
|
19
|
+
let parsedUrl;
|
|
20
|
+
try {
|
|
21
|
+
parsedUrl = new URL(url);
|
|
22
|
+
}
|
|
23
|
+
catch (_error) {
|
|
24
|
+
throw new Error(`Invalid URL: ${url}`);
|
|
25
|
+
}
|
|
26
|
+
// Only allow HTTP and HTTPS protocols
|
|
27
|
+
if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
|
|
28
|
+
throw new Error(`Unsafe protocol: ${parsedUrl.protocol}. Only HTTP and HTTPS are allowed.`);
|
|
29
|
+
}
|
|
30
|
+
// Additional validation: ensure no newlines or control characters
|
|
31
|
+
// eslint-disable-next-line no-control-regex
|
|
32
|
+
if (/[\r\n\x00-\x1f]/.test(url)) {
|
|
33
|
+
throw new Error('URL contains invalid characters');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Opens a URL in the default browser using platform-specific commands.
|
|
38
|
+
* This implementation avoids shell injection vulnerabilities by:
|
|
39
|
+
* 1. Validating the URL to ensure it's HTTP/HTTPS only
|
|
40
|
+
* 2. Using execFile instead of exec to avoid shell interpretation
|
|
41
|
+
* 3. Passing the URL as an argument rather than constructing a command string
|
|
42
|
+
*
|
|
43
|
+
* @param url The URL to open
|
|
44
|
+
* @throws Error if the URL is invalid or if opening the browser fails
|
|
45
|
+
*/
|
|
46
|
+
export async function openBrowserSecurely(url) {
|
|
47
|
+
// Validate the URL first
|
|
48
|
+
validateUrl(url);
|
|
49
|
+
const platformName = platform();
|
|
50
|
+
let command;
|
|
51
|
+
let args;
|
|
52
|
+
switch (platformName) {
|
|
53
|
+
case 'darwin':
|
|
54
|
+
// macOS
|
|
55
|
+
command = 'open';
|
|
56
|
+
args = [url];
|
|
57
|
+
break;
|
|
58
|
+
case 'win32':
|
|
59
|
+
// Windows - use PowerShell with Start-Process
|
|
60
|
+
// This avoids the cmd.exe shell which is vulnerable to injection
|
|
61
|
+
command = 'powershell.exe';
|
|
62
|
+
args = [
|
|
63
|
+
'-NoProfile',
|
|
64
|
+
'-NonInteractive',
|
|
65
|
+
'-WindowStyle',
|
|
66
|
+
'Hidden',
|
|
67
|
+
'-Command',
|
|
68
|
+
`Start-Process '${url.replace(/'/g, "''")}'`,
|
|
69
|
+
];
|
|
70
|
+
break;
|
|
71
|
+
case 'linux':
|
|
72
|
+
case 'freebsd':
|
|
73
|
+
case 'openbsd':
|
|
74
|
+
// Linux and BSD variants
|
|
75
|
+
// Try xdg-open first, fall back to other options
|
|
76
|
+
command = 'xdg-open';
|
|
77
|
+
args = [url];
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
throw new Error(`Unsupported platform: ${platformName}`);
|
|
81
|
+
}
|
|
82
|
+
const options = {
|
|
83
|
+
// Don't inherit parent's environment to avoid potential issues
|
|
84
|
+
env: {
|
|
85
|
+
...process.env,
|
|
86
|
+
// Ensure we're not in a shell that might interpret special characters
|
|
87
|
+
SHELL: undefined,
|
|
88
|
+
},
|
|
89
|
+
// Detach the browser process so it doesn't block
|
|
90
|
+
detached: true,
|
|
91
|
+
stdio: 'ignore',
|
|
92
|
+
};
|
|
93
|
+
try {
|
|
94
|
+
await execFileAsync(command, args, options);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
// For Linux, try fallback commands if xdg-open fails
|
|
98
|
+
if ((platformName === 'linux' ||
|
|
99
|
+
platformName === 'freebsd' ||
|
|
100
|
+
platformName === 'openbsd') &&
|
|
101
|
+
command === 'xdg-open') {
|
|
102
|
+
const fallbackCommands = [
|
|
103
|
+
'gnome-open',
|
|
104
|
+
'kde-open',
|
|
105
|
+
'firefox',
|
|
106
|
+
'chromium',
|
|
107
|
+
'google-chrome',
|
|
108
|
+
];
|
|
109
|
+
for (const fallbackCommand of fallbackCommands) {
|
|
110
|
+
try {
|
|
111
|
+
await execFileAsync(fallbackCommand, [url], options);
|
|
112
|
+
return; // Success!
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
// Try next command
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Re-throw the error if all attempts failed
|
|
121
|
+
throw new Error(`Failed to open browser: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Checks if the current environment should attempt to launch a browser.
|
|
126
|
+
* This is the same logic as in browser.ts for consistency.
|
|
127
|
+
*
|
|
128
|
+
* @returns True if the tool should attempt to launch a browser
|
|
129
|
+
*/
|
|
130
|
+
export function shouldLaunchBrowser() {
|
|
131
|
+
// A list of browser names that indicate we should not attempt to open a
|
|
132
|
+
// web browser for the user.
|
|
133
|
+
const browserBlocklist = ['www-browser'];
|
|
134
|
+
const browserEnv = process.env.BROWSER;
|
|
135
|
+
if (browserEnv && browserBlocklist.includes(browserEnv)) {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
// Common environment variables used in CI/CD or other non-interactive shells.
|
|
139
|
+
if (process.env.CI || process.env.DEBIAN_FRONTEND === 'noninteractive') {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
// The presence of SSH_CONNECTION indicates a remote session.
|
|
143
|
+
// We should not attempt to launch a browser unless a display is explicitly available
|
|
144
|
+
// (checked below for Linux).
|
|
145
|
+
const isSSH = !!process.env.SSH_CONNECTION;
|
|
146
|
+
// On Linux, the presence of a display server is a strong indicator of a GUI.
|
|
147
|
+
if (platform() === 'linux') {
|
|
148
|
+
// These are environment variables that can indicate a running compositor on Linux.
|
|
149
|
+
const displayVariables = ['DISPLAY', 'WAYLAND_DISPLAY', 'MIR_SOCKET'];
|
|
150
|
+
const hasDisplay = displayVariables.some((v) => !!process.env[v]);
|
|
151
|
+
if (!hasDisplay) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// If in an SSH session on a non-Linux OS (e.g., macOS), don't launch browser.
|
|
156
|
+
// The Linux case is handled above (it's allowed if DISPLAY is set).
|
|
157
|
+
if (isSSH && platform() !== 'linux') {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
// For non-Linux OSes, we generally assume a GUI is available
|
|
161
|
+
// unless other signals (like SSH) suggest otherwise.
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=secure-browser-launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-browser-launcher.js","sourceRoot":"","sources":["../../../src/utils/secure-browser-launcher.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAA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EAAoE;IACpE,IAAI,KAAK,IAAI,QAAQ,EAAE,KAAK,OAAO,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,6DAA6D;IAC7D,qDAAqD;IACrD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
7
|
+
import { openBrowserSecurely } from './secure-browser-launcher.js';
|
|
8
|
+
// Create mock function using vi.hoisted
|
|
9
|
+
const mockExecFile = vi.hoisted(() => vi.fn());
|
|
10
|
+
// Mock modules
|
|
11
|
+
vi.mock('node:child_process');
|
|
12
|
+
vi.mock('node:util', () => ({
|
|
13
|
+
promisify: () => mockExecFile,
|
|
14
|
+
}));
|
|
15
|
+
describe('secure-browser-launcher', () => {
|
|
16
|
+
let originalPlatform;
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
vi.clearAllMocks();
|
|
19
|
+
mockExecFile.mockResolvedValue({ stdout: '', stderr: '' });
|
|
20
|
+
originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform');
|
|
21
|
+
});
|
|
22
|
+
afterEach(() => {
|
|
23
|
+
if (originalPlatform) {
|
|
24
|
+
Object.defineProperty(process, 'platform', originalPlatform);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
function setPlatform(platform) {
|
|
28
|
+
Object.defineProperty(process, 'platform', {
|
|
29
|
+
value: platform,
|
|
30
|
+
configurable: true,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
describe('URL validation', () => {
|
|
34
|
+
it('should allow valid HTTP URLs', async () => {
|
|
35
|
+
setPlatform('darwin');
|
|
36
|
+
await openBrowserSecurely('http://example.com');
|
|
37
|
+
expect(mockExecFile).toHaveBeenCalledWith('open', ['http://example.com'], expect.any(Object));
|
|
38
|
+
});
|
|
39
|
+
it('should allow valid HTTPS URLs', async () => {
|
|
40
|
+
setPlatform('darwin');
|
|
41
|
+
await openBrowserSecurely('https://example.com');
|
|
42
|
+
expect(mockExecFile).toHaveBeenCalledWith('open', ['https://example.com'], expect.any(Object));
|
|
43
|
+
});
|
|
44
|
+
it('should reject non-HTTP(S) protocols', async () => {
|
|
45
|
+
await expect(openBrowserSecurely('file:///etc/passwd')).rejects.toThrow('Unsafe protocol');
|
|
46
|
+
await expect(openBrowserSecurely('javascript:alert(1)')).rejects.toThrow('Unsafe protocol');
|
|
47
|
+
await expect(openBrowserSecurely('ftp://example.com')).rejects.toThrow('Unsafe protocol');
|
|
48
|
+
});
|
|
49
|
+
it('should reject invalid URLs', async () => {
|
|
50
|
+
await expect(openBrowserSecurely('not-a-url')).rejects.toThrow('Invalid URL');
|
|
51
|
+
await expect(openBrowserSecurely('')).rejects.toThrow('Invalid URL');
|
|
52
|
+
});
|
|
53
|
+
it('should reject URLs with control characters', async () => {
|
|
54
|
+
await expect(openBrowserSecurely('http://example.com\nmalicious-command')).rejects.toThrow('invalid characters');
|
|
55
|
+
await expect(openBrowserSecurely('http://example.com\rmalicious-command')).rejects.toThrow('invalid characters');
|
|
56
|
+
await expect(openBrowserSecurely('http://example.com\x00')).rejects.toThrow('invalid characters');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
describe('Command injection prevention', () => {
|
|
60
|
+
it('should prevent PowerShell command injection on Windows', async () => {
|
|
61
|
+
setPlatform('win32');
|
|
62
|
+
// The POC from the vulnerability report
|
|
63
|
+
const maliciousUrl = "http://127.0.0.1:8080/?param=example#$(Invoke-Expression([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('Y2FsYy5leGU='))))";
|
|
64
|
+
await openBrowserSecurely(maliciousUrl);
|
|
65
|
+
// Verify that execFile was called (not exec) and the URL is passed safely
|
|
66
|
+
expect(mockExecFile).toHaveBeenCalledWith('powershell.exe', [
|
|
67
|
+
'-NoProfile',
|
|
68
|
+
'-NonInteractive',
|
|
69
|
+
'-WindowStyle',
|
|
70
|
+
'Hidden',
|
|
71
|
+
'-Command',
|
|
72
|
+
`Start-Process '${maliciousUrl.replace(/'/g, "''")}'`,
|
|
73
|
+
], expect.any(Object));
|
|
74
|
+
});
|
|
75
|
+
it('should handle URLs with special shell characters safely', async () => {
|
|
76
|
+
setPlatform('darwin');
|
|
77
|
+
const urlsWithSpecialChars = [
|
|
78
|
+
'http://example.com/path?param=value&other=$value',
|
|
79
|
+
'http://example.com/path#fragment;command',
|
|
80
|
+
'http://example.com/$(whoami)',
|
|
81
|
+
'http://example.com/`command`',
|
|
82
|
+
'http://example.com/|pipe',
|
|
83
|
+
'http://example.com/>redirect',
|
|
84
|
+
];
|
|
85
|
+
for (const url of urlsWithSpecialChars) {
|
|
86
|
+
await openBrowserSecurely(url);
|
|
87
|
+
// Verify the URL is passed as an argument, not interpreted by shell
|
|
88
|
+
expect(mockExecFile).toHaveBeenCalledWith('open', [url], expect.any(Object));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
it('should properly escape single quotes in URLs on Windows', async () => {
|
|
92
|
+
setPlatform('win32');
|
|
93
|
+
const urlWithSingleQuotes = "http://example.com/path?name=O'Brien&test='value'";
|
|
94
|
+
await openBrowserSecurely(urlWithSingleQuotes);
|
|
95
|
+
// Verify that single quotes are escaped by doubling them
|
|
96
|
+
expect(mockExecFile).toHaveBeenCalledWith('powershell.exe', [
|
|
97
|
+
'-NoProfile',
|
|
98
|
+
'-NonInteractive',
|
|
99
|
+
'-WindowStyle',
|
|
100
|
+
'Hidden',
|
|
101
|
+
'-Command',
|
|
102
|
+
`Start-Process 'http://example.com/path?name=O''Brien&test=''value'''`,
|
|
103
|
+
], expect.any(Object));
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
describe('Platform-specific behavior', () => {
|
|
107
|
+
it('should use correct command on macOS', async () => {
|
|
108
|
+
setPlatform('darwin');
|
|
109
|
+
await openBrowserSecurely('https://example.com');
|
|
110
|
+
expect(mockExecFile).toHaveBeenCalledWith('open', ['https://example.com'], expect.any(Object));
|
|
111
|
+
});
|
|
112
|
+
it('should use PowerShell on Windows', async () => {
|
|
113
|
+
setPlatform('win32');
|
|
114
|
+
await openBrowserSecurely('https://example.com');
|
|
115
|
+
expect(mockExecFile).toHaveBeenCalledWith('powershell.exe', expect.arrayContaining([
|
|
116
|
+
'-Command',
|
|
117
|
+
`Start-Process 'https://example.com'`,
|
|
118
|
+
]), expect.any(Object));
|
|
119
|
+
});
|
|
120
|
+
it('should use xdg-open on Linux', async () => {
|
|
121
|
+
setPlatform('linux');
|
|
122
|
+
await openBrowserSecurely('https://example.com');
|
|
123
|
+
expect(mockExecFile).toHaveBeenCalledWith('xdg-open', ['https://example.com'], expect.any(Object));
|
|
124
|
+
});
|
|
125
|
+
it('should throw on unsupported platforms', async () => {
|
|
126
|
+
setPlatform('aix');
|
|
127
|
+
await expect(openBrowserSecurely('https://example.com')).rejects.toThrow('Unsupported platform');
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
describe('Error handling', () => {
|
|
131
|
+
it('should handle browser launch failures gracefully', async () => {
|
|
132
|
+
setPlatform('darwin');
|
|
133
|
+
mockExecFile.mockRejectedValueOnce(new Error('Command not found'));
|
|
134
|
+
await expect(openBrowserSecurely('https://example.com')).rejects.toThrow('Failed to open browser');
|
|
135
|
+
});
|
|
136
|
+
it('should try fallback browsers on Linux', async () => {
|
|
137
|
+
setPlatform('linux');
|
|
138
|
+
// First call to xdg-open fails
|
|
139
|
+
mockExecFile.mockRejectedValueOnce(new Error('Command not found'));
|
|
140
|
+
// Second call to gnome-open succeeds
|
|
141
|
+
mockExecFile.mockResolvedValueOnce({ stdout: '', stderr: '' });
|
|
142
|
+
await openBrowserSecurely('https://example.com');
|
|
143
|
+
expect(mockExecFile).toHaveBeenCalledTimes(2);
|
|
144
|
+
expect(mockExecFile).toHaveBeenNthCalledWith(1, 'xdg-open', ['https://example.com'], expect.any(Object));
|
|
145
|
+
expect(mockExecFile).toHaveBeenNthCalledWith(2, 'gnome-open', ['https://example.com'], expect.any(Object));
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
//# sourceMappingURL=secure-browser-launcher.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-browser-launcher.test.js","sourceRoot":"","sources":["../../../src/utils/secure-browser-launcher.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,wCAAwC;AACxC,MAAM,YAAY,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAE/C,eAAe;AACf,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAC9B,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1B,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY;CAC9B,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,IAAI,gBAAgD,CAAC;IAErD,UAAU,CAAC,GAAG,EAAE;QACd,EAAE,CAAC,aAAa,EAAE,CAAC;QACnB,YAAY,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3D,gBAAgB,GAAG,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,gBAAgB,EAAE,CAAC;YACrB,MAAM,C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