@machina.ai/cell-cli-core 1.0.13-rc9 → 1.0.21-rc1
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/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +12 -4
- package/dist/src/code_assist/converter.d.ts +6 -3
- package/dist/src/code_assist/converter.js +4 -2
- package/dist/src/code_assist/converter.js.map +1 -1
- package/dist/src/code_assist/converter.test.js +61 -11
- package/dist/src/code_assist/converter.test.js.map +1 -1
- package/dist/src/code_assist/oauth2.d.ts +1 -0
- package/dist/src/code_assist/oauth2.js +43 -18
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/oauth2.test.js +142 -9
- package/dist/src/code_assist/oauth2.test.js.map +1 -1
- package/dist/src/code_assist/server.d.ts +2 -2
- package/dist/src/code_assist/server.js +5 -5
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/server.test.js +13 -10
- package/dist/src/code_assist/server.test.js.map +1 -1
- package/dist/src/code_assist/setup.js +49 -18
- package/dist/src/code_assist/setup.js.map +1 -1
- package/dist/src/code_assist/setup.test.js +115 -9
- package/dist/src/code_assist/setup.test.js.map +1 -1
- package/dist/src/config/config.d.ts +71 -13
- package/dist/src/config/config.js +154 -41
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +206 -21
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/flashFallback.test.js +19 -47
- package/dist/src/config/flashFallback.test.js.map +1 -1
- package/dist/src/config/models.d.ts +1 -0
- package/dist/src/config/models.js +1 -0
- package/dist/src/config/models.js.map +1 -1
- package/dist/src/core/client.d.ts +15 -16
- package/dist/src/core/client.js +247 -104
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +798 -49
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/contentGenerator.d.ts +2 -2
- package/dist/src/core/contentGenerator.js +23 -21
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/contentGenerator.test.js +30 -126
- package/dist/src/core/contentGenerator.test.js.map +1 -1
- package/dist/src/core/coreToolScheduler.d.ts +23 -10
- package/dist/src/core/coreToolScheduler.js +201 -77
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +322 -94
- package/dist/src/core/coreToolScheduler.test.js.map +1 -1
- package/dist/src/core/geminiChat.d.ts +8 -6
- package/dist/src/core/geminiChat.js +49 -51
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +2 -2
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/geminiRequest.js +2 -37
- package/dist/src/core/geminiRequest.js.map +1 -1
- package/dist/src/core/logger.d.ts +24 -1
- package/dist/src/core/logger.js +128 -4
- package/dist/src/core/logger.js.map +1 -1
- package/dist/src/core/logger.test.js +157 -11
- package/dist/src/core/logger.test.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.d.ts +25 -0
- package/dist/src/core/loggingContentGenerator.js +95 -0
- package/dist/src/core/loggingContentGenerator.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.js +39 -4
- package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.test.js +85 -62
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
- package/dist/src/core/prompts.js +43 -19
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/prompts.test.js +118 -1
- package/dist/src/core/prompts.test.js.map +1 -1
- 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.js +515 -0
- package/dist/src/core/subagent.test.js.map +1 -0
- package/dist/src/core/tokenLimits.js +1 -0
- package/dist/src/core/tokenLimits.js.map +1 -1
- package/dist/src/core/turn.d.ts +3 -0
- package/dist/src/core/turn.js +4 -0
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/core/turn.test.js +4 -0
- package/dist/src/core/turn.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +7 -0
- package/dist/src/generated/git-commit.js +10 -0
- package/dist/src/generated/git-commit.js.map +1 -0
- package/dist/src/ide/constants.d.ts +6 -0
- package/dist/src/ide/constants.js +7 -0
- package/dist/src/ide/constants.js.map +1 -0
- package/dist/src/ide/detect-ide.d.ts +20 -0
- package/dist/src/ide/detect-ide.js +86 -0
- package/dist/src/ide/detect-ide.js.map +1 -0
- package/dist/src/ide/detect-ide.test.js +65 -0
- package/dist/src/ide/detect-ide.test.js.map +1 -0
- package/dist/src/ide/ide-client.d.ts +63 -0
- package/dist/src/ide/ide-client.js +320 -0
- package/dist/src/ide/ide-client.js.map +1 -0
- package/dist/src/ide/ide-client.test.d.ts +6 -0
- package/dist/src/ide/ide-client.test.js +43 -0
- package/dist/src/ide/ide-client.test.js.map +1 -0
- package/dist/src/ide/ide-installer.d.ts +14 -0
- package/dist/src/ide/ide-installer.js +98 -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 +53 -0
- package/dist/src/ide/ide-installer.test.js.map +1 -0
- package/dist/src/ide/ideContext.d.ts +374 -0
- package/dist/src/ide/ideContext.js +147 -0
- package/dist/src/ide/ideContext.js.map +1 -0
- package/dist/src/ide/ideContext.test.d.ts +6 -0
- package/dist/src/ide/ideContext.test.js +265 -0
- package/dist/src/ide/ideContext.test.js.map +1 -0
- package/dist/src/ide/process-utils.d.ts +14 -0
- package/dist/src/ide/process-utils.js +57 -0
- package/dist/src/ide/process-utils.js.map +1 -0
- package/dist/src/index.d.ts +17 -1
- package/dist/src/index.js +20 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.d.ts +23 -0
- package/dist/src/mcp/google-auth-provider.js +72 -0
- package/dist/src/mcp/google-auth-provider.js.map +1 -0
- package/dist/src/mcp/google-auth-provider.test.d.ts +6 -0
- package/dist/src/mcp/google-auth-provider.test.js +89 -0
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -0
- package/dist/src/mcp/oauth-provider.d.ts +6 -2
- package/dist/src/mcp/oauth-provider.js +208 -53
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-provider.test.js +222 -70
- package/dist/src/mcp/oauth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-token-storage.d.ts +3 -1
- package/dist/src/mcp/oauth-token-storage.js +3 -1
- package/dist/src/mcp/oauth-token-storage.js.map +1 -1
- package/dist/src/mcp/oauth-utils.d.ts +3 -1
- package/dist/src/mcp/oauth-utils.js +52 -14
- package/dist/src/mcp/oauth-utils.js.map +1 -1
- package/dist/src/mcp/oauth-utils.test.js +18 -3
- package/dist/src/mcp/oauth-utils.test.js.map +1 -1
- package/dist/src/mocks/msw.d.ts +6 -0
- package/dist/src/mocks/msw.js +8 -0
- package/dist/src/mocks/msw.js.map +1 -0
- package/dist/src/prompts/mcp-prompts.d.ts +8 -0
- package/dist/src/prompts/mcp-prompts.js +13 -0
- package/dist/src/prompts/mcp-prompts.js.map +1 -0
- package/dist/src/prompts/prompt-registry.d.ts +34 -0
- package/dist/src/prompts/prompt-registry.js +63 -0
- package/dist/src/prompts/prompt-registry.js.map +1 -0
- package/dist/src/services/chatRecordingService.d.ts +150 -0
- package/dist/src/services/chatRecordingService.js +318 -0
- package/dist/src/services/chatRecordingService.js.map +1 -0
- package/dist/src/services/chatRecordingService.test.d.ts +6 -0
- package/dist/src/services/chatRecordingService.test.js +288 -0
- package/dist/src/services/chatRecordingService.test.js.map +1 -0
- package/dist/src/services/fileDiscoveryService.test.js +101 -60
- package/dist/src/services/fileDiscoveryService.test.js.map +1 -1
- package/dist/src/services/fileSystemService.d.ts +31 -0
- package/dist/src/services/fileSystemService.js +18 -0
- package/dist/src/services/fileSystemService.js.map +1 -0
- package/dist/src/services/fileSystemService.test.d.ts +6 -0
- package/dist/src/services/fileSystemService.test.js +41 -0
- package/dist/src/services/fileSystemService.test.js.map +1 -0
- package/dist/src/services/gitService.test.js +67 -86
- package/dist/src/services/gitService.test.js.map +1 -1
- package/dist/src/services/loopDetectionService.d.ts +51 -5
- package/dist/src/services/loopDetectionService.js +152 -45
- package/dist/src/services/loopDetectionService.js.map +1 -1
- package/dist/src/services/loopDetectionService.test.js +286 -89
- package/dist/src/services/loopDetectionService.test.js.map +1 -1
- 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 +282 -0
- package/dist/src/services/shellExecutionService.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +81 -9
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +356 -182
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +17 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +342 -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 +19 -2
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +51 -9
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/constants.d.ts +4 -0
- package/dist/src/telemetry/constants.js +4 -0
- package/dist/src/telemetry/constants.js.map +1 -1
- 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 +2 -2
- package/dist/src/telemetry/index.js +2 -2
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/integration.test.circular.js +1 -0
- package/dist/src/telemetry/integration.test.circular.js.map +1 -1
- package/dist/src/telemetry/loggers.d.ts +6 -1
- package/dist/src/telemetry/loggers.js +87 -6
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.circular.js +9 -2
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +51 -11
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/metrics.d.ts +7 -2
- package/dist/src/telemetry/metrics.js +26 -6
- package/dist/src/telemetry/metrics.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js +81 -1
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/telemetry/sdk.d.ts +1 -1
- package/dist/src/telemetry/sdk.js +77 -30
- package/dist/src/telemetry/sdk.js.map +1 -1
- package/dist/src/telemetry/sdk.test.d.ts +6 -0
- package/dist/src/telemetry/sdk.test.js +82 -0
- package/dist/src/telemetry/sdk.test.js.map +1 -0
- package/dist/src/telemetry/telemetry.test.js +2 -2
- package/dist/src/telemetry/telemetry.test.js.map +1 -1
- 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 +74 -18
- package/dist/src/telemetry/types.js +110 -32
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.d.ts +8 -1
- package/dist/src/telemetry/uiTelemetry.js +17 -2
- package/dist/src/telemetry/uiTelemetry.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.test.js +60 -10
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
- package/dist/src/test-utils/config.d.ts +16 -0
- package/dist/src/test-utils/config.js +32 -0
- package/dist/src/test-utils/config.js.map +1 -0
- package/dist/src/test-utils/mockWorkspaceContext.d.ts +13 -0
- package/dist/src/test-utils/mockWorkspaceContext.js +24 -0
- package/dist/src/test-utils/mockWorkspaceContext.js.map +1 -0
- package/dist/src/test-utils/tools.d.ts +44 -0
- package/dist/src/test-utils/tools.js +105 -0
- package/dist/src/test-utils/tools.js.map +1 -0
- package/dist/src/tools/diffOptions.d.ts +2 -0
- package/dist/src/tools/diffOptions.js +28 -0
- package/dist/src/tools/diffOptions.js.map +1 -1
- 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 +10 -34
- package/dist/src/tools/edit.js +171 -131
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js +220 -43
- package/dist/src/tools/edit.test.js.map +1 -1
- package/dist/src/tools/glob.d.ts +4 -11
- package/dist/src/tools/glob.js +129 -97
- package/dist/src/tools/glob.js.map +1 -1
- package/dist/src/tools/glob.test.js +73 -17
- package/dist/src/tools/glob.test.js.map +1 -1
- package/dist/src/tools/grep.d.ts +5 -37
- package/dist/src/tools/grep.js +175 -100
- package/dist/src/tools/grep.js.map +1 -1
- package/dist/src/tools/grep.test.js +112 -28
- package/dist/src/tools/grep.test.js.map +1 -1
- package/dist/src/tools/ls.d.ts +4 -23
- package/dist/src/tools/ls.js +77 -78
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/ls.test.d.ts +6 -0
- package/dist/src/tools/ls.test.js +384 -0
- package/dist/src/tools/ls.test.js.map +1 -0
- package/dist/src/tools/mcp-client-manager.d.ts +38 -0
- package/dist/src/tools/mcp-client-manager.js +74 -0
- package/dist/src/tools/mcp-client-manager.js.map +1 -0
- package/dist/src/tools/mcp-client-manager.test.d.ts +6 -0
- package/dist/src/tools/mcp-client-manager.test.js +39 -0
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -0
- package/dist/src/tools/mcp-client.d.ts +86 -4
- package/dist/src/tools/mcp-client.js +730 -59
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +295 -22
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/mcp-tool.d.ts +6 -13
- package/dist/src/tools/mcp-tool.js +163 -76
- package/dist/src/tools/mcp-tool.js.map +1 -1
- package/dist/src/tools/mcp-tool.test.js +400 -29
- package/dist/src/tools/mcp-tool.test.js.map +1 -1
- package/dist/src/tools/memoryTool.d.ts +14 -3
- package/dist/src/tools/memoryTool.js +159 -40
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/memoryTool.test.js +116 -11
- package/dist/src/tools/memoryTool.test.js.map +1 -1
- package/dist/src/tools/modifiable-tool.d.ts +9 -6
- package/dist/src/tools/modifiable-tool.js +6 -3
- package/dist/src/tools/modifiable-tool.js.map +1 -1
- package/dist/src/tools/modifiable-tool.test.js +63 -74
- package/dist/src/tools/modifiable-tool.test.js.map +1 -1
- package/dist/src/tools/read-file.d.ts +4 -6
- package/dist/src/tools/read-file.js +100 -53
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/read-file.test.js +238 -111
- package/dist/src/tools/read-file.test.js.map +1 -1
- package/dist/src/tools/read-many-files.d.ts +3 -6
- package/dist/src/tools/read-many-files.js +232 -157
- package/dist/src/tools/read-many-files.js.map +1 -1
- package/dist/src/tools/read-many-files.test.js +231 -34
- package/dist/src/tools/read-many-files.test.js.map +1 -1
- package/dist/src/tools/shell.d.ts +6 -28
- package/dist/src/tools/shell.js +249 -366
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +305 -384
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/tool-error.d.ts +27 -0
- package/dist/src/tools/tool-error.js +32 -0
- package/dist/src/tools/tool-error.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +38 -23
- package/dist/src/tools/tool-registry.js +127 -99
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +37 -212
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/tools.d.ts +145 -92
- package/dist/src/tools/tools.js +188 -61
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/tools.test.d.ts +6 -0
- package/dist/src/tools/tools.test.js +206 -0
- package/dist/src/tools/tools.test.js.map +1 -0
- package/dist/src/tools/web-fetch.d.ts +4 -7
- package/dist/src/tools/web-fetch.js +58 -64
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/web-fetch.test.js +8 -4
- package/dist/src/tools/web-fetch.test.js.map +1 -1
- package/dist/src/tools/web-search.d.ts +4 -5
- package/dist/src/tools/web-search.js +47 -51
- package/dist/src/tools/web-search.js.map +1 -1
- package/dist/src/tools/web-search.test.d.ts +6 -0
- package/dist/src/tools/web-search.test.js +139 -0
- package/dist/src/tools/web-search.test.js.map +1 -0
- package/dist/src/tools/write-file.d.ts +20 -11
- package/dist/src/tools/write-file.js +198 -141
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js +190 -76
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.js +51 -27
- package/dist/src/utils/bfsFileSearch.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.test.js +137 -136
- package/dist/src/utils/bfsFileSearch.test.js.map +1 -1
- package/dist/src/utils/browser.js +4 -3
- package/dist/src/utils/browser.js.map +1 -1
- package/dist/src/utils/editCorrector.js +23 -24
- package/dist/src/utils/editCorrector.js.map +1 -1
- package/dist/src/utils/editor.d.ts +2 -2
- package/dist/src/utils/editor.js +23 -6
- package/dist/src/utils/editor.js.map +1 -1
- package/dist/src/utils/editor.test.js +67 -15
- package/dist/src/utils/editor.test.js.map +1 -1
- 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 +140 -0
- package/dist/src/utils/environmentContext.test.js.map +1 -0
- package/dist/src/utils/errorParsing.d.ts +8 -0
- package/dist/src/utils/errorParsing.js +93 -0
- package/dist/src/utils/errorParsing.js.map +1 -0
- package/dist/src/utils/errorParsing.test.d.ts +6 -0
- package/dist/src/utils/errorParsing.test.js +172 -0
- package/dist/src/utils/errorParsing.test.js.map +1 -0
- package/dist/src/utils/errorReporting.d.ts +1 -1
- package/dist/src/utils/errorReporting.js +2 -2
- package/dist/src/utils/errorReporting.js.map +1 -1
- package/dist/src/utils/errorReporting.test.js +44 -38
- package/dist/src/utils/errorReporting.test.js.map +1 -1
- package/dist/src/utils/fileUtils.d.ts +9 -1
- package/dist/src/utils/fileUtils.js +27 -13
- package/dist/src/utils/fileUtils.js.map +1 -1
- package/dist/src/utils/fileUtils.test.js +61 -18
- package/dist/src/utils/fileUtils.test.js.map +1 -1
- package/dist/src/utils/filesearch/crawlCache.d.ts +25 -0
- package/dist/src/utils/filesearch/crawlCache.js +57 -0
- package/dist/src/utils/filesearch/crawlCache.js.map +1 -0
- package/dist/src/utils/filesearch/crawlCache.test.d.ts +6 -0
- package/dist/src/utils/filesearch/crawlCache.test.js +103 -0
- package/dist/src/utils/filesearch/crawlCache.test.js.map +1 -0
- package/dist/src/utils/filesearch/crawler.d.ts +15 -0
- package/dist/src/utils/filesearch/crawler.js +50 -0
- package/dist/src/utils/filesearch/crawler.js.map +1 -0
- package/dist/src/utils/filesearch/crawler.test.d.ts +6 -0
- package/dist/src/utils/filesearch/crawler.test.js +468 -0
- package/dist/src/utils/filesearch/crawler.test.js.map +1 -0
- package/dist/src/utils/filesearch/fileSearch.d.ts +37 -0
- package/dist/src/utils/filesearch/fileSearch.js +186 -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 +552 -0
- package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -0
- package/dist/src/utils/filesearch/ignore.d.ts +42 -0
- package/dist/src/utils/filesearch/ignore.js +106 -0
- package/dist/src/utils/filesearch/ignore.js.map +1 -0
- package/dist/src/utils/filesearch/ignore.test.d.ts +6 -0
- package/dist/src/utils/filesearch/ignore.test.js +144 -0
- package/dist/src/utils/filesearch/ignore.test.js.map +1 -0
- package/dist/src/utils/filesearch/result-cache.d.ts +33 -0
- package/dist/src/utils/filesearch/result-cache.js +59 -0
- package/dist/src/utils/filesearch/result-cache.js.map +1 -0
- package/dist/src/utils/filesearch/result-cache.test.d.ts +6 -0
- package/dist/src/utils/filesearch/result-cache.test.js +46 -0
- package/dist/src/utils/filesearch/result-cache.test.js.map +1 -0
- package/dist/src/utils/flashFallback.integration.test.js +6 -0
- package/dist/src/utils/flashFallback.integration.test.js.map +1 -1
- 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/getFolderStructure.test.js +11 -13
- package/dist/src/utils/getFolderStructure.test.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.js +5 -11
- package/dist/src/utils/gitIgnoreParser.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.test.js +58 -61
- package/dist/src/utils/gitIgnoreParser.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.d.ts +1 -1
- package/dist/src/utils/memoryDiscovery.js +76 -83
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +122 -372
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.d.ts +19 -12
- package/dist/src/utils/memoryImportProcessor.js +240 -85
- package/dist/src/utils/memoryImportProcessor.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.test.js +593 -51
- package/dist/src/utils/memoryImportProcessor.test.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.js +4 -25
- package/dist/src/utils/nextSpeakerChecker.js.map +1 -1
- 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 +18 -2
- package/dist/src/utils/paths.js +39 -7
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/paths.test.d.ts +6 -0
- package/dist/src/utils/paths.test.js +225 -0
- package/dist/src/utils/paths.test.js.map +1 -0
- package/dist/src/utils/quotaErrorDetection.d.ts +1 -5
- package/dist/src/utils/quotaErrorDetection.js.map +1 -1
- package/dist/src/utils/retry.d.ts +3 -0
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js.map +1 -1
- package/dist/src/utils/schemaValidator.d.ts +1 -8
- package/dist/src/utils/schemaValidator.js +1 -32
- package/dist/src/utils/schemaValidator.js.map +1 -1
- package/dist/src/utils/secure-browser-launcher.d.ts +23 -0
- package/dist/src/utils/secure-browser-launcher.js +165 -0
- package/dist/src/utils/secure-browser-launcher.js.map +1 -0
- package/dist/src/utils/secure-browser-launcher.test.d.ts +6 -0
- package/dist/src/utils/secure-browser-launcher.test.js +149 -0
- package/dist/src/utils/secure-browser-launcher.test.js.map +1 -0
- package/dist/src/utils/shell-utils.d.ts +117 -0
- package/dist/src/utils/shell-utils.js +376 -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 +328 -0
- package/dist/src/utils/shell-utils.test.js.map +1 -0
- package/dist/src/utils/summarizer.js +3 -32
- package/dist/src/utils/summarizer.js.map +1 -1
- package/dist/src/utils/systemEncoding.js +1 -1
- package/dist/src/utils/systemEncoding.js.map +1 -1
- package/dist/src/utils/systemEncoding.test.js +23 -23
- package/dist/src/utils/systemEncoding.test.js.map +1 -1
- 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.js +58 -48
- package/dist/src/utils/user_account.js.map +1 -1
- package/dist/src/utils/user_account.test.js +76 -9
- package/dist/src/utils/user_account.test.js.map +1 -1
- package/dist/src/utils/workspaceContext.d.ts +66 -0
- package/dist/src/utils/workspaceContext.js +165 -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 +293 -0
- package/dist/src/utils/workspaceContext.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -3
- package/dist/src/core/geminiRequest.test.js +0 -72
- package/dist/src/core/geminiRequest.test.js.map +0 -1
- package/dist/src/core/modelCheck.d.ts +0 -14
- package/dist/src/core/modelCheck.js +0 -62
- package/dist/src/core/modelCheck.js.map +0 -1
- package/dist/src/services/ideContext.d.ts +0 -178
- package/dist/src/services/ideContext.js +0 -105
- package/dist/src/services/ideContext.js.map +0 -1
- package/dist/src/services/ideContext.test.js +0 -111
- package/dist/src/services/ideContext.test.js.map +0 -1
- /package/dist/src/core/{geminiRequest.test.d.ts → subagent.test.d.ts} +0 -0
- /package/dist/src/{services/ideContext.test.d.ts → ide/detect-ide.test.d.ts} +0 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
7
|
+
import { createIdeContextStore, FileSchema, IdeContextSchema, } from './ideContext.js';
|
|
8
|
+
describe('ideContext', () => {
|
|
9
|
+
describe('createIdeContextStore', () => {
|
|
10
|
+
let ideContext;
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
// Create a fresh, isolated instance for each test
|
|
13
|
+
ideContext = createIdeContextStore();
|
|
14
|
+
});
|
|
15
|
+
it('should return undefined initially for ide context', () => {
|
|
16
|
+
expect(ideContext.getIdeContext()).toBeUndefined();
|
|
17
|
+
});
|
|
18
|
+
it('should set and retrieve the ide context', () => {
|
|
19
|
+
const testFile = {
|
|
20
|
+
workspaceState: {
|
|
21
|
+
openFiles: [
|
|
22
|
+
{
|
|
23
|
+
path: '/path/to/test/file.ts',
|
|
24
|
+
isActive: true,
|
|
25
|
+
selectedText: '1234',
|
|
26
|
+
timestamp: 0,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
ideContext.setIdeContext(testFile);
|
|
32
|
+
const activeFile = ideContext.getIdeContext();
|
|
33
|
+
expect(activeFile).toEqual(testFile);
|
|
34
|
+
});
|
|
35
|
+
it('should update the ide context when called multiple times', () => {
|
|
36
|
+
const firstFile = {
|
|
37
|
+
workspaceState: {
|
|
38
|
+
openFiles: [
|
|
39
|
+
{
|
|
40
|
+
path: '/path/to/first.js',
|
|
41
|
+
isActive: true,
|
|
42
|
+
selectedText: '1234',
|
|
43
|
+
timestamp: 0,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
ideContext.setIdeContext(firstFile);
|
|
49
|
+
const secondFile = {
|
|
50
|
+
workspaceState: {
|
|
51
|
+
openFiles: [
|
|
52
|
+
{
|
|
53
|
+
path: '/path/to/second.py',
|
|
54
|
+
isActive: true,
|
|
55
|
+
cursor: { line: 20, character: 30 },
|
|
56
|
+
timestamp: 0,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
ideContext.setIdeContext(secondFile);
|
|
62
|
+
const activeFile = ideContext.getIdeContext();
|
|
63
|
+
expect(activeFile).toEqual(secondFile);
|
|
64
|
+
});
|
|
65
|
+
it('should handle empty string for file path', () => {
|
|
66
|
+
const testFile = {
|
|
67
|
+
workspaceState: {
|
|
68
|
+
openFiles: [
|
|
69
|
+
{
|
|
70
|
+
path: '',
|
|
71
|
+
isActive: true,
|
|
72
|
+
selectedText: '1234',
|
|
73
|
+
timestamp: 0,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
ideContext.setIdeContext(testFile);
|
|
79
|
+
expect(ideContext.getIdeContext()).toEqual(testFile);
|
|
80
|
+
});
|
|
81
|
+
it('should notify subscribers when ide context changes', () => {
|
|
82
|
+
const subscriber1 = vi.fn();
|
|
83
|
+
const subscriber2 = vi.fn();
|
|
84
|
+
ideContext.subscribeToIdeContext(subscriber1);
|
|
85
|
+
ideContext.subscribeToIdeContext(subscriber2);
|
|
86
|
+
const testFile = {
|
|
87
|
+
workspaceState: {
|
|
88
|
+
openFiles: [
|
|
89
|
+
{
|
|
90
|
+
path: '/path/to/subscribed.ts',
|
|
91
|
+
isActive: true,
|
|
92
|
+
cursor: { line: 15, character: 25 },
|
|
93
|
+
timestamp: 0,
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
ideContext.setIdeContext(testFile);
|
|
99
|
+
expect(subscriber1).toHaveBeenCalledTimes(1);
|
|
100
|
+
expect(subscriber1).toHaveBeenCalledWith(testFile);
|
|
101
|
+
expect(subscriber2).toHaveBeenCalledTimes(1);
|
|
102
|
+
expect(subscriber2).toHaveBeenCalledWith(testFile);
|
|
103
|
+
// Test with another update
|
|
104
|
+
const newFile = {
|
|
105
|
+
workspaceState: {
|
|
106
|
+
openFiles: [
|
|
107
|
+
{
|
|
108
|
+
path: '/path/to/new.js',
|
|
109
|
+
isActive: true,
|
|
110
|
+
selectedText: '1234',
|
|
111
|
+
timestamp: 0,
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
ideContext.setIdeContext(newFile);
|
|
117
|
+
expect(subscriber1).toHaveBeenCalledTimes(2);
|
|
118
|
+
expect(subscriber1).toHaveBeenCalledWith(newFile);
|
|
119
|
+
expect(subscriber2).toHaveBeenCalledTimes(2);
|
|
120
|
+
expect(subscriber2).toHaveBeenCalledWith(newFile);
|
|
121
|
+
});
|
|
122
|
+
it('should stop notifying a subscriber after unsubscribe', () => {
|
|
123
|
+
const subscriber1 = vi.fn();
|
|
124
|
+
const subscriber2 = vi.fn();
|
|
125
|
+
const unsubscribe1 = ideContext.subscribeToIdeContext(subscriber1);
|
|
126
|
+
ideContext.subscribeToIdeContext(subscriber2);
|
|
127
|
+
ideContext.setIdeContext({
|
|
128
|
+
workspaceState: {
|
|
129
|
+
openFiles: [
|
|
130
|
+
{
|
|
131
|
+
path: '/path/to/file1.txt',
|
|
132
|
+
isActive: true,
|
|
133
|
+
selectedText: '1234',
|
|
134
|
+
timestamp: 0,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
expect(subscriber1).toHaveBeenCalledTimes(1);
|
|
140
|
+
expect(subscriber2).toHaveBeenCalledTimes(1);
|
|
141
|
+
unsubscribe1();
|
|
142
|
+
ideContext.setIdeContext({
|
|
143
|
+
workspaceState: {
|
|
144
|
+
openFiles: [
|
|
145
|
+
{
|
|
146
|
+
path: '/path/to/file2.txt',
|
|
147
|
+
isActive: true,
|
|
148
|
+
selectedText: '1234',
|
|
149
|
+
timestamp: 0,
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
expect(subscriber1).toHaveBeenCalledTimes(1); // Should not be called again
|
|
155
|
+
expect(subscriber2).toHaveBeenCalledTimes(2);
|
|
156
|
+
});
|
|
157
|
+
it('should clear the ide context', () => {
|
|
158
|
+
const testFile = {
|
|
159
|
+
workspaceState: {
|
|
160
|
+
openFiles: [
|
|
161
|
+
{
|
|
162
|
+
path: '/path/to/test/file.ts',
|
|
163
|
+
isActive: true,
|
|
164
|
+
selectedText: '1234',
|
|
165
|
+
timestamp: 0,
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
ideContext.setIdeContext(testFile);
|
|
171
|
+
expect(ideContext.getIdeContext()).toEqual(testFile);
|
|
172
|
+
ideContext.clearIdeContext();
|
|
173
|
+
expect(ideContext.getIdeContext()).toBeUndefined();
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
describe('FileSchema', () => {
|
|
177
|
+
it('should validate a file with only required fields', () => {
|
|
178
|
+
const file = {
|
|
179
|
+
path: '/path/to/file.ts',
|
|
180
|
+
timestamp: 12345,
|
|
181
|
+
};
|
|
182
|
+
const result = FileSchema.safeParse(file);
|
|
183
|
+
expect(result.success).toBe(true);
|
|
184
|
+
});
|
|
185
|
+
it('should validate a file with all fields', () => {
|
|
186
|
+
const file = {
|
|
187
|
+
path: '/path/to/file.ts',
|
|
188
|
+
timestamp: 12345,
|
|
189
|
+
isActive: true,
|
|
190
|
+
selectedText: 'const x = 1;',
|
|
191
|
+
cursor: {
|
|
192
|
+
line: 10,
|
|
193
|
+
character: 20,
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
const result = FileSchema.safeParse(file);
|
|
197
|
+
expect(result.success).toBe(true);
|
|
198
|
+
});
|
|
199
|
+
it('should fail validation if path is missing', () => {
|
|
200
|
+
const file = {
|
|
201
|
+
timestamp: 12345,
|
|
202
|
+
};
|
|
203
|
+
const result = FileSchema.safeParse(file);
|
|
204
|
+
expect(result.success).toBe(false);
|
|
205
|
+
});
|
|
206
|
+
it('should fail validation if timestamp is missing', () => {
|
|
207
|
+
const file = {
|
|
208
|
+
path: '/path/to/file.ts',
|
|
209
|
+
};
|
|
210
|
+
const result = FileSchema.safeParse(file);
|
|
211
|
+
expect(result.success).toBe(false);
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
describe('IdeContextSchema', () => {
|
|
215
|
+
it('should validate an empty context', () => {
|
|
216
|
+
const context = {};
|
|
217
|
+
const result = IdeContextSchema.safeParse(context);
|
|
218
|
+
expect(result.success).toBe(true);
|
|
219
|
+
});
|
|
220
|
+
it('should validate a context with an empty workspaceState', () => {
|
|
221
|
+
const context = {
|
|
222
|
+
workspaceState: {},
|
|
223
|
+
};
|
|
224
|
+
const result = IdeContextSchema.safeParse(context);
|
|
225
|
+
expect(result.success).toBe(true);
|
|
226
|
+
});
|
|
227
|
+
it('should validate a context with an empty openFiles array', () => {
|
|
228
|
+
const context = {
|
|
229
|
+
workspaceState: {
|
|
230
|
+
openFiles: [],
|
|
231
|
+
},
|
|
232
|
+
};
|
|
233
|
+
const result = IdeContextSchema.safeParse(context);
|
|
234
|
+
expect(result.success).toBe(true);
|
|
235
|
+
});
|
|
236
|
+
it('should validate a context with a valid file', () => {
|
|
237
|
+
const context = {
|
|
238
|
+
workspaceState: {
|
|
239
|
+
openFiles: [
|
|
240
|
+
{
|
|
241
|
+
path: '/path/to/file.ts',
|
|
242
|
+
timestamp: 12345,
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
const result = IdeContextSchema.safeParse(context);
|
|
248
|
+
expect(result.success).toBe(true);
|
|
249
|
+
});
|
|
250
|
+
it('should fail validation with an invalid file', () => {
|
|
251
|
+
const context = {
|
|
252
|
+
workspaceState: {
|
|
253
|
+
openFiles: [
|
|
254
|
+
{
|
|
255
|
+
timestamp: 12345, // path is missing
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
const result = IdeContextSchema.safeParse(context);
|
|
261
|
+
expect(result.success).toBe(false);
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
//# sourceMappingURL=ideContext.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ideContext.test.js","sourceRoot":"","sources":["../../../src/ide/ideContext.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAAQ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F,CAAC;YACF,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACnD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACrD,MAAM,OAAO,GAAG;gBACd,cAAc,EAAE;oBACd,SAAS,EAAE;wBACT;4BACE,SAAS,EAAE,KAAK,EAAE,kBAAkB;yBACrC;qBACF;iBACF;aACF,CAAC;YACF,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACnD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Traverses up the process tree from the current process to find the top-level ancestor process ID.
|
|
8
|
+
* This is useful for identifying the main application process that spawned the current script,
|
|
9
|
+
* such as the main VS Code window process.
|
|
10
|
+
*
|
|
11
|
+
* @returns A promise that resolves to the numeric PID of the top-level process.
|
|
12
|
+
* @throws Will throw an error if the underlying shell commands fail unexpectedly.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getIdeProcessId(): Promise<number>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { exec } from 'child_process';
|
|
7
|
+
import { promisify } from 'util';
|
|
8
|
+
import os from 'os';
|
|
9
|
+
const execAsync = promisify(exec);
|
|
10
|
+
/**
|
|
11
|
+
* Traverses up the process tree from the current process to find the top-level ancestor process ID.
|
|
12
|
+
* This is useful for identifying the main application process that spawned the current script,
|
|
13
|
+
* such as the main VS Code window process.
|
|
14
|
+
*
|
|
15
|
+
* @returns A promise that resolves to the numeric PID of the top-level process.
|
|
16
|
+
* @throws Will throw an error if the underlying shell commands fail unexpectedly.
|
|
17
|
+
*/
|
|
18
|
+
export async function getIdeProcessId() {
|
|
19
|
+
const platform = os.platform();
|
|
20
|
+
let currentPid = process.pid;
|
|
21
|
+
// Loop upwards through the process tree, with a depth limit to prevent infinite loops.
|
|
22
|
+
const MAX_TRAVERSAL_DEPTH = 32;
|
|
23
|
+
for (let i = 0; i < MAX_TRAVERSAL_DEPTH; i++) {
|
|
24
|
+
let parentPid;
|
|
25
|
+
try {
|
|
26
|
+
// Use wmic for Windows
|
|
27
|
+
if (platform === 'win32') {
|
|
28
|
+
const command = `wmic process where "ProcessId=${currentPid}" get ParentProcessId /value`;
|
|
29
|
+
const { stdout } = await execAsync(command);
|
|
30
|
+
const match = stdout.match(/ParentProcessId=(\d+)/);
|
|
31
|
+
parentPid = match ? parseInt(match[1], 10) : 0; // Top of the tree is 0
|
|
32
|
+
}
|
|
33
|
+
// Use ps for macOS, Linux, and other Unix-like systems
|
|
34
|
+
else {
|
|
35
|
+
const command = `ps -o ppid= -p ${currentPid}`;
|
|
36
|
+
const { stdout } = await execAsync(command);
|
|
37
|
+
const ppid = parseInt(stdout.trim(), 10);
|
|
38
|
+
parentPid = isNaN(ppid) ? 1 : ppid; // Top of the tree is 1
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (_) {
|
|
42
|
+
// This can happen if a process in the chain dies during execution.
|
|
43
|
+
// We'll break the loop and return the last valid PID we found.
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
// Define the root PID for the current OS
|
|
47
|
+
const rootPid = platform === 'win32' ? 0 : 1;
|
|
48
|
+
// If the parent is the root process or invalid, we've found our target.
|
|
49
|
+
if (parentPid === rootPid || parentPid <= 0) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
// Move one level up the tree for the next iteration.
|
|
53
|
+
currentPid = parentPid;
|
|
54
|
+
}
|
|
55
|
+
return currentPid;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=process-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-utils.js","sourceRoot":"","sources":["../../../src/ide/process-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC/B,IAAI,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAE7B,uFAAuF;IACvF,MAAM,mBAAmB,GAAG,EAAE,CAAC;IAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,mBAAmB,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,IAAI,SAAiB,CAAC;QAEtB,IAAI,CAAC;YACH,uBAAuB;YACvB,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;gBACzB,MAAM,OAAO,GAAG,iCAAiC,UAAU,8BAA8B,CAAC;gBAC1F,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;gBAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;gBACpD,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,uBAAuB;YACzE,CAAC;YACD,uDAAuD;iBAClD,CAAC;gBACJ,MAAM,OAAO,GAAG,kBAAkB,UAAU,EAAE,CAAC;gBAC/C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;gBAC5C,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;gBACzC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,uBAAuB;YAC7D,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,mEAAmE;YACnE,+DAA+D;YAC/D,MAAM;QACR,CAAC;QAED,yCAAyC;QACzC,MAAM,OAAO,GAAG,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7C,wEAAwE;QACxE,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;YAC5C,MAAM;QACR,CAAC;QACD,qDAAqD;QACrD,UAAU,GAAG,SAAS,CAAC;IACzB,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export * from './config/config.js';
|
|
7
7
|
export * from './core/client.js';
|
|
8
8
|
export * from './core/contentGenerator.js';
|
|
9
|
+
export * from './core/loggingContentGenerator.js';
|
|
9
10
|
export * from './core/geminiChat.js';
|
|
10
11
|
export * from './core/logger.js';
|
|
11
12
|
export * from './core/prompts.js';
|
|
@@ -24,16 +25,31 @@ export * from './utils/errors.js';
|
|
|
24
25
|
export * from './utils/getFolderStructure.js';
|
|
25
26
|
export * from './utils/memoryDiscovery.js';
|
|
26
27
|
export * from './utils/gitIgnoreParser.js';
|
|
28
|
+
export * from './utils/gitUtils.js';
|
|
27
29
|
export * from './utils/editor.js';
|
|
28
30
|
export * from './utils/quotaErrorDetection.js';
|
|
29
31
|
export * from './utils/fileUtils.js';
|
|
30
32
|
export * from './utils/retry.js';
|
|
33
|
+
export * from './utils/shell-utils.js';
|
|
31
34
|
export * from './utils/systemEncoding.js';
|
|
35
|
+
export * from './utils/textUtils.js';
|
|
36
|
+
export * from './utils/formatters.js';
|
|
37
|
+
export * from './utils/filesearch/fileSearch.js';
|
|
38
|
+
export * from './utils/errorParsing.js';
|
|
32
39
|
export * from './services/fileDiscoveryService.js';
|
|
33
40
|
export * from './services/gitService.js';
|
|
34
|
-
export * from './services/
|
|
41
|
+
export * from './services/chatRecordingService.js';
|
|
42
|
+
export * from './services/fileSystemService.js';
|
|
43
|
+
export * from './ide/ide-client.js';
|
|
44
|
+
export * from './ide/ideContext.js';
|
|
45
|
+
export * from './ide/ide-installer.js';
|
|
46
|
+
export { getIdeInfo, DetectedIde, IdeInfo } from './ide/detect-ide.js';
|
|
47
|
+
export * from './ide/constants.js';
|
|
48
|
+
export * from './services/shellExecutionService.js';
|
|
35
49
|
export * from './tools/tools.js';
|
|
50
|
+
export * from './tools/tool-error.js';
|
|
36
51
|
export * from './tools/tool-registry.js';
|
|
52
|
+
export * from './prompts/mcp-prompts.js';
|
|
37
53
|
export * from './tools/read-file.js';
|
|
38
54
|
export * from './tools/ls.js';
|
|
39
55
|
export * from './tools/grep.js';
|
package/dist/src/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from './config/config.js';
|
|
|
8
8
|
// Export Core Logic
|
|
9
9
|
export * from './core/client.js';
|
|
10
10
|
export * from './core/contentGenerator.js';
|
|
11
|
+
export * from './core/loggingContentGenerator.js';
|
|
11
12
|
export * from './core/geminiChat.js';
|
|
12
13
|
export * from './core/logger.js';
|
|
13
14
|
export * from './core/prompts.js';
|
|
@@ -27,18 +28,36 @@ export * from './utils/errors.js';
|
|
|
27
28
|
export * from './utils/getFolderStructure.js';
|
|
28
29
|
export * from './utils/memoryDiscovery.js';
|
|
29
30
|
export * from './utils/gitIgnoreParser.js';
|
|
31
|
+
export * from './utils/gitUtils.js';
|
|
30
32
|
export * from './utils/editor.js';
|
|
31
33
|
export * from './utils/quotaErrorDetection.js';
|
|
32
34
|
export * from './utils/fileUtils.js';
|
|
33
35
|
export * from './utils/retry.js';
|
|
36
|
+
export * from './utils/shell-utils.js';
|
|
34
37
|
export * from './utils/systemEncoding.js';
|
|
38
|
+
export * from './utils/textUtils.js';
|
|
39
|
+
export * from './utils/formatters.js';
|
|
40
|
+
export * from './utils/filesearch/fileSearch.js';
|
|
41
|
+
export * from './utils/errorParsing.js';
|
|
35
42
|
// Export services
|
|
36
43
|
export * from './services/fileDiscoveryService.js';
|
|
37
44
|
export * from './services/gitService.js';
|
|
38
|
-
export * from './services/
|
|
45
|
+
export * from './services/chatRecordingService.js';
|
|
46
|
+
export * from './services/fileSystemService.js';
|
|
47
|
+
// Export IDE specific logic
|
|
48
|
+
export * from './ide/ide-client.js';
|
|
49
|
+
export * from './ide/ideContext.js';
|
|
50
|
+
export * from './ide/ide-installer.js';
|
|
51
|
+
export { getIdeInfo, DetectedIde } from './ide/detect-ide.js';
|
|
52
|
+
export * from './ide/constants.js';
|
|
53
|
+
// Export Shell Execution Service
|
|
54
|
+
export * from './services/shellExecutionService.js';
|
|
39
55
|
// Export base tool definitions
|
|
40
56
|
export * from './tools/tools.js';
|
|
57
|
+
export * from './tools/tool-error.js';
|
|
41
58
|
export * from './tools/tool-registry.js';
|
|
59
|
+
// Export prompt logic
|
|
60
|
+
export * from './prompts/mcp-prompts.js';
|
|
42
61
|
// Export specific tool logic
|
|
43
62
|
export * from './tools/read-file.js';
|
|
44
63
|
export * from './tools/ls.js';
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;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Ac,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AAEpC,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAGL,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,6BAA6B;AAC7B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
7
|
+
import { OAuthClientInformation, OAuthClientInformationFull, OAuthClientMetadata, OAuthTokens } from '@modelcontextprotocol/sdk/shared/auth.js';
|
|
8
|
+
import { MCPServerConfig } from '../config/config.js';
|
|
9
|
+
export declare class GoogleCredentialProvider implements OAuthClientProvider {
|
|
10
|
+
private readonly config?;
|
|
11
|
+
private readonly auth;
|
|
12
|
+
readonly redirectUrl = "";
|
|
13
|
+
readonly clientMetadata: OAuthClientMetadata;
|
|
14
|
+
private _clientInformation?;
|
|
15
|
+
constructor(config?: MCPServerConfig | undefined);
|
|
16
|
+
clientInformation(): OAuthClientInformation | undefined;
|
|
17
|
+
saveClientInformation(clientInformation: OAuthClientInformationFull): void;
|
|
18
|
+
tokens(): Promise<OAuthTokens | undefined>;
|
|
19
|
+
saveTokens(_tokens: OAuthTokens): void;
|
|
20
|
+
redirectToAuthorization(_authorizationUrl: URL): void;
|
|
21
|
+
saveCodeVerifier(_codeVerifier: string): void;
|
|
22
|
+
codeVerifier(): string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { GoogleAuth } from 'google-auth-library';
|
|
7
|
+
const ALLOWED_HOSTS = [/^.+\.googleapis\.com$/, /^(.*\.)?luci\.app$/];
|
|
8
|
+
export class GoogleCredentialProvider {
|
|
9
|
+
config;
|
|
10
|
+
auth;
|
|
11
|
+
// Properties required by OAuthClientProvider, with no-op values
|
|
12
|
+
redirectUrl = '';
|
|
13
|
+
clientMetadata = {
|
|
14
|
+
client_name: 'Gemini CLI (Google ADC)',
|
|
15
|
+
redirect_uris: [],
|
|
16
|
+
grant_types: [],
|
|
17
|
+
response_types: [],
|
|
18
|
+
token_endpoint_auth_method: 'none',
|
|
19
|
+
};
|
|
20
|
+
_clientInformation;
|
|
21
|
+
constructor(config) {
|
|
22
|
+
this.config = config;
|
|
23
|
+
const url = this.config?.url || this.config?.httpUrl;
|
|
24
|
+
if (!url) {
|
|
25
|
+
throw new Error('URL must be provided in the config for Google Credentials provider');
|
|
26
|
+
}
|
|
27
|
+
const hostname = new URL(url).hostname;
|
|
28
|
+
if (!ALLOWED_HOSTS.some((pattern) => pattern.test(hostname))) {
|
|
29
|
+
throw new Error(`Host "${hostname}" is not an allowed host for Google Credential provider.`);
|
|
30
|
+
}
|
|
31
|
+
const scopes = this.config?.oauth?.scopes;
|
|
32
|
+
if (!scopes || scopes.length === 0) {
|
|
33
|
+
throw new Error('Scopes must be provided in the oauth config for Google Credentials provider');
|
|
34
|
+
}
|
|
35
|
+
this.auth = new GoogleAuth({
|
|
36
|
+
scopes,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
clientInformation() {
|
|
40
|
+
return this._clientInformation;
|
|
41
|
+
}
|
|
42
|
+
saveClientInformation(clientInformation) {
|
|
43
|
+
this._clientInformation = clientInformation;
|
|
44
|
+
}
|
|
45
|
+
async tokens() {
|
|
46
|
+
const client = await this.auth.getClient();
|
|
47
|
+
const accessTokenResponse = await client.getAccessToken();
|
|
48
|
+
if (!accessTokenResponse.token) {
|
|
49
|
+
console.error('Failed to get access token from Google ADC');
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
const tokens = {
|
|
53
|
+
access_token: accessTokenResponse.token,
|
|
54
|
+
token_type: 'Bearer',
|
|
55
|
+
};
|
|
56
|
+
return tokens;
|
|
57
|
+
}
|
|
58
|
+
saveTokens(_tokens) {
|
|
59
|
+
// No-op, ADC manages tokens.
|
|
60
|
+
}
|
|
61
|
+
redirectToAuthorization(_authorizationUrl) {
|
|
62
|
+
// No-op
|
|
63
|
+
}
|
|
64
|
+
saveCodeVerifier(_codeVerifier) {
|
|
65
|
+
// No-op
|
|
66
|
+
}
|
|
67
|
+
codeVerifier() {
|
|
68
|
+
// No-op
|
|
69
|
+
return '';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=google-auth-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-auth-provider.js","sourceRoot":"","sources":["../../../src/mcp/google-auth-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,aAAa,GAAG,CAAC,uBAAuB,EAAE,oBAAoB,CAAC,CAAC;AAEtE,MAAM,OAAO,wBAAwB;IAcN;IAbZ,IAAI,CAAa;IAElC,gEAAgE;IACvD,WAAW,GAAG,EAAE,CAAC;IACjB,cAAc,GAAwB;QAC7C,WAAW,EAAE,yBAAyB;QACtC,aAAa,EAAE,EAAE;QACjB,WAAW,EAAE,EAAE;QACf,cAAc,EAAE,EAAE;QAClB,0BAA0B,EAAE,MAAM;KACnC,CAAC;IACM,kBAAkB,CAA8B;IAExD,YAA6B,MA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CAAC;QACnB,CAAC;QAED,MAAM,MAAM,GAAgB;YAC1B,YAAY,EAAE,mBAAmB,CAAC,KAAK;YACvC,UAAU,EAAE,QAAQ;SACrB,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,UAAU,CAAC,OAAoB;QAC7B,6BAA6B;IAC/B,CAAC;IAED,uBAAuB,CAAC,iBAAsB;QAC5C,QAAQ;IACV,CAAC;IAED,gBAAgB,CAAC,aAAqB;QACpC,QAAQ;IACV,CAAC;IAED,YAAY;QACV,QAAQ;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { GoogleAuth } from 'google-auth-library';
|
|
7
|
+
import { GoogleCredentialProvider } from './google-auth-provider.js';
|
|
8
|
+
import { vi, describe, beforeEach, it, expect } from 'vitest';
|
|
9
|
+
vi.mock('google-auth-library');
|
|
10
|
+
describe('GoogleCredentialProvider', () => {
|
|
11
|
+
const validConfig = {
|
|
12
|
+
url: 'https://test.googleapis.com',
|
|
13
|
+
oauth: {
|
|
14
|
+
scopes: ['scope1', 'scope2'],
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
it('should throw an error if no scopes are provided', () => {
|
|
18
|
+
const config = {
|
|
19
|
+
url: 'https://test.googleapis.com',
|
|
20
|
+
};
|
|
21
|
+
expect(() => new GoogleCredentialProvider(config)).toThrow('Scopes must be provided in the oauth config for Google Credentials provider');
|
|
22
|
+
});
|
|
23
|
+
it('should use scopes from the config if provided', () => {
|
|
24
|
+
new GoogleCredentialProvider(validConfig);
|
|
25
|
+
expect(GoogleAuth).toHaveBeenCalledWith({
|
|
26
|
+
scopes: ['scope1', 'scope2'],
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
it('should throw an error for a non-allowlisted host', () => {
|
|
30
|
+
const config = {
|
|
31
|
+
url: 'https://example.com',
|
|
32
|
+
oauth: {
|
|
33
|
+
scopes: ['scope1', 'scope2'],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
expect(() => new GoogleCredentialProvider(config)).toThrow('Host "example.com" is not an allowed host for Google Credential provider.');
|
|
37
|
+
});
|
|
38
|
+
it('should allow luci.app', () => {
|
|
39
|
+
const config = {
|
|
40
|
+
url: 'https://luci.app',
|
|
41
|
+
oauth: {
|
|
42
|
+
scopes: ['scope1', 'scope2'],
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
new GoogleCredentialProvider(config);
|
|
46
|
+
});
|
|
47
|
+
it('should allow sub.luci.app', () => {
|
|
48
|
+
const config = {
|
|
49
|
+
url: 'https://sub.luci.app',
|
|
50
|
+
oauth: {
|
|
51
|
+
scopes: ['scope1', 'scope2'],
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
new GoogleCredentialProvider(config);
|
|
55
|
+
});
|
|
56
|
+
it('should not allow googleapis.com without a subdomain', () => {
|
|
57
|
+
const config = {
|
|
58
|
+
url: 'https://googleapis.com',
|
|
59
|
+
oauth: {
|
|
60
|
+
scopes: ['scope1', 'scope2'],
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
expect(() => new GoogleCredentialProvider(config)).toThrow('Host "googleapis.com" is not an allowed host for Google Credential provider.');
|
|
64
|
+
});
|
|
65
|
+
describe('with provider instance', () => {
|
|
66
|
+
let provider;
|
|
67
|
+
beforeEach(() => {
|
|
68
|
+
provider = new GoogleCredentialProvider(validConfig);
|
|
69
|
+
vi.clearAllMocks();
|
|
70
|
+
});
|
|
71
|
+
it('should return credentials', async () => {
|
|
72
|
+
const mockClient = {
|
|
73
|
+
getAccessToken: vi.fn().mockResolvedValue({ token: 'test-token' }),
|
|
74
|
+
};
|
|
75
|
+
GoogleAuth.prototype.getClient.mockResolvedValue(mockClient);
|
|
76
|
+
const credentials = await provider.tokens();
|
|
77
|
+
expect(credentials?.access_token).toBe('test-token');
|
|
78
|
+
});
|
|
79
|
+
it('should return undefined if access token is not available', async () => {
|
|
80
|
+
const mockClient = {
|
|
81
|
+
getAccessToken: vi.fn().mockResolvedValue({ token: null }),
|
|
82
|
+
};
|
|
83
|
+
GoogleAuth.prototype.getClient.mockResolvedValue(mockClient);
|
|
84
|
+
const credentials = await provider.tokens();
|
|
85
|
+
expect(credentials).toBeUndefined();
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=google-auth-provider.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-auth-provider.test.js","sourceRoot":"","sources":["../../../src/mcp/google-auth-provider.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAQ,MAAM,QAAQ,CAAC;AAGpE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAE/B,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,MAAM,WAAW,GAAG;QAClB,GAAG,EAAE,6BAA6B;QAClC,KAAK,EAAE;YACL,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;SAC7B;KACiB,CAAC;IAErB,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,MAAM,GAAG;YACb,GAAG,EAAE,6BAA6B;SAChB,CAAC;QACrB,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CACxD,6EAA6E,CAC9E,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;Q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