@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
|
@@ -7,102 +7,98 @@ import fs from 'fs';
|
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import * as Diff from 'diff';
|
|
9
9
|
import { ApprovalMode } from '../config/config.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { SchemaValidator } from '../utils/schemaValidator.js';
|
|
10
|
+
import { BaseDeclarativeTool, BaseToolInvocation, Kind, ToolConfirmationOutcome, } from './tools.js';
|
|
11
|
+
import { ToolErrorType } from './tool-error.js';
|
|
13
12
|
import { makeRelative, shortenPath } from '../utils/paths.js';
|
|
14
13
|
import { getErrorMessage, isNodeError } from '../utils/errors.js';
|
|
15
14
|
import { ensureCorrectEdit, ensureCorrectFileContent, } from '../utils/editCorrector.js';
|
|
16
|
-
import { DEFAULT_DIFF_OPTIONS } from './diffOptions.js';
|
|
17
|
-
import { getSpecificMimeType
|
|
15
|
+
import { DEFAULT_DIFF_OPTIONS, getDiffStat } from './diffOptions.js';
|
|
16
|
+
import { getSpecificMimeType } from '../utils/fileUtils.js';
|
|
18
17
|
import { recordFileOperationMetric, FileOperation, } from '../telemetry/metrics.js';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
properties: {
|
|
30
|
-
file_path: {
|
|
31
|
-
description: "The absolute path to the file to write to (e.g., '/home/user/project/file.txt'). Relative paths are not supported.",
|
|
32
|
-
type: Type.STRING,
|
|
33
|
-
},
|
|
34
|
-
content: {
|
|
35
|
-
description: 'The content to write to the file.',
|
|
36
|
-
type: Type.STRING,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
required: ['file_path', 'content'],
|
|
40
|
-
type: Type.OBJECT,
|
|
41
|
-
});
|
|
42
|
-
this.config = config;
|
|
18
|
+
import { IDEConnectionStatus } from '../ide/ide-client.js';
|
|
19
|
+
export async function getCorrectedFileContent(config, filePath, proposedContent, abortSignal) {
|
|
20
|
+
let originalContent = '';
|
|
21
|
+
let fileExists = false;
|
|
22
|
+
let correctedContent = proposedContent;
|
|
23
|
+
try {
|
|
24
|
+
originalContent = await config
|
|
25
|
+
.getFileSystemService()
|
|
26
|
+
.readTextFile(filePath);
|
|
27
|
+
fileExists = true; // File exists and was read
|
|
43
28
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
catch (err) {
|
|
30
|
+
if (isNodeError(err) && err.code === 'ENOENT') {
|
|
31
|
+
fileExists = false;
|
|
32
|
+
originalContent = '';
|
|
48
33
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
if (fs.existsSync(filePath)) {
|
|
60
|
-
const stats = fs.lstatSync(filePath);
|
|
61
|
-
if (stats.isDirectory()) {
|
|
62
|
-
return `Path is a directory, not a file: ${filePath}`;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
catch (statError) {
|
|
67
|
-
// If fs.existsSync is true but lstatSync fails (e.g., permissions, race condition where file is deleted)
|
|
68
|
-
// this indicates an issue with accessing the path that should be reported.
|
|
69
|
-
return `Error accessing path properties for validation: ${filePath}. Reason: ${statError instanceof Error ? statError.message : String(statError)}`;
|
|
34
|
+
else {
|
|
35
|
+
// File exists but could not be read (permissions, etc.)
|
|
36
|
+
fileExists = true; // Mark as existing but problematic
|
|
37
|
+
originalContent = ''; // Can't use its content
|
|
38
|
+
const error = {
|
|
39
|
+
message: getErrorMessage(err),
|
|
40
|
+
code: isNodeError(err) ? err.code : undefined,
|
|
41
|
+
};
|
|
42
|
+
// Return early as we can't proceed with content correction meaningfully
|
|
43
|
+
return { originalContent, correctedContent, fileExists, error };
|
|
70
44
|
}
|
|
71
|
-
return null;
|
|
72
45
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
46
|
+
// If readError is set, we have returned.
|
|
47
|
+
// So, file was either read successfully (fileExists=true, originalContent set)
|
|
48
|
+
// or it was ENOENT (fileExists=false, originalContent='').
|
|
49
|
+
if (fileExists) {
|
|
50
|
+
// This implies originalContent is available
|
|
51
|
+
const { params: correctedParams } = await ensureCorrectEdit(filePath, originalContent, {
|
|
52
|
+
old_string: originalContent, // Treat entire current content as old_string
|
|
53
|
+
new_string: proposedContent,
|
|
54
|
+
file_path: filePath,
|
|
55
|
+
}, config.getGeminiClient(), abortSignal);
|
|
56
|
+
correctedContent = correctedParams.new_string;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// This implies new file (ENOENT)
|
|
60
|
+
correctedContent = await ensureCorrectFileContent(proposedContent, config.getGeminiClient(), abortSignal);
|
|
61
|
+
}
|
|
62
|
+
return { originalContent, correctedContent, fileExists };
|
|
63
|
+
}
|
|
64
|
+
class WriteFileToolInvocation extends BaseToolInvocation {
|
|
65
|
+
config;
|
|
66
|
+
constructor(config, params) {
|
|
67
|
+
super(params);
|
|
68
|
+
this.config = config;
|
|
69
|
+
}
|
|
70
|
+
toolLocations() {
|
|
71
|
+
return [{ path: this.params.file_path }];
|
|
72
|
+
}
|
|
73
|
+
getDescription() {
|
|
74
|
+
const relativePath = makeRelative(this.params.file_path, this.config.getTargetDir());
|
|
78
75
|
return `Writing to ${shortenPath(relativePath)}`;
|
|
79
76
|
}
|
|
80
|
-
|
|
81
|
-
* Handles the confirmation prompt for the WriteFile tool.
|
|
82
|
-
*/
|
|
83
|
-
async shouldConfirmExecute(params, abortSignal) {
|
|
77
|
+
async shouldConfirmExecute(abortSignal) {
|
|
84
78
|
if (this.config.getApprovalMode() === ApprovalMode.AUTO_EDIT) {
|
|
85
79
|
return false;
|
|
86
80
|
}
|
|
87
|
-
const
|
|
88
|
-
if (validationError) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
const correctedContentResult = await this._getCorrectedFileContent(params.file_path, params.content, abortSignal);
|
|
81
|
+
const correctedContentResult = await getCorrectedFileContent(this.config, this.params.file_path, this.params.content, abortSignal);
|
|
92
82
|
if (correctedContentResult.error) {
|
|
93
83
|
// If file exists but couldn't be read, we can't show a diff for confirmation.
|
|
94
84
|
return false;
|
|
95
85
|
}
|
|
96
86
|
const { originalContent, correctedContent } = correctedContentResult;
|
|
97
|
-
const relativePath = makeRelative(params.file_path, this.config.getTargetDir());
|
|
98
|
-
const fileName = path.basename(params.file_path);
|
|
87
|
+
const relativePath = makeRelative(this.params.file_path, this.config.getTargetDir());
|
|
88
|
+
const fileName = path.basename(this.params.file_path);
|
|
99
89
|
const fileDiff = Diff.createPatch(fileName, originalContent, // Original content (empty if new file or unreadable)
|
|
100
90
|
correctedContent, // Content after potential correction
|
|
101
91
|
'Current', 'Proposed', DEFAULT_DIFF_OPTIONS);
|
|
92
|
+
const ideClient = this.config.getIdeClient();
|
|
93
|
+
const ideConfirmation = this.config.getIdeMode() &&
|
|
94
|
+
ideClient.getConnectionStatus().status === IDEConnectionStatus.Connected
|
|
95
|
+
? ideClient.openDiff(this.params.file_path, correctedContent)
|
|
96
|
+
: undefined;
|
|
102
97
|
const confirmationDetails = {
|
|
103
98
|
type: 'edit',
|
|
104
99
|
title: `Confirm Write: ${shortenPath(relativePath)}`,
|
|
105
100
|
fileName,
|
|
101
|
+
filePath: this.params.file_path,
|
|
106
102
|
fileDiff,
|
|
107
103
|
originalContent,
|
|
108
104
|
newContent: correctedContent,
|
|
@@ -110,25 +106,32 @@ export class WriteFileTool extends BaseTool {
|
|
|
110
106
|
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
111
107
|
this.config.setApprovalMode(ApprovalMode.AUTO_EDIT);
|
|
112
108
|
}
|
|
109
|
+
if (ideConfirmation) {
|
|
110
|
+
const result = await ideConfirmation;
|
|
111
|
+
if (result.status === 'accepted' && result.content) {
|
|
112
|
+
this.params.content = result.content;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
113
115
|
},
|
|
116
|
+
ideConfirmation,
|
|
114
117
|
};
|
|
115
118
|
return confirmationDetails;
|
|
116
119
|
}
|
|
117
|
-
async execute(
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
return {
|
|
121
|
-
llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
|
|
122
|
-
returnDisplay: `Error: ${validationError}`,
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
const correctedContentResult = await this._getCorrectedFileContent(params.file_path, params.content, abortSignal);
|
|
120
|
+
async execute(abortSignal) {
|
|
121
|
+
const { file_path, content, ai_proposed_content, modified_by_user } = this.params;
|
|
122
|
+
const correctedContentResult = await getCorrectedFileContent(this.config, file_path, content, abortSignal);
|
|
126
123
|
if (correctedContentResult.error) {
|
|
127
124
|
const errDetails = correctedContentResult.error;
|
|
128
|
-
const errorMsg =
|
|
125
|
+
const errorMsg = errDetails.code
|
|
126
|
+
? `Error checking existing file '${file_path}': ${errDetails.message} (${errDetails.code})`
|
|
127
|
+
: `Error checking existing file: ${errDetails.message}`;
|
|
129
128
|
return {
|
|
130
|
-
llmContent:
|
|
129
|
+
llmContent: errorMsg,
|
|
131
130
|
returnDisplay: errorMsg,
|
|
131
|
+
error: {
|
|
132
|
+
message: errorMsg,
|
|
133
|
+
type: ToolErrorType.FILE_WRITE_FAILURE,
|
|
134
|
+
},
|
|
132
135
|
};
|
|
133
136
|
}
|
|
134
137
|
const { originalContent, correctedContent: fileContent, fileExists, } = correctedContentResult;
|
|
@@ -138,13 +141,15 @@ export class WriteFileTool extends BaseTool {
|
|
|
138
141
|
(correctedContentResult.error !== undefined &&
|
|
139
142
|
!correctedContentResult.fileExists);
|
|
140
143
|
try {
|
|
141
|
-
const dirName = path.dirname(
|
|
144
|
+
const dirName = path.dirname(file_path);
|
|
142
145
|
if (!fs.existsSync(dirName)) {
|
|
143
146
|
fs.mkdirSync(dirName, { recursive: true });
|
|
144
147
|
}
|
|
145
|
-
|
|
148
|
+
await this.config
|
|
149
|
+
.getFileSystemService()
|
|
150
|
+
.writeTextFile(file_path, fileContent);
|
|
146
151
|
// Generate diff for display result
|
|
147
|
-
const fileName = path.basename(
|
|
152
|
+
const fileName = path.basename(file_path);
|
|
148
153
|
// If there was a readError, originalContent in correctedContentResult is '',
|
|
149
154
|
// but for the diff, we want to show the original content as it was before the write if possible.
|
|
150
155
|
// However, if it was unreadable, currentContentForDiff will be empty.
|
|
@@ -152,28 +157,31 @@ export class WriteFileTool extends BaseTool {
|
|
|
152
157
|
? '' // Or some indicator of unreadable content
|
|
153
158
|
: originalContent;
|
|
154
159
|
const fileDiff = Diff.createPatch(fileName, currentContentForDiff, fileContent, 'Original', 'Written', DEFAULT_DIFF_OPTIONS);
|
|
160
|
+
const originallyProposedContent = ai_proposed_content || content;
|
|
161
|
+
const diffStat = getDiffStat(fileName, currentContentForDiff, originallyProposedContent, content);
|
|
155
162
|
const llmSuccessMessageParts = [
|
|
156
163
|
isNewFile
|
|
157
|
-
? `Successfully created and wrote to new file: ${
|
|
158
|
-
: `Successfully overwrote file: ${
|
|
164
|
+
? `Successfully created and wrote to new file: ${file_path}.`
|
|
165
|
+
: `Successfully overwrote file: ${file_path}.`,
|
|
159
166
|
];
|
|
160
|
-
if (
|
|
161
|
-
llmSuccessMessageParts.push(`User modified the \`content\` to be: ${
|
|
167
|
+
if (modified_by_user) {
|
|
168
|
+
llmSuccessMessageParts.push(`User modified the \`content\` to be: ${content}`);
|
|
162
169
|
}
|
|
163
170
|
const displayResult = {
|
|
164
171
|
fileDiff,
|
|
165
172
|
fileName,
|
|
166
173
|
originalContent: correctedContentResult.originalContent,
|
|
167
174
|
newContent: correctedContentResult.correctedContent,
|
|
175
|
+
diffStat,
|
|
168
176
|
};
|
|
169
177
|
const lines = fileContent.split('\n').length;
|
|
170
|
-
const mimetype = getSpecificMimeType(
|
|
171
|
-
const extension = path.extname(
|
|
178
|
+
const mimetype = getSpecificMimeType(file_path);
|
|
179
|
+
const extension = path.extname(file_path); // Get extension
|
|
172
180
|
if (isNewFile) {
|
|
173
|
-
recordFileOperationMetric(this.config, FileOperation.CREATE, lines, mimetype, extension);
|
|
181
|
+
recordFileOperationMetric(this.config, FileOperation.CREATE, lines, mimetype, extension, diffStat);
|
|
174
182
|
}
|
|
175
183
|
else {
|
|
176
|
-
recordFileOperationMetric(this.config, FileOperation.UPDATE, lines, mimetype, extension);
|
|
184
|
+
recordFileOperationMetric(this.config, FileOperation.UPDATE, lines, mimetype, extension, diffStat);
|
|
177
185
|
}
|
|
178
186
|
return {
|
|
179
187
|
llmContent: llmSuccessMessageParts.join(' '),
|
|
@@ -181,72 +189,121 @@ export class WriteFileTool extends BaseTool {
|
|
|
181
189
|
};
|
|
182
190
|
}
|
|
183
191
|
catch (error) {
|
|
184
|
-
|
|
192
|
+
// Capture detailed error information for debugging
|
|
193
|
+
let errorMsg;
|
|
194
|
+
let errorType = ToolErrorType.FILE_WRITE_FAILURE;
|
|
195
|
+
if (isNodeError(error)) {
|
|
196
|
+
// Handle specific Node.js errors with their error codes
|
|
197
|
+
errorMsg = `Error writing to file '${file_path}': ${error.message} (${error.code})`;
|
|
198
|
+
// Log specific error types for better debugging
|
|
199
|
+
if (error.code === 'EACCES') {
|
|
200
|
+
errorMsg = `Permission denied writing to file: ${file_path} (${error.code})`;
|
|
201
|
+
errorType = ToolErrorType.PERMISSION_DENIED;
|
|
202
|
+
}
|
|
203
|
+
else if (error.code === 'ENOSPC') {
|
|
204
|
+
errorMsg = `No space left on device: ${file_path} (${error.code})`;
|
|
205
|
+
errorType = ToolErrorType.NO_SPACE_LEFT;
|
|
206
|
+
}
|
|
207
|
+
else if (error.code === 'EISDIR') {
|
|
208
|
+
errorMsg = `Target is a directory, not a file: ${file_path} (${error.code})`;
|
|
209
|
+
errorType = ToolErrorType.TARGET_IS_DIRECTORY;
|
|
210
|
+
}
|
|
211
|
+
// Include stack trace in debug mode for better troubleshooting
|
|
212
|
+
if (this.config.getDebugMode() && error.stack) {
|
|
213
|
+
console.error('Write file error stack:', error.stack);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else if (error instanceof Error) {
|
|
217
|
+
errorMsg = `Error writing to file: ${error.message}`;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
errorMsg = `Error writing to file: ${String(error)}`;
|
|
221
|
+
}
|
|
185
222
|
return {
|
|
186
|
-
llmContent:
|
|
187
|
-
returnDisplay:
|
|
223
|
+
llmContent: errorMsg,
|
|
224
|
+
returnDisplay: errorMsg,
|
|
225
|
+
error: {
|
|
226
|
+
message: errorMsg,
|
|
227
|
+
type: errorType,
|
|
228
|
+
},
|
|
188
229
|
};
|
|
189
230
|
}
|
|
190
231
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Implementation of the WriteFile tool logic
|
|
235
|
+
*/
|
|
236
|
+
export class WriteFileTool extends BaseDeclarativeTool {
|
|
237
|
+
config;
|
|
238
|
+
static Name = 'write_file';
|
|
239
|
+
constructor(config) {
|
|
240
|
+
super(WriteFileTool.Name, 'WriteFile', `Writes content to a specified file in the local filesystem.
|
|
241
|
+
|
|
242
|
+
The user has the ability to modify \`content\`. If modified, this will be stated in the response.`, Kind.Edit, {
|
|
243
|
+
properties: {
|
|
244
|
+
file_path: {
|
|
245
|
+
description: "The absolute path to the file to write to (e.g., '/home/user/project/file.txt'). Relative paths are not supported.",
|
|
246
|
+
type: 'string',
|
|
247
|
+
},
|
|
248
|
+
content: {
|
|
249
|
+
description: 'The content to write to the file.',
|
|
250
|
+
type: 'string',
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
required: ['file_path', 'content'],
|
|
254
|
+
type: 'object',
|
|
255
|
+
});
|
|
256
|
+
this.config = config;
|
|
257
|
+
}
|
|
258
|
+
validateToolParamValues(params) {
|
|
259
|
+
const filePath = params.file_path;
|
|
260
|
+
if (!filePath) {
|
|
261
|
+
return `Missing or empty "file_path"`;
|
|
198
262
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
fileExists = false;
|
|
202
|
-
originalContent = '';
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
// File exists but could not be read (permissions, etc.)
|
|
206
|
-
fileExists = true; // Mark as existing but problematic
|
|
207
|
-
originalContent = ''; // Can't use its content
|
|
208
|
-
const error = {
|
|
209
|
-
message: getErrorMessage(err),
|
|
210
|
-
code: isNodeError(err) ? err.code : undefined,
|
|
211
|
-
};
|
|
212
|
-
// Return early as we can't proceed with content correction meaningfully
|
|
213
|
-
return { originalContent, correctedContent, fileExists, error };
|
|
214
|
-
}
|
|
263
|
+
if (!path.isAbsolute(filePath)) {
|
|
264
|
+
return `File path must be absolute: ${filePath}`;
|
|
215
265
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
// This implies originalContent is available
|
|
221
|
-
const { params: correctedParams } = await ensureCorrectEdit(filePath, originalContent, {
|
|
222
|
-
old_string: originalContent, // Treat entire current content as old_string
|
|
223
|
-
new_string: proposedContent,
|
|
224
|
-
file_path: filePath,
|
|
225
|
-
}, this.config.getGeminiClient(), abortSignal);
|
|
226
|
-
correctedContent = correctedParams.new_string;
|
|
266
|
+
const workspaceContext = this.config.getWorkspaceContext();
|
|
267
|
+
if (!workspaceContext.isPathWithinWorkspace(filePath)) {
|
|
268
|
+
const directories = workspaceContext.getDirectories();
|
|
269
|
+
return `File path must be within one of the workspace directories: ${directories.join(', ')}`;
|
|
227
270
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
271
|
+
try {
|
|
272
|
+
if (fs.existsSync(filePath)) {
|
|
273
|
+
const stats = fs.lstatSync(filePath);
|
|
274
|
+
if (stats.isDirectory()) {
|
|
275
|
+
return `Path is a directory, not a file: ${filePath}`;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
231
278
|
}
|
|
232
|
-
|
|
279
|
+
catch (statError) {
|
|
280
|
+
return `Error accessing path properties for validation: ${filePath}. Reason: ${statError instanceof Error ? statError.message : String(statError)}`;
|
|
281
|
+
}
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
createInvocation(params) {
|
|
285
|
+
return new WriteFileToolInvocation(this.config, params);
|
|
233
286
|
}
|
|
234
287
|
getModifyContext(abortSignal) {
|
|
235
288
|
return {
|
|
236
289
|
getFilePath: (params) => params.file_path,
|
|
237
290
|
getCurrentContent: async (params) => {
|
|
238
|
-
const correctedContentResult = await this.
|
|
291
|
+
const correctedContentResult = await getCorrectedFileContent(this.config, params.file_path, params.content, abortSignal);
|
|
239
292
|
return correctedContentResult.originalContent;
|
|
240
293
|
},
|
|
241
294
|
getProposedContent: async (params) => {
|
|
242
|
-
const correctedContentResult = await this.
|
|
295
|
+
const correctedContentResult = await getCorrectedFileContent(this.config, params.file_path, params.content, abortSignal);
|
|
243
296
|
return correctedContentResult.correctedContent;
|
|
244
297
|
},
|
|
245
|
-
createUpdatedParams: (_oldContent, modifiedProposedContent, originalParams) =>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
298
|
+
createUpdatedParams: (_oldContent, modifiedProposedContent, originalParams) => {
|
|
299
|
+
const content = originalParams.content;
|
|
300
|
+
return {
|
|
301
|
+
...originalParams,
|
|
302
|
+
ai_proposed_content: content,
|
|
303
|
+
content: modifiedProposedContent,
|
|
304
|
+
modified_by_user: true,
|
|
305
|
+
};
|
|
306
|
+
},
|
|
250
307
|
};
|
|
251
308
|
}
|
|
252
309
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-file.js","sourceRoot":"","sources":["../../../src/tools/write-file.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAU,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"write-file.js","sourceRoot":"","sources":["../../../src/tools/write-file.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAU,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAElB,IAAI,EAEJ,uBAAuB,GAKxB,MAAM,YAAY,CAAC;AACpB,OAAO,E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