@dimivelev/chimera 0.78.0
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/CHANGELOG.md +4443 -0
- package/README.md +600 -0
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +9 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -0
- package/dist/bun/register-bedrock.js +4 -0
- package/dist/bun/register-bedrock.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +13 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +32 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/cli/args.d.ts +56 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +368 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/config-selector.d.ts +14 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +31 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +82 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/initial-message.d.ts +18 -0
- package/dist/cli/initial-message.d.ts.map +1 -0
- package/dist/cli/initial-message.js +22 -0
- package/dist/cli/initial-message.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +98 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/session-picker.d.ts +9 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +35 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +18 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +92 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +428 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +117 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +300 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +87 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +119 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session.d.ts +604 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +2526 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +141 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +442 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +32 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +111 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +88 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +243 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +121 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +619 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +38 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +153 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/defaults.d.ts +3 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +2 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +75 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +37 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +226 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1851 -0
- package/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +108 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +6 -0
- package/dist/core/extensions/index.d.ts +12 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +24 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +481 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +160 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +836 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1178 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +45 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +22 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +54 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +338 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +21 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +48 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +12 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/keybindings.d.ts +353 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +295 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/messages.d.ts +77 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +123 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-registry.d.ts +150 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +784 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +110 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +495 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/output-guard.d.ts +7 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +89 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +204 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +2040 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +52 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +238 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-display-names.d.ts +2 -0
- package/dist/core/provider-display-names.d.ts.map +1 -0
- package/dist/core/provider-display-names.js +33 -0
- package/dist/core/provider-display-names.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +31 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +249 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +194 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +734 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/sdk.d.ts +109 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +291 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/session-manager.d.ts +332 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1218 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-manager.d.ts +266 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +800 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +60 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +387 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +14 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +25 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/source-info.d.ts +18 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +19 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/system-prompt.d.ts +28 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +120 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/telemetry.d.ts +3 -0
- package/dist/core/telemetry.d.ts.map +1 -0
- package/dist/core/telemetry.js +9 -0
- package/dist/core/telemetry.js.map +1 -0
- package/dist/core/timings.d.ts +8 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +31 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +68 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +337 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +87 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +345 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +51 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +284 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +52 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +35 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +297 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +37 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +304 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +40 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +112 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +37 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +167 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +99 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/read.d.ts +35 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +289 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +65 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +34 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +70 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +215 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +26 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +197 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +12 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +631 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +33 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +398 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +9 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +333 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +20 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +121 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +175 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +54 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +71 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +506 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +70 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +79 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/dist/modes/interactive/components/daxnuts.js +140 -0
- package/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.js +40 -0
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +20 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +119 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-input.js +61 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +26 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +83 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +28 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +210 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +32 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +33 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +183 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +47 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +278 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +31 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +165 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +290 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +96 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +861 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +69 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +390 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +39 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +50 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +51 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +63 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +295 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +89 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +1093 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +114 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +10 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +29 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +373 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +4723 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +86 -0
- package/dist/modes/interactive/theme/light.json +85 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +100 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +1034 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/print-mode.d.ts +28 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +132 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +227 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +467 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +616 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +420 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/package-manager-cli.d.ts +4 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +515 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +52 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +21 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +87 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/child-process.d.ts +15 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +88 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/chimera-user-agent.d.ts +2 -0
- package/dist/utils/chimera-user-agent.d.ts.map +1 -0
- package/dist/utils/chimera-user-agent.js +5 -0
- package/dist/utils/chimera-user-agent.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +245 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +10 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +20 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +117 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +158 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +26 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +163 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +9 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +39 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +124 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +16 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +97 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/mime.d.ts +3 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +69 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/paths.d.ts +31 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +92 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/photon.d.ts +21 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +121 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/shell.d.ts +30 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +195 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +118 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +3 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +328 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +15 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +82 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/docs/compaction.md +394 -0
- package/docs/custom-provider.md +736 -0
- package/docs/development.md +71 -0
- package/docs/docs.json +148 -0
- package/docs/extensions.md +2613 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +80 -0
- package/docs/json.md +82 -0
- package/docs/keybindings.md +197 -0
- package/docs/models.md +493 -0
- package/docs/packages.md +226 -0
- package/docs/prompt-templates.md +88 -0
- package/docs/providers.md +251 -0
- package/docs/quickstart.md +165 -0
- package/docs/rpc.md +1408 -0
- package/docs/sdk.md +1137 -0
- package/docs/session-format.md +412 -0
- package/docs/sessions.md +145 -0
- package/docs/settings.md +281 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +231 -0
- package/docs/terminal-setup.md +114 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tmux.md +61 -0
- package/docs/tui.md +927 -0
- package/docs/usage.md +288 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +209 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +145 -0
- package/examples/extensions/built-in-tool-renderer.ts +249 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +127 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +400 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +45 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/handoff.ts +191 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +426 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +55 -0
- package/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/examples/extensions/overlay-test.ts +153 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +65 -0
- package/examples/extensions/plan-mode/index.ts +340 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +430 -0
- package/examples/extensions/prompt-customizer.ts +97 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +122 -0
- package/examples/extensions/question.ts +264 -0
- package/examples/extensions/questionnaire.ts +427 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +321 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +175 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +126 -0
- package/examples/extensions/subagent/index.ts +1009 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +206 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/rpc-extension-ui.ts +632 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +53 -0
- package/examples/sdk/03-custom-prompt.ts +70 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/06-extensions.ts +94 -0
- package/examples/sdk/07-context-files.ts +42 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +52 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +77 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +144 -0
- package/node_modules/@anthropic-ai/sdk/CHANGELOG.md +1677 -0
- package/node_modules/@anthropic-ai/sdk/LICENSE +8 -0
- package/node_modules/@anthropic-ai/sdk/README.md +674 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +226 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +223 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.js +6 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/bin/cli +53 -0
- package/node_modules/@anthropic-ai/sdk/bin/migration-config.json +7 -0
- package/node_modules/@anthropic-ai/sdk/client.d.mts +225 -0
- package/node_modules/@anthropic-ai/sdk/client.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/client.d.ts +225 -0
- package/node_modules/@anthropic-ai/sdk/client.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/client.js +536 -0
- package/node_modules/@anthropic-ai/sdk/client.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/client.mjs +531 -0
- package/node_modules/@anthropic-ai/sdk/client.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts +49 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts +49 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js +76 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs +72 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.mts +47 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.ts +47 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/error.js +114 -0
- package/node_modules/@anthropic-ai/sdk/core/error.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/error.mjs +98 -0
- package/node_modules/@anthropic-ai/sdk/core/error.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts +63 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts +63 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.js +123 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs +117 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.js +11 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.mjs +7 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts +31 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts +31 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.js +282 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs +277 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.js +6 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/error.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/error.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/error.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/error.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/error.js +6 -0
- package/node_modules/@anthropic-ai/sdk/error.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/error.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/error.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/index.d.mts +7 -0
- package/node_modules/@anthropic-ai/sdk/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/index.d.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/index.js +35 -0
- package/node_modules/@anthropic-ai/sdk/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/index.mjs +8 -0
- package/node_modules/@anthropic-ai/sdk/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.mts +73 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.ts +73 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.js +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.mts +5 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.ts +5 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.js +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.mjs +12 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js +39 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs +35 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.mts +17 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.ts +17 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.js +113 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs +108 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.mts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.ts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js +162 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs +157 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.js +41 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs +36 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts +22 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts +22 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.js +79 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs +74 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts +17 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts +17 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.js +55 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs +51 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts +34 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts +34 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js +14 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/shim-types.d.mts +28 -0
- package/node_modules/@anthropic-ai/sdk/internal/shim-types.d.ts +28 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts +20 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts +20 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.js +92 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.mjs +85 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.mts +8 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.ts +8 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.js +38 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.mjs +35 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts +45 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts +45 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.js +96 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.mjs +93 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/tslib.js +81 -0
- package/node_modules/@anthropic-ai/sdk/internal/tslib.mjs +17 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.d.mts +67 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.d.ts +67 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.js +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts +42 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts +42 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js +146 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs +136 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.js +38 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs +33 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.mts +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js +31 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs +26 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.mts +9 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.ts +9 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.js +22 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs +18 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts +37 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts +37 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js +86 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +80 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.mts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.ts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.js +58 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs +53 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.mts +5 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.ts +5 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js +19 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts +16 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts +16 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js +109 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs +92 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.mts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.js +11 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.mjs +8 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts +114 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts +114 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +553 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +549 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts +114 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts +114 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +553 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +549 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/package.json +185 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.js +6 -0
- package/node_modules/@anthropic-ai/sdk/pagination.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/pagination.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resource.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/resource.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +61 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +61 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +25 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +20 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +151 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts +151 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js +122 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +118 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +5 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +5 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js +13 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts +343 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts +343 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js +204 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +200 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts +1561 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts +1561 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js +86 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs +81 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts +74 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts +74 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.js +60 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs +56 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts +183 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts +183 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.js +23 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.mjs +19 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.js +15 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs +7 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts +304 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts +304 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js +153 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +149 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +1264 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts +1264 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js +72 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +67 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.d.mts +59 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.d.ts +59 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.js +45 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.mjs +41 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.mts +42 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.ts +42 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.js +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.js +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources.js +5 -0
- package/node_modules/@anthropic-ai/sdk/resources.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/resources.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/README.md +3 -0
- package/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts +264 -0
- package/node_modules/@anthropic-ai/sdk/src/api-promise.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/client.ts +1070 -0
- package/node_modules/@anthropic-ai/sdk/src/core/README.md +3 -0
- package/node_modules/@anthropic-ai/sdk/src/core/api-promise.ts +101 -0
- package/node_modules/@anthropic-ai/sdk/src/core/error.ts +133 -0
- package/node_modules/@anthropic-ai/sdk/src/core/pagination.ts +201 -0
- package/node_modules/@anthropic-ai/sdk/src/core/resource.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/src/core/streaming.ts +331 -0
- package/node_modules/@anthropic-ai/sdk/src/core/uploads.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/error.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/index.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/README.md +3 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/builtin-types.ts +93 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/constants.ts +12 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/decoders/jsonl.ts +48 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/decoders/line.ts +135 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/detect-platform.ts +196 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/errors.ts +33 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/headers.ts +99 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +84 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/request-options.ts +39 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/shim-types.d.ts +28 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/shims.ts +107 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/stream-utils.ts +32 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/to-file.ts +159 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/types.ts +92 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/uploads.ts +193 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/base64.ts +40 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/bytes.ts +32 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/env.ts +18 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/log.ts +127 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/path.ts +65 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/sleep.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/uuid.ts +17 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/values.ts +102 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils.ts +8 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/.keep +4 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +683 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +684 -0
- package/node_modules/@anthropic-ai/sdk/src/pagination.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/resource.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +380 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +258 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +148 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/batches.ts +502 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +135 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +2249 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/models.ts +118 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +231 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/index.ts +121 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/batches.ts +396 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/index.ts +110 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +1783 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/models.ts +103 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/shared.ts +72 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/top-level.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/src/streaming.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/tsconfig.json +11 -0
- package/node_modules/@anthropic-ai/sdk/src/uploads.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/version.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.js +6 -0
- package/node_modules/@anthropic-ai/sdk/streaming.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/streaming.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.js +6 -0
- package/node_modules/@anthropic-ai/sdk/uploads.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/uploads.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/version.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/version.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/version.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/version.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/version.js +5 -0
- package/node_modules/@anthropic-ai/sdk/version.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/version.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/version.mjs.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.d.ts +24 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.js +502 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.d.ts +118 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.js +402 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.d.ts +95 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.js +963 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.d.ts +53 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.js +175 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.d.ts +95 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.js +528 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.d.ts +25 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.js +131 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.d.ts +51 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.js +486 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.d.ts +51 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.js +102 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.d.ts +48 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.js +230 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.d.ts +26 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.js +101 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.d.ts +33 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.js +231 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.d.ts +18 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.js +42 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.d.ts +25 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.js +114 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.d.ts +11 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.js +39 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.d.ts +33 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.js +210 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.d.ts +2 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.js +50 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.d.ts +44 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.js +311 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.js +30 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.d.ts +615 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.js +94 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.d.ts +14 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.js +126 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.d.ts +70 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.js +290 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.d.ts +20 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.js +25 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.js +3 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.d.ts +69 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.js +278 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.d.ts +393 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.js +2 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/package.json +60 -0
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.d.ts +20 -0
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.js +44 -0
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.d.ts +5 -0
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.js +6 -0
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/cli.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-ai/dist/cli.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/cli.js +130 -0
- package/node_modules/@dimivelev/chimera-ai/dist/cli.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.d.ts +18 -0
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.js +178 -0
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.d.ts +10 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.d.ts +4 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.js +6 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.js +23 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.d.ts +14 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.js +22 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images.d.ts +4 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images.js +14 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/index.d.ts +32 -0
- package/node_modules/@dimivelev/chimera-ai/dist/index.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/index.js +20 -0
- package/node_modules/@dimivelev/chimera-ai/dist/index.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.d.ts +18 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.d.ts +14714 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.js +13379 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.js +71 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.d.ts +2 -0
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.js +2 -0
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.d.ts +38 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.js +826 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.d.ts +71 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.js +959 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.d.ts +15 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.js +221 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.d.ts +13 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.js +26 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.d.ts +56 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.js +368 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.d.ts +8 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.js +29 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.d.ts +70 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.js +329 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.d.ts +15 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.js +442 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.d.ts +13 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.js +402 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.js +128 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.d.ts +4 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.js +34 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.d.ts +25 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.js +534 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.d.ts +30 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.js +1171 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.d.ts +19 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.js +956 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.js +10 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.d.ts +18 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.js +495 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.d.ts +13 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.js +233 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.d.ts +35 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.js +254 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.d.ts +8 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.js +42 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.d.ts +8 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.js +184 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.d.ts +4 -0
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.js +22 -0
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/stream.d.ts +8 -0
- package/node_modules/@dimivelev/chimera-ai/dist/stream.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/stream.js +39 -0
- package/node_modules/@dimivelev/chimera-ai/dist/stream.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/types.d.ts +514 -0
- package/node_modules/@dimivelev/chimera-ai/dist/types.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/types.js +2 -0
- package/node_modules/@dimivelev/chimera-ai/dist/types.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.d.ts +6 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.js +34 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.d.ts +19 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.js +25 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.d.ts +21 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.js +81 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.js +14 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.d.ts +2 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.js +8 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.d.ts +16 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.js +113 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.d.ts +10 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.js +97 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.d.ts +25 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.js +335 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.d.ts +21 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.js +56 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.d.ts +30 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.js +268 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.d.ts +58 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.js +122 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.js +105 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.d.ts +43 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.js +485 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.d.ts +13 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.js +31 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.d.ts +64 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.js +2 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.d.ts +57 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.js +154 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.d.ts +22 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.js +26 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.d.ts +17 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.js +21 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.d.ts +18 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.js +281 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/package.json +106 -0
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.d.ts +54 -0
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.js +632 -0
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.d.ts +22 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.js +104 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.js +35 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.d.ts +249 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.js +1857 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.d.ts +28 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.js +89 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.d.ts +37 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.js +378 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.d.ts +31 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.js +69 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.d.ts +96 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.js +644 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.d.ts +50 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.js +159 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.d.ts +50 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.js +185 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.d.ts +12 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.js +23 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.d.ts +19 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.js +89 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.d.ts +13 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.js +51 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.d.ts +39 -0
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.js +2 -0
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.d.ts +16 -0
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.js +110 -0
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/index.d.ts +23 -0
- package/node_modules/@dimivelev/chimera-tui/dist/index.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/index.js +32 -0
- package/node_modules/@dimivelev/chimera-tui/dist/index.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.d.ts +193 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.js +174 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keys.d.ts +184 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keys.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keys.js +1173 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keys.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.d.ts +28 -0
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.js +44 -0
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.js +53 -0
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.d.ts +50 -0
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.js +361 -0
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.d.ts +90 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.js +366 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.d.ts +113 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.js +472 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/tui.d.ts +242 -0
- package/node_modules/@dimivelev/chimera-tui/dist/tui.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/tui.js +1221 -0
- package/node_modules/@dimivelev/chimera-tui/dist/tui.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.d.ts +17 -0
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.js +25 -0
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/utils.d.ts +84 -0
- package/node_modules/@dimivelev/chimera-tui/dist/utils.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/utils.js +1029 -0
- package/node_modules/@dimivelev/chimera-tui/dist/utils.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.d.ts +25 -0
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.js +96 -0
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/package.json +47 -0
- package/npm-shrinkwrap.json +1783 -0
- package/package.json +104 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../../../src/core/tools/path-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,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AQ,CAAC,EAAE,CAAC;QAChC,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,+DAA+D;IAC/D,MAAM,WAAW,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,WAAW,KAAK,QAAQ,IAAI,CAAC,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;QACjE,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,uDAAuD;IACvD,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC3C,IAAI,UAAU,KAAK,QAAQ,IAAI,CAAC,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QAC/D,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,kEAAkE;IAClE,MAAM,YAAY,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACpD,IAAI,YAAY,KAAK,QAAQ,IAAI,CAAC,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;QACnE,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,wFAAuF;IACvF,MAAM,eAAe,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACzD,IAAI,eAAe,KAAK,QAAQ,IAAI,CAAC,MAAM,UAAU,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC;QACzE,OAAO,eAAe,CAAC;IACxB,CAAC;IAED,OAAO,QAAQ,CAAC;AAAA,CAChB","sourcesContent":["import { accessSync, constants } from \"node:fs\";\nimport { access } from \"node:fs/promises\";\nimport { normalizePath, resolvePath } from \"../../utils/paths.ts\";\n\nconst NARROW_NO_BREAK_SPACE = \"\\u202F\";\n\nfunction tryMacOSScreenshotPath(filePath: string): string {\n\treturn filePath.replace(/ (AM|PM)\\./gi, `${NARROW_NO_BREAK_SPACE}$1.`);\n}\n\nfunction tryNFDVariant(filePath: string): string {\n\t// macOS stores filenames in NFD (decomposed) form, try converting user input to NFD\n\treturn filePath.normalize(\"NFD\");\n}\n\nfunction tryCurlyQuoteVariant(filePath: string): string {\n\t// macOS uses U+2019 (right single quotation mark) in screenshot names like \"Capture d'écran\"\n\t// Users typically type U+0027 (straight apostrophe)\n\treturn filePath.replace(/'/g, \"\\u2019\");\n}\n\nfunction fileExists(filePath: string): boolean {\n\ttry {\n\t\taccessSync(filePath, constants.F_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport async function pathExists(filePath: string): Promise<boolean> {\n\ttry {\n\t\tawait access(filePath, constants.F_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function expandPath(filePath: string): string {\n\treturn normalizePath(filePath, { normalizeUnicodeSpaces: true, stripAtPrefix: true });\n}\n\n/**\n * Resolve a path relative to the given cwd.\n * Handles ~ expansion and absolute paths.\n */\nexport function resolveToCwd(filePath: string, cwd: string): string {\n\treturn resolvePath(filePath, cwd, { normalizeUnicodeSpaces: true, stripAtPrefix: true });\n}\n\nexport function resolveReadPath(filePath: string, cwd: string): string {\n\tconst resolved = resolveToCwd(filePath, cwd);\n\n\tif (fileExists(resolved)) {\n\t\treturn resolved;\n\t}\n\n\t// Try macOS AM/PM variant (narrow no-break space before AM/PM)\n\tconst amPmVariant = tryMacOSScreenshotPath(resolved);\n\tif (amPmVariant !== resolved && fileExists(amPmVariant)) {\n\t\treturn amPmVariant;\n\t}\n\n\t// Try NFD variant (macOS stores filenames in NFD form)\n\tconst nfdVariant = tryNFDVariant(resolved);\n\tif (nfdVariant !== resolved && fileExists(nfdVariant)) {\n\t\treturn nfdVariant;\n\t}\n\n\t// Try curly quote variant (macOS uses U+2019 in screenshot names)\n\tconst curlyVariant = tryCurlyQuoteVariant(resolved);\n\tif (curlyVariant !== resolved && fileExists(curlyVariant)) {\n\t\treturn curlyVariant;\n\t}\n\n\t// Try combined NFD + curly quote (for French macOS screenshots like \"Capture d'écran\")\n\tconst nfdCurlyVariant = tryCurlyQuoteVariant(nfdVariant);\n\tif (nfdCurlyVariant !== resolved && fileExists(nfdCurlyVariant)) {\n\t\treturn nfdCurlyVariant;\n\t}\n\n\treturn resolved;\n}\n\nexport async function resolveReadPathAsync(filePath: string, cwd: string): Promise<string> {\n\tconst resolved = resolveToCwd(filePath, cwd);\n\n\tif (await pathExists(resolved)) {\n\t\treturn resolved;\n\t}\n\n\t// Try macOS AM/PM variant (narrow no-break space before AM/PM)\n\tconst amPmVariant = tryMacOSScreenshotPath(resolved);\n\tif (amPmVariant !== resolved && (await pathExists(amPmVariant))) {\n\t\treturn amPmVariant;\n\t}\n\n\t// Try NFD variant (macOS stores filenames in NFD form)\n\tconst nfdVariant = tryNFDVariant(resolved);\n\tif (nfdVariant !== resolved && (await pathExists(nfdVariant))) {\n\t\treturn nfdVariant;\n\t}\n\n\t// Try curly quote variant (macOS uses U+2019 in screenshot names)\n\tconst curlyVariant = tryCurlyQuoteVariant(resolved);\n\tif (curlyVariant !== resolved && (await pathExists(curlyVariant))) {\n\t\treturn curlyVariant;\n\t}\n\n\t// Try combined NFD + curly quote (for French macOS screenshots like \"Capture d'écran\")\n\tconst nfdCurlyVariant = tryCurlyQuoteVariant(nfdVariant);\n\tif (nfdCurlyVariant !== resolved && (await pathExists(nfdCurlyVariant))) {\n\t\treturn nfdCurlyVariant;\n\t}\n\n\treturn resolved;\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentTool } from "@dimivelev/chimera-agent-core";
|
|
2
|
+
import { type Static, Type } from "typebox";
|
|
3
|
+
import type { ToolDefinition } from "../extensions/types.ts";
|
|
4
|
+
import { type TruncationResult } from "./truncate.ts";
|
|
5
|
+
declare const readSchema: Type.TObject<{
|
|
6
|
+
path: Type.TString;
|
|
7
|
+
offset: Type.TOptional<Type.TNumber>;
|
|
8
|
+
limit: Type.TOptional<Type.TNumber>;
|
|
9
|
+
}>;
|
|
10
|
+
export type ReadToolInput = Static<typeof readSchema>;
|
|
11
|
+
export interface ReadToolDetails {
|
|
12
|
+
truncation?: TruncationResult;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Pluggable operations for the read tool.
|
|
16
|
+
* Override these to delegate file reading to remote systems (for example SSH).
|
|
17
|
+
*/
|
|
18
|
+
export interface ReadOperations {
|
|
19
|
+
/** Read file contents as a Buffer */
|
|
20
|
+
readFile: (absolutePath: string) => Promise<Buffer>;
|
|
21
|
+
/** Check if file is readable (throw if not) */
|
|
22
|
+
access: (absolutePath: string) => Promise<void>;
|
|
23
|
+
/** Detect image MIME type, return null or undefined for non-images */
|
|
24
|
+
detectImageMimeType?: (absolutePath: string) => Promise<string | null | undefined>;
|
|
25
|
+
}
|
|
26
|
+
export interface ReadToolOptions {
|
|
27
|
+
/** Whether to auto-resize images to 2000x2000 max. Default: true */
|
|
28
|
+
autoResizeImages?: boolean;
|
|
29
|
+
/** Custom operations for file reading. Default: local filesystem */
|
|
30
|
+
operations?: ReadOperations;
|
|
31
|
+
}
|
|
32
|
+
export declare function createReadToolDefinition(cwd: string, options?: ReadToolOptions): ToolDefinition<typeof readSchema, ReadToolDetails | undefined>;
|
|
33
|
+
export declare function createReadTool(cwd: string, options?: ReadToolOptions): AgentTool<typeof readSchema>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/core/tools/read.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAK/D,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO5C,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,wBAAwB,CAAC;AAItF,OAAO,EAAoD,KAAK,gBAAgB,EAAgB,MAAM,eAAe,CAAC;AAEtH,QAAA,MAAM,UAAU;;;;EAId,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC/B,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AASD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,qCAAqC;IACrC,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,+CAA+C;IAC/C,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACnF;AAQD,MAAM,WAAW,eAAe;IAC/B,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oEAAoE;IACpE,UAAU,CAAC,EAAE,cAAc,CAAC;CAC5B;AA4ID,wBAAgB,wBAAwB,CACvC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,eAAe,GACvB,cAAc,CAAC,OAAO,UAAU,EAAE,eAAe,GAAG,SAAS,CAAC,CAwJhE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,OAAO,UAAU,CAAC,CAEnG","sourcesContent":["import { basename, dirname, isAbsolute, relative, resolve as resolvePath, sep } from \"node:path\";\nimport type { AgentTool } from \"@dimivelev/chimera-agent-core\";\nimport type { Api, ImageContent, Model, TextContent } from \"@dimivelev/chimera-ai\";\nimport { Text } from \"@dimivelev/chimera-tui\";\nimport { constants } from \"fs\";\nimport { access as fsAccess, readFile as fsReadFile } from \"fs/promises\";\nimport { type Static, Type } from \"typebox\";\nimport { getReadmePath } from \"../../config.ts\";\nimport { keyHint, keyText } from \"../../modes/interactive/components/keybinding-hints.ts\";\nimport { getLanguageFromPath, highlightCode, type Theme } from \"../../modes/interactive/theme/theme.ts\";\nimport { formatDimensionNote, resizeImage } from \"../../utils/image-resize.ts\";\nimport { detectSupportedImageMimeTypeFromFile } from \"../../utils/mime.ts\";\nimport { formatPathRelativeToCwdOrAbsolute } from \"../../utils/paths.ts\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../extensions/types.ts\";\nimport { resolveReadPathAsync, resolveToCwd } from \"./path-utils.ts\";\nimport { getTextOutput, renderToolPath, replaceTabs, str } from \"./render-utils.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\nimport { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationResult, truncateHead } from \"./truncate.ts\";\n\nconst readSchema = Type.Object({\n\tpath: Type.String({ description: \"Path to the file to read (relative or absolute)\" }),\n\toffset: Type.Optional(Type.Number({ description: \"Line number to start reading from (1-indexed)\" })),\n\tlimit: Type.Optional(Type.Number({ description: \"Maximum number of lines to read\" })),\n});\n\nexport type ReadToolInput = Static<typeof readSchema>;\n\nexport interface ReadToolDetails {\n\ttruncation?: TruncationResult;\n}\n\ninterface CompactReadClassification {\n\tkind: \"docs\" | \"resource\" | \"skill\";\n\tlabel: string;\n}\n\nconst COMPACT_RESOURCE_FILE_NAMES = new Set([\"AGENTS.md\", \"AGENTS.MD\", \"CLAUDE.md\", \"CLAUDE.MD\"]);\n\n/**\n * Pluggable operations for the read tool.\n * Override these to delegate file reading to remote systems (for example SSH).\n */\nexport interface ReadOperations {\n\t/** Read file contents as a Buffer */\n\treadFile: (absolutePath: string) => Promise<Buffer>;\n\t/** Check if file is readable (throw if not) */\n\taccess: (absolutePath: string) => Promise<void>;\n\t/** Detect image MIME type, return null or undefined for non-images */\n\tdetectImageMimeType?: (absolutePath: string) => Promise<string | null | undefined>;\n}\n\nconst defaultReadOperations: ReadOperations = {\n\treadFile: (path) => fsReadFile(path),\n\taccess: (path) => fsAccess(path, constants.R_OK),\n\tdetectImageMimeType: detectSupportedImageMimeTypeFromFile,\n};\n\nexport interface ReadToolOptions {\n\t/** Whether to auto-resize images to 2000x2000 max. Default: true */\n\tautoResizeImages?: boolean;\n\t/** Custom operations for file reading. Default: local filesystem */\n\toperations?: ReadOperations;\n}\n\ntype ReadRenderArgs = { path?: string; file_path?: string; offset?: number; limit?: number };\n\nfunction formatReadLineRange(args: ReadRenderArgs | undefined, theme: Theme): string {\n\tif (args?.offset === undefined && args?.limit === undefined) return \"\";\n\tconst startLine = args.offset ?? 1;\n\tconst endLine = args.limit !== undefined ? startLine + args.limit - 1 : \"\";\n\treturn theme.fg(\"warning\", `:${startLine}${endLine ? `-${endLine}` : \"\"}`);\n}\n\nfunction formatReadCall(args: ReadRenderArgs | undefined, theme: Theme, cwd: string): string {\n\tconst pathDisplay = renderToolPath(str(args?.file_path ?? args?.path), theme, cwd);\n\treturn `${theme.fg(\"toolTitle\", theme.bold(\"read\"))} ${pathDisplay}${formatReadLineRange(args, theme)}`;\n}\n\nfunction trimTrailingEmptyLines(lines: string[]): string[] {\n\tlet end = lines.length;\n\twhile (end > 0 && lines[end - 1] === \"\") {\n\t\tend--;\n\t}\n\treturn lines.slice(0, end);\n}\n\nfunction getNonVisionImageNote(model: Model<Api> | undefined): string | undefined {\n\tif (!model || model.input.includes(\"image\")) {\n\t\treturn undefined;\n\t}\n\treturn \"[Current model does not support images. The image will be omitted from this request.]\";\n}\n\nfunction toPosixPath(filePath: string): string {\n\treturn filePath.split(sep).join(\"/\");\n}\n\nfunction getPiDocsClassification(absolutePath: string): CompactReadClassification | undefined {\n\tconst packageRoot = dirname(getReadmePath());\n\tconst relativePath = relative(resolvePath(packageRoot), resolvePath(absolutePath));\n\tif (\n\t\trelativePath === \"\" ||\n\t\trelativePath === \"..\" ||\n\t\trelativePath.startsWith(`..${sep}`) ||\n\t\tisAbsolute(relativePath)\n\t) {\n\t\treturn undefined;\n\t}\n\n\tconst label = toPosixPath(relativePath);\n\tif (label === \"README.md\" || label.startsWith(\"docs/\") || label.startsWith(\"examples/\")) {\n\t\treturn { kind: \"docs\", label };\n\t}\n\treturn undefined;\n}\n\nfunction getCompactReadClassification(\n\targs: ReadRenderArgs | undefined,\n\tcwd: string,\n): CompactReadClassification | undefined {\n\tconst rawPath = str(args?.file_path ?? args?.path);\n\tif (!rawPath) return undefined;\n\n\tconst absolutePath = resolveToCwd(rawPath, cwd);\n\tconst fileName = basename(absolutePath);\n\tif (fileName === \"SKILL.md\") {\n\t\treturn { kind: \"skill\", label: basename(dirname(absolutePath)) || fileName };\n\t}\n\n\tconst docsClassification = getPiDocsClassification(absolutePath);\n\tif (docsClassification) return docsClassification;\n\n\tif (COMPACT_RESOURCE_FILE_NAMES.has(fileName)) {\n\t\treturn { kind: \"resource\", label: formatPathRelativeToCwdOrAbsolute(absolutePath, cwd) };\n\t}\n\n\treturn undefined;\n}\n\nfunction formatCompactReadCall(\n\tclassification: CompactReadClassification,\n\targs: ReadRenderArgs | undefined,\n\ttheme: Theme,\n): string {\n\tconst expandHint = theme.fg(\"dim\", ` (${keyText(\"app.tools.expand\")} to expand)`);\n\tif (classification.kind === \"skill\") {\n\t\treturn (\n\t\t\ttheme.fg(\"customMessageLabel\", `\\x1b[1m[skill]\\x1b[22m `) +\n\t\t\ttheme.fg(\"customMessageText\", classification.label) +\n\t\t\tformatReadLineRange(args, theme) +\n\t\t\texpandHint\n\t\t);\n\t}\n\n\treturn (\n\t\ttheme.fg(\"toolTitle\", theme.bold(`read ${classification.kind}`)) +\n\t\t\" \" +\n\t\ttheme.fg(\"accent\", classification.label) +\n\t\tformatReadLineRange(args, theme) +\n\t\texpandHint\n\t);\n}\n\nfunction formatReadResult(\n\targs: ReadRenderArgs | undefined,\n\tresult: { content: (TextContent | ImageContent)[]; details?: ReadToolDetails },\n\toptions: ToolRenderResultOptions,\n\ttheme: Theme,\n\tshowImages: boolean,\n\t_cwd: string,\n\tisError: boolean,\n): string {\n\tif (!options.expanded && !isError) {\n\t\treturn \"\";\n\t}\n\n\tconst rawPath = str(args?.file_path ?? args?.path);\n\tconst output = getTextOutput(result, showImages);\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tconst renderedLines = lang ? highlightCode(replaceTabs(output), lang) : output.split(\"\\n\");\n\tconst lines = trimTrailingEmptyLines(renderedLines);\n\tconst maxLines = options.expanded ? lines.length : 10;\n\tconst displayLines = lines.slice(0, maxLines);\n\tconst remaining = lines.length - maxLines;\n\tlet text = `\\n${displayLines.map((line) => (lang ? replaceTabs(line) : theme.fg(\"toolOutput\", replaceTabs(line)))).join(\"\\n\")}`;\n\tif (remaining > 0) {\n\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines,`)} ${keyHint(\"app.tools.expand\", \"to expand\")})`;\n\t}\n\n\tconst truncation = result.details?.truncation;\n\tif (truncation?.truncated) {\n\t\tif (truncation.firstLineExceedsLimit) {\n\t\t\ttext += `\\n${theme.fg(\"warning\", `[First line exceeds ${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit]`)}`;\n\t\t} else if (truncation.truncatedBy === \"lines\") {\n\t\t\ttext += `\\n${theme.fg(\"warning\", `[Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines (${truncation.maxLines ?? DEFAULT_MAX_LINES} line limit)]`)}`;\n\t\t} else {\n\t\t\ttext += `\\n${theme.fg(\"warning\", `[Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)]`)}`;\n\t\t}\n\t}\n\treturn text;\n}\n\nexport function createReadToolDefinition(\n\tcwd: string,\n\toptions?: ReadToolOptions,\n): ToolDefinition<typeof readSchema, ReadToolDetails | undefined> {\n\tconst autoResizeImages = options?.autoResizeImages ?? true;\n\tconst ops = options?.operations ?? defaultReadOperations;\n\treturn {\n\t\tname: \"read\",\n\t\tlabel: \"read\",\n\t\tdescription: `Read the contents of a file. Supports text files and images (jpg, png, gif, webp). Images are sent as attachments. For text files, output is truncated to ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). Use offset/limit for large files. When you need the full file, continue with offset until complete.`,\n\t\tpromptSnippet: \"Read file contents\",\n\t\tpromptGuidelines: [\"Use read to examine files instead of cat or sed.\"],\n\t\tparameters: readSchema,\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ path, offset, limit }: { path: string; offset?: number; limit?: number },\n\t\t\tsignal?: AbortSignal,\n\t\t\t_onUpdate?,\n\t\t\tctx?,\n\t\t) {\n\t\t\treturn new Promise<{ content: (TextContent | ImageContent)[]; details: ReadToolDetails | undefined }>(\n\t\t\t\t(resolve, reject) => {\n\t\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tlet aborted = false;\n\t\t\t\t\tconst onAbort = () => {\n\t\t\t\t\t\taborted = true;\n\t\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\t};\n\t\t\t\t\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\n\t\t\t\t\t(async () => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst absolutePath = await resolveReadPathAsync(path, cwd);\n\t\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\t\t// Check if file exists and is readable.\n\t\t\t\t\t\t\tawait ops.access(absolutePath);\n\t\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\t\tconst mimeType = ops.detectImageMimeType ? await ops.detectImageMimeType(absolutePath) : undefined;\n\t\t\t\t\t\t\tlet content: (TextContent | ImageContent)[];\n\t\t\t\t\t\t\tlet details: ReadToolDetails | undefined;\n\t\t\t\t\t\t\tconst nonVisionImageNote = getNonVisionImageNote(ctx?.model);\n\t\t\t\t\t\t\tif (mimeType) {\n\t\t\t\t\t\t\t\t// Read image as binary.\n\t\t\t\t\t\t\t\tconst buffer = await ops.readFile(absolutePath);\n\t\t\t\t\t\t\t\tif (autoResizeImages) {\n\t\t\t\t\t\t\t\t\t// Resize image if needed before sending it back to the model.\n\t\t\t\t\t\t\t\t\tconst resized = await resizeImage(buffer, mimeType);\n\t\t\t\t\t\t\t\t\tif (!resized) {\n\t\t\t\t\t\t\t\t\t\tlet textNote = `Read image file [${mimeType}]\\n[Image omitted: could not be resized below the inline image size limit.]`;\n\t\t\t\t\t\t\t\t\t\tif (nonVisionImageNote) textNote += `\\n${nonVisionImageNote}`;\n\t\t\t\t\t\t\t\t\t\tcontent = [{ type: \"text\", text: textNote }];\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tconst dimensionNote = formatDimensionNote(resized);\n\t\t\t\t\t\t\t\t\t\tlet textNote = `Read image file [${resized.mimeType}]`;\n\t\t\t\t\t\t\t\t\t\tif (dimensionNote) textNote += `\\n${dimensionNote}`;\n\t\t\t\t\t\t\t\t\t\tif (nonVisionImageNote) textNote += `\\n${nonVisionImageNote}`;\n\t\t\t\t\t\t\t\t\t\tcontent = [\n\t\t\t\t\t\t\t\t\t\t\t{ type: \"text\", text: textNote },\n\t\t\t\t\t\t\t\t\t\t\t{ type: \"image\", data: resized.data, mimeType: resized.mimeType },\n\t\t\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tlet textNote = `Read image file [${mimeType}]`;\n\t\t\t\t\t\t\t\t\tif (nonVisionImageNote) textNote += `\\n${nonVisionImageNote}`;\n\t\t\t\t\t\t\t\t\tcontent = [\n\t\t\t\t\t\t\t\t\t\t{ type: \"text\", text: textNote },\n\t\t\t\t\t\t\t\t\t\t{ type: \"image\", data: buffer.toString(\"base64\"), mimeType },\n\t\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Read text content.\n\t\t\t\t\t\t\t\tconst buffer = await ops.readFile(absolutePath);\n\t\t\t\t\t\t\t\tconst textContent = buffer.toString(\"utf-8\");\n\t\t\t\t\t\t\t\tconst allLines = textContent.split(\"\\n\");\n\t\t\t\t\t\t\t\tconst totalFileLines = allLines.length;\n\t\t\t\t\t\t\t\t// Apply offset if specified. Convert from 1-indexed input to 0-indexed array access.\n\t\t\t\t\t\t\t\tconst startLine = offset ? Math.max(0, offset - 1) : 0;\n\t\t\t\t\t\t\t\tconst startLineDisplay = startLine + 1;\n\t\t\t\t\t\t\t\t// Check if offset is out of bounds.\n\t\t\t\t\t\t\t\tif (startLine >= allLines.length) {\n\t\t\t\t\t\t\t\t\tthrow new Error(`Offset ${offset} is beyond end of file (${allLines.length} lines total)`);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlet selectedContent: string;\n\t\t\t\t\t\t\t\tlet userLimitedLines: number | undefined;\n\t\t\t\t\t\t\t\t// If limit is specified by the user, honor it first. Otherwise truncateHead decides.\n\t\t\t\t\t\t\t\tif (limit !== undefined) {\n\t\t\t\t\t\t\t\t\tconst endLine = Math.min(startLine + limit, allLines.length);\n\t\t\t\t\t\t\t\t\tselectedContent = allLines.slice(startLine, endLine).join(\"\\n\");\n\t\t\t\t\t\t\t\t\tuserLimitedLines = endLine - startLine;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tselectedContent = allLines.slice(startLine).join(\"\\n\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Apply truncation, respecting both line and byte limits.\n\t\t\t\t\t\t\t\tconst truncation = truncateHead(selectedContent);\n\t\t\t\t\t\t\t\tlet outputText: string;\n\t\t\t\t\t\t\t\tif (truncation.firstLineExceedsLimit) {\n\t\t\t\t\t\t\t\t\t// First line alone exceeds the byte limit. Point the model at a bash fallback.\n\t\t\t\t\t\t\t\t\tconst firstLineSize = formatSize(Buffer.byteLength(allLines[startLine], \"utf-8\"));\n\t\t\t\t\t\t\t\t\toutputText = `[Line ${startLineDisplay} is ${firstLineSize}, exceeds ${formatSize(DEFAULT_MAX_BYTES)} limit. Use bash: sed -n '${startLineDisplay}p' ${path} | head -c ${DEFAULT_MAX_BYTES}]`;\n\t\t\t\t\t\t\t\t\tdetails = { truncation };\n\t\t\t\t\t\t\t\t} else if (truncation.truncated) {\n\t\t\t\t\t\t\t\t\t// Truncation occurred. Build an actionable continuation notice.\n\t\t\t\t\t\t\t\t\tconst endLineDisplay = startLineDisplay + truncation.outputLines - 1;\n\t\t\t\t\t\t\t\t\tconst nextOffset = endLineDisplay + 1;\n\t\t\t\t\t\t\t\t\toutputText = truncation.content;\n\t\t\t\t\t\t\t\t\tif (truncation.truncatedBy === \"lines\") {\n\t\t\t\t\t\t\t\t\t\toutputText += `\\n\\n[Showing lines ${startLineDisplay}-${endLineDisplay} of ${totalFileLines}. Use offset=${nextOffset} to continue.]`;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\toutputText += `\\n\\n[Showing lines ${startLineDisplay}-${endLineDisplay} of ${totalFileLines} (${formatSize(DEFAULT_MAX_BYTES)} limit). Use offset=${nextOffset} to continue.]`;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdetails = { truncation };\n\t\t\t\t\t\t\t\t} else if (userLimitedLines !== undefined && startLine + userLimitedLines < allLines.length) {\n\t\t\t\t\t\t\t\t\t// User-specified limit stopped early, but the file still has more content.\n\t\t\t\t\t\t\t\t\tconst remaining = allLines.length - (startLine + userLimitedLines);\n\t\t\t\t\t\t\t\t\tconst nextOffset = startLine + userLimitedLines + 1;\n\t\t\t\t\t\t\t\t\toutputText = `${truncation.content}\\n\\n[${remaining} more lines in file. Use offset=${nextOffset} to continue.]`;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// No truncation and no remaining user-limited content.\n\t\t\t\t\t\t\t\t\toutputText = truncation.content;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontent = [{ type: \"text\", text: outputText }];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t\tresolve({ content, details });\n\t\t\t\t\t\t} catch (error: any) {\n\t\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t\tif (!aborted) reject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\t\t\t\t},\n\t\t\t);\n\t\t},\n\t\trenderCall(args, theme, context) {\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\tconst classification = !context.expanded ? getCompactReadClassification(args, context.cwd) : undefined;\n\t\t\ttext.setText(\n\t\t\t\tclassification\n\t\t\t\t\t? formatCompactReadCall(classification, args, theme)\n\t\t\t\t\t: formatReadCall(args, theme, context.cwd),\n\t\t\t);\n\t\t\treturn text;\n\t\t},\n\t\trenderResult(result, options, theme, context) {\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(\n\t\t\t\tformatReadResult(context.args, result, options, theme, context.showImages, context.cwd, context.isError),\n\t\t\t);\n\t\t\treturn text;\n\t\t},\n\t};\n}\n\nexport function createReadTool(cwd: string, options?: ReadToolOptions): AgentTool<typeof readSchema> {\n\treturn wrapToolDefinition(createReadToolDefinition(cwd, options));\n}\n"]}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { basename, dirname, isAbsolute, relative, resolve as resolvePath, sep } from "node:path";
|
|
2
|
+
import { Text } from "@dimivelev/chimera-tui";
|
|
3
|
+
import { constants } from "fs";
|
|
4
|
+
import { access as fsAccess, readFile as fsReadFile } from "fs/promises";
|
|
5
|
+
import { Type } from "typebox";
|
|
6
|
+
import { getReadmePath } from "../../config.js";
|
|
7
|
+
import { keyHint, keyText } from "../../modes/interactive/components/keybinding-hints.js";
|
|
8
|
+
import { getLanguageFromPath, highlightCode } from "../../modes/interactive/theme/theme.js";
|
|
9
|
+
import { formatDimensionNote, resizeImage } from "../../utils/image-resize.js";
|
|
10
|
+
import { detectSupportedImageMimeTypeFromFile } from "../../utils/mime.js";
|
|
11
|
+
import { formatPathRelativeToCwdOrAbsolute } from "../../utils/paths.js";
|
|
12
|
+
import { resolveReadPathAsync, resolveToCwd } from "./path-utils.js";
|
|
13
|
+
import { getTextOutput, renderToolPath, replaceTabs, str } from "./render-utils.js";
|
|
14
|
+
import { wrapToolDefinition } from "./tool-definition-wrapper.js";
|
|
15
|
+
import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead } from "./truncate.js";
|
|
16
|
+
const readSchema = Type.Object({
|
|
17
|
+
path: Type.String({ description: "Path to the file to read (relative or absolute)" }),
|
|
18
|
+
offset: Type.Optional(Type.Number({ description: "Line number to start reading from (1-indexed)" })),
|
|
19
|
+
limit: Type.Optional(Type.Number({ description: "Maximum number of lines to read" })),
|
|
20
|
+
});
|
|
21
|
+
const COMPACT_RESOURCE_FILE_NAMES = new Set(["AGENTS.md", "AGENTS.MD", "CLAUDE.md", "CLAUDE.MD"]);
|
|
22
|
+
const defaultReadOperations = {
|
|
23
|
+
readFile: (path) => fsReadFile(path),
|
|
24
|
+
access: (path) => fsAccess(path, constants.R_OK),
|
|
25
|
+
detectImageMimeType: detectSupportedImageMimeTypeFromFile,
|
|
26
|
+
};
|
|
27
|
+
function formatReadLineRange(args, theme) {
|
|
28
|
+
if (args?.offset === undefined && args?.limit === undefined)
|
|
29
|
+
return "";
|
|
30
|
+
const startLine = args.offset ?? 1;
|
|
31
|
+
const endLine = args.limit !== undefined ? startLine + args.limit - 1 : "";
|
|
32
|
+
return theme.fg("warning", `:${startLine}${endLine ? `-${endLine}` : ""}`);
|
|
33
|
+
}
|
|
34
|
+
function formatReadCall(args, theme, cwd) {
|
|
35
|
+
const pathDisplay = renderToolPath(str(args?.file_path ?? args?.path), theme, cwd);
|
|
36
|
+
return `${theme.fg("toolTitle", theme.bold("read"))} ${pathDisplay}${formatReadLineRange(args, theme)}`;
|
|
37
|
+
}
|
|
38
|
+
function trimTrailingEmptyLines(lines) {
|
|
39
|
+
let end = lines.length;
|
|
40
|
+
while (end > 0 && lines[end - 1] === "") {
|
|
41
|
+
end--;
|
|
42
|
+
}
|
|
43
|
+
return lines.slice(0, end);
|
|
44
|
+
}
|
|
45
|
+
function getNonVisionImageNote(model) {
|
|
46
|
+
if (!model || model.input.includes("image")) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
return "[Current model does not support images. The image will be omitted from this request.]";
|
|
50
|
+
}
|
|
51
|
+
function toPosixPath(filePath) {
|
|
52
|
+
return filePath.split(sep).join("/");
|
|
53
|
+
}
|
|
54
|
+
function getPiDocsClassification(absolutePath) {
|
|
55
|
+
const packageRoot = dirname(getReadmePath());
|
|
56
|
+
const relativePath = relative(resolvePath(packageRoot), resolvePath(absolutePath));
|
|
57
|
+
if (relativePath === "" ||
|
|
58
|
+
relativePath === ".." ||
|
|
59
|
+
relativePath.startsWith(`..${sep}`) ||
|
|
60
|
+
isAbsolute(relativePath)) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
const label = toPosixPath(relativePath);
|
|
64
|
+
if (label === "README.md" || label.startsWith("docs/") || label.startsWith("examples/")) {
|
|
65
|
+
return { kind: "docs", label };
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
function getCompactReadClassification(args, cwd) {
|
|
70
|
+
const rawPath = str(args?.file_path ?? args?.path);
|
|
71
|
+
if (!rawPath)
|
|
72
|
+
return undefined;
|
|
73
|
+
const absolutePath = resolveToCwd(rawPath, cwd);
|
|
74
|
+
const fileName = basename(absolutePath);
|
|
75
|
+
if (fileName === "SKILL.md") {
|
|
76
|
+
return { kind: "skill", label: basename(dirname(absolutePath)) || fileName };
|
|
77
|
+
}
|
|
78
|
+
const docsClassification = getPiDocsClassification(absolutePath);
|
|
79
|
+
if (docsClassification)
|
|
80
|
+
return docsClassification;
|
|
81
|
+
if (COMPACT_RESOURCE_FILE_NAMES.has(fileName)) {
|
|
82
|
+
return { kind: "resource", label: formatPathRelativeToCwdOrAbsolute(absolutePath, cwd) };
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
function formatCompactReadCall(classification, args, theme) {
|
|
87
|
+
const expandHint = theme.fg("dim", ` (${keyText("app.tools.expand")} to expand)`);
|
|
88
|
+
if (classification.kind === "skill") {
|
|
89
|
+
return (theme.fg("customMessageLabel", `\x1b[1m[skill]\x1b[22m `) +
|
|
90
|
+
theme.fg("customMessageText", classification.label) +
|
|
91
|
+
formatReadLineRange(args, theme) +
|
|
92
|
+
expandHint);
|
|
93
|
+
}
|
|
94
|
+
return (theme.fg("toolTitle", theme.bold(`read ${classification.kind}`)) +
|
|
95
|
+
" " +
|
|
96
|
+
theme.fg("accent", classification.label) +
|
|
97
|
+
formatReadLineRange(args, theme) +
|
|
98
|
+
expandHint);
|
|
99
|
+
}
|
|
100
|
+
function formatReadResult(args, result, options, theme, showImages, _cwd, isError) {
|
|
101
|
+
if (!options.expanded && !isError) {
|
|
102
|
+
return "";
|
|
103
|
+
}
|
|
104
|
+
const rawPath = str(args?.file_path ?? args?.path);
|
|
105
|
+
const output = getTextOutput(result, showImages);
|
|
106
|
+
const lang = rawPath ? getLanguageFromPath(rawPath) : undefined;
|
|
107
|
+
const renderedLines = lang ? highlightCode(replaceTabs(output), lang) : output.split("\n");
|
|
108
|
+
const lines = trimTrailingEmptyLines(renderedLines);
|
|
109
|
+
const maxLines = options.expanded ? lines.length : 10;
|
|
110
|
+
const displayLines = lines.slice(0, maxLines);
|
|
111
|
+
const remaining = lines.length - maxLines;
|
|
112
|
+
let text = `\n${displayLines.map((line) => (lang ? replaceTabs(line) : theme.fg("toolOutput", replaceTabs(line)))).join("\n")}`;
|
|
113
|
+
if (remaining > 0) {
|
|
114
|
+
text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("app.tools.expand", "to expand")})`;
|
|
115
|
+
}
|
|
116
|
+
const truncation = result.details?.truncation;
|
|
117
|
+
if (truncation?.truncated) {
|
|
118
|
+
if (truncation.firstLineExceedsLimit) {
|
|
119
|
+
text += `\n${theme.fg("warning", `[First line exceeds ${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit]`)}`;
|
|
120
|
+
}
|
|
121
|
+
else if (truncation.truncatedBy === "lines") {
|
|
122
|
+
text += `\n${theme.fg("warning", `[Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines (${truncation.maxLines ?? DEFAULT_MAX_LINES} line limit)]`)}`;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
text += `\n${theme.fg("warning", `[Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)]`)}`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return text;
|
|
129
|
+
}
|
|
130
|
+
export function createReadToolDefinition(cwd, options) {
|
|
131
|
+
const autoResizeImages = options?.autoResizeImages ?? true;
|
|
132
|
+
const ops = options?.operations ?? defaultReadOperations;
|
|
133
|
+
return {
|
|
134
|
+
name: "read",
|
|
135
|
+
label: "read",
|
|
136
|
+
description: `Read the contents of a file. Supports text files and images (jpg, png, gif, webp). Images are sent as attachments. For text files, output is truncated to ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). Use offset/limit for large files. When you need the full file, continue with offset until complete.`,
|
|
137
|
+
promptSnippet: "Read file contents",
|
|
138
|
+
promptGuidelines: ["Use read to examine files instead of cat or sed."],
|
|
139
|
+
parameters: readSchema,
|
|
140
|
+
async execute(_toolCallId, { path, offset, limit }, signal, _onUpdate, ctx) {
|
|
141
|
+
return new Promise((resolve, reject) => {
|
|
142
|
+
if (signal?.aborted) {
|
|
143
|
+
reject(new Error("Operation aborted"));
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
let aborted = false;
|
|
147
|
+
const onAbort = () => {
|
|
148
|
+
aborted = true;
|
|
149
|
+
reject(new Error("Operation aborted"));
|
|
150
|
+
};
|
|
151
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
152
|
+
(async () => {
|
|
153
|
+
try {
|
|
154
|
+
const absolutePath = await resolveReadPathAsync(path, cwd);
|
|
155
|
+
if (aborted)
|
|
156
|
+
return;
|
|
157
|
+
// Check if file exists and is readable.
|
|
158
|
+
await ops.access(absolutePath);
|
|
159
|
+
if (aborted)
|
|
160
|
+
return;
|
|
161
|
+
const mimeType = ops.detectImageMimeType ? await ops.detectImageMimeType(absolutePath) : undefined;
|
|
162
|
+
let content;
|
|
163
|
+
let details;
|
|
164
|
+
const nonVisionImageNote = getNonVisionImageNote(ctx?.model);
|
|
165
|
+
if (mimeType) {
|
|
166
|
+
// Read image as binary.
|
|
167
|
+
const buffer = await ops.readFile(absolutePath);
|
|
168
|
+
if (autoResizeImages) {
|
|
169
|
+
// Resize image if needed before sending it back to the model.
|
|
170
|
+
const resized = await resizeImage(buffer, mimeType);
|
|
171
|
+
if (!resized) {
|
|
172
|
+
let textNote = `Read image file [${mimeType}]\n[Image omitted: could not be resized below the inline image size limit.]`;
|
|
173
|
+
if (nonVisionImageNote)
|
|
174
|
+
textNote += `\n${nonVisionImageNote}`;
|
|
175
|
+
content = [{ type: "text", text: textNote }];
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
const dimensionNote = formatDimensionNote(resized);
|
|
179
|
+
let textNote = `Read image file [${resized.mimeType}]`;
|
|
180
|
+
if (dimensionNote)
|
|
181
|
+
textNote += `\n${dimensionNote}`;
|
|
182
|
+
if (nonVisionImageNote)
|
|
183
|
+
textNote += `\n${nonVisionImageNote}`;
|
|
184
|
+
content = [
|
|
185
|
+
{ type: "text", text: textNote },
|
|
186
|
+
{ type: "image", data: resized.data, mimeType: resized.mimeType },
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
let textNote = `Read image file [${mimeType}]`;
|
|
192
|
+
if (nonVisionImageNote)
|
|
193
|
+
textNote += `\n${nonVisionImageNote}`;
|
|
194
|
+
content = [
|
|
195
|
+
{ type: "text", text: textNote },
|
|
196
|
+
{ type: "image", data: buffer.toString("base64"), mimeType },
|
|
197
|
+
];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
// Read text content.
|
|
202
|
+
const buffer = await ops.readFile(absolutePath);
|
|
203
|
+
const textContent = buffer.toString("utf-8");
|
|
204
|
+
const allLines = textContent.split("\n");
|
|
205
|
+
const totalFileLines = allLines.length;
|
|
206
|
+
// Apply offset if specified. Convert from 1-indexed input to 0-indexed array access.
|
|
207
|
+
const startLine = offset ? Math.max(0, offset - 1) : 0;
|
|
208
|
+
const startLineDisplay = startLine + 1;
|
|
209
|
+
// Check if offset is out of bounds.
|
|
210
|
+
if (startLine >= allLines.length) {
|
|
211
|
+
throw new Error(`Offset ${offset} is beyond end of file (${allLines.length} lines total)`);
|
|
212
|
+
}
|
|
213
|
+
let selectedContent;
|
|
214
|
+
let userLimitedLines;
|
|
215
|
+
// If limit is specified by the user, honor it first. Otherwise truncateHead decides.
|
|
216
|
+
if (limit !== undefined) {
|
|
217
|
+
const endLine = Math.min(startLine + limit, allLines.length);
|
|
218
|
+
selectedContent = allLines.slice(startLine, endLine).join("\n");
|
|
219
|
+
userLimitedLines = endLine - startLine;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
selectedContent = allLines.slice(startLine).join("\n");
|
|
223
|
+
}
|
|
224
|
+
// Apply truncation, respecting both line and byte limits.
|
|
225
|
+
const truncation = truncateHead(selectedContent);
|
|
226
|
+
let outputText;
|
|
227
|
+
if (truncation.firstLineExceedsLimit) {
|
|
228
|
+
// First line alone exceeds the byte limit. Point the model at a bash fallback.
|
|
229
|
+
const firstLineSize = formatSize(Buffer.byteLength(allLines[startLine], "utf-8"));
|
|
230
|
+
outputText = `[Line ${startLineDisplay} is ${firstLineSize}, exceeds ${formatSize(DEFAULT_MAX_BYTES)} limit. Use bash: sed -n '${startLineDisplay}p' ${path} | head -c ${DEFAULT_MAX_BYTES}]`;
|
|
231
|
+
details = { truncation };
|
|
232
|
+
}
|
|
233
|
+
else if (truncation.truncated) {
|
|
234
|
+
// Truncation occurred. Build an actionable continuation notice.
|
|
235
|
+
const endLineDisplay = startLineDisplay + truncation.outputLines - 1;
|
|
236
|
+
const nextOffset = endLineDisplay + 1;
|
|
237
|
+
outputText = truncation.content;
|
|
238
|
+
if (truncation.truncatedBy === "lines") {
|
|
239
|
+
outputText += `\n\n[Showing lines ${startLineDisplay}-${endLineDisplay} of ${totalFileLines}. Use offset=${nextOffset} to continue.]`;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
outputText += `\n\n[Showing lines ${startLineDisplay}-${endLineDisplay} of ${totalFileLines} (${formatSize(DEFAULT_MAX_BYTES)} limit). Use offset=${nextOffset} to continue.]`;
|
|
243
|
+
}
|
|
244
|
+
details = { truncation };
|
|
245
|
+
}
|
|
246
|
+
else if (userLimitedLines !== undefined && startLine + userLimitedLines < allLines.length) {
|
|
247
|
+
// User-specified limit stopped early, but the file still has more content.
|
|
248
|
+
const remaining = allLines.length - (startLine + userLimitedLines);
|
|
249
|
+
const nextOffset = startLine + userLimitedLines + 1;
|
|
250
|
+
outputText = `${truncation.content}\n\n[${remaining} more lines in file. Use offset=${nextOffset} to continue.]`;
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
// No truncation and no remaining user-limited content.
|
|
254
|
+
outputText = truncation.content;
|
|
255
|
+
}
|
|
256
|
+
content = [{ type: "text", text: outputText }];
|
|
257
|
+
}
|
|
258
|
+
if (aborted)
|
|
259
|
+
return;
|
|
260
|
+
signal?.removeEventListener("abort", onAbort);
|
|
261
|
+
resolve({ content, details });
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
signal?.removeEventListener("abort", onAbort);
|
|
265
|
+
if (!aborted)
|
|
266
|
+
reject(error);
|
|
267
|
+
}
|
|
268
|
+
})();
|
|
269
|
+
});
|
|
270
|
+
},
|
|
271
|
+
renderCall(args, theme, context) {
|
|
272
|
+
const text = context.lastComponent ?? new Text("", 0, 0);
|
|
273
|
+
const classification = !context.expanded ? getCompactReadClassification(args, context.cwd) : undefined;
|
|
274
|
+
text.setText(classification
|
|
275
|
+
? formatCompactReadCall(classification, args, theme)
|
|
276
|
+
: formatReadCall(args, theme, context.cwd));
|
|
277
|
+
return text;
|
|
278
|
+
},
|
|
279
|
+
renderResult(result, options, theme, context) {
|
|
280
|
+
const text = context.lastComponent ?? new Text("", 0, 0);
|
|
281
|
+
text.setText(formatReadResult(context.args, result, options, theme, context.showImages, context.cwd, context.isError));
|
|
282
|
+
return text;
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
export function createReadTool(cwd, options) {
|
|
287
|
+
return wrapToolDefinition(createReadToolDefinition(cwd, options));
|
|
288
|
+
}
|
|
289
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../src/core/tools/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,IAAI,WAAW,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGjG,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAc,MAAM,wCAAwC,CAAC;AACxG,OAAO,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AAC,CAAC,CAAC,SAAS,CAAC;YACvG,IAAI,CAAC,OAAO,CACX,cAAc;gBACb,CAAC,CAAC,qBAAqB,CAAC,cAAc,EAAE,IAAI,EAAE,KAAK,CAAC;gBACpD,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAC3C,CAAC;YACF,OAAO,IAAI,CAAC;QAAA,CACZ;QACD,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;YAC7C,MAAM,IAAI,GAAI,OAAO,CAAC,aAAkC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/E,IAAI,CAAC,OAAO,CACX,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,CACxG,CAAC;YACF,OAAO,IAAI,CAAC;QAAA,CACZ;KACD,CAAC;AAAA,CACF;AAED,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,OAAyB,EAAgC;IACpG,OAAO,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AAAA,CAClE","sourcesContent":["import { basename, dirname, isAbsolute, relative, resolve as resolvePath, sep } from \"node:path\";\nimport type { AgentTool } from \"@dimivelev/chimera-agent-core\";\nimport type { Api, ImageContent, Model, TextContent } from \"@dimivelev/chimera-ai\";\nimport { Text } from \"@dimivelev/chimera-tui\";\nimport { constants } from \"fs\";\nimport { access as fsAccess, readFile as fsReadFile } from \"fs/promises\";\nimport { type Static, Type } from \"typebox\";\nimport { getReadmePath } from \"../../config.ts\";\nimport { keyHint, keyText } from \"../../modes/interactive/components/keybinding-hints.ts\";\nimport { getLanguageFromPath, highlightCode, type Theme } from \"../../modes/interactive/theme/theme.ts\";\nimport { formatDimensionNote, resizeImage } from \"../../utils/image-resize.ts\";\nimport { detectSupportedImageMimeTypeFromFile } from \"../../utils/mime.ts\";\nimport { formatPathRelativeToCwdOrAbsolute } from \"../../utils/paths.ts\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../extensions/types.ts\";\nimport { resolveReadPathAsync, resolveToCwd } from \"./path-utils.ts\";\nimport { getTextOutput, renderToolPath, replaceTabs, str } from \"./render-utils.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\nimport { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationResult, truncateHead } from \"./truncate.ts\";\n\nconst readSchema = Type.Object({\n\tpath: Type.String({ description: \"Path to the file to read (relative or absolute)\" }),\n\toffset: Type.Optional(Type.Number({ description: \"Line number to start reading from (1-indexed)\" })),\n\tlimit: Type.Optional(Type.Number({ description: \"Maximum number of lines to read\" })),\n});\n\nexport type ReadToolInput = Static<typeof readSchema>;\n\nexport interface ReadToolDetails {\n\ttruncation?: TruncationResult;\n}\n\ninterface CompactReadClassification {\n\tkind: \"docs\" | \"resource\" | \"skill\";\n\tlabel: string;\n}\n\nconst COMPACT_RESOURCE_FILE_NAMES = new Set([\"AGENTS.md\", \"AGENTS.MD\", \"CLAUDE.md\", \"CLAUDE.MD\"]);\n\n/**\n * Pluggable operations for the read tool.\n * Override these to delegate file reading to remote systems (for example SSH).\n */\nexport interface ReadOperations {\n\t/** Read file contents as a Buffer */\n\treadFile: (absolutePath: string) => Promise<Buffer>;\n\t/** Check if file is readable (throw if not) */\n\taccess: (absolutePath: string) => Promise<void>;\n\t/** Detect image MIME type, return null or undefined for non-images */\n\tdetectImageMimeType?: (absolutePath: string) => Promise<string | null | undefined>;\n}\n\nconst defaultReadOperations: ReadOperations = {\n\treadFile: (path) => fsReadFile(path),\n\taccess: (path) => fsAccess(path, constants.R_OK),\n\tdetectImageMimeType: detectSupportedImageMimeTypeFromFile,\n};\n\nexport interface ReadToolOptions {\n\t/** Whether to auto-resize images to 2000x2000 max. Default: true */\n\tautoResizeImages?: boolean;\n\t/** Custom operations for file reading. Default: local filesystem */\n\toperations?: ReadOperations;\n}\n\ntype ReadRenderArgs = { path?: string; file_path?: string; offset?: number; limit?: number };\n\nfunction formatReadLineRange(args: ReadRenderArgs | undefined, theme: Theme): string {\n\tif (args?.offset === undefined && args?.limit === undefined) return \"\";\n\tconst startLine = args.offset ?? 1;\n\tconst endLine = args.limit !== undefined ? startLine + args.limit - 1 : \"\";\n\treturn theme.fg(\"warning\", `:${startLine}${endLine ? `-${endLine}` : \"\"}`);\n}\n\nfunction formatReadCall(args: ReadRenderArgs | undefined, theme: Theme, cwd: string): string {\n\tconst pathDisplay = renderToolPath(str(args?.file_path ?? args?.path), theme, cwd);\n\treturn `${theme.fg(\"toolTitle\", theme.bold(\"read\"))} ${pathDisplay}${formatReadLineRange(args, theme)}`;\n}\n\nfunction trimTrailingEmptyLines(lines: string[]): string[] {\n\tlet end = lines.length;\n\twhile (end > 0 && lines[end - 1] === \"\") {\n\t\tend--;\n\t}\n\treturn lines.slice(0, end);\n}\n\nfunction getNonVisionImageNote(model: Model<Api> | undefined): string | undefined {\n\tif (!model || model.input.includes(\"image\")) {\n\t\treturn undefined;\n\t}\n\treturn \"[Current model does not support images. The image will be omitted from this request.]\";\n}\n\nfunction toPosixPath(filePath: string): string {\n\treturn filePath.split(sep).join(\"/\");\n}\n\nfunction getPiDocsClassification(absolutePath: string): CompactReadClassification | undefined {\n\tconst packageRoot = dirname(getReadmePath());\n\tconst relativePath = relative(resolvePath(packageRoot), resolvePath(absolutePath));\n\tif (\n\t\trelativePath === \"\" ||\n\t\trelativePath === \"..\" ||\n\t\trelativePath.startsWith(`..${sep}`) ||\n\t\tisAbsolute(relativePath)\n\t) {\n\t\treturn undefined;\n\t}\n\n\tconst label = toPosixPath(relativePath);\n\tif (label === \"README.md\" || label.startsWith(\"docs/\") || label.startsWith(\"examples/\")) {\n\t\treturn { kind: \"docs\", label };\n\t}\n\treturn undefined;\n}\n\nfunction getCompactReadClassification(\n\targs: ReadRenderArgs | undefined,\n\tcwd: string,\n): CompactReadClassification | undefined {\n\tconst rawPath = str(args?.file_path ?? args?.path);\n\tif (!rawPath) return undefined;\n\n\tconst absolutePath = resolveToCwd(rawPath, cwd);\n\tconst fileName = basename(absolutePath);\n\tif (fileName === \"SKILL.md\") {\n\t\treturn { kind: \"skill\", label: basename(dirname(absolutePath)) || fileName };\n\t}\n\n\tconst docsClassification = getPiDocsClassification(absolutePath);\n\tif (docsClassification) return docsClassification;\n\n\tif (COMPACT_RESOURCE_FILE_NAMES.has(fileName)) {\n\t\treturn { kind: \"resource\", label: formatPathRelativeToCwdOrAbsolute(absolutePath, cwd) };\n\t}\n\n\treturn undefined;\n}\n\nfunction formatCompactReadCall(\n\tclassification: CompactReadClassification,\n\targs: ReadRenderArgs | undefined,\n\ttheme: Theme,\n): string {\n\tconst expandHint = theme.fg(\"dim\", ` (${keyText(\"app.tools.expand\")} to expand)`);\n\tif (classification.kind === \"skill\") {\n\t\treturn (\n\t\t\ttheme.fg(\"customMessageLabel\", `\\x1b[1m[skill]\\x1b[22m `) +\n\t\t\ttheme.fg(\"customMessageText\", classification.label) +\n\t\t\tformatReadLineRange(args, theme) +\n\t\t\texpandHint\n\t\t);\n\t}\n\n\treturn (\n\t\ttheme.fg(\"toolTitle\", theme.bold(`read ${classification.kind}`)) +\n\t\t\" \" +\n\t\ttheme.fg(\"accent\", classification.label) +\n\t\tformatReadLineRange(args, theme) +\n\t\texpandHint\n\t);\n}\n\nfunction formatReadResult(\n\targs: ReadRenderArgs | undefined,\n\tresult: { content: (TextContent | ImageContent)[]; details?: ReadToolDetails },\n\toptions: ToolRenderResultOptions,\n\ttheme: Theme,\n\tshowImages: boolean,\n\t_cwd: string,\n\tisError: boolean,\n): string {\n\tif (!options.expanded && !isError) {\n\t\treturn \"\";\n\t}\n\n\tconst rawPath = str(args?.file_path ?? args?.path);\n\tconst output = getTextOutput(result, showImages);\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tconst renderedLines = lang ? highlightCode(replaceTabs(output), lang) : output.split(\"\\n\");\n\tconst lines = trimTrailingEmptyLines(renderedLines);\n\tconst maxLines = options.expanded ? lines.length : 10;\n\tconst displayLines = lines.slice(0, maxLines);\n\tconst remaining = lines.length - maxLines;\n\tlet text = `\\n${displayLines.map((line) => (lang ? replaceTabs(line) : theme.fg(\"toolOutput\", replaceTabs(line)))).join(\"\\n\")}`;\n\tif (remaining > 0) {\n\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines,`)} ${keyHint(\"app.tools.expand\", \"to expand\")})`;\n\t}\n\n\tconst truncation = result.details?.truncation;\n\tif (truncation?.truncated) {\n\t\tif (truncation.firstLineExceedsLimit) {\n\t\t\ttext += `\\n${theme.fg(\"warning\", `[First line exceeds ${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit]`)}`;\n\t\t} else if (truncation.truncatedBy === \"lines\") {\n\t\t\ttext += `\\n${theme.fg(\"warning\", `[Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines (${truncation.maxLines ?? DEFAULT_MAX_LINES} line limit)]`)}`;\n\t\t} else {\n\t\t\ttext += `\\n${theme.fg(\"warning\", `[Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)]`)}`;\n\t\t}\n\t}\n\treturn text;\n}\n\nexport function createReadToolDefinition(\n\tcwd: string,\n\toptions?: ReadToolOptions,\n): ToolDefinition<typeof readSchema, ReadToolDetails | undefined> {\n\tconst autoResizeImages = options?.autoResizeImages ?? true;\n\tconst ops = options?.operations ?? defaultReadOperations;\n\treturn {\n\t\tname: \"read\",\n\t\tlabel: \"read\",\n\t\tdescription: `Read the contents of a file. Supports text files and images (jpg, png, gif, webp). Images are sent as attachments. For text files, output is truncated to ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). Use offset/limit for large files. When you need the full file, continue with offset until complete.`,\n\t\tpromptSnippet: \"Read file contents\",\n\t\tpromptGuidelines: [\"Use read to examine files instead of cat or sed.\"],\n\t\tparameters: readSchema,\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ path, offset, limit }: { path: string; offset?: number; limit?: number },\n\t\t\tsignal?: AbortSignal,\n\t\t\t_onUpdate?,\n\t\t\tctx?,\n\t\t) {\n\t\t\treturn new Promise<{ content: (TextContent | ImageContent)[]; details: ReadToolDetails | undefined }>(\n\t\t\t\t(resolve, reject) => {\n\t\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tlet aborted = false;\n\t\t\t\t\tconst onAbort = () => {\n\t\t\t\t\t\taborted = true;\n\t\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\t};\n\t\t\t\t\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\n\t\t\t\t\t(async () => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst absolutePath = await resolveReadPathAsync(path, cwd);\n\t\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\t\t// Check if file exists and is readable.\n\t\t\t\t\t\t\tawait ops.access(absolutePath);\n\t\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\t\tconst mimeType = ops.detectImageMimeType ? await ops.detectImageMimeType(absolutePath) : undefined;\n\t\t\t\t\t\t\tlet content: (TextContent | ImageContent)[];\n\t\t\t\t\t\t\tlet details: ReadToolDetails | undefined;\n\t\t\t\t\t\t\tconst nonVisionImageNote = getNonVisionImageNote(ctx?.model);\n\t\t\t\t\t\t\tif (mimeType) {\n\t\t\t\t\t\t\t\t// Read image as binary.\n\t\t\t\t\t\t\t\tconst buffer = await ops.readFile(absolutePath);\n\t\t\t\t\t\t\t\tif (autoResizeImages) {\n\t\t\t\t\t\t\t\t\t// Resize image if needed before sending it back to the model.\n\t\t\t\t\t\t\t\t\tconst resized = await resizeImage(buffer, mimeType);\n\t\t\t\t\t\t\t\t\tif (!resized) {\n\t\t\t\t\t\t\t\t\t\tlet textNote = `Read image file [${mimeType}]\\n[Image omitted: could not be resized below the inline image size limit.]`;\n\t\t\t\t\t\t\t\t\t\tif (nonVisionImageNote) textNote += `\\n${nonVisionImageNote}`;\n\t\t\t\t\t\t\t\t\t\tcontent = [{ type: \"text\", text: textNote }];\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tconst dimensionNote = formatDimensionNote(resized);\n\t\t\t\t\t\t\t\t\t\tlet textNote = `Read image file [${resized.mimeType}]`;\n\t\t\t\t\t\t\t\t\t\tif (dimensionNote) textNote += `\\n${dimensionNote}`;\n\t\t\t\t\t\t\t\t\t\tif (nonVisionImageNote) textNote += `\\n${nonVisionImageNote}`;\n\t\t\t\t\t\t\t\t\t\tcontent = [\n\t\t\t\t\t\t\t\t\t\t\t{ type: \"text\", text: textNote },\n\t\t\t\t\t\t\t\t\t\t\t{ type: \"image\", data: resized.data, mimeType: resized.mimeType },\n\t\t\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tlet textNote = `Read image file [${mimeType}]`;\n\t\t\t\t\t\t\t\t\tif (nonVisionImageNote) textNote += `\\n${nonVisionImageNote}`;\n\t\t\t\t\t\t\t\t\tcontent = [\n\t\t\t\t\t\t\t\t\t\t{ type: \"text\", text: textNote },\n\t\t\t\t\t\t\t\t\t\t{ type: \"image\", data: buffer.toString(\"base64\"), mimeType },\n\t\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Read text content.\n\t\t\t\t\t\t\t\tconst buffer = await ops.readFile(absolutePath);\n\t\t\t\t\t\t\t\tconst textContent = buffer.toString(\"utf-8\");\n\t\t\t\t\t\t\t\tconst allLines = textContent.split(\"\\n\");\n\t\t\t\t\t\t\t\tconst totalFileLines = allLines.length;\n\t\t\t\t\t\t\t\t// Apply offset if specified. Convert from 1-indexed input to 0-indexed array access.\n\t\t\t\t\t\t\t\tconst startLine = offset ? Math.max(0, offset - 1) : 0;\n\t\t\t\t\t\t\t\tconst startLineDisplay = startLine + 1;\n\t\t\t\t\t\t\t\t// Check if offset is out of bounds.\n\t\t\t\t\t\t\t\tif (startLine >= allLines.length) {\n\t\t\t\t\t\t\t\t\tthrow new Error(`Offset ${offset} is beyond end of file (${allLines.length} lines total)`);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlet selectedContent: string;\n\t\t\t\t\t\t\t\tlet userLimitedLines: number | undefined;\n\t\t\t\t\t\t\t\t// If limit is specified by the user, honor it first. Otherwise truncateHead decides.\n\t\t\t\t\t\t\t\tif (limit !== undefined) {\n\t\t\t\t\t\t\t\t\tconst endLine = Math.min(startLine + limit, allLines.length);\n\t\t\t\t\t\t\t\t\tselectedContent = allLines.slice(startLine, endLine).join(\"\\n\");\n\t\t\t\t\t\t\t\t\tuserLimitedLines = endLine - startLine;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tselectedContent = allLines.slice(startLine).join(\"\\n\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Apply truncation, respecting both line and byte limits.\n\t\t\t\t\t\t\t\tconst truncation = truncateHead(selectedContent);\n\t\t\t\t\t\t\t\tlet outputText: string;\n\t\t\t\t\t\t\t\tif (truncation.firstLineExceedsLimit) {\n\t\t\t\t\t\t\t\t\t// First line alone exceeds the byte limit. Point the model at a bash fallback.\n\t\t\t\t\t\t\t\t\tconst firstLineSize = formatSize(Buffer.byteLength(allLines[startLine], \"utf-8\"));\n\t\t\t\t\t\t\t\t\toutputText = `[Line ${startLineDisplay} is ${firstLineSize}, exceeds ${formatSize(DEFAULT_MAX_BYTES)} limit. Use bash: sed -n '${startLineDisplay}p' ${path} | head -c ${DEFAULT_MAX_BYTES}]`;\n\t\t\t\t\t\t\t\t\tdetails = { truncation };\n\t\t\t\t\t\t\t\t} else if (truncation.truncated) {\n\t\t\t\t\t\t\t\t\t// Truncation occurred. Build an actionable continuation notice.\n\t\t\t\t\t\t\t\t\tconst endLineDisplay = startLineDisplay + truncation.outputLines - 1;\n\t\t\t\t\t\t\t\t\tconst nextOffset = endLineDisplay + 1;\n\t\t\t\t\t\t\t\t\toutputText = truncation.content;\n\t\t\t\t\t\t\t\t\tif (truncation.truncatedBy === \"lines\") {\n\t\t\t\t\t\t\t\t\t\toutputText += `\\n\\n[Showing lines ${startLineDisplay}-${endLineDisplay} of ${totalFileLines}. Use offset=${nextOffset} to continue.]`;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\toutputText += `\\n\\n[Showing lines ${startLineDisplay}-${endLineDisplay} of ${totalFileLines} (${formatSize(DEFAULT_MAX_BYTES)} limit). Use offset=${nextOffset} to continue.]`;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdetails = { truncation };\n\t\t\t\t\t\t\t\t} else if (userLimitedLines !== undefined && startLine + userLimitedLines < allLines.length) {\n\t\t\t\t\t\t\t\t\t// User-specified limit stopped early, but the file still has more content.\n\t\t\t\t\t\t\t\t\tconst remaining = allLines.length - (startLine + userLimitedLines);\n\t\t\t\t\t\t\t\t\tconst nextOffset = startLine + userLimitedLines + 1;\n\t\t\t\t\t\t\t\t\toutputText = `${truncation.content}\\n\\n[${remaining} more lines in file. Use offset=${nextOffset} to continue.]`;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// No truncation and no remaining user-limited content.\n\t\t\t\t\t\t\t\t\toutputText = truncation.content;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontent = [{ type: \"text\", text: outputText }];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t\tresolve({ content, details });\n\t\t\t\t\t\t} catch (error: any) {\n\t\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t\tif (!aborted) reject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\t\t\t\t},\n\t\t\t);\n\t\t},\n\t\trenderCall(args, theme, context) {\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\tconst classification = !context.expanded ? getCompactReadClassification(args, context.cwd) : undefined;\n\t\t\ttext.setText(\n\t\t\t\tclassification\n\t\t\t\t\t? formatCompactReadCall(classification, args, theme)\n\t\t\t\t\t: formatReadCall(args, theme, context.cwd),\n\t\t\t);\n\t\t\treturn text;\n\t\t},\n\t\trenderResult(result, options, theme, context) {\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(\n\t\t\t\tformatReadResult(context.args, result, options, theme, context.showImages, context.cwd, context.isError),\n\t\t\t);\n\t\t\treturn text;\n\t\t},\n\t};\n}\n\nexport function createReadTool(cwd: string, options?: ReadToolOptions): AgentTool<typeof readSchema> {\n\treturn wrapToolDefinition(createReadToolDefinition(cwd, options));\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ImageContent, TextContent } from "@dimivelev/chimera-ai";
|
|
2
|
+
import type { Theme } from "../../modes/interactive/theme/theme.ts";
|
|
3
|
+
export declare function shortenPath(path: unknown): string;
|
|
4
|
+
export declare function linkPath(styledText: string, rawPath: string, cwd: string): string;
|
|
5
|
+
export declare function str(value: unknown): string | null;
|
|
6
|
+
export declare function replaceTabs(text: string): string;
|
|
7
|
+
export declare function normalizeDisplayText(text: string): string;
|
|
8
|
+
export declare function getTextOutput(result: {
|
|
9
|
+
content: Array<{
|
|
10
|
+
type: string;
|
|
11
|
+
text?: string;
|
|
12
|
+
data?: string;
|
|
13
|
+
mimeType?: string;
|
|
14
|
+
}>;
|
|
15
|
+
} | undefined, showImages: boolean): string;
|
|
16
|
+
export type ToolRenderResultLike<TDetails> = {
|
|
17
|
+
content: (TextContent | ImageContent)[];
|
|
18
|
+
details: TDetails;
|
|
19
|
+
};
|
|
20
|
+
export declare function invalidArgText(theme: Theme): string;
|
|
21
|
+
export declare function renderToolPath(rawPath: string | null, theme: Theme, cwd: string, options?: {
|
|
22
|
+
emptyFallback?: string;
|
|
23
|
+
}): string;
|
|
24
|
+
//# sourceMappingURL=render-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-utils.d.ts","sourceRoot":"","sources":["../../../src/core/tools/render-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAKpE,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAOjD;AAED,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAIjF;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAIjD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,aAAa,CAC5B,MAAM,EAAE;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAAG,SAAS,EACzG,UAAU,EAAE,OAAO,GACjB,MAAM,CAsBR;AAED,MAAM,MAAM,oBAAoB,CAAC,QAAQ,IAAI;IAC5C,OAAO,EAAE,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC;IACxC,OAAO,EAAE,QAAQ,CAAC;CAClB,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAEnD;AAED,wBAAgB,cAAc,CAC7B,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GAClC,MAAM,CAKR","sourcesContent":["import * as os from \"node:os\";\nimport { pathToFileURL } from \"node:url\";\nimport type { ImageContent, TextContent } from \"@dimivelev/chimera-ai\";\nimport { getCapabilities, getImageDimensions, hyperlink, imageFallback } from \"@dimivelev/chimera-tui\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.ts\";\nimport { stripAnsi } from \"../../utils/ansi.ts\";\nimport { resolvePath } from \"../../utils/paths.ts\";\nimport { sanitizeBinaryOutput } from \"../../utils/shell.ts\";\n\nexport function shortenPath(path: unknown): string {\n\tif (typeof path !== \"string\") return \"\";\n\tconst home = os.homedir();\n\tif (path.startsWith(home)) {\n\t\treturn `~${path.slice(home.length)}`;\n\t}\n\treturn path;\n}\n\nexport function linkPath(styledText: string, rawPath: string, cwd: string): string {\n\tif (!getCapabilities().hyperlinks) return styledText;\n\tconst absolutePath = resolvePath(rawPath, cwd);\n\treturn hyperlink(styledText, pathToFileURL(absolutePath).href);\n}\n\nexport function str(value: unknown): string | null {\n\tif (typeof value === \"string\") return value;\n\tif (value == null) return \"\";\n\treturn null;\n}\n\nexport function replaceTabs(text: string): string {\n\treturn text.replace(/\\t/g, \" \");\n}\n\nexport function normalizeDisplayText(text: string): string {\n\treturn text.replace(/\\r/g, \"\");\n}\n\nexport function getTextOutput(\n\tresult: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }> } | undefined,\n\tshowImages: boolean,\n): string {\n\tif (!result) return \"\";\n\n\tconst textBlocks = result.content.filter((c) => c.type === \"text\");\n\tconst imageBlocks = result.content.filter((c) => c.type === \"image\");\n\n\tlet output = textBlocks.map((c) => sanitizeBinaryOutput(stripAnsi(c.text || \"\")).replace(/\\r/g, \"\")).join(\"\\n\");\n\n\tconst caps = getCapabilities();\n\tif (imageBlocks.length > 0 && (!caps.images || !showImages)) {\n\t\tconst imageIndicators = imageBlocks\n\t\t\t.map((img) => {\n\t\t\t\tconst mimeType = img.mimeType ?? \"image/unknown\";\n\t\t\t\tconst dims =\n\t\t\t\t\timg.data && img.mimeType ? (getImageDimensions(img.data, img.mimeType) ?? undefined) : undefined;\n\t\t\t\treturn imageFallback(mimeType, dims);\n\t\t\t})\n\t\t\t.join(\"\\n\");\n\t\toutput = output ? `${output}\\n${imageIndicators}` : imageIndicators;\n\t}\n\n\treturn output;\n}\n\nexport type ToolRenderResultLike<TDetails> = {\n\tcontent: (TextContent | ImageContent)[];\n\tdetails: TDetails;\n};\n\nexport function invalidArgText(theme: Theme): string {\n\treturn theme.fg(\"error\", \"[invalid arg]\");\n}\n\nexport function renderToolPath(\n\trawPath: string | null,\n\ttheme: Theme,\n\tcwd: string,\n\toptions?: { emptyFallback?: string },\n): string {\n\tif (rawPath === null) return invalidArgText(theme);\n\tconst value = rawPath || options?.emptyFallback;\n\tif (!value) return theme.fg(\"toolOutput\", \"...\");\n\treturn linkPath(theme.fg(\"accent\", shortenPath(value)), value, cwd);\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as os from "node:os";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { getCapabilities, getImageDimensions, hyperlink, imageFallback } from "@dimivelev/chimera-tui";
|
|
4
|
+
import { stripAnsi } from "../../utils/ansi.js";
|
|
5
|
+
import { resolvePath } from "../../utils/paths.js";
|
|
6
|
+
import { sanitizeBinaryOutput } from "../../utils/shell.js";
|
|
7
|
+
export function shortenPath(path) {
|
|
8
|
+
if (typeof path !== "string")
|
|
9
|
+
return "";
|
|
10
|
+
const home = os.homedir();
|
|
11
|
+
if (path.startsWith(home)) {
|
|
12
|
+
return `~${path.slice(home.length)}`;
|
|
13
|
+
}
|
|
14
|
+
return path;
|
|
15
|
+
}
|
|
16
|
+
export function linkPath(styledText, rawPath, cwd) {
|
|
17
|
+
if (!getCapabilities().hyperlinks)
|
|
18
|
+
return styledText;
|
|
19
|
+
const absolutePath = resolvePath(rawPath, cwd);
|
|
20
|
+
return hyperlink(styledText, pathToFileURL(absolutePath).href);
|
|
21
|
+
}
|
|
22
|
+
export function str(value) {
|
|
23
|
+
if (typeof value === "string")
|
|
24
|
+
return value;
|
|
25
|
+
if (value == null)
|
|
26
|
+
return "";
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
export function replaceTabs(text) {
|
|
30
|
+
return text.replace(/\t/g, " ");
|
|
31
|
+
}
|
|
32
|
+
export function normalizeDisplayText(text) {
|
|
33
|
+
return text.replace(/\r/g, "");
|
|
34
|
+
}
|
|
35
|
+
export function getTextOutput(result, showImages) {
|
|
36
|
+
if (!result)
|
|
37
|
+
return "";
|
|
38
|
+
const textBlocks = result.content.filter((c) => c.type === "text");
|
|
39
|
+
const imageBlocks = result.content.filter((c) => c.type === "image");
|
|
40
|
+
let output = textBlocks.map((c) => sanitizeBinaryOutput(stripAnsi(c.text || "")).replace(/\r/g, "")).join("\n");
|
|
41
|
+
const caps = getCapabilities();
|
|
42
|
+
if (imageBlocks.length > 0 && (!caps.images || !showImages)) {
|
|
43
|
+
const imageIndicators = imageBlocks
|
|
44
|
+
.map((img) => {
|
|
45
|
+
const mimeType = img.mimeType ?? "image/unknown";
|
|
46
|
+
const dims = img.data && img.mimeType ? (getImageDimensions(img.data, img.mimeType) ?? undefined) : undefined;
|
|
47
|
+
return imageFallback(mimeType, dims);
|
|
48
|
+
})
|
|
49
|
+
.join("\n");
|
|
50
|
+
output = output ? `${output}\n${imageIndicators}` : imageIndicators;
|
|
51
|
+
}
|
|
52
|
+
return output;
|
|
53
|
+
}
|
|
54
|
+
export function invalidArgText(theme) {
|
|
55
|
+
return theme.fg("error", "[invalid arg]");
|
|
56
|
+
}
|
|
57
|
+
export function renderToolPath(rawPath, theme, cwd, options) {
|
|
58
|
+
if (rawPath === null)
|
|
59
|
+
return invalidArgText(theme);
|
|
60
|
+
const value = rawPath || options?.emptyFallback;
|
|
61
|
+
if (!value)
|
|
62
|
+
return theme.fg("toolOutput", "...");
|
|
63
|
+
return linkPath(theme.fg("accent", shortenPath(value)), value, cwd);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=render-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-utils.js","sourceRoot":"","sources":["../../../src/core/tools/render-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvG,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,UAAU,WAAW,CAAC,IAAa,EAAU;IAClD,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACxC,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IAC1B,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC;AAAA,CACZ;AAED,MAAM,UAAU,QAAQ,CAA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,EAAE,KAAK,CAAC,CAAC;IACjD,OAAO,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAAA,CACpE","sourcesContent":["import * as os from \"node:os\";\nimport { pathToFileURL } from \"node:url\";\nimport type { ImageContent, TextContent } from \"@dimivelev/chimera-ai\";\nimport { getCapabilities, getImageDimensions, hyperlink, imageFallback } from \"@dimivelev/chimera-tui\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.ts\";\nimport { stripAnsi } from \"../../utils/ansi.ts\";\nimport { resolvePath } from \"../../utils/paths.ts\";\nimport { sanitizeBinaryOutput } from \"../../utils/shell.ts\";\n\nexport function shortenPath(path: unknown): string {\n\tif (typeof path !== \"string\") return \"\";\n\tconst home = os.homedir();\n\tif (path.startsWith(home)) {\n\t\treturn `~${path.slice(home.length)}`;\n\t}\n\treturn path;\n}\n\nexport function linkPath(styledText: string, rawPath: string, cwd: string): string {\n\tif (!getCapabilities().hyperlinks) return styledText;\n\tconst absolutePath = resolvePath(rawPath, cwd);\n\treturn hyperlink(styledText, pathToFileURL(absolutePath).href);\n}\n\nexport function str(value: unknown): string | null {\n\tif (typeof value === \"string\") return value;\n\tif (value == null) return \"\";\n\treturn null;\n}\n\nexport function replaceTabs(text: string): string {\n\treturn text.replace(/\\t/g, \" \");\n}\n\nexport function normalizeDisplayText(text: string): string {\n\treturn text.replace(/\\r/g, \"\");\n}\n\nexport function getTextOutput(\n\tresult: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }> } | undefined,\n\tshowImages: boolean,\n): string {\n\tif (!result) return \"\";\n\n\tconst textBlocks = result.content.filter((c) => c.type === \"text\");\n\tconst imageBlocks = result.content.filter((c) => c.type === \"image\");\n\n\tlet output = textBlocks.map((c) => sanitizeBinaryOutput(stripAnsi(c.text || \"\")).replace(/\\r/g, \"\")).join(\"\\n\");\n\n\tconst caps = getCapabilities();\n\tif (imageBlocks.length > 0 && (!caps.images || !showImages)) {\n\t\tconst imageIndicators = imageBlocks\n\t\t\t.map((img) => {\n\t\t\t\tconst mimeType = img.mimeType ?? \"image/unknown\";\n\t\t\t\tconst dims =\n\t\t\t\t\timg.data && img.mimeType ? (getImageDimensions(img.data, img.mimeType) ?? undefined) : undefined;\n\t\t\t\treturn imageFallback(mimeType, dims);\n\t\t\t})\n\t\t\t.join(\"\\n\");\n\t\toutput = output ? `${output}\\n${imageIndicators}` : imageIndicators;\n\t}\n\n\treturn output;\n}\n\nexport type ToolRenderResultLike<TDetails> = {\n\tcontent: (TextContent | ImageContent)[];\n\tdetails: TDetails;\n};\n\nexport function invalidArgText(theme: Theme): string {\n\treturn theme.fg(\"error\", \"[invalid arg]\");\n}\n\nexport function renderToolPath(\n\trawPath: string | null,\n\ttheme: Theme,\n\tcwd: string,\n\toptions?: { emptyFallback?: string },\n): string {\n\tif (rawPath === null) return invalidArgText(theme);\n\tconst value = rawPath || options?.emptyFallback;\n\tif (!value) return theme.fg(\"toolOutput\", \"...\");\n\treturn linkPath(theme.fg(\"accent\", shortenPath(value)), value, cwd);\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentTool } from "@dimivelev/chimera-agent-core";
|
|
2
|
+
import type { ExtensionContext, ToolDefinition } from "../extensions/types.ts";
|
|
3
|
+
/** Wrap a ToolDefinition into an AgentTool for the core runtime. */
|
|
4
|
+
export declare function wrapToolDefinition<TDetails = unknown>(definition: ToolDefinition<any, TDetails>, ctxFactory?: () => ExtensionContext): AgentTool<any, TDetails>;
|
|
5
|
+
/** Wrap multiple ToolDefinitions into AgentTools for the core runtime. */
|
|
6
|
+
export declare function wrapToolDefinitions(definitions: ToolDefinition<any, any>[], ctxFactory?: () => ExtensionContext): AgentTool<any>[];
|
|
7
|
+
/**
|
|
8
|
+
* Synthesize a minimal ToolDefinition from an AgentTool.
|
|
9
|
+
*
|
|
10
|
+
* This keeps AgentSession's internal registry definition-first even when a caller
|
|
11
|
+
* provides plain AgentTool overrides that do not include prompt metadata or renderers.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createToolDefinitionFromAgentTool(tool: AgentTool<any>): ToolDefinition<any, unknown>;
|
|
14
|
+
//# sourceMappingURL=tool-definition-wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-definition-wrapper.d.ts","sourceRoot":"","sources":["../../../src/core/tools/tool-definition-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE/E,oEAAoE;AACpE,wBAAgB,kBAAkB,CAAC,QAAQ,GAAG,OAAO,EACpD,UAAU,EAAE,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,EACzC,UAAU,CAAC,EAAE,MAAM,gBAAgB,GACjC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAW1B;AAED,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EACvC,UAAU,CAAC,EAAE,MAAM,gBAAgB,GACjC,SAAS,CAAC,GAAG,CAAC,EAAE,CAElB;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAUpG","sourcesContent":["import type { AgentTool } from \"@dimivelev/chimera-agent-core\";\nimport type { ExtensionContext, ToolDefinition } from \"../extensions/types.ts\";\n\n/** Wrap a ToolDefinition into an AgentTool for the core runtime. */\nexport function wrapToolDefinition<TDetails = unknown>(\n\tdefinition: ToolDefinition<any, TDetails>,\n\tctxFactory?: () => ExtensionContext,\n): AgentTool<any, TDetails> {\n\treturn {\n\t\tname: definition.name,\n\t\tlabel: definition.label,\n\t\tdescription: definition.description,\n\t\tparameters: definition.parameters,\n\t\tprepareArguments: definition.prepareArguments,\n\t\texecutionMode: definition.executionMode,\n\t\texecute: (toolCallId, params, signal, onUpdate) =>\n\t\t\tdefinition.execute(toolCallId, params, signal, onUpdate, ctxFactory?.() as ExtensionContext),\n\t};\n}\n\n/** Wrap multiple ToolDefinitions into AgentTools for the core runtime. */\nexport function wrapToolDefinitions(\n\tdefinitions: ToolDefinition<any, any>[],\n\tctxFactory?: () => ExtensionContext,\n): AgentTool<any>[] {\n\treturn definitions.map((definition) => wrapToolDefinition(definition, ctxFactory));\n}\n\n/**\n * Synthesize a minimal ToolDefinition from an AgentTool.\n *\n * This keeps AgentSession's internal registry definition-first even when a caller\n * provides plain AgentTool overrides that do not include prompt metadata or renderers.\n */\nexport function createToolDefinitionFromAgentTool(tool: AgentTool<any>): ToolDefinition<any, unknown> {\n\treturn {\n\t\tname: tool.name,\n\t\tlabel: tool.label,\n\t\tdescription: tool.description,\n\t\tparameters: tool.parameters as any,\n\t\tprepareArguments: tool.prepareArguments,\n\t\texecutionMode: tool.executionMode,\n\t\texecute: async (toolCallId, params, signal, onUpdate) => tool.execute(toolCallId, params, signal, onUpdate),\n\t};\n}\n"]}
|