@vybestack/llxprt-code-core 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.last_build +0 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/src/__mocks__/fs/promises.d.ts +11 -0
- package/dist/src/__mocks__/fs/promises.js +17 -0
- package/dist/src/__mocks__/fs/promises.js.map +1 -0
- package/dist/src/code_assist/codeAssist.d.ts +9 -0
- package/dist/src/code_assist/codeAssist.js +19 -0
- package/dist/src/code_assist/codeAssist.js.map +1 -0
- package/dist/src/code_assist/converter.d.ts +68 -0
- package/dist/src/code_assist/converter.js +125 -0
- package/dist/src/code_assist/converter.js.map +1 -0
- package/dist/src/code_assist/converter.test.d.ts +6 -0
- package/dist/src/code_assist/converter.test.js +229 -0
- package/dist/src/code_assist/converter.test.js.map +1 -0
- package/dist/src/code_assist/oauth2.d.ts +20 -0
- package/dist/src/code_assist/oauth2.js +339 -0
- package/dist/src/code_assist/oauth2.js.map +1 -0
- package/dist/src/code_assist/oauth2.test.d.ts +6 -0
- package/dist/src/code_assist/oauth2.test.js +249 -0
- package/dist/src/code_assist/oauth2.test.js.map +1 -0
- package/dist/src/code_assist/server.d.ts +39 -0
- package/dist/src/code_assist/server.js +191 -0
- package/dist/src/code_assist/server.js.map +1 -0
- package/dist/src/code_assist/server.test.d.ts +6 -0
- package/dist/src/code_assist/server.test.js +123 -0
- package/dist/src/code_assist/server.test.js.map +1 -0
- package/dist/src/code_assist/setup.d.ts +15 -0
- package/dist/src/code_assist/setup.js +67 -0
- package/dist/src/code_assist/setup.js.map +1 -0
- package/dist/src/code_assist/setup.test.d.ts +6 -0
- package/dist/src/code_assist/setup.test.js +62 -0
- package/dist/src/code_assist/setup.test.js.map +1 -0
- package/dist/src/code_assist/types.d.ts +148 -0
- package/dist/src/code_assist/types.js +46 -0
- package/dist/src/code_assist/types.js.map +1 -0
- package/dist/src/config/config.d.ts +212 -0
- package/dist/src/config/config.js +454 -0
- package/dist/src/config/config.js.map +1 -0
- package/dist/src/config/config.test.d.ts +6 -0
- package/dist/src/config/config.test.js +291 -0
- package/dist/src/config/config.test.js.map +1 -0
- package/dist/src/config/flashFallback.test.d.ts +6 -0
- package/dist/src/config/flashFallback.test.js +115 -0
- package/dist/src/config/flashFallback.test.js.map +1 -0
- package/dist/src/config/models.d.ts +8 -0
- package/dist/src/config/models.js +9 -0
- package/dist/src/config/models.js.map +1 -0
- package/dist/src/core/client.d.ts +59 -0
- package/dist/src/core/client.js +503 -0
- package/dist/src/core/client.js.map +1 -0
- package/dist/src/core/client.test.d.ts +6 -0
- package/dist/src/core/client.test.js +1006 -0
- package/dist/src/core/client.test.js.map +1 -0
- package/dist/src/core/contentGenerator.d.ts +36 -0
- package/dist/src/core/contentGenerator.js +79 -0
- package/dist/src/core/contentGenerator.js.map +1 -0
- package/dist/src/core/contentGenerator.test.d.ts +6 -0
- package/dist/src/core/contentGenerator.test.js +92 -0
- package/dist/src/core/contentGenerator.test.js.map +1 -0
- package/dist/src/core/coreToolScheduler.d.ts +104 -0
- package/dist/src/core/coreToolScheduler.js +413 -0
- package/dist/src/core/coreToolScheduler.js.map +1 -0
- package/dist/src/core/coreToolScheduler.test.d.ts +6 -0
- package/dist/src/core/coreToolScheduler.test.js +347 -0
- package/dist/src/core/coreToolScheduler.test.js.map +1 -0
- package/dist/src/core/geminiChat.d.ts +116 -0
- package/dist/src/core/geminiChat.js +513 -0
- package/dist/src/core/geminiChat.js.map +1 -0
- package/dist/src/core/geminiChat.test.d.ts +6 -0
- package/dist/src/core/geminiChat.test.js +424 -0
- package/dist/src/core/geminiChat.test.js.map +1 -0
- package/dist/src/core/geminiRequest.d.ts +13 -0
- package/dist/src/core/geminiRequest.js +45 -0
- package/dist/src/core/geminiRequest.js.map +1 -0
- package/dist/src/core/geminiRequest.test.d.ts +6 -0
- package/dist/src/core/geminiRequest.test.js +72 -0
- package/dist/src/core/geminiRequest.test.js.map +1 -0
- package/dist/src/core/logger.d.ts +38 -0
- package/dist/src/core/logger.js +237 -0
- package/dist/src/core/logger.js.map +1 -0
- package/dist/src/core/logger.test.d.ts +6 -0
- package/dist/src/core/logger.test.js +387 -0
- package/dist/src/core/logger.test.js.map +1 -0
- package/dist/src/core/modelCheck.d.ts +14 -0
- package/dist/src/core/modelCheck.js +55 -0
- package/dist/src/core/modelCheck.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.d.ts +12 -0
- package/dist/src/core/nonInteractiveToolExecutor.js +93 -0
- package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.d.ts +6 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.js +180 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
- package/dist/src/core/prompts.d.ts +12 -0
- package/dist/src/core/prompts.js +418 -0
- package/dist/src/core/prompts.js.map +1 -0
- package/dist/src/core/prompts.test.d.ts +6 -0
- package/dist/src/core/prompts.test.js +97 -0
- package/dist/src/core/prompts.test.js.map +1 -0
- package/dist/src/core/tokenLimits.d.ts +10 -0
- package/dist/src/core/tokenLimits.js +75 -0
- package/dist/src/core/tokenLimits.js.map +1 -0
- package/dist/src/core/tokenLimits.test.d.ts +6 -0
- package/dist/src/core/tokenLimits.test.js +66 -0
- package/dist/src/core/tokenLimits.test.js.map +1 -0
- package/dist/src/core/turn.d.ts +116 -0
- package/dist/src/core/turn.js +131 -0
- package/dist/src/core/turn.js.map +1 -0
- package/dist/src/core/turn.test.d.ts +6 -0
- package/dist/src/core/turn.test.js +237 -0
- package/dist/src/core/turn.test.js.map +1 -0
- package/dist/src/index.d.ts +57 -0
- package/dist/src/index.js +64 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.test.d.ts +6 -0
- package/dist/src/index.test.js +12 -0
- package/dist/src/index.test.js.map +1 -0
- package/dist/src/providers/ProviderContentGenerator.d.ts +21 -0
- package/dist/src/providers/ProviderContentGenerator.js +52 -0
- package/dist/src/providers/ProviderContentGenerator.js.map +1 -0
- package/dist/src/providers/adapters/GeminiCompatibleWrapper.d.ts +68 -0
- package/dist/src/providers/adapters/GeminiCompatibleWrapper.js +549 -0
- package/dist/src/providers/adapters/GeminiCompatibleWrapper.js.map +1 -0
- package/dist/src/providers/adapters/GeminiCompatibleWrapper.test.d.ts +6 -0
- package/dist/src/providers/adapters/GeminiCompatibleWrapper.test.js +253 -0
- package/dist/src/providers/adapters/GeminiCompatibleWrapper.test.js.map +1 -0
- package/dist/src/providers/types.d.ts +82 -0
- package/dist/src/providers/types.js +7 -0
- package/dist/src/providers/types.js.map +1 -0
- package/dist/src/services/fileDiscoveryService.d.ts +35 -0
- package/dist/src/services/fileDiscoveryService.js +91 -0
- package/dist/src/services/fileDiscoveryService.js.map +1 -0
- package/dist/src/services/fileDiscoveryService.test.d.ts +6 -0
- package/dist/src/services/fileDiscoveryService.test.js +102 -0
- package/dist/src/services/fileDiscoveryService.test.js.map +1 -0
- package/dist/src/services/gitService.d.ts +21 -0
- package/dist/src/services/gitService.js +102 -0
- package/dist/src/services/gitService.js.map +1 -0
- package/dist/src/services/gitService.test.d.ts +6 -0
- package/dist/src/services/gitService.test.js +246 -0
- package/dist/src/services/gitService.test.js.map +1 -0
- package/dist/src/services/ideContext.d.ts +124 -0
- package/dist/src/services/ideContext.js +90 -0
- package/dist/src/services/ideContext.js.map +1 -0
- package/dist/src/services/ideContext.test.d.ts +6 -0
- package/dist/src/services/ideContext.test.js +101 -0
- package/dist/src/services/ideContext.test.js.map +1 -0
- package/dist/src/services/loopDetectionService.d.ts +35 -0
- package/dist/src/services/loopDetectionService.js +117 -0
- package/dist/src/services/loopDetectionService.js.map +1 -0
- package/dist/src/services/loopDetectionService.test.d.ts +6 -0
- package/dist/src/services/loopDetectionService.test.js +232 -0
- package/dist/src/services/loopDetectionService.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +35 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +424 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +47 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +123 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +20 -0
- package/dist/src/telemetry/constants.js +21 -0
- package/dist/src/telemetry/constants.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +18 -0
- package/dist/src/telemetry/index.js +20 -0
- package/dist/src/telemetry/index.js.map +1 -0
- package/dist/src/telemetry/integration.test.circular.d.ts +6 -0
- package/dist/src/telemetry/integration.test.circular.js +53 -0
- package/dist/src/telemetry/integration.test.circular.js.map +1 -0
- package/dist/src/telemetry/loggers.d.ts +15 -0
- package/dist/src/telemetry/loggers.js +229 -0
- package/dist/src/telemetry/loggers.js.map +1 -0
- package/dist/src/telemetry/loggers.test.circular.d.ts +6 -0
- package/dist/src/telemetry/loggers.test.circular.js +100 -0
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -0
- package/dist/src/telemetry/loggers.test.d.ts +6 -0
- package/dist/src/telemetry/loggers.test.js +558 -0
- package/dist/src/telemetry/loggers.test.js.map +1 -0
- package/dist/src/telemetry/metrics.d.ts +19 -0
- package/dist/src/telemetry/metrics.js +144 -0
- package/dist/src/telemetry/metrics.js.map +1 -0
- package/dist/src/telemetry/metrics.test.d.ts +6 -0
- package/dist/src/telemetry/metrics.test.js +162 -0
- package/dist/src/telemetry/metrics.test.js.map +1 -0
- package/dist/src/telemetry/sdk.d.ts +9 -0
- package/dist/src/telemetry/sdk.js +120 -0
- package/dist/src/telemetry/sdk.js.map +1 -0
- package/dist/src/telemetry/telemetry.test.d.ts +6 -0
- package/dist/src/telemetry/telemetry.test.js +52 -0
- package/dist/src/telemetry/telemetry.test.js.map +1 -0
- package/dist/src/telemetry/types.d.ts +115 -0
- package/dist/src/telemetry/types.js +217 -0
- package/dist/src/telemetry/types.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.d.ts +67 -0
- package/dist/src/telemetry/uiTelemetry.js +131 -0
- package/dist/src/telemetry/uiTelemetry.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.test.d.ts +6 -0
- package/dist/src/telemetry/uiTelemetry.test.js +412 -0
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -0
- package/dist/src/tools/diffOptions.d.ts +7 -0
- package/dist/src/tools/diffOptions.js +10 -0
- package/dist/src/tools/diffOptions.js.map +1 -0
- package/dist/src/tools/edit.d.ts +73 -0
- package/dist/src/tools/edit.js +343 -0
- package/dist/src/tools/edit.js.map +1 -0
- package/dist/src/tools/edit.test.d.ts +6 -0
- package/dist/src/tools/edit.test.js +500 -0
- package/dist/src/tools/edit.test.js.map +1 -0
- package/dist/src/tools/glob.d.ts +58 -0
- package/dist/src/tools/glob.js +193 -0
- package/dist/src/tools/glob.js.map +1 -0
- package/dist/src/tools/glob.test.d.ts +6 -0
- package/dist/src/tools/glob.test.js +294 -0
- package/dist/src/tools/glob.test.js.map +1 -0
- package/dist/src/tools/grep.d.ts +78 -0
- package/dist/src/tools/grep.js +422 -0
- package/dist/src/tools/grep.js.map +1 -0
- package/dist/src/tools/grep.test.d.ts +6 -0
- package/dist/src/tools/grep.test.js +188 -0
- package/dist/src/tools/grep.test.js.map +1 -0
- package/dist/src/tools/ls.d.ts +83 -0
- package/dist/src/tools/ls.js +194 -0
- package/dist/src/tools/ls.js.map +1 -0
- package/dist/src/tools/mcp-client.d.ts +112 -0
- package/dist/src/tools/mcp-client.js +332 -0
- package/dist/src/tools/mcp-client.js.map +1 -0
- package/dist/src/tools/mcp-client.test.d.ts +6 -0
- package/dist/src/tools/mcp-client.test.js +227 -0
- package/dist/src/tools/mcp-client.test.js.map +1 -0
- package/dist/src/tools/mcp-tool.d.ts +23 -0
- package/dist/src/tools/mcp-tool.js +119 -0
- package/dist/src/tools/mcp-tool.js.map +1 -0
- package/dist/src/tools/mcp-tool.test.d.ts +6 -0
- package/dist/src/tools/mcp-tool.test.js +173 -0
- package/dist/src/tools/mcp-tool.test.js.map +1 -0
- package/dist/src/tools/memoryTool.d.ts +28 -0
- package/dist/src/tools/memoryTool.js +172 -0
- package/dist/src/tools/memoryTool.js.map +1 -0
- package/dist/src/tools/memoryTool.test.d.ts +6 -0
- package/dist/src/tools/memoryTool.test.js +181 -0
- package/dist/src/tools/memoryTool.test.js.map +1 -0
- package/dist/src/tools/modifiable-tool.d.ts +29 -0
- package/dist/src/tools/modifiable-tool.js +85 -0
- package/dist/src/tools/modifiable-tool.js.map +1 -0
- package/dist/src/tools/modifiable-tool.test.d.ts +6 -0
- package/dist/src/tools/modifiable-tool.test.js +204 -0
- package/dist/src/tools/modifiable-tool.test.js.map +1 -0
- package/dist/src/tools/read-file.d.ts +35 -0
- package/dist/src/tools/read-file.js +106 -0
- package/dist/src/tools/read-file.js.map +1 -0
- package/dist/src/tools/read-file.test.d.ts +6 -0
- package/dist/src/tools/read-file.test.js +181 -0
- package/dist/src/tools/read-file.test.js.map +1 -0
- package/dist/src/tools/read-many-files.d.ts +59 -0
- package/dist/src/tools/read-many-files.js +321 -0
- package/dist/src/tools/read-many-files.js.map +1 -0
- package/dist/src/tools/read-many-files.test.d.ts +6 -0
- package/dist/src/tools/read-many-files.test.js +312 -0
- package/dist/src/tools/read-many-files.test.js.map +1 -0
- package/dist/src/tools/shell.d.ts +43 -0
- package/dist/src/tools/shell.js +435 -0
- package/dist/src/tools/shell.js.map +1 -0
- package/dist/src/tools/shell.test.d.ts +6 -0
- package/dist/src/tools/shell.test.js +407 -0
- package/dist/src/tools/shell.test.js.map +1 -0
- package/dist/src/tools/todo-read.d.ts +15 -0
- package/dist/src/tools/todo-read.js +66 -0
- package/dist/src/tools/todo-read.js.map +1 -0
- package/dist/src/tools/todo-read.test.d.ts +6 -0
- package/dist/src/tools/todo-read.test.js +158 -0
- package/dist/src/tools/todo-read.test.js.map +1 -0
- package/dist/src/tools/todo-schemas.d.ts +43 -0
- package/dist/src/tools/todo-schemas.js +16 -0
- package/dist/src/tools/todo-schemas.js.map +1 -0
- package/dist/src/tools/todo-schemas.test.d.ts +6 -0
- package/dist/src/tools/todo-schemas.test.js +152 -0
- package/dist/src/tools/todo-schemas.test.js.map +1 -0
- package/dist/src/tools/todo-store.d.ts +15 -0
- package/dist/src/tools/todo-store.js +59 -0
- package/dist/src/tools/todo-store.js.map +1 -0
- package/dist/src/tools/todo-store.test.d.ts +6 -0
- package/dist/src/tools/todo-store.test.js +175 -0
- package/dist/src/tools/todo-store.test.js.map +1 -0
- package/dist/src/tools/todo-write.d.ts +17 -0
- package/dist/src/tools/todo-write.js +98 -0
- package/dist/src/tools/todo-write.js.map +1 -0
- package/dist/src/tools/todo-write.test.d.ts +6 -0
- package/dist/src/tools/todo-write.test.js +208 -0
- package/dist/src/tools/todo-write.test.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +67 -0
- package/dist/src/tools/tool-registry.js +326 -0
- package/dist/src/tools/tool-registry.js.map +1 -0
- package/dist/src/tools/tool-registry.test.d.ts +6 -0
- package/dist/src/tools/tool-registry.test.js +398 -0
- package/dist/src/tools/tool-registry.test.js.map +1 -0
- package/dist/src/tools/tools.d.ts +184 -0
- package/dist/src/tools/tools.js +88 -0
- package/dist/src/tools/tools.js.map +1 -0
- package/dist/src/tools/web-fetch.d.ts +29 -0
- package/dist/src/tools/web-fetch.js +243 -0
- package/dist/src/tools/web-fetch.js.map +1 -0
- package/dist/src/tools/web-fetch.test.d.ts +6 -0
- package/dist/src/tools/web-fetch.test.js +70 -0
- package/dist/src/tools/web-fetch.test.js.map +1 -0
- package/dist/src/tools/web-search.d.ts +49 -0
- package/dist/src/tools/web-search.js +120 -0
- package/dist/src/tools/web-search.js.map +1 -0
- package/dist/src/tools/write-file.d.ts +42 -0
- package/dist/src/tools/write-file.js +248 -0
- package/dist/src/tools/write-file.js.map +1 -0
- package/dist/src/tools/write-file.test.d.ts +6 -0
- package/dist/src/tools/write-file.test.js +413 -0
- package/dist/src/tools/write-file.test.js.map +1 -0
- package/dist/src/utils/LruCache.d.ts +13 -0
- package/dist/src/utils/LruCache.js +38 -0
- package/dist/src/utils/LruCache.js.map +1 -0
- package/dist/src/utils/bfsFileSearch.d.ts +22 -0
- package/dist/src/utils/bfsFileSearch.js +62 -0
- package/dist/src/utils/bfsFileSearch.js.map +1 -0
- package/dist/src/utils/bfsFileSearch.test.d.ts +6 -0
- package/dist/src/utils/bfsFileSearch.test.js +129 -0
- package/dist/src/utils/bfsFileSearch.test.js.map +1 -0
- package/dist/src/utils/editCorrector.d.ts +53 -0
- package/dist/src/utils/editCorrector.js +546 -0
- package/dist/src/utils/editCorrector.js.map +1 -0
- package/dist/src/utils/editCorrector.test.d.ts +6 -0
- package/dist/src/utils/editCorrector.test.js +564 -0
- package/dist/src/utils/editCorrector.test.js.map +1 -0
- package/dist/src/utils/editor.d.ts +28 -0
- package/dist/src/utils/editor.js +163 -0
- package/dist/src/utils/editor.js.map +1 -0
- package/dist/src/utils/editor.test.d.ts +6 -0
- package/dist/src/utils/editor.test.js +293 -0
- package/dist/src/utils/editor.test.js.map +1 -0
- package/dist/src/utils/errorReporting.d.ts +14 -0
- package/dist/src/utils/errorReporting.js +88 -0
- package/dist/src/utils/errorReporting.js.map +1 -0
- package/dist/src/utils/errorReporting.test.d.ts +6 -0
- package/dist/src/utils/errorReporting.test.js +124 -0
- package/dist/src/utils/errorReporting.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +14 -0
- package/dist/src/utils/errors.js +54 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/fetch.d.ts +11 -0
- package/dist/src/utils/fetch.js +51 -0
- package/dist/src/utils/fetch.js.map +1 -0
- package/dist/src/utils/fileUtils.d.ts +49 -0
- package/dist/src/utils/fileUtils.js +286 -0
- package/dist/src/utils/fileUtils.js.map +1 -0
- package/dist/src/utils/fileUtils.test.d.ts +6 -0
- package/dist/src/utils/fileUtils.test.js +321 -0
- package/dist/src/utils/fileUtils.test.js.map +1 -0
- package/dist/src/utils/flashFallback.integration.test.d.ts +6 -0
- package/dist/src/utils/flashFallback.integration.test.js +112 -0
- package/dist/src/utils/flashFallback.integration.test.js.map +1 -0
- package/dist/src/utils/generateContentResponseUtilities.d.ts +14 -0
- package/dist/src/utils/generateContentResponseUtilities.js +92 -0
- package/dist/src/utils/generateContentResponseUtilities.js.map +1 -0
- package/dist/src/utils/generateContentResponseUtilities.test.d.ts +6 -0
- package/dist/src/utils/generateContentResponseUtilities.test.js +273 -0
- package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -0
- package/dist/src/utils/getFolderStructure.d.ts +30 -0
- package/dist/src/utils/getFolderStructure.js +247 -0
- package/dist/src/utils/getFolderStructure.js.map +1 -0
- package/dist/src/utils/getFolderStructure.test.d.ts +6 -0
- package/dist/src/utils/getFolderStructure.test.js +298 -0
- package/dist/src/utils/getFolderStructure.test.js.map +1 -0
- package/dist/src/utils/gitIgnoreParser.d.ts +20 -0
- package/dist/src/utils/gitIgnoreParser.js +64 -0
- package/dist/src/utils/gitIgnoreParser.js.map +1 -0
- package/dist/src/utils/gitIgnoreParser.test.d.ts +6 -0
- package/dist/src/utils/gitIgnoreParser.test.js +145 -0
- package/dist/src/utils/gitIgnoreParser.test.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +17 -0
- package/dist/src/utils/gitUtils.js +61 -0
- package/dist/src/utils/gitUtils.js.map +1 -0
- package/dist/src/utils/memoryDiscovery.d.ts +14 -0
- package/dist/src/utils/memoryDiscovery.js +219 -0
- package/dist/src/utils/memoryDiscovery.js.map +1 -0
- package/dist/src/utils/memoryDiscovery.test.d.ts +6 -0
- package/dist/src/utils/memoryDiscovery.test.js +432 -0
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -0
- package/dist/src/utils/memoryImportProcessor.d.ts +35 -0
- package/dist/src/utils/memoryImportProcessor.js +141 -0
- package/dist/src/utils/memoryImportProcessor.js.map +1 -0
- package/dist/src/utils/memoryImportProcessor.test.d.ts +6 -0
- package/dist/src/utils/memoryImportProcessor.test.js +170 -0
- package/dist/src/utils/memoryImportProcessor.test.js.map +1 -0
- package/dist/src/utils/messageInspectors.d.ts +8 -0
- package/dist/src/utils/messageInspectors.js +16 -0
- package/dist/src/utils/messageInspectors.js.map +1 -0
- package/dist/src/utils/nextSpeakerChecker.d.ts +12 -0
- package/dist/src/utils/nextSpeakerChecker.js +113 -0
- package/dist/src/utils/nextSpeakerChecker.js.map +1 -0
- package/dist/src/utils/nextSpeakerChecker.test.d.ts +6 -0
- package/dist/src/utils/nextSpeakerChecker.test.js +168 -0
- package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -0
- package/dist/src/utils/paths.d.ts +49 -0
- package/dist/src/utils/paths.js +145 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/quotaErrorDetection.d.ts +22 -0
- package/dist/src/utils/quotaErrorDetection.js +67 -0
- package/dist/src/utils/quotaErrorDetection.js.map +1 -0
- package/dist/src/utils/retry.d.ts +21 -0
- package/dist/src/utils/retry.js +276 -0
- package/dist/src/utils/retry.js.map +1 -0
- package/dist/src/utils/retry.test.d.ts +6 -0
- package/dist/src/utils/retry.test.js +322 -0
- package/dist/src/utils/retry.test.js.map +1 -0
- package/dist/src/utils/safeJsonStringify.d.ts +13 -0
- package/dist/src/utils/safeJsonStringify.js +25 -0
- package/dist/src/utils/safeJsonStringify.js.map +1 -0
- package/dist/src/utils/safeJsonStringify.test.d.ts +6 -0
- package/dist/src/utils/safeJsonStringify.test.js +61 -0
- package/dist/src/utils/safeJsonStringify.test.js.map +1 -0
- package/dist/src/utils/schemaValidator.d.ts +23 -0
- package/dist/src/utils/schemaValidator.js +142 -0
- package/dist/src/utils/schemaValidator.js.map +1 -0
- package/dist/src/utils/schemaValidator.test.d.ts +6 -0
- package/dist/src/utils/schemaValidator.test.js +146 -0
- package/dist/src/utils/schemaValidator.test.js.map +1 -0
- package/dist/src/utils/session.d.ts +6 -0
- package/dist/src/utils/session.js +8 -0
- package/dist/src/utils/session.js.map +1 -0
- package/dist/src/utils/summarizer.d.ts +25 -0
- package/dist/src/utils/summarizer.js +80 -0
- package/dist/src/utils/summarizer.js.map +1 -0
- package/dist/src/utils/summarizer.test.d.ts +6 -0
- package/dist/src/utils/summarizer.test.js +131 -0
- package/dist/src/utils/summarizer.test.js.map +1 -0
- package/dist/src/utils/testUtils.d.ts +29 -0
- package/dist/src/utils/testUtils.js +70 -0
- package/dist/src/utils/testUtils.js.map +1 -0
- package/dist/src/utils/user_account.d.ts +9 -0
- package/dist/src/utils/user_account.js +99 -0
- package/dist/src/utils/user_account.js.map +1 -0
- package/dist/src/utils/user_account.test.d.ts +6 -0
- package/dist/src/utils/user_account.test.js +153 -0
- package/dist/src/utils/user_account.test.js.map +1 -0
- package/dist/src/utils/user_id.d.ts +11 -0
- package/dist/src/utils/user_id.js +49 -0
- package/dist/src/utils/user_id.js.map +1 -0
- package/dist/src/utils/user_id.test.d.ts +6 -0
- package/dist/src/utils/user_id.test.js +21 -0
- package/dist/src/utils/user_id.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/vybestack-llxprt-code-core-0.1.12.tgz +0 -0
- package/package.json +62 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Type, } from '@google/genai';
|
|
7
|
+
import { EditTool } from '../tools/edit.js';
|
|
8
|
+
import { WriteFileTool } from '../tools/write-file.js';
|
|
9
|
+
import { ReadFileTool } from '../tools/read-file.js';
|
|
10
|
+
import { ReadManyFilesTool } from '../tools/read-many-files.js';
|
|
11
|
+
import { GrepTool } from '../tools/grep.js';
|
|
12
|
+
import { LruCache } from './LruCache.js';
|
|
13
|
+
import { DEFAULT_GEMINI_FLASH_MODEL } from '../config/models.js';
|
|
14
|
+
import { isFunctionResponse, isFunctionCall, } from '../utils/messageInspectors.js';
|
|
15
|
+
import * as fs from 'fs';
|
|
16
|
+
const EditModel = DEFAULT_GEMINI_FLASH_MODEL;
|
|
17
|
+
const EditConfig = {
|
|
18
|
+
thinkingConfig: {
|
|
19
|
+
thinkingBudget: 0,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const MAX_CACHE_SIZE = 50;
|
|
23
|
+
// Cache for ensureCorrectEdit results
|
|
24
|
+
const editCorrectionCache = new LruCache(MAX_CACHE_SIZE);
|
|
25
|
+
// Cache for ensureCorrectFileContent results
|
|
26
|
+
const fileContentCorrectionCache = new LruCache(MAX_CACHE_SIZE);
|
|
27
|
+
/**
|
|
28
|
+
* Extracts the timestamp from the .id value, which is in format
|
|
29
|
+
* <tool.name>-<timestamp>-<uuid>
|
|
30
|
+
* @param fcnId the ID value of a functionCall or functionResponse object
|
|
31
|
+
* @returns -1 if the timestamp could not be extracted, else the timestamp (as a number)
|
|
32
|
+
*/
|
|
33
|
+
function getTimestampFromFunctionId(fcnId) {
|
|
34
|
+
const idParts = fcnId.split('-');
|
|
35
|
+
if (idParts.length > 2) {
|
|
36
|
+
const timestamp = parseInt(idParts[1], 10);
|
|
37
|
+
if (!isNaN(timestamp)) {
|
|
38
|
+
return timestamp;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return -1;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Will look through the gemini client history and determine when the most recent
|
|
45
|
+
* edit to a target file occured. If no edit happened, it will return -1
|
|
46
|
+
* @param filePath the path to the file
|
|
47
|
+
* @param client the geminiClient, so that we can get the history
|
|
48
|
+
* @returns a DateTime (as a number) of when the last edit occured, or -1 if no edit was found.
|
|
49
|
+
*/
|
|
50
|
+
async function findLastEditTimestamp(filePath, client) {
|
|
51
|
+
const history = (await client.getHistory()) ?? [];
|
|
52
|
+
// Tools that may reference the file path in their FunctionResponse `output`.
|
|
53
|
+
const toolsInResp = new Set([
|
|
54
|
+
WriteFileTool.Name,
|
|
55
|
+
EditTool.Name,
|
|
56
|
+
ReadManyFilesTool.Name,
|
|
57
|
+
GrepTool.Name,
|
|
58
|
+
]);
|
|
59
|
+
// Tools that may reference the file path in their FunctionCall `args`.
|
|
60
|
+
const toolsInCall = new Set([...toolsInResp, ReadFileTool.Name]);
|
|
61
|
+
// Iterate backwards to find the most recent relevant action.
|
|
62
|
+
for (const entry of history.slice().reverse()) {
|
|
63
|
+
if (!entry.parts)
|
|
64
|
+
continue;
|
|
65
|
+
for (const part of entry.parts) {
|
|
66
|
+
let id;
|
|
67
|
+
let content;
|
|
68
|
+
// Check for a relevant FunctionCall with the file path in its arguments.
|
|
69
|
+
if (isFunctionCall(entry) &&
|
|
70
|
+
part.functionCall?.name &&
|
|
71
|
+
toolsInCall.has(part.functionCall.name)) {
|
|
72
|
+
id = part.functionCall.id;
|
|
73
|
+
content = part.functionCall.args;
|
|
74
|
+
}
|
|
75
|
+
// Check for a relevant FunctionResponse with the file path in its output.
|
|
76
|
+
else if (isFunctionResponse(entry) &&
|
|
77
|
+
part.functionResponse?.name &&
|
|
78
|
+
toolsInResp.has(part.functionResponse.name)) {
|
|
79
|
+
const { response } = part.functionResponse;
|
|
80
|
+
if (response && !('error' in response) && 'output' in response) {
|
|
81
|
+
id = part.functionResponse.id;
|
|
82
|
+
content = response.output;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (!id || content === undefined)
|
|
86
|
+
continue;
|
|
87
|
+
// Use the "blunt hammer" approach to find the file path in the content.
|
|
88
|
+
// Note that the tool response data is inconsistent in their formatting
|
|
89
|
+
// with successes and errors - so, we just check for the existance
|
|
90
|
+
// as the best guess to if error/failed occured with the response.
|
|
91
|
+
const stringified = JSON.stringify(content);
|
|
92
|
+
if (!stringified.includes('Error') && // only applicable for functionResponse
|
|
93
|
+
!stringified.includes('Failed') && // only applicable for functionResponse
|
|
94
|
+
stringified.includes(filePath)) {
|
|
95
|
+
return getTimestampFromFunctionId(id);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return -1;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Attempts to correct edit parameters if the original old_string is not found.
|
|
103
|
+
* It tries unescaping, and then LLM-based correction.
|
|
104
|
+
* Results are cached to avoid redundant processing.
|
|
105
|
+
*
|
|
106
|
+
* @param currentContent The current content of the file.
|
|
107
|
+
* @param originalParams The original EditToolParams
|
|
108
|
+
* @param client The GeminiClient for LLM calls.
|
|
109
|
+
* @returns A promise resolving to an object containing the (potentially corrected)
|
|
110
|
+
* EditToolParams (as CorrectedEditParams) and the final occurrences count.
|
|
111
|
+
*/
|
|
112
|
+
export async function ensureCorrectEdit(filePath, currentContent, originalParams, // This is the EditToolParams from edit.ts, without \'corrected\'
|
|
113
|
+
client, abortSignal) {
|
|
114
|
+
const cacheKey = `${currentContent}---${originalParams.old_string}---${originalParams.new_string}`;
|
|
115
|
+
const cachedResult = editCorrectionCache.get(cacheKey);
|
|
116
|
+
if (cachedResult) {
|
|
117
|
+
return cachedResult;
|
|
118
|
+
}
|
|
119
|
+
let finalNewString = originalParams.new_string;
|
|
120
|
+
const newStringPotentiallyEscaped = unescapeStringForGeminiBug(originalParams.new_string) !==
|
|
121
|
+
originalParams.new_string;
|
|
122
|
+
const expectedReplacements = originalParams.expected_replacements ?? 1;
|
|
123
|
+
let finalOldString = originalParams.old_string;
|
|
124
|
+
let occurrences = countOccurrences(currentContent, finalOldString);
|
|
125
|
+
if (occurrences === expectedReplacements) {
|
|
126
|
+
if (newStringPotentiallyEscaped) {
|
|
127
|
+
finalNewString = await correctNewStringEscaping(client, finalOldString, originalParams.new_string, abortSignal);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else if (occurrences > expectedReplacements) {
|
|
131
|
+
const expectedReplacements = originalParams.expected_replacements ?? 1;
|
|
132
|
+
// If user expects multiple replacements, return as-is
|
|
133
|
+
if (occurrences === expectedReplacements) {
|
|
134
|
+
const result = {
|
|
135
|
+
params: { ...originalParams },
|
|
136
|
+
occurrences,
|
|
137
|
+
};
|
|
138
|
+
editCorrectionCache.set(cacheKey, result);
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
// If user expects 1 but found multiple, try to correct (existing behavior)
|
|
142
|
+
if (expectedReplacements === 1) {
|
|
143
|
+
const result = {
|
|
144
|
+
params: { ...originalParams },
|
|
145
|
+
occurrences,
|
|
146
|
+
};
|
|
147
|
+
editCorrectionCache.set(cacheKey, result);
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
// If occurrences don't match expected, return as-is (will fail validation later)
|
|
151
|
+
const result = {
|
|
152
|
+
params: { ...originalParams },
|
|
153
|
+
occurrences,
|
|
154
|
+
};
|
|
155
|
+
editCorrectionCache.set(cacheKey, result);
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
// occurrences is 0 or some other unexpected state initially
|
|
160
|
+
const unescapedOldStringAttempt = unescapeStringForGeminiBug(originalParams.old_string);
|
|
161
|
+
occurrences = countOccurrences(currentContent, unescapedOldStringAttempt);
|
|
162
|
+
if (occurrences === expectedReplacements) {
|
|
163
|
+
finalOldString = unescapedOldStringAttempt;
|
|
164
|
+
if (newStringPotentiallyEscaped) {
|
|
165
|
+
finalNewString = await correctNewString(client, originalParams.old_string, // original old
|
|
166
|
+
unescapedOldStringAttempt, // corrected old
|
|
167
|
+
originalParams.new_string, // original new (which is potentially escaped)
|
|
168
|
+
abortSignal);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
else if (occurrences === 0) {
|
|
172
|
+
if (filePath) {
|
|
173
|
+
// In order to keep from clobbering edits made outside our system,
|
|
174
|
+
// let's check if there was a more recent edit to the file than what
|
|
175
|
+
// our system has done
|
|
176
|
+
const lastEditedByUsTime = await findLastEditTimestamp(filePath, client);
|
|
177
|
+
// Add a 1-second buffer to account for timing inaccuracies. If the file
|
|
178
|
+
// was modified more than a second after the last edit tool was run, we
|
|
179
|
+
// can assume it was modified by something else.
|
|
180
|
+
if (lastEditedByUsTime > 0) {
|
|
181
|
+
const stats = fs.statSync(filePath);
|
|
182
|
+
const diff = stats.mtimeMs - lastEditedByUsTime;
|
|
183
|
+
if (diff > 2000) {
|
|
184
|
+
// Hard coded for 2 seconds
|
|
185
|
+
// This file was edited sooner
|
|
186
|
+
const result = {
|
|
187
|
+
params: { ...originalParams },
|
|
188
|
+
occurrences: 0, // Explicitly 0 as LLM failed
|
|
189
|
+
};
|
|
190
|
+
editCorrectionCache.set(cacheKey, result);
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const llmCorrectedOldString = await correctOldStringMismatch(client, currentContent, unescapedOldStringAttempt, abortSignal);
|
|
196
|
+
const llmOldOccurrences = countOccurrences(currentContent, llmCorrectedOldString);
|
|
197
|
+
if (llmOldOccurrences === expectedReplacements) {
|
|
198
|
+
finalOldString = llmCorrectedOldString;
|
|
199
|
+
occurrences = llmOldOccurrences;
|
|
200
|
+
if (newStringPotentiallyEscaped) {
|
|
201
|
+
const baseNewStringForLLMCorrection = unescapeStringForGeminiBug(originalParams.new_string);
|
|
202
|
+
finalNewString = await correctNewString(client, originalParams.old_string, // original old
|
|
203
|
+
llmCorrectedOldString, // corrected old
|
|
204
|
+
baseNewStringForLLMCorrection, // base new for correction
|
|
205
|
+
abortSignal);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
// LLM correction also failed for old_string
|
|
210
|
+
const result = {
|
|
211
|
+
params: { ...originalParams },
|
|
212
|
+
occurrences: 0, // Explicitly 0 as LLM failed
|
|
213
|
+
};
|
|
214
|
+
editCorrectionCache.set(cacheKey, result);
|
|
215
|
+
return result;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
// Unescaping old_string resulted in > 1 occurrence
|
|
220
|
+
const result = {
|
|
221
|
+
params: { ...originalParams },
|
|
222
|
+
occurrences, // This will be > 1
|
|
223
|
+
};
|
|
224
|
+
editCorrectionCache.set(cacheKey, result);
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
const { targetString, pair } = trimPairIfPossible(finalOldString, finalNewString, currentContent, expectedReplacements);
|
|
229
|
+
finalOldString = targetString;
|
|
230
|
+
finalNewString = pair;
|
|
231
|
+
// Final result construction
|
|
232
|
+
const result = {
|
|
233
|
+
params: {
|
|
234
|
+
file_path: originalParams.file_path,
|
|
235
|
+
old_string: finalOldString,
|
|
236
|
+
new_string: finalNewString,
|
|
237
|
+
},
|
|
238
|
+
occurrences: countOccurrences(currentContent, finalOldString), // Recalculate occurrences with the final old_string
|
|
239
|
+
};
|
|
240
|
+
editCorrectionCache.set(cacheKey, result);
|
|
241
|
+
return result;
|
|
242
|
+
}
|
|
243
|
+
export async function ensureCorrectFileContent(content, client, abortSignal) {
|
|
244
|
+
const cachedResult = fileContentCorrectionCache.get(content);
|
|
245
|
+
if (cachedResult) {
|
|
246
|
+
return cachedResult;
|
|
247
|
+
}
|
|
248
|
+
const contentPotentiallyEscaped = unescapeStringForGeminiBug(content) !== content;
|
|
249
|
+
if (!contentPotentiallyEscaped) {
|
|
250
|
+
fileContentCorrectionCache.set(content, content);
|
|
251
|
+
return content;
|
|
252
|
+
}
|
|
253
|
+
const correctedContent = await correctStringEscaping(content, client, abortSignal);
|
|
254
|
+
fileContentCorrectionCache.set(content, correctedContent);
|
|
255
|
+
return correctedContent;
|
|
256
|
+
}
|
|
257
|
+
// Define the expected JSON schema for the LLM response for old_string correction
|
|
258
|
+
const OLD_STRING_CORRECTION_SCHEMA = {
|
|
259
|
+
type: Type.OBJECT,
|
|
260
|
+
properties: {
|
|
261
|
+
corrected_target_snippet: {
|
|
262
|
+
type: Type.STRING,
|
|
263
|
+
description: 'The corrected version of the target snippet that exactly and uniquely matches a segment within the provided file content.',
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
required: ['corrected_target_snippet'],
|
|
267
|
+
};
|
|
268
|
+
export async function correctOldStringMismatch(geminiClient, fileContent, problematicSnippet, abortSignal) {
|
|
269
|
+
const prompt = `
|
|
270
|
+
Context: A process needs to find an exact literal, unique match for a specific text snippet within a file's content. The provided snippet failed to match exactly. This is most likely because it has been overly escaped.
|
|
271
|
+
|
|
272
|
+
Task: Analyze the provided file content and the problematic target snippet. Identify the segment in the file content that the snippet was *most likely* intended to match. Output the *exact*, literal text of that segment from the file content. Focus *only* on removing extra escape characters and correcting formatting, whitespace, or minor differences to achieve a PERFECT literal match. The output must be the exact literal text as it appears in the file.
|
|
273
|
+
|
|
274
|
+
Problematic target snippet:
|
|
275
|
+
\`\`\`
|
|
276
|
+
${problematicSnippet}
|
|
277
|
+
\`\`\`
|
|
278
|
+
|
|
279
|
+
File Content:
|
|
280
|
+
\`\`\`
|
|
281
|
+
${fileContent}
|
|
282
|
+
\`\`\`
|
|
283
|
+
|
|
284
|
+
For example, if the problematic target snippet was "\\\\\\nconst greeting = \`Hello \\\\\`\${name}\\\\\`\`;" and the file content had content that looked like "\nconst greeting = \`Hello ${'\\`'}\${name}${'\\`'}\`;", then corrected_target_snippet should likely be "\nconst greeting = \`Hello ${'\\`'}\${name}${'\\`'}\`;" to fix the incorrect escaping to match the original file content.
|
|
285
|
+
If the differences are only in whitespace or formatting, apply similar whitespace/formatting changes to the corrected_target_snippet.
|
|
286
|
+
|
|
287
|
+
Return ONLY the corrected target snippet in the specified JSON format with the key 'corrected_target_snippet'. If no clear, unique match can be found, return an empty string for 'corrected_target_snippet'.
|
|
288
|
+
`.trim();
|
|
289
|
+
const contents = [{ role: 'user', parts: [{ text: prompt }] }];
|
|
290
|
+
try {
|
|
291
|
+
const result = await geminiClient.generateJson(contents, OLD_STRING_CORRECTION_SCHEMA, abortSignal, EditModel, EditConfig);
|
|
292
|
+
if (result &&
|
|
293
|
+
typeof result.corrected_target_snippet === 'string' &&
|
|
294
|
+
result.corrected_target_snippet.length > 0) {
|
|
295
|
+
return result.corrected_target_snippet;
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
return problematicSnippet;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
if (abortSignal.aborted) {
|
|
303
|
+
throw error;
|
|
304
|
+
}
|
|
305
|
+
console.error('Error during LLM call for old string snippet correction:', error);
|
|
306
|
+
return problematicSnippet;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
// Define the expected JSON schema for the new_string correction LLM response
|
|
310
|
+
const NEW_STRING_CORRECTION_SCHEMA = {
|
|
311
|
+
type: Type.OBJECT,
|
|
312
|
+
properties: {
|
|
313
|
+
corrected_new_string: {
|
|
314
|
+
type: Type.STRING,
|
|
315
|
+
description: 'The original_new_string adjusted to be a suitable replacement for the corrected_old_string, while maintaining the original intent of the change.',
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
required: ['corrected_new_string'],
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Adjusts the new_string to align with a corrected old_string, maintaining the original intent.
|
|
322
|
+
*/
|
|
323
|
+
export async function correctNewString(geminiClient, originalOldString, correctedOldString, originalNewString, abortSignal) {
|
|
324
|
+
if (originalOldString === correctedOldString) {
|
|
325
|
+
return originalNewString;
|
|
326
|
+
}
|
|
327
|
+
const prompt = `
|
|
328
|
+
Context: A text replacement operation was planned. The original text to be replaced (original_old_string) was slightly different from the actual text in the file (corrected_old_string). The original_old_string has now been corrected to match the file content.
|
|
329
|
+
We now need to adjust the replacement text (original_new_string) so that it makes sense as a replacement for the corrected_old_string, while preserving the original intent of the change.
|
|
330
|
+
|
|
331
|
+
original_old_string (what was initially intended to be found):
|
|
332
|
+
\`\`\`
|
|
333
|
+
${originalOldString}
|
|
334
|
+
\`\`\`
|
|
335
|
+
|
|
336
|
+
corrected_old_string (what was actually found in the file and will be replaced):
|
|
337
|
+
\`\`\`
|
|
338
|
+
${correctedOldString}
|
|
339
|
+
\`\`\`
|
|
340
|
+
|
|
341
|
+
original_new_string (what was intended to replace original_old_string):
|
|
342
|
+
\`\`\`
|
|
343
|
+
${originalNewString}
|
|
344
|
+
\`\`\`
|
|
345
|
+
|
|
346
|
+
Task: Based on the differences between original_old_string and corrected_old_string, and the content of original_new_string, generate a corrected_new_string. This corrected_new_string should be what original_new_string would have been if it was designed to replace corrected_old_string directly, while maintaining the spirit of the original transformation.
|
|
347
|
+
|
|
348
|
+
For example, if original_old_string was "\\\\\\nconst greeting = \`Hello \\\\\`\${name}\\\\\`\`;" and corrected_old_string is "\nconst greeting = \`Hello ${'\\`'}\${name}${'\\`'}\`;", and original_new_string was "\\\\\\nconst greeting = \`Hello \\\\\`\${name} \${lastName}\\\\\`\`;", then corrected_new_string should likely be "\nconst greeting = \`Hello ${'\\`'}\${name} \${lastName}${'\\`'}\`;" to fix the incorrect escaping.
|
|
349
|
+
If the differences are only in whitespace or formatting, apply similar whitespace/formatting changes to the corrected_new_string.
|
|
350
|
+
|
|
351
|
+
Return ONLY the corrected string in the specified JSON format with the key 'corrected_new_string'. If no adjustment is deemed necessary or possible, return the original_new_string.
|
|
352
|
+
`.trim();
|
|
353
|
+
const contents = [{ role: 'user', parts: [{ text: prompt }] }];
|
|
354
|
+
try {
|
|
355
|
+
const result = await geminiClient.generateJson(contents, NEW_STRING_CORRECTION_SCHEMA, abortSignal, EditModel, EditConfig);
|
|
356
|
+
if (result &&
|
|
357
|
+
typeof result.corrected_new_string === 'string' &&
|
|
358
|
+
result.corrected_new_string.length > 0) {
|
|
359
|
+
return result.corrected_new_string;
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
return originalNewString;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
catch (error) {
|
|
366
|
+
if (abortSignal.aborted) {
|
|
367
|
+
throw error;
|
|
368
|
+
}
|
|
369
|
+
console.error('Error during LLM call for new_string correction:', error);
|
|
370
|
+
return originalNewString;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
const CORRECT_NEW_STRING_ESCAPING_SCHEMA = {
|
|
374
|
+
type: Type.OBJECT,
|
|
375
|
+
properties: {
|
|
376
|
+
corrected_new_string_escaping: {
|
|
377
|
+
type: Type.STRING,
|
|
378
|
+
description: 'The new_string with corrected escaping, ensuring it is a proper replacement for the old_string, especially considering potential over-escaping issues from previous LLM generations.',
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
required: ['corrected_new_string_escaping'],
|
|
382
|
+
};
|
|
383
|
+
export async function correctNewStringEscaping(geminiClient, oldString, potentiallyProblematicNewString, abortSignal) {
|
|
384
|
+
const prompt = `
|
|
385
|
+
Context: A text replacement operation is planned. The text to be replaced (old_string) has been correctly identified in the file. However, the replacement text (new_string) might have been improperly escaped by a previous LLM generation (e.g. too many backslashes for newlines like \\n instead of \n, or unnecessarily quotes like \\"Hello\\" instead of "Hello").
|
|
386
|
+
|
|
387
|
+
old_string (this is the exact text that will be replaced):
|
|
388
|
+
\`\`\`
|
|
389
|
+
${oldString}
|
|
390
|
+
\`\`\`
|
|
391
|
+
|
|
392
|
+
potentially_problematic_new_string (this is the text that should replace old_string, but MIGHT have bad escaping, or might be entirely correct):
|
|
393
|
+
\`\`\`
|
|
394
|
+
${potentiallyProblematicNewString}
|
|
395
|
+
\`\`\`
|
|
396
|
+
|
|
397
|
+
Task: Analyze the potentially_problematic_new_string. If it's syntactically invalid due to incorrect escaping (e.g., "\n", "\t", "\\", "\\'", "\\""), correct the invalid syntax. The goal is to ensure the new_string, when inserted into the code, will be a valid and correctly interpreted.
|
|
398
|
+
|
|
399
|
+
For example, if old_string is "foo" and potentially_problematic_new_string is "bar\\nbaz", the corrected_new_string_escaping should be "bar\nbaz".
|
|
400
|
+
If potentially_problematic_new_string is console.log(\\"Hello World\\"), it should be console.log("Hello World").
|
|
401
|
+
|
|
402
|
+
Return ONLY the corrected string in the specified JSON format with the key 'corrected_new_string_escaping'. If no escaping correction is needed, return the original potentially_problematic_new_string.
|
|
403
|
+
`.trim();
|
|
404
|
+
const contents = [{ role: 'user', parts: [{ text: prompt }] }];
|
|
405
|
+
try {
|
|
406
|
+
const result = await geminiClient.generateJson(contents, CORRECT_NEW_STRING_ESCAPING_SCHEMA, abortSignal, EditModel, EditConfig);
|
|
407
|
+
if (result &&
|
|
408
|
+
typeof result.corrected_new_string_escaping === 'string' &&
|
|
409
|
+
result.corrected_new_string_escaping.length > 0) {
|
|
410
|
+
return result.corrected_new_string_escaping;
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
return potentiallyProblematicNewString;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
catch (error) {
|
|
417
|
+
if (abortSignal.aborted) {
|
|
418
|
+
throw error;
|
|
419
|
+
}
|
|
420
|
+
console.error('Error during LLM call for new_string escaping correction:', error);
|
|
421
|
+
return potentiallyProblematicNewString;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
const CORRECT_STRING_ESCAPING_SCHEMA = {
|
|
425
|
+
type: Type.OBJECT,
|
|
426
|
+
properties: {
|
|
427
|
+
corrected_string_escaping: {
|
|
428
|
+
type: Type.STRING,
|
|
429
|
+
description: 'The string with corrected escaping, ensuring it is valid, specially considering potential over-escaping issues from previous LLM generations.',
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
required: ['corrected_string_escaping'],
|
|
433
|
+
};
|
|
434
|
+
export async function correctStringEscaping(potentiallyProblematicString, client, abortSignal) {
|
|
435
|
+
const prompt = `
|
|
436
|
+
Context: An LLM has just generated potentially_problematic_string and the text might have been improperly escaped (e.g. too many backslashes for newlines like \\n instead of \n, or unnecessarily quotes like \\"Hello\\" instead of "Hello").
|
|
437
|
+
|
|
438
|
+
potentially_problematic_string (this text MIGHT have bad escaping, or might be entirely correct):
|
|
439
|
+
\`\`\`
|
|
440
|
+
${potentiallyProblematicString}
|
|
441
|
+
\`\`\`
|
|
442
|
+
|
|
443
|
+
Task: Analyze the potentially_problematic_string. If it's syntactically invalid due to incorrect escaping (e.g., "\n", "\t", "\\", "\\'", "\\""), correct the invalid syntax. The goal is to ensure the text will be a valid and correctly interpreted.
|
|
444
|
+
|
|
445
|
+
For example, if potentially_problematic_string is "bar\\nbaz", the corrected_new_string_escaping should be "bar\nbaz".
|
|
446
|
+
If potentially_problematic_string is console.log(\\"Hello World\\"), it should be console.log("Hello World").
|
|
447
|
+
|
|
448
|
+
Return ONLY the corrected string in the specified JSON format with the key 'corrected_string_escaping'. If no escaping correction is needed, return the original potentially_problematic_string.
|
|
449
|
+
`.trim();
|
|
450
|
+
const contents = [{ role: 'user', parts: [{ text: prompt }] }];
|
|
451
|
+
try {
|
|
452
|
+
const result = await client.generateJson(contents, CORRECT_STRING_ESCAPING_SCHEMA, abortSignal, EditModel, EditConfig);
|
|
453
|
+
if (result &&
|
|
454
|
+
typeof result.corrected_string_escaping === 'string' &&
|
|
455
|
+
result.corrected_string_escaping.length > 0) {
|
|
456
|
+
return result.corrected_string_escaping;
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
return potentiallyProblematicString;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
catch (error) {
|
|
463
|
+
if (abortSignal.aborted) {
|
|
464
|
+
throw error;
|
|
465
|
+
}
|
|
466
|
+
console.error('Error during LLM call for string escaping correction:', error);
|
|
467
|
+
return potentiallyProblematicString;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
function trimPairIfPossible(target, trimIfTargetTrims, currentContent, expectedReplacements) {
|
|
471
|
+
const trimmedTargetString = target.trim();
|
|
472
|
+
if (target.length !== trimmedTargetString.length) {
|
|
473
|
+
const trimmedTargetOccurrences = countOccurrences(currentContent, trimmedTargetString);
|
|
474
|
+
if (trimmedTargetOccurrences === expectedReplacements) {
|
|
475
|
+
const trimmedReactiveString = trimIfTargetTrims.trim();
|
|
476
|
+
return {
|
|
477
|
+
targetString: trimmedTargetString,
|
|
478
|
+
pair: trimmedReactiveString,
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return {
|
|
483
|
+
targetString: target,
|
|
484
|
+
pair: trimIfTargetTrims,
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Unescapes a string that might have been overly escaped by an LLM.
|
|
489
|
+
*/
|
|
490
|
+
export function unescapeStringForGeminiBug(inputString) {
|
|
491
|
+
// Regex explanation:
|
|
492
|
+
// \\ : Matches exactly one literal backslash character.
|
|
493
|
+
// (n|t|r|'|"|`|\\|\n) : This is a capturing group. It matches one of the following:
|
|
494
|
+
// n, t, r, ', ", ` : These match the literal characters 'n', 't', 'r', single quote, double quote, or backtick.
|
|
495
|
+
// This handles cases like "\\n", "\\`", etc.
|
|
496
|
+
// \\ : This matches a literal backslash. This handles cases like "\\\\" (escaped backslash).
|
|
497
|
+
// \n : This matches an actual newline character. This handles cases where the input
|
|
498
|
+
// string might have something like "\\\n" (a literal backslash followed by a newline).
|
|
499
|
+
// g : Global flag, to replace all occurrences.
|
|
500
|
+
return inputString.replace(/\\+(n|t|r|'|"|`|\\|\n)/g, (match, capturedChar) => {
|
|
501
|
+
// 'match' is the entire erroneous sequence, e.g., if the input (in memory) was "\\\\`", match is "\\\\`".
|
|
502
|
+
// 'capturedChar' is the character that determines the true meaning, e.g., '`'.
|
|
503
|
+
switch (capturedChar) {
|
|
504
|
+
case 'n':
|
|
505
|
+
return '\n'; // Correctly escaped: \n (newline character)
|
|
506
|
+
case 't':
|
|
507
|
+
return '\t'; // Correctly escaped: \t (tab character)
|
|
508
|
+
case 'r':
|
|
509
|
+
return '\r'; // Correctly escaped: \r (carriage return character)
|
|
510
|
+
case "'":
|
|
511
|
+
return "'"; // Correctly escaped: ' (apostrophe character)
|
|
512
|
+
case '"':
|
|
513
|
+
return '"'; // Correctly escaped: " (quotation mark character)
|
|
514
|
+
case '`':
|
|
515
|
+
return '`'; // Correctly escaped: ` (backtick character)
|
|
516
|
+
case '\\': // This handles when 'capturedChar' is a literal backslash
|
|
517
|
+
return '\\'; // Replace escaped backslash (e.g., "\\\\") with single backslash
|
|
518
|
+
case '\n': // This handles when 'capturedChar' is an actual newline
|
|
519
|
+
return '\n'; // Replace the whole erroneous sequence (e.g., "\\\n" in memory) with a clean newline
|
|
520
|
+
default:
|
|
521
|
+
// This fallback should ideally not be reached if the regex captures correctly.
|
|
522
|
+
// It would return the original matched sequence if an unexpected character was captured.
|
|
523
|
+
return match;
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Counts occurrences of a substring in a string
|
|
529
|
+
*/
|
|
530
|
+
export function countOccurrences(str, substr) {
|
|
531
|
+
if (substr === '') {
|
|
532
|
+
return 0;
|
|
533
|
+
}
|
|
534
|
+
let count = 0;
|
|
535
|
+
let pos = str.indexOf(substr);
|
|
536
|
+
while (pos !== -1) {
|
|
537
|
+
count++;
|
|
538
|
+
pos = str.indexOf(substr, pos + substr.length); // Start search after the current match
|
|
539
|
+
}
|
|
540
|
+
return count;
|
|
541
|
+
}
|
|
542
|
+
export function resetEditCorrectorCaches_TEST_ONLY() {
|
|
543
|
+
editCorrectionCache.clear();
|
|
544
|
+
fileContentCorrectionCache.clear();
|
|
545
|
+
}
|
|
546
|
+
//# sourceMappingURL=editCorrector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editCorrector.js","sourceRoot":"","sources":["../../../src/utils/editCorrector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIL,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAkB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAA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