@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,366 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
let cachedCapabilities = null;
|
|
3
|
+
// Default cell dimensions - updated by TUI when terminal responds to query
|
|
4
|
+
let cellDimensions = { widthPx: 9, heightPx: 18 };
|
|
5
|
+
export function getCellDimensions() {
|
|
6
|
+
return cellDimensions;
|
|
7
|
+
}
|
|
8
|
+
export function setCellDimensions(dims) {
|
|
9
|
+
cellDimensions = dims;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Checks whether the attached tmux client forwards OSC 8 hyperlinks to the
|
|
13
|
+
* outer terminal. tmux only re-emits them when its `client_termfeatures` lists
|
|
14
|
+
* `hyperlinks`, and strips them otherwise. On any error fallbacks `false`.
|
|
15
|
+
*/
|
|
16
|
+
function probeTmuxHyperlinks() {
|
|
17
|
+
try {
|
|
18
|
+
const termfeatures = execSync("tmux display-message -p '#{client_termfeatures}'", {
|
|
19
|
+
encoding: "utf8",
|
|
20
|
+
timeout: 250,
|
|
21
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
22
|
+
});
|
|
23
|
+
return termfeatures
|
|
24
|
+
.split(",")
|
|
25
|
+
.map((feature) => feature.trim())
|
|
26
|
+
.includes("hyperlinks");
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function detectCapabilities(tmuxForwardsHyperlink = probeTmuxHyperlinks) {
|
|
33
|
+
const termProgram = process.env.TERM_PROGRAM?.toLowerCase() || "";
|
|
34
|
+
const terminalEmulator = process.env.TERMINAL_EMULATOR?.toLowerCase() || "";
|
|
35
|
+
const term = process.env.TERM?.toLowerCase() || "";
|
|
36
|
+
const colorTerm = process.env.COLORTERM?.toLowerCase() || "";
|
|
37
|
+
const hasTrueColorHint = colorTerm === "truecolor" || colorTerm === "24bit";
|
|
38
|
+
// Emit OSC 8 hyperlinks only when tmux confirms it forwards.
|
|
39
|
+
// Image protocols are unreliable under tmux, so leave `images: null`.
|
|
40
|
+
if (process.env.TMUX || term.startsWith("tmux")) {
|
|
41
|
+
return { images: null, trueColor: hasTrueColorHint, hyperlinks: tmuxForwardsHyperlink() };
|
|
42
|
+
}
|
|
43
|
+
// screen does not forward OSC 8 hyperlinks, so keep them off there.
|
|
44
|
+
if (term.startsWith("screen")) {
|
|
45
|
+
return { images: null, trueColor: hasTrueColorHint, hyperlinks: false };
|
|
46
|
+
}
|
|
47
|
+
if (process.env.KITTY_WINDOW_ID || termProgram === "kitty") {
|
|
48
|
+
return { images: "kitty", trueColor: true, hyperlinks: true };
|
|
49
|
+
}
|
|
50
|
+
if (termProgram === "ghostty" || term.includes("ghostty") || process.env.GHOSTTY_RESOURCES_DIR) {
|
|
51
|
+
return { images: "kitty", trueColor: true, hyperlinks: true };
|
|
52
|
+
}
|
|
53
|
+
if (process.env.WEZTERM_PANE || termProgram === "wezterm") {
|
|
54
|
+
return { images: "kitty", trueColor: true, hyperlinks: true };
|
|
55
|
+
}
|
|
56
|
+
if (process.env.ITERM_SESSION_ID || termProgram === "iterm.app") {
|
|
57
|
+
return { images: "iterm2", trueColor: true, hyperlinks: true };
|
|
58
|
+
}
|
|
59
|
+
if (process.env.WT_SESSION) {
|
|
60
|
+
return { images: null, trueColor: true, hyperlinks: true };
|
|
61
|
+
}
|
|
62
|
+
if (termProgram === "vscode") {
|
|
63
|
+
return { images: null, trueColor: true, hyperlinks: true };
|
|
64
|
+
}
|
|
65
|
+
if (termProgram === "alacritty") {
|
|
66
|
+
return { images: null, trueColor: true, hyperlinks: true };
|
|
67
|
+
}
|
|
68
|
+
if (terminalEmulator === "jetbrains-jediterm") {
|
|
69
|
+
return { images: null, trueColor: true, hyperlinks: false };
|
|
70
|
+
}
|
|
71
|
+
// Unknown terminal: be conservative. OSC 8 is rendered invisibly as "just
|
|
72
|
+
// text" on terminals that swallow it, which means the URL disappears from
|
|
73
|
+
// the rendered output. Default to the legacy `text (url)` behavior unless we
|
|
74
|
+
// have positively identified a hyperlink-capable terminal above.
|
|
75
|
+
return { images: null, trueColor: hasTrueColorHint, hyperlinks: false };
|
|
76
|
+
}
|
|
77
|
+
export function getCapabilities() {
|
|
78
|
+
if (!cachedCapabilities) {
|
|
79
|
+
cachedCapabilities = detectCapabilities();
|
|
80
|
+
}
|
|
81
|
+
return cachedCapabilities;
|
|
82
|
+
}
|
|
83
|
+
export function resetCapabilitiesCache() {
|
|
84
|
+
cachedCapabilities = null;
|
|
85
|
+
}
|
|
86
|
+
/** Override the cached capabilities. Useful in tests to exercise both code paths. */
|
|
87
|
+
export function setCapabilities(caps) {
|
|
88
|
+
cachedCapabilities = caps;
|
|
89
|
+
}
|
|
90
|
+
const KITTY_PREFIX = "\x1b_G";
|
|
91
|
+
const ITERM2_PREFIX = "\x1b]1337;File=";
|
|
92
|
+
export function isImageLine(line) {
|
|
93
|
+
// Fast path: sequence at line start (single-row images)
|
|
94
|
+
if (line.startsWith(KITTY_PREFIX) || line.startsWith(ITERM2_PREFIX)) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
// Slow path: sequence elsewhere (multi-row images have cursor-up prefix)
|
|
98
|
+
return line.includes(KITTY_PREFIX) || line.includes(ITERM2_PREFIX);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Generate a random image ID for Kitty graphics protocol.
|
|
102
|
+
* Uses random IDs to avoid collisions between different module instances
|
|
103
|
+
* (e.g., main app vs extensions).
|
|
104
|
+
*/
|
|
105
|
+
export function allocateImageId() {
|
|
106
|
+
// Use random ID in range [1, 0xffffffff] to avoid collisions
|
|
107
|
+
return Math.floor(Math.random() * 0xfffffffe) + 1;
|
|
108
|
+
}
|
|
109
|
+
export function encodeKitty(base64Data, options = {}) {
|
|
110
|
+
const CHUNK_SIZE = 4096;
|
|
111
|
+
const params = ["a=T", "f=100", "q=2"];
|
|
112
|
+
if (options.moveCursor === false)
|
|
113
|
+
params.push("C=1");
|
|
114
|
+
if (options.columns)
|
|
115
|
+
params.push(`c=${options.columns}`);
|
|
116
|
+
if (options.rows)
|
|
117
|
+
params.push(`r=${options.rows}`);
|
|
118
|
+
if (options.imageId)
|
|
119
|
+
params.push(`i=${options.imageId}`);
|
|
120
|
+
if (base64Data.length <= CHUNK_SIZE) {
|
|
121
|
+
return `\x1b_G${params.join(",")};${base64Data}\x1b\\`;
|
|
122
|
+
}
|
|
123
|
+
const chunks = [];
|
|
124
|
+
let offset = 0;
|
|
125
|
+
let isFirst = true;
|
|
126
|
+
while (offset < base64Data.length) {
|
|
127
|
+
const chunk = base64Data.slice(offset, offset + CHUNK_SIZE);
|
|
128
|
+
const isLast = offset + CHUNK_SIZE >= base64Data.length;
|
|
129
|
+
if (isFirst) {
|
|
130
|
+
chunks.push(`\x1b_G${params.join(",")},m=1;${chunk}\x1b\\`);
|
|
131
|
+
isFirst = false;
|
|
132
|
+
}
|
|
133
|
+
else if (isLast) {
|
|
134
|
+
chunks.push(`\x1b_Gm=0;${chunk}\x1b\\`);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
chunks.push(`\x1b_Gm=1;${chunk}\x1b\\`);
|
|
138
|
+
}
|
|
139
|
+
offset += CHUNK_SIZE;
|
|
140
|
+
}
|
|
141
|
+
return chunks.join("");
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Delete a Kitty graphics image by ID.
|
|
145
|
+
* Uses uppercase 'I' to also free the image data.
|
|
146
|
+
*/
|
|
147
|
+
export function deleteKittyImage(imageId) {
|
|
148
|
+
return `\x1b_Ga=d,d=I,i=${imageId},q=2\x1b\\`;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Delete all visible Kitty graphics images.
|
|
152
|
+
* Uses uppercase 'A' to also free the image data.
|
|
153
|
+
*/
|
|
154
|
+
export function deleteAllKittyImages() {
|
|
155
|
+
return "\x1b_Ga=d,d=A,q=2\x1b\\";
|
|
156
|
+
}
|
|
157
|
+
export function encodeITerm2(base64Data, options = {}) {
|
|
158
|
+
const params = [`inline=${options.inline !== false ? 1 : 0}`];
|
|
159
|
+
if (options.width !== undefined)
|
|
160
|
+
params.push(`width=${options.width}`);
|
|
161
|
+
if (options.height !== undefined)
|
|
162
|
+
params.push(`height=${options.height}`);
|
|
163
|
+
if (options.name) {
|
|
164
|
+
const nameBase64 = Buffer.from(options.name).toString("base64");
|
|
165
|
+
params.push(`name=${nameBase64}`);
|
|
166
|
+
}
|
|
167
|
+
if (options.preserveAspectRatio === false) {
|
|
168
|
+
params.push("preserveAspectRatio=0");
|
|
169
|
+
}
|
|
170
|
+
return `\x1b]1337;File=${params.join(";")}:${base64Data}\x07`;
|
|
171
|
+
}
|
|
172
|
+
export function calculateImageCellSize(imageDimensions, maxWidthCells, maxHeightCells, cellDimensions = { widthPx: 9, heightPx: 18 }) {
|
|
173
|
+
const maxWidth = Math.max(1, Math.floor(maxWidthCells));
|
|
174
|
+
const maxHeight = maxHeightCells === undefined ? undefined : Math.max(1, Math.floor(maxHeightCells));
|
|
175
|
+
const imageWidth = Math.max(1, imageDimensions.widthPx);
|
|
176
|
+
const imageHeight = Math.max(1, imageDimensions.heightPx);
|
|
177
|
+
const widthScale = (maxWidth * cellDimensions.widthPx) / imageWidth;
|
|
178
|
+
const heightScale = maxHeight === undefined ? widthScale : (maxHeight * cellDimensions.heightPx) / imageHeight;
|
|
179
|
+
const scale = Math.min(widthScale, heightScale);
|
|
180
|
+
const scaledWidthPx = imageWidth * scale;
|
|
181
|
+
const scaledHeightPx = imageHeight * scale;
|
|
182
|
+
const columns = Math.ceil(scaledWidthPx / cellDimensions.widthPx);
|
|
183
|
+
const rows = Math.ceil(scaledHeightPx / cellDimensions.heightPx);
|
|
184
|
+
return {
|
|
185
|
+
columns: Math.max(1, Math.min(maxWidth, columns)),
|
|
186
|
+
rows: Math.max(1, maxHeight === undefined ? rows : Math.min(maxHeight, rows)),
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
export function calculateImageRows(imageDimensions, targetWidthCells, cellDimensions = { widthPx: 9, heightPx: 18 }) {
|
|
190
|
+
return calculateImageCellSize(imageDimensions, targetWidthCells, undefined, cellDimensions).rows;
|
|
191
|
+
}
|
|
192
|
+
export function getPngDimensions(base64Data) {
|
|
193
|
+
try {
|
|
194
|
+
const buffer = Buffer.from(base64Data, "base64");
|
|
195
|
+
if (buffer.length < 24) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
if (buffer[0] !== 0x89 || buffer[1] !== 0x50 || buffer[2] !== 0x4e || buffer[3] !== 0x47) {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
const width = buffer.readUInt32BE(16);
|
|
202
|
+
const height = buffer.readUInt32BE(20);
|
|
203
|
+
return { widthPx: width, heightPx: height };
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
export function getJpegDimensions(base64Data) {
|
|
210
|
+
try {
|
|
211
|
+
const buffer = Buffer.from(base64Data, "base64");
|
|
212
|
+
if (buffer.length < 2) {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
if (buffer[0] !== 0xff || buffer[1] !== 0xd8) {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
let offset = 2;
|
|
219
|
+
while (offset < buffer.length - 9) {
|
|
220
|
+
if (buffer[offset] !== 0xff) {
|
|
221
|
+
offset++;
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
const marker = buffer[offset + 1];
|
|
225
|
+
if (marker >= 0xc0 && marker <= 0xc2) {
|
|
226
|
+
const height = buffer.readUInt16BE(offset + 5);
|
|
227
|
+
const width = buffer.readUInt16BE(offset + 7);
|
|
228
|
+
return { widthPx: width, heightPx: height };
|
|
229
|
+
}
|
|
230
|
+
if (offset + 3 >= buffer.length) {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
const length = buffer.readUInt16BE(offset + 2);
|
|
234
|
+
if (length < 2) {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
offset += 2 + length;
|
|
238
|
+
}
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
catch {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
export function getGifDimensions(base64Data) {
|
|
246
|
+
try {
|
|
247
|
+
const buffer = Buffer.from(base64Data, "base64");
|
|
248
|
+
if (buffer.length < 10) {
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
const sig = buffer.slice(0, 6).toString("ascii");
|
|
252
|
+
if (sig !== "GIF87a" && sig !== "GIF89a") {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
const width = buffer.readUInt16LE(6);
|
|
256
|
+
const height = buffer.readUInt16LE(8);
|
|
257
|
+
return { widthPx: width, heightPx: height };
|
|
258
|
+
}
|
|
259
|
+
catch {
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
export function getWebpDimensions(base64Data) {
|
|
264
|
+
try {
|
|
265
|
+
const buffer = Buffer.from(base64Data, "base64");
|
|
266
|
+
if (buffer.length < 30) {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
const riff = buffer.slice(0, 4).toString("ascii");
|
|
270
|
+
const webp = buffer.slice(8, 12).toString("ascii");
|
|
271
|
+
if (riff !== "RIFF" || webp !== "WEBP") {
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
const chunk = buffer.slice(12, 16).toString("ascii");
|
|
275
|
+
if (chunk === "VP8 ") {
|
|
276
|
+
if (buffer.length < 30)
|
|
277
|
+
return null;
|
|
278
|
+
const width = buffer.readUInt16LE(26) & 0x3fff;
|
|
279
|
+
const height = buffer.readUInt16LE(28) & 0x3fff;
|
|
280
|
+
return { widthPx: width, heightPx: height };
|
|
281
|
+
}
|
|
282
|
+
else if (chunk === "VP8L") {
|
|
283
|
+
if (buffer.length < 25)
|
|
284
|
+
return null;
|
|
285
|
+
const bits = buffer.readUInt32LE(21);
|
|
286
|
+
const width = (bits & 0x3fff) + 1;
|
|
287
|
+
const height = ((bits >> 14) & 0x3fff) + 1;
|
|
288
|
+
return { widthPx: width, heightPx: height };
|
|
289
|
+
}
|
|
290
|
+
else if (chunk === "VP8X") {
|
|
291
|
+
if (buffer.length < 30)
|
|
292
|
+
return null;
|
|
293
|
+
const width = (buffer[24] | (buffer[25] << 8) | (buffer[26] << 16)) + 1;
|
|
294
|
+
const height = (buffer[27] | (buffer[28] << 8) | (buffer[29] << 16)) + 1;
|
|
295
|
+
return { widthPx: width, heightPx: height };
|
|
296
|
+
}
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
catch {
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
export function getImageDimensions(base64Data, mimeType) {
|
|
304
|
+
if (mimeType === "image/png") {
|
|
305
|
+
return getPngDimensions(base64Data);
|
|
306
|
+
}
|
|
307
|
+
if (mimeType === "image/jpeg") {
|
|
308
|
+
return getJpegDimensions(base64Data);
|
|
309
|
+
}
|
|
310
|
+
if (mimeType === "image/gif") {
|
|
311
|
+
return getGifDimensions(base64Data);
|
|
312
|
+
}
|
|
313
|
+
if (mimeType === "image/webp") {
|
|
314
|
+
return getWebpDimensions(base64Data);
|
|
315
|
+
}
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
318
|
+
export function renderImage(base64Data, imageDimensions, options = {}) {
|
|
319
|
+
const caps = getCapabilities();
|
|
320
|
+
if (!caps.images) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
const maxWidth = options.maxWidthCells ?? 80;
|
|
324
|
+
const size = calculateImageCellSize(imageDimensions, maxWidth, options.maxHeightCells, getCellDimensions());
|
|
325
|
+
if (caps.images === "kitty") {
|
|
326
|
+
const sequence = encodeKitty(base64Data, {
|
|
327
|
+
columns: size.columns,
|
|
328
|
+
rows: size.rows,
|
|
329
|
+
imageId: options.imageId,
|
|
330
|
+
moveCursor: options.moveCursor,
|
|
331
|
+
});
|
|
332
|
+
return { sequence, rows: size.rows, imageId: options.imageId };
|
|
333
|
+
}
|
|
334
|
+
if (caps.images === "iterm2") {
|
|
335
|
+
const sequence = encodeITerm2(base64Data, {
|
|
336
|
+
width: size.columns,
|
|
337
|
+
height: "auto",
|
|
338
|
+
preserveAspectRatio: options.preserveAspectRatio ?? true,
|
|
339
|
+
});
|
|
340
|
+
return { sequence, rows: size.rows };
|
|
341
|
+
}
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Wrap text in an OSC 8 hyperlink sequence.
|
|
346
|
+
* The text is rendered as a clickable hyperlink in terminals that support OSC 8
|
|
347
|
+
* (Ghostty, Kitty, WezTerm, iTerm2, VSCode, and others).
|
|
348
|
+
* In terminals that do not support OSC 8, the escape sequences are ignored
|
|
349
|
+
* and only the plain text is displayed.
|
|
350
|
+
*
|
|
351
|
+
* @param text - The visible text to display
|
|
352
|
+
* @param url - The URL to link to
|
|
353
|
+
*/
|
|
354
|
+
export function hyperlink(text, url) {
|
|
355
|
+
return `\x1b]8;;${url}\x1b\\${text}\x1b]8;;\x1b\\`;
|
|
356
|
+
}
|
|
357
|
+
export function imageFallback(mimeType, dimensions, filename) {
|
|
358
|
+
const parts = [];
|
|
359
|
+
if (filename)
|
|
360
|
+
parts.push(filename);
|
|
361
|
+
parts.push(`[${mimeType}]`);
|
|
362
|
+
if (dimensions)
|
|
363
|
+
parts.push(`${dimensions.widthPx}x${dimensions.heightPx}`);
|
|
364
|
+
return `[Image: ${parts.join(" ")}]`;
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=terminal-image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-image.js","sourceRoot":"","sources":["../src/terminal-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA8B9C,IAAI,kBAAkB,GAAgC,IAAI,CAAC;AAE3D,2EAA2E;AAC3E,IAAI,cAAc,GAAmB,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAElE,MAAM,UAAU,iBAAiB,GAAmB;IACnD,OAAO,cAAc,CAAC;AAAA,CACtB;AAED,MAAM,UAAU,iBAAiB,CAAC,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AAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACtC,CAAC;IAED,OAAO,IAAI,CAAC;AAAA,CACZ;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,GAAW,EAAU;IAC5D,OAAO,WAAW,GAAG,SAAS,IAAI,gBAAgB,CAAC;AAAA,CACnD;AAED,MAAM,UAAU,aAAa,CAAC,QAAgB,EAAE,UAA4B,EAAE,QAAiB,EAAU;IACxG,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAC;IAC5B,IAAI,UAAU;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,OAAO,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3E,OAAO,WAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAAA,CACrC","sourcesContent":["import { execSync } from \"node:child_process\";\n\nexport type ImageProtocol = \"kitty\" | \"iterm2\" | null;\n\nexport interface TerminalCapabilities {\n\timages: ImageProtocol;\n\ttrueColor: boolean;\n\thyperlinks: boolean;\n}\n\nexport interface CellDimensions {\n\twidthPx: number;\n\theightPx: number;\n}\n\nexport interface ImageDimensions {\n\twidthPx: number;\n\theightPx: number;\n}\n\nexport interface ImageRenderOptions {\n\tmaxWidthCells?: number;\n\tmaxHeightCells?: number;\n\tpreserveAspectRatio?: boolean;\n\t/** Kitty image ID. If provided, reuses/replaces existing image with this ID. */\n\timageId?: number;\n\t/** Whether Kitty should apply its default cursor movement after placement. */\n\tmoveCursor?: boolean;\n}\n\nlet cachedCapabilities: TerminalCapabilities | null = null;\n\n// Default cell dimensions - updated by TUI when terminal responds to query\nlet cellDimensions: CellDimensions = { widthPx: 9, heightPx: 18 };\n\nexport function getCellDimensions(): CellDimensions {\n\treturn cellDimensions;\n}\n\nexport function setCellDimensions(dims: CellDimensions): void {\n\tcellDimensions = dims;\n}\n\n/**\n * Checks whether the attached tmux client forwards OSC 8 hyperlinks to the\n * outer terminal. tmux only re-emits them when its `client_termfeatures` lists\n * `hyperlinks`, and strips them otherwise. On any error fallbacks `false`.\n */\nfunction probeTmuxHyperlinks(): boolean {\n\ttry {\n\t\tconst termfeatures = execSync(\"tmux display-message -p '#{client_termfeatures}'\", {\n\t\t\tencoding: \"utf8\",\n\t\t\ttimeout: 250,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t});\n\t\treturn termfeatures\n\t\t\t.split(\",\")\n\t\t\t.map((feature) => feature.trim())\n\t\t\t.includes(\"hyperlinks\");\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function detectCapabilities(tmuxForwardsHyperlink: () => boolean = probeTmuxHyperlinks): TerminalCapabilities {\n\tconst termProgram = process.env.TERM_PROGRAM?.toLowerCase() || \"\";\n\tconst terminalEmulator = process.env.TERMINAL_EMULATOR?.toLowerCase() || \"\";\n\tconst term = process.env.TERM?.toLowerCase() || \"\";\n\tconst colorTerm = process.env.COLORTERM?.toLowerCase() || \"\";\n\tconst hasTrueColorHint = colorTerm === \"truecolor\" || colorTerm === \"24bit\";\n\n\t// Emit OSC 8 hyperlinks only when tmux confirms it forwards.\n\t// Image protocols are unreliable under tmux, so leave `images: null`.\n\tif (process.env.TMUX || term.startsWith(\"tmux\")) {\n\t\treturn { images: null, trueColor: hasTrueColorHint, hyperlinks: tmuxForwardsHyperlink() };\n\t}\n\n\t// screen does not forward OSC 8 hyperlinks, so keep them off there.\n\tif (term.startsWith(\"screen\")) {\n\t\treturn { images: null, trueColor: hasTrueColorHint, hyperlinks: false };\n\t}\n\n\tif (process.env.KITTY_WINDOW_ID || termProgram === \"kitty\") {\n\t\treturn { images: \"kitty\", trueColor: true, hyperlinks: true };\n\t}\n\n\tif (termProgram === \"ghostty\" || term.includes(\"ghostty\") || process.env.GHOSTTY_RESOURCES_DIR) {\n\t\treturn { images: \"kitty\", trueColor: true, hyperlinks: true };\n\t}\n\n\tif (process.env.WEZTERM_PANE || termProgram === \"wezterm\") {\n\t\treturn { images: \"kitty\", trueColor: true, hyperlinks: true };\n\t}\n\n\tif (process.env.ITERM_SESSION_ID || termProgram === \"iterm.app\") {\n\t\treturn { images: \"iterm2\", trueColor: true, hyperlinks: true };\n\t}\n\n\tif (process.env.WT_SESSION) {\n\t\treturn { images: null, trueColor: true, hyperlinks: true };\n\t}\n\n\tif (termProgram === \"vscode\") {\n\t\treturn { images: null, trueColor: true, hyperlinks: true };\n\t}\n\n\tif (termProgram === \"alacritty\") {\n\t\treturn { images: null, trueColor: true, hyperlinks: true };\n\t}\n\n\tif (terminalEmulator === \"jetbrains-jediterm\") {\n\t\treturn { images: null, trueColor: true, hyperlinks: false };\n\t}\n\n\t// Unknown terminal: be conservative. OSC 8 is rendered invisibly as \"just\n\t// text\" on terminals that swallow it, which means the URL disappears from\n\t// the rendered output. Default to the legacy `text (url)` behavior unless we\n\t// have positively identified a hyperlink-capable terminal above.\n\treturn { images: null, trueColor: hasTrueColorHint, hyperlinks: false };\n}\n\nexport function getCapabilities(): TerminalCapabilities {\n\tif (!cachedCapabilities) {\n\t\tcachedCapabilities = detectCapabilities();\n\t}\n\treturn cachedCapabilities;\n}\n\nexport function resetCapabilitiesCache(): void {\n\tcachedCapabilities = null;\n}\n\n/** Override the cached capabilities. Useful in tests to exercise both code paths. */\nexport function setCapabilities(caps: TerminalCapabilities): void {\n\tcachedCapabilities = caps;\n}\n\nconst KITTY_PREFIX = \"\\x1b_G\";\nconst ITERM2_PREFIX = \"\\x1b]1337;File=\";\n\nexport function isImageLine(line: string): boolean {\n\t// Fast path: sequence at line start (single-row images)\n\tif (line.startsWith(KITTY_PREFIX) || line.startsWith(ITERM2_PREFIX)) {\n\t\treturn true;\n\t}\n\t// Slow path: sequence elsewhere (multi-row images have cursor-up prefix)\n\treturn line.includes(KITTY_PREFIX) || line.includes(ITERM2_PREFIX);\n}\n\n/**\n * Generate a random image ID for Kitty graphics protocol.\n * Uses random IDs to avoid collisions between different module instances\n * (e.g., main app vs extensions).\n */\nexport function allocateImageId(): number {\n\t// Use random ID in range [1, 0xffffffff] to avoid collisions\n\treturn Math.floor(Math.random() * 0xfffffffe) + 1;\n}\n\nexport function encodeKitty(\n\tbase64Data: string,\n\toptions: {\n\t\tcolumns?: number;\n\t\trows?: number;\n\t\timageId?: number;\n\t\t/** Whether Kitty should apply its default cursor movement after placement. Default: true. */\n\t\tmoveCursor?: boolean;\n\t} = {},\n): string {\n\tconst CHUNK_SIZE = 4096;\n\n\tconst params: string[] = [\"a=T\", \"f=100\", \"q=2\"];\n\n\tif (options.moveCursor === false) params.push(\"C=1\");\n\tif (options.columns) params.push(`c=${options.columns}`);\n\tif (options.rows) params.push(`r=${options.rows}`);\n\tif (options.imageId) params.push(`i=${options.imageId}`);\n\n\tif (base64Data.length <= CHUNK_SIZE) {\n\t\treturn `\\x1b_G${params.join(\",\")};${base64Data}\\x1b\\\\`;\n\t}\n\n\tconst chunks: string[] = [];\n\tlet offset = 0;\n\tlet isFirst = true;\n\n\twhile (offset < base64Data.length) {\n\t\tconst chunk = base64Data.slice(offset, offset + CHUNK_SIZE);\n\t\tconst isLast = offset + CHUNK_SIZE >= base64Data.length;\n\n\t\tif (isFirst) {\n\t\t\tchunks.push(`\\x1b_G${params.join(\",\")},m=1;${chunk}\\x1b\\\\`);\n\t\t\tisFirst = false;\n\t\t} else if (isLast) {\n\t\t\tchunks.push(`\\x1b_Gm=0;${chunk}\\x1b\\\\`);\n\t\t} else {\n\t\t\tchunks.push(`\\x1b_Gm=1;${chunk}\\x1b\\\\`);\n\t\t}\n\n\t\toffset += CHUNK_SIZE;\n\t}\n\n\treturn chunks.join(\"\");\n}\n\n/**\n * Delete a Kitty graphics image by ID.\n * Uses uppercase 'I' to also free the image data.\n */\nexport function deleteKittyImage(imageId: number): string {\n\treturn `\\x1b_Ga=d,d=I,i=${imageId},q=2\\x1b\\\\`;\n}\n\n/**\n * Delete all visible Kitty graphics images.\n * Uses uppercase 'A' to also free the image data.\n */\nexport function deleteAllKittyImages(): string {\n\treturn \"\\x1b_Ga=d,d=A,q=2\\x1b\\\\\";\n}\n\nexport function encodeITerm2(\n\tbase64Data: string,\n\toptions: {\n\t\twidth?: number | string;\n\t\theight?: number | string;\n\t\tname?: string;\n\t\tpreserveAspectRatio?: boolean;\n\t\tinline?: boolean;\n\t} = {},\n): string {\n\tconst params: string[] = [`inline=${options.inline !== false ? 1 : 0}`];\n\n\tif (options.width !== undefined) params.push(`width=${options.width}`);\n\tif (options.height !== undefined) params.push(`height=${options.height}`);\n\tif (options.name) {\n\t\tconst nameBase64 = Buffer.from(options.name).toString(\"base64\");\n\t\tparams.push(`name=${nameBase64}`);\n\t}\n\tif (options.preserveAspectRatio === false) {\n\t\tparams.push(\"preserveAspectRatio=0\");\n\t}\n\n\treturn `\\x1b]1337;File=${params.join(\";\")}:${base64Data}\\x07`;\n}\n\nexport interface ImageCellSize {\n\tcolumns: number;\n\trows: number;\n}\n\nexport function calculateImageCellSize(\n\timageDimensions: ImageDimensions,\n\tmaxWidthCells: number,\n\tmaxHeightCells?: number,\n\tcellDimensions: CellDimensions = { widthPx: 9, heightPx: 18 },\n): ImageCellSize {\n\tconst maxWidth = Math.max(1, Math.floor(maxWidthCells));\n\tconst maxHeight = maxHeightCells === undefined ? undefined : Math.max(1, Math.floor(maxHeightCells));\n\tconst imageWidth = Math.max(1, imageDimensions.widthPx);\n\tconst imageHeight = Math.max(1, imageDimensions.heightPx);\n\n\tconst widthScale = (maxWidth * cellDimensions.widthPx) / imageWidth;\n\tconst heightScale = maxHeight === undefined ? widthScale : (maxHeight * cellDimensions.heightPx) / imageHeight;\n\tconst scale = Math.min(widthScale, heightScale);\n\n\tconst scaledWidthPx = imageWidth * scale;\n\tconst scaledHeightPx = imageHeight * scale;\n\tconst columns = Math.ceil(scaledWidthPx / cellDimensions.widthPx);\n\tconst rows = Math.ceil(scaledHeightPx / cellDimensions.heightPx);\n\n\treturn {\n\t\tcolumns: Math.max(1, Math.min(maxWidth, columns)),\n\t\trows: Math.max(1, maxHeight === undefined ? rows : Math.min(maxHeight, rows)),\n\t};\n}\n\nexport function calculateImageRows(\n\timageDimensions: ImageDimensions,\n\ttargetWidthCells: number,\n\tcellDimensions: CellDimensions = { widthPx: 9, heightPx: 18 },\n): number {\n\treturn calculateImageCellSize(imageDimensions, targetWidthCells, undefined, cellDimensions).rows;\n}\n\nexport function getPngDimensions(base64Data: string): ImageDimensions | null {\n\ttry {\n\t\tconst buffer = Buffer.from(base64Data, \"base64\");\n\n\t\tif (buffer.length < 24) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (buffer[0] !== 0x89 || buffer[1] !== 0x50 || buffer[2] !== 0x4e || buffer[3] !== 0x47) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst width = buffer.readUInt32BE(16);\n\t\tconst height = buffer.readUInt32BE(20);\n\n\t\treturn { widthPx: width, heightPx: height };\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport function getJpegDimensions(base64Data: string): ImageDimensions | null {\n\ttry {\n\t\tconst buffer = Buffer.from(base64Data, \"base64\");\n\n\t\tif (buffer.length < 2) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (buffer[0] !== 0xff || buffer[1] !== 0xd8) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet offset = 2;\n\t\twhile (offset < buffer.length - 9) {\n\t\t\tif (buffer[offset] !== 0xff) {\n\t\t\t\toffset++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst marker = buffer[offset + 1];\n\n\t\t\tif (marker >= 0xc0 && marker <= 0xc2) {\n\t\t\t\tconst height = buffer.readUInt16BE(offset + 5);\n\t\t\t\tconst width = buffer.readUInt16BE(offset + 7);\n\t\t\t\treturn { widthPx: width, heightPx: height };\n\t\t\t}\n\n\t\t\tif (offset + 3 >= buffer.length) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst length = buffer.readUInt16BE(offset + 2);\n\t\t\tif (length < 2) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\toffset += 2 + length;\n\t\t}\n\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport function getGifDimensions(base64Data: string): ImageDimensions | null {\n\ttry {\n\t\tconst buffer = Buffer.from(base64Data, \"base64\");\n\n\t\tif (buffer.length < 10) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst sig = buffer.slice(0, 6).toString(\"ascii\");\n\t\tif (sig !== \"GIF87a\" && sig !== \"GIF89a\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst width = buffer.readUInt16LE(6);\n\t\tconst height = buffer.readUInt16LE(8);\n\n\t\treturn { widthPx: width, heightPx: height };\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport function getWebpDimensions(base64Data: string): ImageDimensions | null {\n\ttry {\n\t\tconst buffer = Buffer.from(base64Data, \"base64\");\n\n\t\tif (buffer.length < 30) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst riff = buffer.slice(0, 4).toString(\"ascii\");\n\t\tconst webp = buffer.slice(8, 12).toString(\"ascii\");\n\t\tif (riff !== \"RIFF\" || webp !== \"WEBP\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst chunk = buffer.slice(12, 16).toString(\"ascii\");\n\t\tif (chunk === \"VP8 \") {\n\t\t\tif (buffer.length < 30) return null;\n\t\t\tconst width = buffer.readUInt16LE(26) & 0x3fff;\n\t\t\tconst height = buffer.readUInt16LE(28) & 0x3fff;\n\t\t\treturn { widthPx: width, heightPx: height };\n\t\t} else if (chunk === \"VP8L\") {\n\t\t\tif (buffer.length < 25) return null;\n\t\t\tconst bits = buffer.readUInt32LE(21);\n\t\t\tconst width = (bits & 0x3fff) + 1;\n\t\t\tconst height = ((bits >> 14) & 0x3fff) + 1;\n\t\t\treturn { widthPx: width, heightPx: height };\n\t\t} else if (chunk === \"VP8X\") {\n\t\t\tif (buffer.length < 30) return null;\n\t\t\tconst width = (buffer[24] | (buffer[25] << 8) | (buffer[26] << 16)) + 1;\n\t\t\tconst height = (buffer[27] | (buffer[28] << 8) | (buffer[29] << 16)) + 1;\n\t\t\treturn { widthPx: width, heightPx: height };\n\t\t}\n\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport function getImageDimensions(base64Data: string, mimeType: string): ImageDimensions | null {\n\tif (mimeType === \"image/png\") {\n\t\treturn getPngDimensions(base64Data);\n\t}\n\tif (mimeType === \"image/jpeg\") {\n\t\treturn getJpegDimensions(base64Data);\n\t}\n\tif (mimeType === \"image/gif\") {\n\t\treturn getGifDimensions(base64Data);\n\t}\n\tif (mimeType === \"image/webp\") {\n\t\treturn getWebpDimensions(base64Data);\n\t}\n\treturn null;\n}\n\nexport function renderImage(\n\tbase64Data: string,\n\timageDimensions: ImageDimensions,\n\toptions: ImageRenderOptions = {},\n): { sequence: string; rows: number; imageId?: number } | null {\n\tconst caps = getCapabilities();\n\n\tif (!caps.images) {\n\t\treturn null;\n\t}\n\n\tconst maxWidth = options.maxWidthCells ?? 80;\n\tconst size = calculateImageCellSize(imageDimensions, maxWidth, options.maxHeightCells, getCellDimensions());\n\n\tif (caps.images === \"kitty\") {\n\t\tconst sequence = encodeKitty(base64Data, {\n\t\t\tcolumns: size.columns,\n\t\t\trows: size.rows,\n\t\t\timageId: options.imageId,\n\t\t\tmoveCursor: options.moveCursor,\n\t\t});\n\t\treturn { sequence, rows: size.rows, imageId: options.imageId };\n\t}\n\n\tif (caps.images === \"iterm2\") {\n\t\tconst sequence = encodeITerm2(base64Data, {\n\t\t\twidth: size.columns,\n\t\t\theight: \"auto\",\n\t\t\tpreserveAspectRatio: options.preserveAspectRatio ?? true,\n\t\t});\n\t\treturn { sequence, rows: size.rows };\n\t}\n\n\treturn null;\n}\n\n/**\n * Wrap text in an OSC 8 hyperlink sequence.\n * The text is rendered as a clickable hyperlink in terminals that support OSC 8\n * (Ghostty, Kitty, WezTerm, iTerm2, VSCode, and others).\n * In terminals that do not support OSC 8, the escape sequences are ignored\n * and only the plain text is displayed.\n *\n * @param text - The visible text to display\n * @param url - The URL to link to\n */\nexport function hyperlink(text: string, url: string): string {\n\treturn `\\x1b]8;;${url}\\x1b\\\\${text}\\x1b]8;;\\x1b\\\\`;\n}\n\nexport function imageFallback(mimeType: string, dimensions?: ImageDimensions, filename?: string): string {\n\tconst parts: string[] = [];\n\tif (filename) parts.push(filename);\n\tparts.push(`[${mimeType}]`);\n\tif (dimensions) parts.push(`${dimensions.widthPx}x${dimensions.heightPx}`);\n\treturn `[Image: ${parts.join(\" \")}]`;\n}\n"]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export type KeyboardProtocolNegotiationSequence = {
|
|
2
|
+
type: "kitty-flags";
|
|
3
|
+
flags: number;
|
|
4
|
+
} | {
|
|
5
|
+
type: "device-attributes";
|
|
6
|
+
};
|
|
7
|
+
export declare function parseKeyboardProtocolNegotiationSequence(sequence: string): KeyboardProtocolNegotiationSequence | undefined;
|
|
8
|
+
export declare function isAppleTerminalSession(): boolean;
|
|
9
|
+
export declare function normalizeAppleTerminalInput(data: string, isAppleTerminal: boolean, isShiftPressed: boolean): string;
|
|
10
|
+
/**
|
|
11
|
+
* Minimal terminal interface for TUI
|
|
12
|
+
*/
|
|
13
|
+
export interface Terminal {
|
|
14
|
+
start(onInput: (data: string) => void, onResize: () => void): void;
|
|
15
|
+
stop(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Drain stdin before exiting to prevent Kitty key release events from
|
|
18
|
+
* leaking to the parent shell over slow SSH connections.
|
|
19
|
+
* @param maxMs - Maximum time to drain (default: 1000ms)
|
|
20
|
+
* @param idleMs - Exit early if no input arrives within this time (default: 50ms)
|
|
21
|
+
*/
|
|
22
|
+
drainInput(maxMs?: number, idleMs?: number): Promise<void>;
|
|
23
|
+
write(data: string): void;
|
|
24
|
+
get columns(): number;
|
|
25
|
+
get rows(): number;
|
|
26
|
+
get kittyProtocolActive(): boolean;
|
|
27
|
+
moveBy(lines: number): void;
|
|
28
|
+
hideCursor(): void;
|
|
29
|
+
showCursor(): void;
|
|
30
|
+
clearLine(): void;
|
|
31
|
+
clearFromCursor(): void;
|
|
32
|
+
clearScreen(): void;
|
|
33
|
+
setTitle(title: string): void;
|
|
34
|
+
setProgress(active: boolean): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Real terminal using process.stdin/stdout
|
|
38
|
+
*/
|
|
39
|
+
export declare class ProcessTerminal implements Terminal {
|
|
40
|
+
private wasRaw;
|
|
41
|
+
private inputHandler?;
|
|
42
|
+
private resizeHandler?;
|
|
43
|
+
private _kittyProtocolActive;
|
|
44
|
+
private _modifyOtherKeysActive;
|
|
45
|
+
private keyboardProtocolPushed;
|
|
46
|
+
private keyboardProtocolNegotiationPending;
|
|
47
|
+
private keyboardProtocolLateResponsePending;
|
|
48
|
+
private keyboardProtocolNegotiationBuffer;
|
|
49
|
+
private keyboardProtocolFallbackTimer?;
|
|
50
|
+
private keyboardProtocolBufferFlushTimer?;
|
|
51
|
+
private stdinBuffer?;
|
|
52
|
+
private stdinDataHandler?;
|
|
53
|
+
private progressInterval?;
|
|
54
|
+
private writeLogPath;
|
|
55
|
+
get kittyProtocolActive(): boolean;
|
|
56
|
+
start(onInput: (data: string) => void, onResize: () => void): void;
|
|
57
|
+
/**
|
|
58
|
+
* Set up StdinBuffer to split batched input into individual sequences.
|
|
59
|
+
* This ensures components receive single events, making matchesKey/isKeyRelease work correctly.
|
|
60
|
+
*
|
|
61
|
+
* Also watches for Kitty protocol response and enables it when detected.
|
|
62
|
+
* This is done here (after stdinBuffer parsing) rather than on raw stdin
|
|
63
|
+
* to handle the case where the response arrives split across multiple events.
|
|
64
|
+
*/
|
|
65
|
+
private setupStdinBuffer;
|
|
66
|
+
/**
|
|
67
|
+
* Query terminal for Kitty keyboard protocol support and enable it if available.
|
|
68
|
+
*
|
|
69
|
+
* Kitty's progressive enhancement detection requires requesting the desired
|
|
70
|
+
* flags before querying them. The trailing DA query is a sentinel supported by
|
|
71
|
+
* terminals that do not know Kitty keyboard protocol. A short timeout remains
|
|
72
|
+
* as a backup for terminals, PTYs, and SSH sessions that delay, split, or drop
|
|
73
|
+
* the DA response.
|
|
74
|
+
*
|
|
75
|
+
* The requested flags are:
|
|
76
|
+
* - 1 = disambiguate escape codes
|
|
77
|
+
* - 2 = report event types (press/repeat/release)
|
|
78
|
+
* - 4 = report alternate keys (shifted key, base layout key)
|
|
79
|
+
*/
|
|
80
|
+
private queryAndEnableKittyProtocol;
|
|
81
|
+
private handleKeyboardProtocolNegotiationSequence;
|
|
82
|
+
private readKeyboardProtocolNegotiationSequence;
|
|
83
|
+
private setKeyboardProtocolNegotiationBuffer;
|
|
84
|
+
private clearKeyboardProtocolNegotiationBuffer;
|
|
85
|
+
private flushKeyboardProtocolNegotiationBufferAsInput;
|
|
86
|
+
private scheduleKeyboardProtocolNegotiationBufferFlush;
|
|
87
|
+
private clearKeyboardProtocolNegotiationBufferFlushTimer;
|
|
88
|
+
private forwardInputSequence;
|
|
89
|
+
private enableModifyOtherKeys;
|
|
90
|
+
private clearKeyboardProtocolFallbackTimer;
|
|
91
|
+
/**
|
|
92
|
+
* On Windows, add ENABLE_VIRTUAL_TERMINAL_INPUT (0x0200) to the stdin
|
|
93
|
+
* console handle so the terminal sends VT sequences for modified keys
|
|
94
|
+
* (e.g. \x1b[Z for Shift+Tab). Without this, libuv's ReadConsoleInputW
|
|
95
|
+
* discards modifier state and Shift+Tab arrives as plain \t.
|
|
96
|
+
*/
|
|
97
|
+
private enableWindowsVTInput;
|
|
98
|
+
drainInput(maxMs?: number, idleMs?: number): Promise<void>;
|
|
99
|
+
stop(): void;
|
|
100
|
+
write(data: string): void;
|
|
101
|
+
get columns(): number;
|
|
102
|
+
get rows(): number;
|
|
103
|
+
moveBy(lines: number): void;
|
|
104
|
+
hideCursor(): void;
|
|
105
|
+
showCursor(): void;
|
|
106
|
+
clearLine(): void;
|
|
107
|
+
clearFromCursor(): void;
|
|
108
|
+
clearScreen(): void;
|
|
109
|
+
setTitle(title: string): void;
|
|
110
|
+
setProgress(active: boolean): void;
|
|
111
|
+
private clearProgressInterval;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../src/terminal.ts"],"names":[],"mappings":"AAmBA,MAAM,MAAM,mCAAmC,GAC5C;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAEjC,wBAAgB,wCAAwC,CACvD,QAAQ,EAAE,MAAM,GACd,mCAAmC,GAAG,SAAS,CASjD;AAMD,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,GAAG,MAAM,CAGnH;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IAExB,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAGnE,IAAI,IAAI,IAAI,CAAC;IAEb;;;;;OAKG;IACH,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAG3D,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,IAAI,OAAO,IAAI,MAAM,CAAC;IACtB,IAAI,IAAI,IAAI,MAAM,CAAC;IAGnB,IAAI,mBAAmB,IAAI,OAAO,CAAC;IAGnC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAG5B,UAAU,I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OAAO,CAAC,8CAA8C;IAQtD,OAAO,CAAC,gDAAgD;IAMxD,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,kCAAkC;IAM1C;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IA8BtB,UAAU,CAAC,KAAK,SAAO,EAAE,MAAM,SAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CA2CzD;IAED,IAAI,IAAI,IAAI,CAqDX;IAED,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CASxB;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAS1B;IAED,UAAU,IAAI,IAAI,CAEjB;IAED,UAAU,IAAI,IAAI,CAEjB;IAED,SAAS,IAAI,IAAI,CAEhB;IAED,eAAe,IAAI,IAAI,CAEtB;IAED,WAAW,IAAI,IAAI,CAElB;IAED,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAG5B;IAED,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAcjC;IAED,OAAO,CAAC,qBAAqB;CAM7B","sourcesContent":["import * as fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { setKittyProtocolActive } from \"./keys.ts\";\nimport { isNativeModifierPressed } from \"./native-modifiers.ts\";\nimport { StdinBuffer } from \"./stdin-buffer.ts\";\n\nconst cjsRequire = createRequire(import.meta.url);\n\nconst TERMINAL_PROGRESS_KEEPALIVE_MS = 1000;\nconst TERMINAL_PROGRESS_ACTIVE_SEQUENCE = \"\\x1b]9;4;3\\x07\";\nconst TERMINAL_PROGRESS_CLEAR_SEQUENCE = \"\\x1b]9;4;0;\\x07\";\nconst APPLE_TERMINAL_SHIFT_ENTER_SEQUENCE = \"\\x1b[13;2u\";\nconst DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS = 7;\nconst KITTY_KEYBOARD_PROTOCOL_FALLBACK_TIMEOUT_MS = 150;\nconst KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS = 150;\nconst KITTY_KEYBOARD_PROTOCOL_QUERY = `\\x1b[>${DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS}u\\x1b[?u\\x1b[c`;\n\nexport type KeyboardProtocolNegotiationSequence =\n\t| { type: \"kitty-flags\"; flags: number }\n\t| { type: \"device-attributes\" };\n\nexport function parseKeyboardProtocolNegotiationSequence(\n\tsequence: string,\n): KeyboardProtocolNegotiationSequence | undefined {\n\tconst kittyFlags = sequence.match(/^\\x1b\\[\\?(\\d+)u$/);\n\tif (kittyFlags) {\n\t\treturn { type: \"kitty-flags\", flags: Number.parseInt(kittyFlags[1]!, 10) };\n\t}\n\tif (/^\\x1b\\[\\?[\\d;]*c$/.test(sequence)) {\n\t\treturn { type: \"device-attributes\" };\n\t}\n\treturn undefined;\n}\n\nfunction isKeyboardProtocolNegotiationSequencePrefix(sequence: string, allowBareEscapePrefix: boolean): boolean {\n\treturn (allowBareEscapePrefix && sequence === \"\\x1b\") || sequence === \"\\x1b[\" || /^\\x1b\\[\\?[\\d;]*$/.test(sequence);\n}\n\nexport function isAppleTerminalSession(): boolean {\n\treturn process.platform === \"darwin\" && process.env.TERM_PROGRAM === \"Apple_Terminal\";\n}\n\nexport function normalizeAppleTerminalInput(data: string, isAppleTerminal: boolean, isShiftPressed: boolean): string {\n\tif (isAppleTerminal && data === \"\\r\" && isShiftPressed) return APPLE_TERMINAL_SHIFT_ENTER_SEQUENCE;\n\treturn data;\n}\n\n/**\n * Minimal terminal interface for TUI\n */\nexport interface Terminal {\n\t// Start the terminal with input and resize handlers\n\tstart(onInput: (data: string) => void, onResize: () => void): void;\n\n\t// Stop the terminal and restore state\n\tstop(): void;\n\n\t/**\n\t * Drain stdin before exiting to prevent Kitty key release events from\n\t * leaking to the parent shell over slow SSH connections.\n\t * @param maxMs - Maximum time to drain (default: 1000ms)\n\t * @param idleMs - Exit early if no input arrives within this time (default: 50ms)\n\t */\n\tdrainInput(maxMs?: number, idleMs?: number): Promise<void>;\n\n\t// Write output to terminal\n\twrite(data: string): void;\n\n\t// Get terminal dimensions\n\tget columns(): number;\n\tget rows(): number;\n\n\t// Whether Kitty keyboard protocol is active\n\tget kittyProtocolActive(): boolean;\n\n\t// Cursor positioning (relative to current position)\n\tmoveBy(lines: number): void; // Move cursor up (negative) or down (positive) by N lines\n\n\t// Cursor visibility\n\thideCursor(): void; // Hide the cursor\n\tshowCursor(): void; // Show the cursor\n\n\t// Clear operations\n\tclearLine(): void; // Clear current line\n\tclearFromCursor(): void; // Clear from cursor to end of screen\n\tclearScreen(): void; // Clear entire screen and move cursor to (0,0)\n\n\t// Title operations\n\tsetTitle(title: string): void; // Set terminal window title\n\n\t// Progress indicator (OSC 9;4)\n\tsetProgress(active: boolean): void;\n}\n\n/**\n * Real terminal using process.stdin/stdout\n */\nexport class ProcessTerminal implements Terminal {\n\tprivate wasRaw = false;\n\tprivate inputHandler?: (data: string) => void;\n\tprivate resizeHandler?: () => void;\n\tprivate _kittyProtocolActive = false;\n\tprivate _modifyOtherKeysActive = false;\n\tprivate keyboardProtocolPushed = false;\n\tprivate keyboardProtocolNegotiationPending = false;\n\tprivate keyboardProtocolLateResponsePending = false;\n\tprivate keyboardProtocolNegotiationBuffer = \"\";\n\tprivate keyboardProtocolFallbackTimer?: ReturnType<typeof setTimeout>;\n\tprivate keyboardProtocolBufferFlushTimer?: ReturnType<typeof setTimeout>;\n\tprivate stdinBuffer?: StdinBuffer;\n\tprivate stdinDataHandler?: (data: string) => void;\n\tprivate progressInterval?: ReturnType<typeof setInterval>;\n\tprivate writeLogPath = (() => {\n\t\tconst env = process.env.PI_TUI_WRITE_LOG || \"\";\n\t\tif (!env) return \"\";\n\t\ttry {\n\t\t\tif (fs.statSync(env).isDirectory()) {\n\t\t\t\tconst now = new Date();\n\t\t\t\tconst ts = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}-${String(now.getDate()).padStart(2, \"0\")}_${String(now.getHours()).padStart(2, \"0\")}-${String(now.getMinutes()).padStart(2, \"0\")}-${String(now.getSeconds()).padStart(2, \"0\")}`;\n\t\t\t\treturn path.join(env, `tui-${ts}-${process.pid}.log`);\n\t\t\t}\n\t\t} catch {\n\t\t\t// Not an existing directory - use as-is (file path)\n\t\t}\n\t\treturn env;\n\t})();\n\n\tget kittyProtocolActive(): boolean {\n\t\treturn this._kittyProtocolActive;\n\t}\n\n\tstart(onInput: (data: string) => void, onResize: () => void): void {\n\t\tthis.inputHandler = onInput;\n\t\tthis.resizeHandler = onResize;\n\n\t\t// Save previous state and enable raw mode\n\t\tthis.wasRaw = process.stdin.isRaw || false;\n\t\tif (process.stdin.setRawMode) {\n\t\t\tprocess.stdin.setRawMode(true);\n\t\t}\n\t\tprocess.stdin.setEncoding(\"utf8\");\n\t\tprocess.stdin.resume();\n\n\t\t// Enable bracketed paste mode - terminal will wrap pastes in \\x1b[200~ ... \\x1b[201~\n\t\tprocess.stdout.write(\"\\x1b[?2004h\");\n\n\t\t// Set up resize handler immediately\n\t\tprocess.stdout.on(\"resize\", this.resizeHandler);\n\n\t\t// Refresh terminal dimensions - they may be stale after suspend/resume\n\t\t// (SIGWINCH is lost while process is stopped). Unix only.\n\t\tif (process.platform !== \"win32\") {\n\t\t\tprocess.kill(process.pid, \"SIGWINCH\");\n\t\t}\n\n\t\t// On Windows, enable ENABLE_VIRTUAL_TERMINAL_INPUT so the console sends\n\t\t// VT escape sequences (e.g. \\x1b[Z for Shift+Tab) instead of raw console\n\t\t// events that lose modifier information. Must run AFTER setRawMode(true)\n\t\t// since that resets console mode flags.\n\t\tthis.enableWindowsVTInput();\n\n\t\t// Query and enable Kitty keyboard protocol\n\t\t// The query handler intercepts input temporarily, then installs the user's handler\n\t\t// See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/\n\t\tthis.queryAndEnableKittyProtocol();\n\t}\n\n\t/**\n\t * Set up StdinBuffer to split batched input into individual sequences.\n\t * This ensures components receive single events, making matchesKey/isKeyRelease work correctly.\n\t *\n\t * Also watches for Kitty protocol response and enables it when detected.\n\t * This is done here (after stdinBuffer parsing) rather than on raw stdin\n\t * to handle the case where the response arrives split across multiple events.\n\t */\n\tprivate setupStdinBuffer(): void {\n\t\tthis.stdinBuffer = new StdinBuffer({ timeout: 10 });\n\n\t\t// Forward individual sequences to the input handler\n\t\tthis.stdinBuffer.on(\"data\", (sequence) => {\n\t\t\tif (this.keyboardProtocolNegotiationPending) {\n\t\t\t\tconst negotiationSequence = this.readKeyboardProtocolNegotiationSequence(sequence, true);\n\t\t\t\tif (negotiationSequence === \"pending\") {\n\t\t\t\t\treturn; // Wait for the rest of a split negotiation response.\n\t\t\t\t}\n\t\t\t\tif (this.handleKeyboardProtocolNegotiationSequence(negotiationSequence)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.keyboardProtocolLateResponsePending) {\n\t\t\t\tconst negotiationSequence = this.readKeyboardProtocolNegotiationSequence(sequence, false);\n\t\t\t\tif (negotiationSequence === \"pending\") {\n\t\t\t\t\tthis.scheduleKeyboardProtocolNegotiationBufferFlush();\n\t\t\t\t\treturn; // Wait for the rest of a split late negotiation response.\n\t\t\t\t}\n\t\t\t\tif (this.handleKeyboardProtocolNegotiationSequence(negotiationSequence)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.forwardInputSequence(sequence);\n\t\t});\n\n\t\t// Re-wrap paste content with bracketed paste markers for existing editor handling\n\t\tthis.stdinBuffer.on(\"paste\", (content) => {\n\t\t\tif (this.inputHandler) {\n\t\t\t\tthis.inputHandler(`\\x1b[200~${content}\\x1b[201~`);\n\t\t\t}\n\t\t});\n\n\t\t// Handler that pipes stdin data through the buffer\n\t\tthis.stdinDataHandler = (data: string) => {\n\t\t\tthis.stdinBuffer!.process(data);\n\t\t};\n\t}\n\n\t/**\n\t * Query terminal for Kitty keyboard protocol support and enable it if available.\n\t *\n\t * Kitty's progressive enhancement detection requires requesting the desired\n\t * flags before querying them. The trailing DA query is a sentinel supported by\n\t * terminals that do not know Kitty keyboard protocol. A short timeout remains\n\t * as a backup for terminals, PTYs, and SSH sessions that delay, split, or drop\n\t * the DA response.\n\t *\n\t * The requested flags are:\n\t * - 1 = disambiguate escape codes\n\t * - 2 = report event types (press/repeat/release)\n\t * - 4 = report alternate keys (shifted key, base layout key)\n\t */\n\tprivate queryAndEnableKittyProtocol(): void {\n\t\tthis.setupStdinBuffer();\n\t\tprocess.stdin.on(\"data\", this.stdinDataHandler!);\n\t\tthis.keyboardProtocolPushed = true;\n\t\tthis.keyboardProtocolNegotiationPending = true;\n\t\tthis.keyboardProtocolLateResponsePending = false;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tprocess.stdout.write(KITTY_KEYBOARD_PROTOCOL_QUERY);\n\t\tthis.keyboardProtocolFallbackTimer = setTimeout(() => {\n\t\t\tthis.keyboardProtocolFallbackTimer = undefined;\n\t\t\tthis.keyboardProtocolNegotiationPending = false;\n\t\t\tthis.keyboardProtocolLateResponsePending = true;\n\t\t\tif (this.keyboardProtocolNegotiationBuffer === \"\\x1b\") {\n\t\t\t\tthis.flushKeyboardProtocolNegotiationBufferAsInput();\n\t\t\t} else {\n\t\t\t\tthis.scheduleKeyboardProtocolNegotiationBufferFlush();\n\t\t\t}\n\t\t\tthis.enableModifyOtherKeys();\n\t\t}, KITTY_KEYBOARD_PROTOCOL_FALLBACK_TIMEOUT_MS);\n\t}\n\n\tprivate handleKeyboardProtocolNegotiationSequence(\n\t\tnegotiationSequence: KeyboardProtocolNegotiationSequence | undefined,\n\t): boolean {\n\t\tif (!negotiationSequence) return false;\n\t\tif (negotiationSequence.type === \"kitty-flags\") {\n\t\t\tif (negotiationSequence.flags !== 0 && !this._kittyProtocolActive) {\n\t\t\t\tthis._kittyProtocolActive = true;\n\t\t\t\tsetKittyProtocolActive(true);\n\t\t\t\tthis.keyboardProtocolNegotiationPending = false;\n\t\t\t\tthis.keyboardProtocolLateResponsePending = true;\n\t\t\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\t\t\tthis.clearKeyboardProtocolFallbackTimer();\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.keyboardProtocolNegotiationPending = false;\n\t\tthis.keyboardProtocolLateResponsePending = true;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.clearKeyboardProtocolFallbackTimer();\n\t\tthis.enableModifyOtherKeys();\n\t\treturn true;\n\t}\n\n\tprivate readKeyboardProtocolNegotiationSequence(\n\t\tsequence: string,\n\t\tallowBareEscapePrefix: boolean,\n\t): KeyboardProtocolNegotiationSequence | \"pending\" | undefined {\n\t\tif (this.keyboardProtocolNegotiationBuffer) {\n\t\t\tconst bufferedSequence = this.keyboardProtocolNegotiationBuffer + sequence;\n\t\t\tconst negotiationSequence = parseKeyboardProtocolNegotiationSequence(bufferedSequence);\n\t\t\tif (negotiationSequence) {\n\t\t\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\t\t\treturn negotiationSequence;\n\t\t\t}\n\t\t\tif (isKeyboardProtocolNegotiationSequencePrefix(bufferedSequence, allowBareEscapePrefix)) {\n\t\t\t\tthis.setKeyboardProtocolNegotiationBuffer(bufferedSequence);\n\t\t\t\treturn \"pending\";\n\t\t\t}\n\t\t\tthis.flushKeyboardProtocolNegotiationBufferAsInput();\n\t\t}\n\n\t\tconst negotiationSequence = parseKeyboardProtocolNegotiationSequence(sequence);\n\t\tif (negotiationSequence) return negotiationSequence;\n\t\tif (isKeyboardProtocolNegotiationSequencePrefix(sequence, allowBareEscapePrefix)) {\n\t\t\tthis.setKeyboardProtocolNegotiationBuffer(sequence);\n\t\t\treturn \"pending\";\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate setKeyboardProtocolNegotiationBuffer(sequence: string): void {\n\t\tthis.clearKeyboardProtocolNegotiationBufferFlushTimer();\n\t\tthis.keyboardProtocolNegotiationBuffer = sequence;\n\t}\n\n\tprivate clearKeyboardProtocolNegotiationBuffer(): void {\n\t\tthis.clearKeyboardProtocolNegotiationBufferFlushTimer();\n\t\tthis.keyboardProtocolNegotiationBuffer = \"\";\n\t}\n\n\tprivate flushKeyboardProtocolNegotiationBufferAsInput(): void {\n\t\tif (!this.keyboardProtocolNegotiationBuffer) return;\n\t\tconst sequence = this.keyboardProtocolNegotiationBuffer;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.forwardInputSequence(sequence);\n\t}\n\n\tprivate scheduleKeyboardProtocolNegotiationBufferFlush(): void {\n\t\tif (!this.keyboardProtocolNegotiationBuffer || this.keyboardProtocolBufferFlushTimer) return;\n\t\tthis.keyboardProtocolBufferFlushTimer = setTimeout(() => {\n\t\t\tthis.keyboardProtocolBufferFlushTimer = undefined;\n\t\t\tthis.flushKeyboardProtocolNegotiationBufferAsInput();\n\t\t}, KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS);\n\t}\n\n\tprivate clearKeyboardProtocolNegotiationBufferFlushTimer(): void {\n\t\tif (!this.keyboardProtocolBufferFlushTimer) return;\n\t\tclearTimeout(this.keyboardProtocolBufferFlushTimer);\n\t\tthis.keyboardProtocolBufferFlushTimer = undefined;\n\t}\n\n\tprivate forwardInputSequence(sequence: string): void {\n\t\tif (!this.inputHandler) return;\n\t\tconst isAppleTerminal = sequence === \"\\r\" && isAppleTerminalSession();\n\t\tconst input = normalizeAppleTerminalInput(\n\t\t\tsequence,\n\t\t\tisAppleTerminal,\n\t\t\tisAppleTerminal && isNativeModifierPressed(\"shift\"),\n\t\t);\n\t\tthis.inputHandler(input);\n\t}\n\n\tprivate enableModifyOtherKeys(): void {\n\t\tif (this._kittyProtocolActive || this._modifyOtherKeysActive) return;\n\t\tprocess.stdout.write(\"\\x1b[>4;2m\");\n\t\tthis._modifyOtherKeysActive = true;\n\t}\n\n\tprivate clearKeyboardProtocolFallbackTimer(): void {\n\t\tif (!this.keyboardProtocolFallbackTimer) return;\n\t\tclearTimeout(this.keyboardProtocolFallbackTimer);\n\t\tthis.keyboardProtocolFallbackTimer = undefined;\n\t}\n\n\t/**\n\t * On Windows, add ENABLE_VIRTUAL_TERMINAL_INPUT (0x0200) to the stdin\n\t * console handle so the terminal sends VT sequences for modified keys\n\t * (e.g. \\x1b[Z for Shift+Tab). Without this, libuv's ReadConsoleInputW\n\t * discards modifier state and Shift+Tab arrives as plain \\t.\n\t */\n\tprivate enableWindowsVTInput(): void {\n\t\tif (process.platform !== \"win32\") return;\n\t\ttry {\n\t\t\tconst arch = process.arch;\n\t\t\tif (arch !== \"x64\" && arch !== \"arm64\") return;\n\n\t\t\t// Dynamic require so non-Windows and bundled/browser paths never load the\n\t\t\t// native helper. In the npm package native/ is next to dist/; in compiled\n\t\t\t// binary archives native/ is copied next to the executable.\n\t\t\tconst moduleDir = path.dirname(fileURLToPath(import.meta.url));\n\t\t\tconst nativePath = path.join(\"native\", \"win32\", \"prebuilds\", `win32-${arch}`, \"win32-console-mode.node\");\n\t\t\tconst candidates = [\n\t\t\t\tpath.join(moduleDir, \"..\", nativePath),\n\t\t\t\tpath.join(moduleDir, nativePath),\n\t\t\t\tpath.join(path.dirname(process.execPath), nativePath),\n\t\t\t];\n\t\t\tfor (const modulePath of candidates) {\n\t\t\t\ttry {\n\t\t\t\t\tconst helper = cjsRequire(modulePath) as { enableVirtualTerminalInput?: () => boolean };\n\t\t\t\t\thelper.enableVirtualTerminalInput?.();\n\t\t\t\t\treturn;\n\t\t\t\t} catch {\n\t\t\t\t\t// Try the next possible packaging location.\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {\n\t\t\t// Native helper not available — Shift+Tab won't be distinguishable from Tab.\n\t\t}\n\t}\n\n\tasync drainInput(maxMs = 1000, idleMs = 50): Promise<void> {\n\t\tconst shouldDisableKittyProtocol =\n\t\t\tthis.keyboardProtocolPushed || this._kittyProtocolActive || this.keyboardProtocolNegotiationPending;\n\t\tthis.keyboardProtocolLateResponsePending = false;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.clearKeyboardProtocolFallbackTimer();\n\t\tif (shouldDisableKittyProtocol) {\n\t\t\t// Disable Kitty keyboard protocol first so any late key releases\n\t\t\t// do not generate new Kitty escape sequences.\n\t\t\tprocess.stdout.write(\"\\x1b[<u\");\n\t\t\tthis.keyboardProtocolPushed = false;\n\t\t\tthis._kittyProtocolActive = false;\n\t\t\tsetKittyProtocolActive(false);\n\t\t}\n\t\tthis.keyboardProtocolNegotiationPending = false;\n\t\tif (this._modifyOtherKeysActive) {\n\t\t\tprocess.stdout.write(\"\\x1b[>4;0m\");\n\t\t\tthis._modifyOtherKeysActive = false;\n\t\t}\n\n\t\tconst previousHandler = this.inputHandler;\n\t\tthis.inputHandler = undefined;\n\n\t\tlet lastDataTime = Date.now();\n\t\tconst onData = () => {\n\t\t\tlastDataTime = Date.now();\n\t\t};\n\n\t\tprocess.stdin.on(\"data\", onData);\n\t\tconst endTime = Date.now() + maxMs;\n\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst now = Date.now();\n\t\t\t\tconst timeLeft = endTime - now;\n\t\t\t\tif (timeLeft <= 0) break;\n\t\t\t\tif (now - lastDataTime >= idleMs) break;\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, Math.min(idleMs, timeLeft)));\n\t\t\t}\n\t\t} finally {\n\t\t\tprocess.stdin.removeListener(\"data\", onData);\n\t\t\tthis.inputHandler = previousHandler;\n\t\t}\n\t}\n\n\tstop(): void {\n\t\tif (this.clearProgressInterval()) {\n\t\t\tprocess.stdout.write(TERMINAL_PROGRESS_CLEAR_SEQUENCE);\n\t\t}\n\n\t\t// Disable bracketed paste mode\n\t\tprocess.stdout.write(\"\\x1b[?2004l\");\n\n\t\tconst shouldDisableKittyProtocol =\n\t\t\tthis.keyboardProtocolPushed || this._kittyProtocolActive || this.keyboardProtocolNegotiationPending;\n\t\tthis.keyboardProtocolLateResponsePending = false;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.clearKeyboardProtocolFallbackTimer();\n\n\t\t// Disable Kitty keyboard protocol if not already done by drainInput()\n\t\tif (shouldDisableKittyProtocol) {\n\t\t\tprocess.stdout.write(\"\\x1b[<u\");\n\t\t\tthis.keyboardProtocolPushed = false;\n\t\t\tthis._kittyProtocolActive = false;\n\t\t\tsetKittyProtocolActive(false);\n\t\t}\n\t\tthis.keyboardProtocolNegotiationPending = false;\n\t\tif (this._modifyOtherKeysActive) {\n\t\t\tprocess.stdout.write(\"\\x1b[>4;0m\");\n\t\t\tthis._modifyOtherKeysActive = false;\n\t\t}\n\n\t\t// Clean up StdinBuffer\n\t\tif (this.stdinBuffer) {\n\t\t\tthis.stdinBuffer.destroy();\n\t\t\tthis.stdinBuffer = undefined;\n\t\t}\n\n\t\t// Remove event handlers\n\t\tif (this.stdinDataHandler) {\n\t\t\tprocess.stdin.removeListener(\"data\", this.stdinDataHandler);\n\t\t\tthis.stdinDataHandler = undefined;\n\t\t}\n\t\tthis.inputHandler = undefined;\n\t\tif (this.resizeHandler) {\n\t\t\tprocess.stdout.removeListener(\"resize\", this.resizeHandler);\n\t\t\tthis.resizeHandler = undefined;\n\t\t}\n\n\t\t// Pause stdin to prevent any buffered input (e.g., Ctrl+D) from being\n\t\t// re-interpreted after raw mode is disabled. This fixes a race condition\n\t\t// where Ctrl+D could close the parent shell over SSH.\n\t\tprocess.stdin.pause();\n\n\t\t// Restore raw mode state\n\t\tif (process.stdin.setRawMode) {\n\t\t\tprocess.stdin.setRawMode(this.wasRaw);\n\t\t}\n\t}\n\n\twrite(data: string): void {\n\t\tprocess.stdout.write(data);\n\t\tif (this.writeLogPath) {\n\t\t\ttry {\n\t\t\t\tfs.appendFileSync(this.writeLogPath, data, { encoding: \"utf8\" });\n\t\t\t} catch {\n\t\t\t\t// Ignore logging errors\n\t\t\t}\n\t\t}\n\t}\n\n\tget columns(): number {\n\t\treturn process.stdout.columns || Number(process.env.COLUMNS) || 80;\n\t}\n\n\tget rows(): number {\n\t\treturn process.stdout.rows || Number(process.env.LINES) || 24;\n\t}\n\n\tmoveBy(lines: number): void {\n\t\tif (lines > 0) {\n\t\t\t// Move down\n\t\t\tprocess.stdout.write(`\\x1b[${lines}B`);\n\t\t} else if (lines < 0) {\n\t\t\t// Move up\n\t\t\tprocess.stdout.write(`\\x1b[${-lines}A`);\n\t\t}\n\t\t// lines === 0: no movement\n\t}\n\n\thideCursor(): void {\n\t\tprocess.stdout.write(\"\\x1b[?25l\");\n\t}\n\n\tshowCursor(): void {\n\t\tprocess.stdout.write(\"\\x1b[?25h\");\n\t}\n\n\tclearLine(): void {\n\t\tprocess.stdout.write(\"\\x1b[K\");\n\t}\n\n\tclearFromCursor(): void {\n\t\tprocess.stdout.write(\"\\x1b[J\");\n\t}\n\n\tclearScreen(): void {\n\t\tprocess.stdout.write(\"\\x1b[2J\\x1b[H\"); // Clear screen and move to home (1,1)\n\t}\n\n\tsetTitle(title: string): void {\n\t\t// OSC 0;title BEL - set terminal window title\n\t\tprocess.stdout.write(`\\x1b]0;${title}\\x07`);\n\t}\n\n\tsetProgress(active: boolean): void {\n\t\tif (active) {\n\t\t\t// OSC 9;4;3 - indeterminate progress\n\t\t\tprocess.stdout.write(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);\n\t\t\tif (!this.progressInterval) {\n\t\t\t\tthis.progressInterval = setInterval(() => {\n\t\t\t\t\tprocess.stdout.write(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);\n\t\t\t\t}, TERMINAL_PROGRESS_KEEPALIVE_MS);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.clearProgressInterval();\n\t\t\t// OSC 9;4;0 - clear progress\n\t\t\tprocess.stdout.write(TERMINAL_PROGRESS_CLEAR_SEQUENCE);\n\t\t}\n\t}\n\n\tprivate clearProgressInterval(): boolean {\n\t\tif (!this.progressInterval) return false;\n\t\tclearInterval(this.progressInterval);\n\t\tthis.progressInterval = undefined;\n\t\treturn true;\n\t}\n}\n"]}
|