@vybestack/llxprt-code-tools 0.10.0-nightly.260613.1adad3b34
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/LICENSE +202 -0
- package/README.md +294 -0
- package/dist/.last_build +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/src/__tests__/fixtures/filesystem-tool-fixtures.d.ts +29 -0
- package/dist/src/__tests__/fixtures/filesystem-tool-fixtures.js +30 -0
- package/dist/src/__tests__/fixtures/filesystem-tool-fixtures.js.map +1 -0
- package/dist/src/__tests__/fixtures/key-storage-fixtures.d.ts +39 -0
- package/dist/src/__tests__/fixtures/key-storage-fixtures.js +53 -0
- package/dist/src/__tests__/fixtures/key-storage-fixtures.js.map +1 -0
- package/dist/src/__tests__/fixtures/provider-formatting-fixtures.d.ts +140 -0
- package/dist/src/__tests__/fixtures/provider-formatting-fixtures.js +157 -0
- package/dist/src/__tests__/fixtures/provider-formatting-fixtures.js.map +1 -0
- package/dist/src/__tests__/red-test-helpers.d.ts +14 -0
- package/dist/src/__tests__/red-test-helpers.js +18 -0
- package/dist/src/__tests__/red-test-helpers.js.map +1 -0
- package/dist/src/formatters/IToolFormatter.d.ts +84 -0
- package/dist/src/formatters/IToolFormatter.js +6 -0
- package/dist/src/formatters/IToolFormatter.js.map +1 -0
- package/dist/src/formatters/ToolFormatter.d.ts +94 -0
- package/dist/src/formatters/ToolFormatter.js +379 -0
- package/dist/src/formatters/ToolFormatter.js.map +1 -0
- package/dist/src/formatters/ToolIdStrategy.d.ts +79 -0
- package/dist/src/formatters/ToolIdStrategy.js +173 -0
- package/dist/src/formatters/ToolIdStrategy.js.map +1 -0
- package/dist/src/formatters/doubleEscapeUtils.d.ts +46 -0
- package/dist/src/formatters/doubleEscapeUtils.js +223 -0
- package/dist/src/formatters/doubleEscapeUtils.js.map +1 -0
- package/dist/src/formatters/index.d.ts +21 -0
- package/dist/src/formatters/index.js +12 -0
- package/dist/src/formatters/index.js.map +1 -0
- package/dist/src/formatters/toolIdNormalization.d.ts +28 -0
- package/dist/src/formatters/toolIdNormalization.js +97 -0
- package/dist/src/formatters/toolIdNormalization.js.map +1 -0
- package/dist/src/formatters/toolNameUtils.d.ts +43 -0
- package/dist/src/formatters/toolNameUtils.js +143 -0
- package/dist/src/formatters/toolNameUtils.js.map +1 -0
- package/dist/src/index.d.ts +88 -0
- package/dist/src/index.js +68 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interfaces/IAsyncTaskService.d.ts +57 -0
- package/dist/src/interfaces/IAsyncTaskService.js +6 -0
- package/dist/src/interfaces/IAsyncTaskService.js.map +1 -0
- package/dist/src/interfaces/IIdeService.d.ts +62 -0
- package/dist/src/interfaces/IIdeService.js +6 -0
- package/dist/src/interfaces/IIdeService.js.map +1 -0
- package/dist/src/interfaces/ILspService.d.ts +54 -0
- package/dist/src/interfaces/ILspService.js +6 -0
- package/dist/src/interfaces/ILspService.js.map +1 -0
- package/dist/src/interfaces/IMcpToolService.d.ts +47 -0
- package/dist/src/interfaces/IMcpToolService.js +6 -0
- package/dist/src/interfaces/IMcpToolService.js.map +1 -0
- package/dist/src/interfaces/IPromptRegistryService.d.ts +51 -0
- package/dist/src/interfaces/IPromptRegistryService.js +6 -0
- package/dist/src/interfaces/IPromptRegistryService.js.map +1 -0
- package/dist/src/interfaces/ISettingsService.d.ts +50 -0
- package/dist/src/interfaces/ISettingsService.js +6 -0
- package/dist/src/interfaces/ISettingsService.js.map +1 -0
- package/dist/src/interfaces/IShellExecutionService.d.ts +55 -0
- package/dist/src/interfaces/IShellExecutionService.js +6 -0
- package/dist/src/interfaces/IShellExecutionService.js.map +1 -0
- package/dist/src/interfaces/IShellToolHost.d.ts +176 -0
- package/dist/src/interfaces/IShellToolHost.js +6 -0
- package/dist/src/interfaces/IShellToolHost.js.map +1 -0
- package/dist/src/interfaces/ISkillService.d.ts +69 -0
- package/dist/src/interfaces/ISkillService.js +6 -0
- package/dist/src/interfaces/ISkillService.js.map +1 -0
- package/dist/src/interfaces/IStorageService.d.ts +42 -0
- package/dist/src/interfaces/IStorageService.js +6 -0
- package/dist/src/interfaces/IStorageService.js.map +1 -0
- package/dist/src/interfaces/ISubagentService.d.ts +112 -0
- package/dist/src/interfaces/ISubagentService.js +6 -0
- package/dist/src/interfaces/ISubagentService.js.map +1 -0
- package/dist/src/interfaces/ITaskToolHost.d.ts +185 -0
- package/dist/src/interfaces/ITaskToolHost.js +6 -0
- package/dist/src/interfaces/ITaskToolHost.js.map +1 -0
- package/dist/src/interfaces/ITodoService.d.ts +79 -0
- package/dist/src/interfaces/ITodoService.js +6 -0
- package/dist/src/interfaces/ITodoService.js.map +1 -0
- package/dist/src/interfaces/IToolHost.d.ts +91 -0
- package/dist/src/interfaces/IToolHost.js +6 -0
- package/dist/src/interfaces/IToolHost.js.map +1 -0
- package/dist/src/interfaces/IToolKeyStorage.d.ts +62 -0
- package/dist/src/interfaces/IToolKeyStorage.js +6 -0
- package/dist/src/interfaces/IToolKeyStorage.js.map +1 -0
- package/dist/src/interfaces/IToolMessageBus.d.ts +63 -0
- package/dist/src/interfaces/IToolMessageBus.js +6 -0
- package/dist/src/interfaces/IToolMessageBus.js.map +1 -0
- package/dist/src/interfaces/IToolRegistryHost.d.ts +43 -0
- package/dist/src/interfaces/IToolRegistryHost.js +6 -0
- package/dist/src/interfaces/IToolRegistryHost.js.map +1 -0
- package/dist/src/interfaces/IWebSearchService.d.ts +16 -0
- package/dist/src/interfaces/IWebSearchService.js +7 -0
- package/dist/src/interfaces/IWebSearchService.js.map +1 -0
- package/dist/src/interfaces/index.d.ts +33 -0
- package/dist/src/interfaces/index.js +6 -0
- package/dist/src/interfaces/index.js.map +1 -0
- package/dist/src/tools/activate-skill.d.ts +26 -0
- package/dist/src/tools/activate-skill.js +121 -0
- package/dist/src/tools/activate-skill.js.map +1 -0
- package/dist/src/tools/apply-patch.d.ts +65 -0
- package/dist/src/tools/apply-patch.js +528 -0
- package/dist/src/tools/apply-patch.js.map +1 -0
- package/dist/src/tools/ast-edit/ast-config.d.ts +67 -0
- package/dist/src/tools/ast-edit/ast-config.js +72 -0
- package/dist/src/tools/ast-edit/ast-config.js.map +1 -0
- package/dist/src/tools/ast-edit/ast-edit-invocation.d.ts +40 -0
- package/dist/src/tools/ast-edit/ast-edit-invocation.js +410 -0
- package/dist/src/tools/ast-edit/ast-edit-invocation.js.map +1 -0
- package/dist/src/tools/ast-edit/ast-query-extractor.d.ts +21 -0
- package/dist/src/tools/ast-edit/ast-query-extractor.js +178 -0
- package/dist/src/tools/ast-edit/ast-query-extractor.js.map +1 -0
- package/dist/src/tools/ast-edit/ast-read-file-invocation.d.ts +26 -0
- package/dist/src/tools/ast-edit/ast-read-file-invocation.js +149 -0
- package/dist/src/tools/ast-edit/ast-read-file-invocation.js.map +1 -0
- package/dist/src/tools/ast-edit/constants.d.ts +30 -0
- package/dist/src/tools/ast-edit/constants.js +36 -0
- package/dist/src/tools/ast-edit/constants.js.map +1 -0
- package/dist/src/tools/ast-edit/context-collector.d.ts +25 -0
- package/dist/src/tools/ast-edit/context-collector.js +115 -0
- package/dist/src/tools/ast-edit/context-collector.js.map +1 -0
- package/dist/src/tools/ast-edit/context-optimizer.d.ts +29 -0
- package/dist/src/tools/ast-edit/context-optimizer.js +86 -0
- package/dist/src/tools/ast-edit/context-optimizer.js.map +1 -0
- package/dist/src/tools/ast-edit/cross-file-analyzer.d.ts +41 -0
- package/dist/src/tools/ast-edit/cross-file-analyzer.js +294 -0
- package/dist/src/tools/ast-edit/cross-file-analyzer.js.map +1 -0
- package/dist/src/tools/ast-edit/edit-calculator.d.ts +71 -0
- package/dist/src/tools/ast-edit/edit-calculator.js +249 -0
- package/dist/src/tools/ast-edit/edit-calculator.js.map +1 -0
- package/dist/src/tools/ast-edit/edit-helpers.d.ts +22 -0
- package/dist/src/tools/ast-edit/edit-helpers.js +36 -0
- package/dist/src/tools/ast-edit/edit-helpers.js.map +1 -0
- package/dist/src/tools/ast-edit/language-analysis.d.ts +19 -0
- package/dist/src/tools/ast-edit/language-analysis.js +123 -0
- package/dist/src/tools/ast-edit/language-analysis.js.map +1 -0
- package/dist/src/tools/ast-edit/local-context-analyzer.d.ts +84 -0
- package/dist/src/tools/ast-edit/local-context-analyzer.js +267 -0
- package/dist/src/tools/ast-edit/local-context-analyzer.js.map +1 -0
- package/dist/src/tools/ast-edit/repository-context-provider.d.ts +22 -0
- package/dist/src/tools/ast-edit/repository-context-provider.js +139 -0
- package/dist/src/tools/ast-edit/repository-context-provider.js.map +1 -0
- package/dist/src/tools/ast-edit/types.d.ts +155 -0
- package/dist/src/tools/ast-edit/types.js +7 -0
- package/dist/src/tools/ast-edit/types.js.map +1 -0
- package/dist/src/tools/ast-edit/workspace-context-provider.d.ts +22 -0
- package/dist/src/tools/ast-edit/workspace-context-provider.js +39 -0
- package/dist/src/tools/ast-edit/workspace-context-provider.js.map +1 -0
- package/dist/src/tools/ast-edit.d.ts +43 -0
- package/dist/src/tools/ast-edit.js +183 -0
- package/dist/src/tools/ast-edit.js.map +1 -0
- package/dist/src/tools/ast-grep.d.ts +22 -0
- package/dist/src/tools/ast-grep.js +291 -0
- package/dist/src/tools/ast-grep.js.map +1 -0
- package/dist/src/tools/check-async-tasks.d.ts +46 -0
- package/dist/src/tools/check-async-tasks.js +241 -0
- package/dist/src/tools/check-async-tasks.js.map +1 -0
- package/dist/src/tools/codesearch.d.ts +25 -0
- package/dist/src/tools/codesearch.js +153 -0
- package/dist/src/tools/codesearch.js.map +1 -0
- package/dist/src/tools/delete_line_range.d.ts +41 -0
- package/dist/src/tools/delete_line_range.js +238 -0
- package/dist/src/tools/delete_line_range.js.map +1 -0
- package/dist/src/tools/direct-web-fetch.d.ts +22 -0
- package/dist/src/tools/direct-web-fetch.js +215 -0
- package/dist/src/tools/direct-web-fetch.js.map +1 -0
- package/dist/src/tools/edit-utils.d.ts +53 -0
- package/dist/src/tools/edit-utils.js +250 -0
- package/dist/src/tools/edit-utils.js.map +1 -0
- package/dist/src/tools/edit.d.ts +70 -0
- package/dist/src/tools/edit.js +816 -0
- package/dist/src/tools/edit.js.map +1 -0
- package/dist/src/tools/exa-web-search.d.ts +27 -0
- package/dist/src/tools/exa-web-search.js +153 -0
- package/dist/src/tools/exa-web-search.js.map +1 -0
- package/dist/src/tools/glob.d.ts +55 -0
- package/dist/src/tools/glob.js +284 -0
- package/dist/src/tools/glob.js.map +1 -0
- package/dist/src/tools/google-web-fetch.d.ts +34 -0
- package/dist/src/tools/google-web-fetch.js +417 -0
- package/dist/src/tools/google-web-fetch.js.map +1 -0
- package/dist/src/tools/google-web-search-invocation.d.ts +53 -0
- package/dist/src/tools/google-web-search-invocation.js +180 -0
- package/dist/src/tools/google-web-search-invocation.js.map +1 -0
- package/dist/src/tools/google-web-search.d.ts +16 -0
- package/dist/src/tools/google-web-search.js +34 -0
- package/dist/src/tools/google-web-search.js.map +1 -0
- package/dist/src/tools/grep.d.ts +56 -0
- package/dist/src/tools/grep.js +883 -0
- package/dist/src/tools/grep.js.map +1 -0
- package/dist/src/tools/insert_at_line.d.ts +41 -0
- package/dist/src/tools/insert_at_line.js +287 -0
- package/dist/src/tools/insert_at_line.js.map +1 -0
- package/dist/src/tools/list-subagents.d.ts +31 -0
- package/dist/src/tools/list-subagents.js +122 -0
- package/dist/src/tools/list-subagents.js.map +1 -0
- package/dist/src/tools/ls.d.ts +71 -0
- package/dist/src/tools/ls.js +238 -0
- package/dist/src/tools/ls.js.map +1 -0
- package/dist/src/tools/memoryTool.d.ts +66 -0
- package/dist/src/tools/memoryTool.js +435 -0
- package/dist/src/tools/memoryTool.js.map +1 -0
- package/dist/src/tools/modifiable-tool.d.ts +37 -0
- package/dist/src/tools/modifiable-tool.js +120 -0
- package/dist/src/tools/modifiable-tool.js.map +1 -0
- package/dist/src/tools/read-file.d.ts +49 -0
- package/dist/src/tools/read-file.js +279 -0
- package/dist/src/tools/read-file.js.map +1 -0
- package/dist/src/tools/read-many-files.d.ts +60 -0
- package/dist/src/tools/read-many-files.js +529 -0
- package/dist/src/tools/read-many-files.js.map +1 -0
- package/dist/src/tools/read_line_range.d.ts +47 -0
- package/dist/src/tools/read_line_range.js +248 -0
- package/dist/src/tools/read_line_range.js.map +1 -0
- package/dist/src/tools/ripGrep.d.ts +41 -0
- package/dist/src/tools/ripGrep.js +395 -0
- package/dist/src/tools/ripGrep.js.map +1 -0
- package/dist/src/tools/shell.d.ts +60 -0
- package/dist/src/tools/shell.js +735 -0
- package/dist/src/tools/shell.js.map +1 -0
- package/dist/src/tools/structural-analysis.d.ts +27 -0
- package/dist/src/tools/structural-analysis.js +1089 -0
- package/dist/src/tools/structural-analysis.js.map +1 -0
- package/dist/src/tools/stubs.d.ts +10 -0
- package/dist/src/tools/stubs.js +6 -0
- package/dist/src/tools/stubs.js.map +1 -0
- package/dist/src/tools/task.d.ts +41 -0
- package/dist/src/tools/task.js +195 -0
- package/dist/src/tools/task.js.map +1 -0
- package/dist/src/tools/todo-events.d.ts +22 -0
- package/dist/src/tools/todo-events.js +24 -0
- package/dist/src/tools/todo-events.js.map +1 -0
- package/dist/src/tools/todo-pause.d.ts +29 -0
- package/dist/src/tools/todo-pause.js +172 -0
- package/dist/src/tools/todo-pause.js.map +1 -0
- package/dist/src/tools/todo-read.d.ts +18 -0
- package/dist/src/tools/todo-read.js +98 -0
- package/dist/src/tools/todo-read.js.map +1 -0
- package/dist/src/tools/todo-store.d.ts +35 -0
- package/dist/src/tools/todo-store.js +124 -0
- package/dist/src/tools/todo-store.js.map +1 -0
- package/dist/src/tools/todo-write.d.ts +29 -0
- package/dist/src/tools/todo-write.js +366 -0
- package/dist/src/tools/todo-write.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +156 -0
- package/dist/src/tools/tool-registry.js +623 -0
- package/dist/src/tools/tool-registry.js.map +1 -0
- package/dist/src/tools/tools.d.ts +403 -0
- package/dist/src/tools/tools.js +519 -0
- package/dist/src/tools/tools.js.map +1 -0
- package/dist/src/tools/write-file.d.ts +45 -0
- package/dist/src/tools/write-file.js +320 -0
- package/dist/src/tools/write-file.js.map +1 -0
- package/dist/src/types/index.d.ts +17 -0
- package/dist/src/types/index.js +9 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/provider-content-types.d.ts +56 -0
- package/dist/src/types/provider-content-types.js +6 -0
- package/dist/src/types/provider-content-types.js.map +1 -0
- package/dist/src/types/todo-schemas.d.ts +263 -0
- package/dist/src/types/todo-schemas.js +32 -0
- package/dist/src/types/todo-schemas.js.map +1 -0
- package/dist/src/types/tool-confirmation-types.d.ts +34 -0
- package/dist/src/types/tool-confirmation-types.js +29 -0
- package/dist/src/types/tool-confirmation-types.js.map +1 -0
- package/dist/src/types/tool-context.d.ts +31 -0
- package/dist/src/types/tool-context.js +6 -0
- package/dist/src/types/tool-context.js.map +1 -0
- package/dist/src/types/tool-error.d.ts +69 -0
- package/dist/src/types/tool-error.js +94 -0
- package/dist/src/types/tool-error.js.map +1 -0
- package/dist/src/types/tool-names.d.ts +57 -0
- package/dist/src/types/tool-names.js +64 -0
- package/dist/src/types/tool-names.js.map +1 -0
- package/dist/src/utils/EmojiFilter.d.ts +134 -0
- package/dist/src/utils/EmojiFilter.js +370 -0
- package/dist/src/utils/EmojiFilter.js.map +1 -0
- package/dist/src/utils/ast-grep-utils.d.ts +42 -0
- package/dist/src/utils/ast-grep-utils.js +140 -0
- package/dist/src/utils/ast-grep-utils.js.map +1 -0
- package/dist/src/utils/debugLogger.d.ts +11 -0
- package/dist/src/utils/debugLogger.js +16 -0
- package/dist/src/utils/debugLogger.js.map +1 -0
- package/dist/src/utils/diffOptions.d.ts +14 -0
- package/dist/src/utils/diffOptions.js +46 -0
- package/dist/src/utils/diffOptions.js.map +1 -0
- package/dist/src/utils/editor.d.ts +39 -0
- package/dist/src/utils/editor.js +212 -0
- package/dist/src/utils/editor.js.map +1 -0
- package/dist/src/utils/ensure-dirs.d.ts +10 -0
- package/dist/src/utils/ensure-dirs.js +16 -0
- package/dist/src/utils/ensure-dirs.js.map +1 -0
- package/dist/src/utils/errors.d.ts +59 -0
- package/dist/src/utils/errors.js +178 -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 +74 -0
- package/dist/src/utils/fetch.js.map +1 -0
- package/dist/src/utils/fileUtils.d.ts +32 -0
- package/dist/src/utils/fileUtils.js +363 -0
- package/dist/src/utils/fileUtils.js.map +1 -0
- package/dist/src/utils/fuzzy-replacer.d.ts +61 -0
- package/dist/src/utils/fuzzy-replacer.js +492 -0
- package/dist/src/utils/fuzzy-replacer.js.map +1 -0
- package/dist/src/utils/gitLineChanges.d.ts +12 -0
- package/dist/src/utils/gitLineChanges.js +171 -0
- package/dist/src/utils/gitLineChanges.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +6 -0
- package/dist/src/utils/gitUtils.js +31 -0
- package/dist/src/utils/gitUtils.js.map +1 -0
- package/dist/src/utils/lsp-diagnostics-helper.d.ts +27 -0
- package/dist/src/utils/lsp-diagnostics-helper.js +62 -0
- package/dist/src/utils/lsp-diagnostics-helper.js.map +1 -0
- package/dist/src/utils/mediaUtils.d.ts +38 -0
- package/dist/src/utils/mediaUtils.js +22 -0
- package/dist/src/utils/mediaUtils.js.map +1 -0
- package/dist/src/utils/pathValidation.d.ts +7 -0
- package/dist/src/utils/pathValidation.js +39 -0
- package/dist/src/utils/pathValidation.js.map +1 -0
- package/dist/src/utils/paths.d.ts +7 -0
- package/dist/src/utils/paths.js +158 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/resolveTextSearchTarget.d.ts +17 -0
- package/dist/src/utils/resolveTextSearchTarget.js +45 -0
- package/dist/src/utils/resolveTextSearchTarget.js.map +1 -0
- package/dist/src/utils/retry.d.ts +17 -0
- package/dist/src/utils/retry.js +185 -0
- package/dist/src/utils/retry.js.map +1 -0
- package/dist/src/utils/ripgrepPathResolver.d.ts +23 -0
- package/dist/src/utils/ripgrepPathResolver.js +179 -0
- package/dist/src/utils/ripgrepPathResolver.js.map +1 -0
- package/dist/src/utils/safeJsonStringify.d.ts +9 -0
- package/dist/src/utils/safeJsonStringify.js +21 -0
- package/dist/src/utils/safeJsonStringify.js.map +1 -0
- package/dist/src/utils/schemaValidator.d.ts +13 -0
- package/dist/src/utils/schemaValidator.js +275 -0
- package/dist/src/utils/schemaValidator.js.map +1 -0
- package/dist/src/utils/terminalSerializer.d.ts +33 -0
- package/dist/src/utils/terminalSerializer.js +6 -0
- package/dist/src/utils/terminalSerializer.js.map +1 -0
- package/dist/src/utils/todoContextTracker.d.ts +12 -0
- package/dist/src/utils/todoContextTracker.js +28 -0
- package/dist/src/utils/todoContextTracker.js.map +1 -0
- package/dist/src/utils/todoFormatter.d.ts +24 -0
- package/dist/src/utils/todoFormatter.js +157 -0
- package/dist/src/utils/todoFormatter.js.map +1 -0
- package/dist/src/utils/todoReminderService.d.ts +22 -0
- package/dist/src/utils/todoReminderService.js +43 -0
- package/dist/src/utils/todoReminderService.js.map +1 -0
- package/dist/src/utils/tool-key-storage-facade.d.ts +32 -0
- package/dist/src/utils/tool-key-storage-facade.js +56 -0
- package/dist/src/utils/tool-key-storage-facade.js.map +1 -0
- package/dist/src/utils/tool-key-storage-types.d.ts +56 -0
- package/dist/src/utils/tool-key-storage-types.js +56 -0
- package/dist/src/utils/tool-key-storage-types.js.map +1 -0
- package/dist/src/utils/toolOutputLimiter.d.ts +29 -0
- package/dist/src/utils/toolOutputLimiter.js +107 -0
- package/dist/src/utils/toolOutputLimiter.js.map +1 -0
- package/dist/src/utils/unicodeUtils.d.ts +55 -0
- package/dist/src/utils/unicodeUtils.js +129 -0
- package/dist/src/utils/unicodeUtils.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/* eslint-disable complexity, sonarjs/cognitive-complexity -- Phase 5: legacy core boundary retained while larger decomposition continues. */
|
|
7
|
+
import fs from 'fs';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import * as Diff from 'diff';
|
|
10
|
+
import { BaseDeclarativeTool, BaseToolInvocation, Kind, ToolConfirmationOutcome, } from './tools.js';
|
|
11
|
+
import { ToolErrorType } from '../types/tool-error.js';
|
|
12
|
+
import { makeRelative, shortenPath } from '../utils/paths.js';
|
|
13
|
+
import { getErrorMessage, isNodeError } from '../utils/errors.js';
|
|
14
|
+
import { DEFAULT_CREATE_PATCH_OPTIONS, getDiffStat, } from '../utils/diffOptions.js';
|
|
15
|
+
import { getSpecificMimeType } from '../utils/fileUtils.js';
|
|
16
|
+
import { debugLogger } from '../utils/debugLogger.js';
|
|
17
|
+
import { validatePathWithinWorkspace } from '../utils/pathValidation.js';
|
|
18
|
+
/**
|
|
19
|
+
* Gets corrected file content — preserves trailing newline for existing files.
|
|
20
|
+
*/
|
|
21
|
+
async function getCorrectedFileContent(filePath, proposedContent, host) {
|
|
22
|
+
let originalContent = '';
|
|
23
|
+
let fileExists = false;
|
|
24
|
+
let correctedContent = proposedContent;
|
|
25
|
+
try {
|
|
26
|
+
originalContent = await fs.promises.readFile(filePath, 'utf-8');
|
|
27
|
+
fileExists = true;
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
if (isNodeError(err) && err.code === 'ENOENT') {
|
|
31
|
+
fileExists = false;
|
|
32
|
+
originalContent = '';
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
fileExists = true;
|
|
36
|
+
originalContent = '';
|
|
37
|
+
const error = {
|
|
38
|
+
message: getErrorMessage(err),
|
|
39
|
+
code: isNodeError(err) ? err.code : undefined,
|
|
40
|
+
};
|
|
41
|
+
return { originalContent, correctedContent, fileExists, error };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
correctedContent = proposedContent;
|
|
45
|
+
const preserveTrailingNewline = fileExists && originalContent.endsWith('\n');
|
|
46
|
+
if (preserveTrailingNewline &&
|
|
47
|
+
correctedContent.length > 0 &&
|
|
48
|
+
!correctedContent.endsWith('\n')) {
|
|
49
|
+
correctedContent = `${correctedContent}\n`;
|
|
50
|
+
}
|
|
51
|
+
return { originalContent, correctedContent, fileExists };
|
|
52
|
+
}
|
|
53
|
+
class WriteFileToolInvocation extends BaseToolInvocation {
|
|
54
|
+
host;
|
|
55
|
+
constructor(host, params, messageBus, toolName, displayName) {
|
|
56
|
+
super(params, messageBus, toolName, displayName);
|
|
57
|
+
this.host = host;
|
|
58
|
+
}
|
|
59
|
+
getToolName() {
|
|
60
|
+
return WriteFileTool.Name;
|
|
61
|
+
}
|
|
62
|
+
getFilePath() {
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentional falsy coalescing: empty string paths are invalid, fall back to file_path
|
|
64
|
+
return this.params.absolute_path || this.params.file_path || '';
|
|
65
|
+
}
|
|
66
|
+
toolLocations() {
|
|
67
|
+
return [{ path: this.getFilePath() }];
|
|
68
|
+
}
|
|
69
|
+
getDescription() {
|
|
70
|
+
const filePath = this.getFilePath();
|
|
71
|
+
if (!filePath || !this.params.content) {
|
|
72
|
+
return `Model did not provide valid parameters for write file tool`;
|
|
73
|
+
}
|
|
74
|
+
const relativePath = makeRelative(filePath, this.host.getTargetDir());
|
|
75
|
+
return `Writing to ${shortenPath(relativePath)}`;
|
|
76
|
+
}
|
|
77
|
+
async shouldConfirmExecute(abortSignal) {
|
|
78
|
+
if (this.messageBus) {
|
|
79
|
+
const decision = await this.getMessageBusDecision(abortSignal);
|
|
80
|
+
if (decision === 'ALLOW') {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (decision === 'DENY') {
|
|
84
|
+
throw new Error('Tool execution denied by policy.');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (this.host.getApprovalMode() === 'auto') {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
const filePath = this.getFilePath();
|
|
91
|
+
const correctedContentResult = await getCorrectedFileContent(filePath, this.params.content, this.host);
|
|
92
|
+
const fileName = path.basename(filePath);
|
|
93
|
+
const originalContent = correctedContentResult.originalContent;
|
|
94
|
+
const newContent = correctedContentResult.correctedContent;
|
|
95
|
+
const fileDiff = Diff.createPatch(fileName, originalContent, newContent, 'Original', 'Written', DEFAULT_CREATE_PATCH_OPTIONS);
|
|
96
|
+
return {
|
|
97
|
+
type: 'edit',
|
|
98
|
+
title: 'Confirm Write File',
|
|
99
|
+
fileName,
|
|
100
|
+
filePath,
|
|
101
|
+
fileDiff,
|
|
102
|
+
originalContent,
|
|
103
|
+
newContent,
|
|
104
|
+
onConfirm: async (outcome) => {
|
|
105
|
+
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
|
106
|
+
this.host.setApprovalMode('auto');
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
await this.publishPolicyUpdate(outcome);
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
async execute(_abortSignal) {
|
|
115
|
+
const filePath = this.getFilePath();
|
|
116
|
+
const correctedContentResult = await getCorrectedFileContent(filePath, this.params.content, this.host);
|
|
117
|
+
if (correctedContentResult.error) {
|
|
118
|
+
const errDetails = correctedContentResult.error;
|
|
119
|
+
const errorMsg = errDetails.code
|
|
120
|
+
? `Error checking existing file '${filePath}': ${errDetails.message} (${errDetails.code})`
|
|
121
|
+
: `Error checking existing file: ${errDetails.message}`;
|
|
122
|
+
return {
|
|
123
|
+
llmContent: errorMsg,
|
|
124
|
+
returnDisplay: errorMsg,
|
|
125
|
+
error: {
|
|
126
|
+
message: errorMsg,
|
|
127
|
+
type: ToolErrorType.FILE_WRITE_FAILURE,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const { originalContent, correctedContent: fileContent, fileExists, } = correctedContentResult;
|
|
132
|
+
const isNewFile = !fileExists;
|
|
133
|
+
try {
|
|
134
|
+
return await this.writeFile(filePath, fileContent, originalContent, isNewFile);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
return this.createWriteError(filePath, error);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async writeFile(filePath, fileContent, originalContent, isNewFile) {
|
|
141
|
+
const dirName = path.dirname(filePath);
|
|
142
|
+
if (!fs.existsSync(dirName)) {
|
|
143
|
+
fs.mkdirSync(dirName, { recursive: true });
|
|
144
|
+
}
|
|
145
|
+
fs.writeFileSync(filePath, fileContent, 'utf-8');
|
|
146
|
+
const fileName = path.basename(filePath);
|
|
147
|
+
const fileDiff = Diff.createPatch(fileName, originalContent, fileContent, 'Original', 'Written', DEFAULT_CREATE_PATCH_OPTIONS);
|
|
148
|
+
const originallyProposedContent = this.params.ai_proposed_content ?? this.params.content;
|
|
149
|
+
const diffStat = getDiffStat(fileName, originalContent, originallyProposedContent, this.params.content);
|
|
150
|
+
const llmSuccessMessageParts = this.buildSuccessMessageParts(isNewFile);
|
|
151
|
+
this.recordMetrics(filePath, fileContent, isNewFile, diffStat);
|
|
152
|
+
const displayResult = {
|
|
153
|
+
fileDiff,
|
|
154
|
+
fileName,
|
|
155
|
+
filePath,
|
|
156
|
+
originalContent,
|
|
157
|
+
newContent: fileContent,
|
|
158
|
+
diffStat,
|
|
159
|
+
isNewFile,
|
|
160
|
+
};
|
|
161
|
+
const result = {
|
|
162
|
+
llmContent: llmSuccessMessageParts.join('\n\n'),
|
|
163
|
+
returnDisplay: displayResult,
|
|
164
|
+
};
|
|
165
|
+
return result;
|
|
166
|
+
}
|
|
167
|
+
buildSuccessMessageParts(isNewFile) {
|
|
168
|
+
const displayPath =
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentional falsy coalescing: empty string paths are invalid, fall back to file_path
|
|
170
|
+
this.params.absolute_path || this.params.file_path || '';
|
|
171
|
+
const parts = [
|
|
172
|
+
isNewFile
|
|
173
|
+
? `Successfully created and wrote to new file: ${displayPath}.`
|
|
174
|
+
: `Successfully overwrote file: ${displayPath}.`,
|
|
175
|
+
];
|
|
176
|
+
if (this.params.modified_by_user === true) {
|
|
177
|
+
parts.push(`User modified the \`content\` to be: ${this.params.content}`);
|
|
178
|
+
}
|
|
179
|
+
return parts;
|
|
180
|
+
}
|
|
181
|
+
recordMetrics(filePath, fileContent, isNewFile, diffStat) {
|
|
182
|
+
const lines = fileContent.split('\n').length;
|
|
183
|
+
const mimetype = getSpecificMimeType(filePath);
|
|
184
|
+
const extension = path.extname(filePath);
|
|
185
|
+
void lines;
|
|
186
|
+
void mimetype;
|
|
187
|
+
void extension;
|
|
188
|
+
void diffStat;
|
|
189
|
+
void isNewFile;
|
|
190
|
+
// Metrics recording deferred to core adapter layer
|
|
191
|
+
}
|
|
192
|
+
createWriteError(filePath, error) {
|
|
193
|
+
let errorMsg;
|
|
194
|
+
let errorType = ToolErrorType.FILE_WRITE_FAILURE;
|
|
195
|
+
if (isNodeError(error)) {
|
|
196
|
+
errorMsg = `Error writing to file '${filePath}': ${error.message} (${error.code})`;
|
|
197
|
+
if (error.code === 'EACCES') {
|
|
198
|
+
errorMsg = `Permission denied writing to file: ${filePath} (${error.code})`;
|
|
199
|
+
errorType = ToolErrorType.PERMISSION_DENIED;
|
|
200
|
+
}
|
|
201
|
+
else if (error.code === 'ENOSPC') {
|
|
202
|
+
errorMsg = `No space left on device: ${filePath} (${error.code})`;
|
|
203
|
+
errorType = ToolErrorType.NO_SPACE_LEFT;
|
|
204
|
+
}
|
|
205
|
+
else if (error.code === 'EISDIR') {
|
|
206
|
+
errorMsg = `Target is a directory, not a file: ${filePath} (${error.code})`;
|
|
207
|
+
errorType = ToolErrorType.TARGET_IS_DIRECTORY;
|
|
208
|
+
}
|
|
209
|
+
if (this.host.getDebugMode() && error.stack) {
|
|
210
|
+
debugLogger.error('Write file error stack:', error.stack);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else if (error instanceof Error) {
|
|
214
|
+
errorMsg = `Error writing to file: ${error.message}`;
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
errorMsg = `Error writing to file: ${String(error)}`;
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
llmContent: errorMsg,
|
|
221
|
+
returnDisplay: errorMsg,
|
|
222
|
+
error: {
|
|
223
|
+
message: errorMsg,
|
|
224
|
+
type: errorType,
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Implementation of the WriteFile tool logic
|
|
231
|
+
*/
|
|
232
|
+
export class WriteFileTool extends BaseDeclarativeTool {
|
|
233
|
+
host;
|
|
234
|
+
static Name = 'write_file';
|
|
235
|
+
constructor(host, messageBus) {
|
|
236
|
+
super(WriteFileTool.Name, 'WriteFile', `Writes content to a specified file in the local filesystem.
|
|
237
|
+
|
|
238
|
+
The user has the ability to modify \`content\`. If modified, this will be stated in the response.`, Kind.Edit, {
|
|
239
|
+
properties: {
|
|
240
|
+
absolute_path: {
|
|
241
|
+
description: "The absolute path to the file to write to (e.g., '/home/user/project/file.txt'). Relative paths are not supported.",
|
|
242
|
+
type: 'string',
|
|
243
|
+
},
|
|
244
|
+
file_path: {
|
|
245
|
+
description: 'Alternative parameter name for absolute_path (for compatibility). The absolute path to the file to write.',
|
|
246
|
+
type: 'string',
|
|
247
|
+
},
|
|
248
|
+
content: {
|
|
249
|
+
description: 'The content to write to the file.',
|
|
250
|
+
type: 'string',
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
required: ['content'],
|
|
254
|
+
type: 'object',
|
|
255
|
+
}, true, false, messageBus);
|
|
256
|
+
this.host = host;
|
|
257
|
+
}
|
|
258
|
+
validateToolParamValues(params) {
|
|
259
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentional falsy coalescing: empty string paths are invalid
|
|
260
|
+
const filePath = params.absolute_path || params.file_path || '';
|
|
261
|
+
if (filePath.trim() === '') {
|
|
262
|
+
return "Either 'absolute_path' or 'file_path' parameter must be provided and non-empty.";
|
|
263
|
+
}
|
|
264
|
+
if (!path.isAbsolute(filePath)) {
|
|
265
|
+
return `File path must be absolute: ${filePath}`;
|
|
266
|
+
}
|
|
267
|
+
const pathError = validatePathWithinWorkspace(this.host.getWorkspaceRoots(), filePath);
|
|
268
|
+
if (pathError) {
|
|
269
|
+
return pathError;
|
|
270
|
+
}
|
|
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
|
+
}
|
|
278
|
+
}
|
|
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, messageBus, toolName, displayName) {
|
|
285
|
+
const normalizedParams = { ...params };
|
|
286
|
+
if (!normalizedParams.absolute_path && normalizedParams.file_path) {
|
|
287
|
+
normalizedParams.absolute_path = normalizedParams.file_path;
|
|
288
|
+
}
|
|
289
|
+
return new WriteFileToolInvocation(this.host, normalizedParams, messageBus, toolName ?? this.name, displayName ?? this.displayName);
|
|
290
|
+
}
|
|
291
|
+
getModifyContext(_abortSignal) {
|
|
292
|
+
return {
|
|
293
|
+
getFilePath: (params) =>
|
|
294
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentional falsy coalescing: empty string paths are invalid, fall back to file_path
|
|
295
|
+
params.absolute_path || params.file_path || '',
|
|
296
|
+
getCurrentContent: async (params) => {
|
|
297
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentional falsy coalescing: empty string paths are invalid, fall back to file_path
|
|
298
|
+
const filePath = params.absolute_path || params.file_path || '';
|
|
299
|
+
const correctedContentResult = await getCorrectedFileContent(filePath, params.content, this.host);
|
|
300
|
+
return correctedContentResult.originalContent;
|
|
301
|
+
},
|
|
302
|
+
getProposedContent: async (params) => {
|
|
303
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentional falsy coalescing: empty string paths are invalid, fall back to file_path
|
|
304
|
+
const filePath = params.absolute_path || params.file_path || '';
|
|
305
|
+
const correctedContentResult = await getCorrectedFileContent(filePath, params.content, this.host);
|
|
306
|
+
return correctedContentResult.correctedContent;
|
|
307
|
+
},
|
|
308
|
+
createUpdatedParams: (_oldContent, modifiedProposedContent, originalParams) => {
|
|
309
|
+
const content = originalParams.content;
|
|
310
|
+
return {
|
|
311
|
+
...originalParams,
|
|
312
|
+
ai_proposed_content: content,
|
|
313
|
+
content: modifiedProposedContent,
|
|
314
|
+
modified_by_user: true,
|
|
315
|
+
};
|
|
316
|
+
},
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=write-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-file.js","sourceRoot":"","sources":["../../../src/tools/write-file.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6IAA6I;AAE7I,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAGlB,IAAI,EAIJ,uBAAuB,GACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EACL,4BAA4B,EAC5B,WAAW,GACZ,MA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O,sBAAsB,CAAC,gBAAgB,CAAC;YACjD,CAAC;YACD,mBAAmB,EAAE,CACnB,WAAmB,EACnB,uBAA+B,EAC/B,cAAmC,EACnC,EAAE;gBACF,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;gBACvC,OAAO;oBACL,GAAG,cAAc;oBACjB,mBAAmB,EAAE,OAAO;oBAC5B,OAAO,EAAE,uBAAuB;oBAChC,gBAAgB,EAAE,IAAI;iBACvB,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @plan:PLAN-20260608-ISSUE1585.P05
|
|
3
|
+
* @requirement:REQ-API-001
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2025 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Barrel export for package-local types.
|
|
12
|
+
*/
|
|
13
|
+
export type { ToolContext, ContextAwareTool } from './tool-context.js';
|
|
14
|
+
export { ToolConfirmationOutcome, type ToolConfirmationPayload, } from './tool-confirmation-types.js';
|
|
15
|
+
export { ToolErrorType, isFatalToolError } from './tool-error.js';
|
|
16
|
+
export { GOOGLE_WEB_SEARCH_TOOL, EXA_WEB_SEARCH_TOOL, EDIT_TOOL_NAME, GREP_TOOL_NAME, READ_MANY_FILES_TOOL_NAME, READ_FILE_TOOL_NAME, LS_TOOL_NAME, MEMORY_TOOL_NAME, ACTIVATE_SKILL_TOOL_NAME, READ_FILE_TOOL, WRITE_FILE_TOOL, EDIT_TOOL, INSERT_AT_LINE_TOOL, DELETE_LINE_RANGE_TOOL, READ_LINE_RANGE_TOOL, READ_MANY_FILES_TOOL, GREP_TOOL, RIPGREP_TOOL, GLOB_TOOL, LS_TOOL, LIST_DIRECTORY_TOOL, CODE_SEARCH_TOOL, GOOGLE_WEB_FETCH_TOOL, DIRECT_WEB_FETCH_TOOL, TASK_TOOL, MEMORY_TOOL, TODO_READ_TOOL, TODO_WRITE_TOOL, TODO_PAUSE_TOOL, LIST_SUBAGENTS_TOOL, SHELL_TOOL, AST_GREP_TOOL, STRUCTURAL_ANALYSIS_TOOL, APPLY_PATCH_TOOL, EDIT_TOOL_NAMES, type ToolName, } from './tool-names.js';
|
|
17
|
+
export { TodoStatus, TodoToolCallSchema, SubtaskSchema, TodoSchema, TodoArraySchema, type TodoToolCall, type Subtask, type Todo, } from './todo-schemas.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @plan:PLAN-20260608-ISSUE1585.P05
|
|
3
|
+
* @requirement:REQ-API-001
|
|
4
|
+
*/
|
|
5
|
+
export { ToolConfirmationOutcome, } from './tool-confirmation-types.js';
|
|
6
|
+
export { ToolErrorType, isFatalToolError } from './tool-error.js';
|
|
7
|
+
export { GOOGLE_WEB_SEARCH_TOOL, EXA_WEB_SEARCH_TOOL, EDIT_TOOL_NAME, GREP_TOOL_NAME, READ_MANY_FILES_TOOL_NAME, READ_FILE_TOOL_NAME, LS_TOOL_NAME, MEMORY_TOOL_NAME, ACTIVATE_SKILL_TOOL_NAME, READ_FILE_TOOL, WRITE_FILE_TOOL, EDIT_TOOL, INSERT_AT_LINE_TOOL, DELETE_LINE_RANGE_TOOL, READ_LINE_RANGE_TOOL, READ_MANY_FILES_TOOL, GREP_TOOL, RIPGREP_TOOL, GLOB_TOOL, LS_TOOL, LIST_DIRECTORY_TOOL, CODE_SEARCH_TOOL, GOOGLE_WEB_FETCH_TOOL, DIRECT_WEB_FETCH_TOOL, TASK_TOOL, MEMORY_TOOL, TODO_READ_TOOL, TODO_WRITE_TOOL, TODO_PAUSE_TOOL, LIST_SUBAGENTS_TOOL, SHELL_TOOL, AST_GREP_TOOL, STRUCTURAL_ANALYSIS_TOOL, APPLY_PATCH_TOOL, EDIT_TOOL_NAMES, } from './tool-names.js';
|
|
8
|
+
export { TodoStatus, TodoToolCallSchema, SubtaskSchema, TodoSchema, TodoArraySchema, } from './todo-schemas.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,EACL,uBAAuB,GAExB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,SAAS,EACT,YAAY,EACZ,SAAS,EACT,OAAO,EACP,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,SAAS,EACT,WAAW,EACX,cAAc,EACd,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,eAAe,GAIhB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @plan:PLAN-20260608-ISSUE1585.P11
|
|
3
|
+
* @requirement:REQ-PKG-BOUNDARY
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2025 Vybestack LLC
|
|
8
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Tools-owned structural replacement types for provider content shapes.
|
|
12
|
+
*
|
|
13
|
+
* These replace imports from packages/core/src/runtime/contracts and
|
|
14
|
+
* packages/core/src/services/history that would create forbidden
|
|
15
|
+
* dependencies. Moved tool files MUST import from this module instead.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Tools-owned structural replacement for RuntimeProviderChat.
|
|
19
|
+
* Replaces import from packages/core/src/runtime/contracts/RuntimeProviderChat.
|
|
20
|
+
* Shape matches the provider content fields that ToolFormatter and tool registry consume.
|
|
21
|
+
*/
|
|
22
|
+
export interface ProviderChatContent {
|
|
23
|
+
role: string;
|
|
24
|
+
content?: string;
|
|
25
|
+
toolCalls?: ProviderToolCallBlock[];
|
|
26
|
+
toolResults?: ProviderToolResultBlock[];
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Tools-owned structural replacement for tool call blocks in history content.
|
|
31
|
+
* Replaces import from packages/core/src/services/history IContent shapes.
|
|
32
|
+
*/
|
|
33
|
+
export interface ProviderToolCallBlock {
|
|
34
|
+
id: string;
|
|
35
|
+
type: 'function';
|
|
36
|
+
function: {
|
|
37
|
+
name: string;
|
|
38
|
+
arguments: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Tools-owned structural replacement for tool result blocks in history content.
|
|
43
|
+
*/
|
|
44
|
+
export interface ProviderToolResultBlock {
|
|
45
|
+
toolCallId: string;
|
|
46
|
+
output: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Tools-owned structural type for RuntimeProviderTool.
|
|
50
|
+
* Replaces import from packages/core/src/runtime/contracts.
|
|
51
|
+
*/
|
|
52
|
+
export interface ProviderToolDefinition {
|
|
53
|
+
name: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
inputSchema?: Record<string, unknown>;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-content-types.js","sourceRoot":"","sources":["../../../src/types/provider-content-types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|