@machina.ai/cell-cli-core 1.0.17-rc1 → 1.0.21-rc2
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 +9 -2
- package/dist/src/code_assist/converter.d.ts +4 -2
- package/dist/src/code_assist/converter.js +2 -1
- package/dist/src/code_assist/converter.js.map +1 -1
- package/dist/src/code_assist/converter.test.js +48 -1
- 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 +38 -21
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/oauth2.test.js +51 -8
- package/dist/src/code_assist/oauth2.test.js.map +1 -1
- package/dist/src/code_assist/server.js +1 -1
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/server.test.js +4 -1
- package/dist/src/code_assist/server.test.js.map +1 -1
- package/dist/src/code_assist/setup.js +48 -17
- package/dist/src/code_assist/setup.js.map +1 -1
- package/dist/src/code_assist/setup.test.js +114 -8
- package/dist/src/code_assist/setup.test.js.map +1 -1
- package/dist/src/config/config.d.ts +41 -11
- package/dist/src/config/config.js +85 -27
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +117 -3
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/flashFallback.test.js +0 -4
- package/dist/src/config/flashFallback.test.js.map +1 -1
- package/dist/src/core/client.d.ts +12 -16
- package/dist/src/core/client.js +218 -135
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +636 -37
- package/dist/src/core/client.test.js.map +1 -1
- 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 -8
- package/dist/src/core/coreToolScheduler.js +179 -64
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +250 -97
- package/dist/src/core/coreToolScheduler.test.js.map +1 -1
- package/dist/src/core/geminiChat.d.ts +7 -6
- package/dist/src/core/geminiChat.js +43 -43
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/logger.d.ts +23 -1
- package/dist/src/core/logger.js +115 -11
- package/dist/src/core/logger.js.map +1 -1
- package/dist/src/core/logger.test.js +112 -17
- 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 +28 -1
- 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 +4 -4
- package/dist/src/core/prompts.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.d.ts +6 -0
- package/dist/src/core/subagent.test.js +515 -0
- package/dist/src/core/subagent.test.js.map +1 -0
- package/dist/src/core/turn.js +1 -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 +12 -2
- package/dist/src/ide/detect-ide.js +64 -5
- package/dist/src/ide/detect-ide.js.map +1 -1
- package/dist/src/ide/detect-ide.test.d.ts +6 -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 +34 -11
- package/dist/src/ide/ide-client.js +230 -62
- package/dist/src/ide/ide-client.js.map +1 -1
- 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.js +23 -34
- package/dist/src/ide/ide-installer.js.map +1 -1
- package/dist/src/ide/ide-installer.test.js +6 -8
- package/dist/src/ide/ide-installer.test.js.map +1 -1
- package/dist/src/ide/ideContext.d.ts +97 -2
- package/dist/src/ide/ideContext.js +45 -0
- package/dist/src/ide/ideContext.js.map +1 -1
- 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 +7 -1
- package/dist/src/index.js +7 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.js +9 -0
- package/dist/src/mcp/google-auth-provider.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.test.js +45 -10
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-provider.d.ts +1 -1
- package/dist/src/mcp/oauth-provider.js +185 -59
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-provider.test.js +134 -62
- package/dist/src/mcp/oauth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-utils.d.ts +3 -1
- package/dist/src/mcp/oauth-utils.js +50 -12
- package/dist/src/mcp/oauth-utils.js.map +1 -1
- package/dist/src/mcp/oauth-utils.test.js +17 -2
- 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/prompt-registry.d.ts +8 -0
- package/dist/src/prompts/prompt-registry.js +16 -0
- package/dist/src/prompts/prompt-registry.js.map +1 -1
- 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/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/loopDetectionService.js +19 -16
- package/dist/src/services/loopDetectionService.js.map +1 -1
- package/dist/src/services/loopDetectionService.test.js +191 -0
- package/dist/src/services/loopDetectionService.test.js.map +1 -1
- package/dist/src/services/shellExecutionService.js +29 -9
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +21 -3
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +78 -9
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +316 -205
- 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 +14 -2
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +32 -9
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/constants.d.ts +2 -0
- package/dist/src/telemetry/constants.js +2 -0
- package/dist/src/telemetry/constants.js.map +1 -1
- 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 +4 -1
- package/dist/src/telemetry/loggers.js +55 -6
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.circular.js +7 -2
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +43 -8
- 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 -41
- 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 -4
- 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 +55 -21
- package/dist/src/telemetry/types.js +83 -43
- 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 +57 -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/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 +152 -136
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js +125 -51
- 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 +87 -91
- package/dist/src/tools/glob.js.map +1 -1
- package/dist/src/tools/glob.test.js +42 -12
- package/dist/src/tools/glob.test.js.map +1 -1
- package/dist/src/tools/grep.d.ts +4 -36
- package/dist/src/tools/grep.js +107 -84
- package/dist/src/tools/grep.js.map +1 -1
- package/dist/src/tools/grep.test.js +40 -23
- 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 -79
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/ls.test.js +62 -34
- package/dist/src/tools/ls.test.js.map +1 -1
- 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 +57 -3
- package/dist/src/tools/mcp-client.js +235 -10
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +234 -87
- 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 +62 -34
- package/dist/src/tools/mcp-tool.js.map +1 -1
- package/dist/src/tools/mcp-tool.test.js +118 -59
- package/dist/src/tools/mcp-tool.test.js.map +1 -1
- package/dist/src/tools/memoryTool.d.ts +10 -14
- package/dist/src/tools/memoryTool.js +123 -121
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/memoryTool.test.js +38 -18
- 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 +12 -12
- 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 +95 -50
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/read-file.test.js +199 -129
- package/dist/src/tools/read-file.test.js.map +1 -1
- package/dist/src/tools/read-many-files.d.ts +3 -5
- package/dist/src/tools/read-many-files.js +204 -138
- package/dist/src/tools/read-many-files.js.map +1 -1
- package/dist/src/tools/read-many-files.test.js +197 -33
- package/dist/src/tools/read-many-files.test.js.map +1 -1
- package/dist/src/tools/shell.d.ts +4 -6
- package/dist/src/tools/shell.js +112 -102
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +55 -28
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/tool-error.d.ts +5 -0
- package/dist/src/tools/tool-error.js +5 -0
- package/dist/src/tools/tool-error.js.map +1 -1
- package/dist/src/tools/tool-registry.d.ts +25 -22
- package/dist/src/tools/tool-registry.js +100 -116
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +29 -212
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/tools.d.ts +137 -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 +197 -142
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js +156 -96
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.test.js +28 -56
- 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 +21 -22
- package/dist/src/utils/editCorrector.js.map +1 -1
- package/dist/src/utils/editor.d.ts +1 -1
- package/dist/src/utils/editor.js +14 -6
- package/dist/src/utils/editor.js.map +1 -1
- package/dist/src/utils/editor.test.js +48 -16
- 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/fileUtils.d.ts +9 -1
- package/dist/src/utils/fileUtils.js +18 -15
- package/dist/src/utils/fileUtils.js.map +1 -1
- package/dist/src/utils/fileUtils.test.js +24 -22
- 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 +0 -2
- package/dist/src/utils/flashFallback.integration.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.js +7 -4
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +3 -2
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.js +3 -7
- package/dist/src/utils/memoryImportProcessor.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.test.js +17 -20
- package/dist/src/utils/memoryImportProcessor.test.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.js +5 -6
- package/dist/src/utils/nextSpeakerChecker.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.test.js +2 -2
- package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -1
- package/dist/src/utils/paths.d.ts +7 -0
- package/dist/src/utils/paths.js +15 -0
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/paths.test.js +74 -2
- package/dist/src/utils/paths.test.js.map +1 -1
- package/dist/src/utils/quotaErrorDetection.d.ts +1 -5
- package/dist/src/utils/quotaErrorDetection.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.js +4 -3
- package/dist/src/utils/secure-browser-launcher.js.map +1 -1
- package/dist/src/utils/shell-utils.d.ts +39 -0
- package/dist/src/utils/shell-utils.js +72 -2
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +132 -4
- package/dist/src/utils/shell-utils.test.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/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 +22 -7
- package/dist/src/utils/workspaceContext.js +81 -55
- package/dist/src/utils/workspaceContext.js.map +1 -1
- package/dist/src/utils/workspaceContext.test.js +221 -137
- package/dist/src/utils/workspaceContext.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -2
- 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
|
@@ -7,104 +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';
|
|
15
|
+
import { DEFAULT_DIFF_OPTIONS, getDiffStat } from './diffOptions.js';
|
|
17
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
|
-
|
|
48
|
-
}
|
|
49
|
-
const filePath = params.file_path;
|
|
50
|
-
if (!path.isAbsolute(filePath)) {
|
|
51
|
-
return `File path must be absolute: ${filePath}`;
|
|
29
|
+
catch (err) {
|
|
30
|
+
if (isNodeError(err) && err.code === 'ENOENT') {
|
|
31
|
+
fileExists = false;
|
|
32
|
+
originalContent = '';
|
|
52
33
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (stats.isDirectory()) {
|
|
64
|
-
return `Path is a directory, not a file: ${filePath}`;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
catch (statError) {
|
|
69
|
-
// If fs.existsSync is true but lstatSync fails (e.g., permissions, race condition where file is deleted)
|
|
70
|
-
// this indicates an issue with accessing the path that should be reported.
|
|
71
|
-
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 };
|
|
72
44
|
}
|
|
73
|
-
return null;
|
|
74
45
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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());
|
|
80
75
|
return `Writing to ${shortenPath(relativePath)}`;
|
|
81
76
|
}
|
|
82
|
-
|
|
83
|
-
* Handles the confirmation prompt for the WriteFile tool.
|
|
84
|
-
*/
|
|
85
|
-
async shouldConfirmExecute(params, abortSignal) {
|
|
77
|
+
async shouldConfirmExecute(abortSignal) {
|
|
86
78
|
if (this.config.getApprovalMode() === ApprovalMode.AUTO_EDIT) {
|
|
87
79
|
return false;
|
|
88
80
|
}
|
|
89
|
-
const
|
|
90
|
-
if (validationError) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
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);
|
|
94
82
|
if (correctedContentResult.error) {
|
|
95
83
|
// If file exists but couldn't be read, we can't show a diff for confirmation.
|
|
96
84
|
return false;
|
|
97
85
|
}
|
|
98
86
|
const { originalContent, correctedContent } = correctedContentResult;
|
|
99
|
-
const relativePath = makeRelative(params.file_path, this.config.getTargetDir());
|
|
100
|
-
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);
|
|
101
89
|
const fileDiff = Diff.createPatch(fileName, originalContent, // Original content (empty if new file or unreadable)
|
|
102
90
|
correctedContent, // Content after potential correction
|
|
103
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;
|
|
104
97
|
const confirmationDetails = {
|
|
105
98
|
type: 'edit',
|
|
106
99
|
title: `Confirm Write: ${shortenPath(relativePath)}`,
|
|
107
100
|
fileName,
|
|
101
|
+
filePath: this.params.file_path,
|
|
108
102
|
fileDiff,
|
|
109
103
|
originalContent,
|
|
110
104
|
newContent: correctedContent,
|
|
@@ -112,25 +106,32 @@ export class WriteFileTool extends BaseTool {
|
|
|
112
106
|
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
113
107
|
this.config.setApprovalMode(ApprovalMode.AUTO_EDIT);
|
|
114
108
|
}
|
|
109
|
+
if (ideConfirmation) {
|
|
110
|
+
const result = await ideConfirmation;
|
|
111
|
+
if (result.status === 'accepted' && result.content) {
|
|
112
|
+
this.params.content = result.content;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
115
|
},
|
|
116
|
+
ideConfirmation,
|
|
116
117
|
};
|
|
117
118
|
return confirmationDetails;
|
|
118
119
|
}
|
|
119
|
-
async execute(
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
return {
|
|
123
|
-
llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
|
|
124
|
-
returnDisplay: `Error: ${validationError}`,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
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);
|
|
128
123
|
if (correctedContentResult.error) {
|
|
129
124
|
const errDetails = correctedContentResult.error;
|
|
130
|
-
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}`;
|
|
131
128
|
return {
|
|
132
|
-
llmContent:
|
|
129
|
+
llmContent: errorMsg,
|
|
133
130
|
returnDisplay: errorMsg,
|
|
131
|
+
error: {
|
|
132
|
+
message: errorMsg,
|
|
133
|
+
type: ToolErrorType.FILE_WRITE_FAILURE,
|
|
134
|
+
},
|
|
134
135
|
};
|
|
135
136
|
}
|
|
136
137
|
const { originalContent, correctedContent: fileContent, fileExists, } = correctedContentResult;
|
|
@@ -140,13 +141,15 @@ export class WriteFileTool extends BaseTool {
|
|
|
140
141
|
(correctedContentResult.error !== undefined &&
|
|
141
142
|
!correctedContentResult.fileExists);
|
|
142
143
|
try {
|
|
143
|
-
const dirName = path.dirname(
|
|
144
|
+
const dirName = path.dirname(file_path);
|
|
144
145
|
if (!fs.existsSync(dirName)) {
|
|
145
146
|
fs.mkdirSync(dirName, { recursive: true });
|
|
146
147
|
}
|
|
147
|
-
|
|
148
|
+
await this.config
|
|
149
|
+
.getFileSystemService()
|
|
150
|
+
.writeTextFile(file_path, fileContent);
|
|
148
151
|
// Generate diff for display result
|
|
149
|
-
const fileName = path.basename(
|
|
152
|
+
const fileName = path.basename(file_path);
|
|
150
153
|
// If there was a readError, originalContent in correctedContentResult is '',
|
|
151
154
|
// but for the diff, we want to show the original content as it was before the write if possible.
|
|
152
155
|
// However, if it was unreadable, currentContentForDiff will be empty.
|
|
@@ -154,28 +157,31 @@ export class WriteFileTool extends BaseTool {
|
|
|
154
157
|
? '' // Or some indicator of unreadable content
|
|
155
158
|
: originalContent;
|
|
156
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);
|
|
157
162
|
const llmSuccessMessageParts = [
|
|
158
163
|
isNewFile
|
|
159
|
-
? `Successfully created and wrote to new file: ${
|
|
160
|
-
: `Successfully overwrote file: ${
|
|
164
|
+
? `Successfully created and wrote to new file: ${file_path}.`
|
|
165
|
+
: `Successfully overwrote file: ${file_path}.`,
|
|
161
166
|
];
|
|
162
|
-
if (
|
|
163
|
-
llmSuccessMessageParts.push(`User modified the \`content\` to be: ${
|
|
167
|
+
if (modified_by_user) {
|
|
168
|
+
llmSuccessMessageParts.push(`User modified the \`content\` to be: ${content}`);
|
|
164
169
|
}
|
|
165
170
|
const displayResult = {
|
|
166
171
|
fileDiff,
|
|
167
172
|
fileName,
|
|
168
173
|
originalContent: correctedContentResult.originalContent,
|
|
169
174
|
newContent: correctedContentResult.correctedContent,
|
|
175
|
+
diffStat,
|
|
170
176
|
};
|
|
171
177
|
const lines = fileContent.split('\n').length;
|
|
172
|
-
const mimetype = getSpecificMimeType(
|
|
173
|
-
const extension = path.extname(
|
|
178
|
+
const mimetype = getSpecificMimeType(file_path);
|
|
179
|
+
const extension = path.extname(file_path); // Get extension
|
|
174
180
|
if (isNewFile) {
|
|
175
|
-
recordFileOperationMetric(this.config, FileOperation.CREATE, lines, mimetype, extension);
|
|
181
|
+
recordFileOperationMetric(this.config, FileOperation.CREATE, lines, mimetype, extension, diffStat);
|
|
176
182
|
}
|
|
177
183
|
else {
|
|
178
|
-
recordFileOperationMetric(this.config, FileOperation.UPDATE, lines, mimetype, extension);
|
|
184
|
+
recordFileOperationMetric(this.config, FileOperation.UPDATE, lines, mimetype, extension, diffStat);
|
|
179
185
|
}
|
|
180
186
|
return {
|
|
181
187
|
llmContent: llmSuccessMessageParts.join(' '),
|
|
@@ -183,72 +189,121 @@ export class WriteFileTool extends BaseTool {
|
|
|
183
189
|
};
|
|
184
190
|
}
|
|
185
191
|
catch (error) {
|
|
186
|
-
|
|
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
|
+
}
|
|
187
222
|
return {
|
|
188
|
-
llmContent:
|
|
189
|
-
returnDisplay:
|
|
223
|
+
llmContent: errorMsg,
|
|
224
|
+
returnDisplay: errorMsg,
|
|
225
|
+
error: {
|
|
226
|
+
message: errorMsg,
|
|
227
|
+
type: errorType,
|
|
228
|
+
},
|
|
190
229
|
};
|
|
191
230
|
}
|
|
192
231
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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"`;
|
|
200
262
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
fileExists = false;
|
|
204
|
-
originalContent = '';
|
|
205
|
-
}
|
|
206
|
-
else {
|
|
207
|
-
// File exists but could not be read (permissions, etc.)
|
|
208
|
-
fileExists = true; // Mark as existing but problematic
|
|
209
|
-
originalContent = ''; // Can't use its content
|
|
210
|
-
const error = {
|
|
211
|
-
message: getErrorMessage(err),
|
|
212
|
-
code: isNodeError(err) ? err.code : undefined,
|
|
213
|
-
};
|
|
214
|
-
// Return early as we can't proceed with content correction meaningfully
|
|
215
|
-
return { originalContent, correctedContent, fileExists, error };
|
|
216
|
-
}
|
|
263
|
+
if (!path.isAbsolute(filePath)) {
|
|
264
|
+
return `File path must be absolute: ${filePath}`;
|
|
217
265
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
// This implies originalContent is available
|
|
223
|
-
const { params: correctedParams } = await ensureCorrectEdit(filePath, originalContent, {
|
|
224
|
-
old_string: originalContent, // Treat entire current content as old_string
|
|
225
|
-
new_string: proposedContent,
|
|
226
|
-
file_path: filePath,
|
|
227
|
-
}, this.config.getGeminiClient(), abortSignal);
|
|
228
|
-
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(', ')}`;
|
|
229
270
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
+
}
|
|
233
278
|
}
|
|
234
|
-
|
|
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);
|
|
235
286
|
}
|
|
236
287
|
getModifyContext(abortSignal) {
|
|
237
288
|
return {
|
|
238
289
|
getFilePath: (params) => params.file_path,
|
|
239
290
|
getCurrentContent: async (params) => {
|
|
240
|
-
const correctedContentResult = await this.
|
|
291
|
+
const correctedContentResult = await getCorrectedFileContent(this.config, params.file_path, params.content, abortSignal);
|
|
241
292
|
return correctedContentResult.originalContent;
|
|
242
293
|
},
|
|
243
294
|
getProposedContent: async (params) => {
|
|
244
|
-
const correctedContentResult = await this.
|
|
295
|
+
const correctedContentResult = await getCorrectedFileContent(this.config, params.file_path, params.content, abortSignal);
|
|
245
296
|
return correctedContentResult.correctedContent;
|
|
246
297
|
},
|
|
247
|
-
createUpdatedParams: (_oldContent, modifiedProposedContent, originalParams) =>
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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
|
+
},
|
|
252
307
|
};
|
|
253
308
|
}
|
|
254
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,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAErE,O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