@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,163 @@
|
|
|
1
|
+
import hostedGitInfo from "hosted-git-info";
|
|
2
|
+
function splitRef(url) {
|
|
3
|
+
const scpLikeMatch = url.match(/^git@([^:]+):(.+)$/);
|
|
4
|
+
if (scpLikeMatch) {
|
|
5
|
+
const pathWithMaybeRef = scpLikeMatch[2] ?? "";
|
|
6
|
+
const refSeparator = pathWithMaybeRef.indexOf("@");
|
|
7
|
+
if (refSeparator < 0)
|
|
8
|
+
return { repo: url };
|
|
9
|
+
const repoPath = pathWithMaybeRef.slice(0, refSeparator);
|
|
10
|
+
const ref = pathWithMaybeRef.slice(refSeparator + 1);
|
|
11
|
+
if (!repoPath || !ref)
|
|
12
|
+
return { repo: url };
|
|
13
|
+
return {
|
|
14
|
+
repo: `git@${scpLikeMatch[1] ?? ""}:${repoPath}`,
|
|
15
|
+
ref,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
if (url.includes("://")) {
|
|
19
|
+
try {
|
|
20
|
+
const parsed = new URL(url);
|
|
21
|
+
const pathWithMaybeRef = parsed.pathname.replace(/^\/+/, "");
|
|
22
|
+
const refSeparator = pathWithMaybeRef.indexOf("@");
|
|
23
|
+
if (refSeparator < 0)
|
|
24
|
+
return { repo: url };
|
|
25
|
+
const repoPath = pathWithMaybeRef.slice(0, refSeparator);
|
|
26
|
+
const ref = pathWithMaybeRef.slice(refSeparator + 1);
|
|
27
|
+
if (!repoPath || !ref)
|
|
28
|
+
return { repo: url };
|
|
29
|
+
parsed.pathname = `/${repoPath}`;
|
|
30
|
+
return {
|
|
31
|
+
repo: parsed.toString().replace(/\/$/, ""),
|
|
32
|
+
ref,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return { repo: url };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const slashIndex = url.indexOf("/");
|
|
40
|
+
if (slashIndex < 0) {
|
|
41
|
+
return { repo: url };
|
|
42
|
+
}
|
|
43
|
+
const host = url.slice(0, slashIndex);
|
|
44
|
+
const pathWithMaybeRef = url.slice(slashIndex + 1);
|
|
45
|
+
const refSeparator = pathWithMaybeRef.indexOf("@");
|
|
46
|
+
if (refSeparator < 0) {
|
|
47
|
+
return { repo: url };
|
|
48
|
+
}
|
|
49
|
+
const repoPath = pathWithMaybeRef.slice(0, refSeparator);
|
|
50
|
+
const ref = pathWithMaybeRef.slice(refSeparator + 1);
|
|
51
|
+
if (!repoPath || !ref) {
|
|
52
|
+
return { repo: url };
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
repo: `${host}/${repoPath}`,
|
|
56
|
+
ref,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function parseGenericGitUrl(url) {
|
|
60
|
+
const { repo: repoWithoutRef, ref } = splitRef(url);
|
|
61
|
+
let repo = repoWithoutRef;
|
|
62
|
+
let host = "";
|
|
63
|
+
let path = "";
|
|
64
|
+
const scpLikeMatch = repoWithoutRef.match(/^git@([^:]+):(.+)$/);
|
|
65
|
+
if (scpLikeMatch) {
|
|
66
|
+
host = scpLikeMatch[1] ?? "";
|
|
67
|
+
path = scpLikeMatch[2] ?? "";
|
|
68
|
+
}
|
|
69
|
+
else if (repoWithoutRef.startsWith("https://") ||
|
|
70
|
+
repoWithoutRef.startsWith("http://") ||
|
|
71
|
+
repoWithoutRef.startsWith("ssh://") ||
|
|
72
|
+
repoWithoutRef.startsWith("git://")) {
|
|
73
|
+
try {
|
|
74
|
+
const parsed = new URL(repoWithoutRef);
|
|
75
|
+
host = parsed.hostname;
|
|
76
|
+
path = parsed.pathname.replace(/^\/+/, "");
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const slashIndex = repoWithoutRef.indexOf("/");
|
|
84
|
+
if (slashIndex < 0) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
host = repoWithoutRef.slice(0, slashIndex);
|
|
88
|
+
path = repoWithoutRef.slice(slashIndex + 1);
|
|
89
|
+
if (!host.includes(".") && host !== "localhost") {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
repo = `https://${repoWithoutRef}`;
|
|
93
|
+
}
|
|
94
|
+
const normalizedPath = path.replace(/\.git$/, "").replace(/^\/+/, "");
|
|
95
|
+
if (!host || !normalizedPath || normalizedPath.split("/").length < 2) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
type: "git",
|
|
100
|
+
repo,
|
|
101
|
+
host,
|
|
102
|
+
path: normalizedPath,
|
|
103
|
+
ref,
|
|
104
|
+
pinned: Boolean(ref),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Parse git source into a GitSource.
|
|
109
|
+
*
|
|
110
|
+
* Rules:
|
|
111
|
+
* - With git: prefix, accept all historical shorthand forms.
|
|
112
|
+
* - Without git: prefix, only accept explicit protocol URLs.
|
|
113
|
+
*/
|
|
114
|
+
export function parseGitUrl(source) {
|
|
115
|
+
const trimmed = source.trim();
|
|
116
|
+
const hasGitPrefix = trimmed.startsWith("git:");
|
|
117
|
+
const url = hasGitPrefix ? trimmed.slice(4).trim() : trimmed;
|
|
118
|
+
if (!hasGitPrefix && !/^(https?|ssh|git):\/\//i.test(url)) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
const split = splitRef(url);
|
|
122
|
+
const hostedCandidates = [split.ref ? `${split.repo}#${split.ref}` : undefined, url].filter((value) => Boolean(value));
|
|
123
|
+
for (const candidate of hostedCandidates) {
|
|
124
|
+
const info = hostedGitInfo.fromUrl(candidate);
|
|
125
|
+
if (info) {
|
|
126
|
+
if (split.ref && info.project?.includes("@")) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const useHttpsPrefix = !split.repo.startsWith("http://") &&
|
|
130
|
+
!split.repo.startsWith("https://") &&
|
|
131
|
+
!split.repo.startsWith("ssh://") &&
|
|
132
|
+
!split.repo.startsWith("git://") &&
|
|
133
|
+
!split.repo.startsWith("git@");
|
|
134
|
+
return {
|
|
135
|
+
type: "git",
|
|
136
|
+
repo: useHttpsPrefix ? `https://${split.repo}` : split.repo,
|
|
137
|
+
host: info.domain || "",
|
|
138
|
+
path: `${info.user}/${info.project}`.replace(/\.git$/, ""),
|
|
139
|
+
ref: info.committish || split.ref || undefined,
|
|
140
|
+
pinned: Boolean(info.committish || split.ref),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const httpsCandidates = [split.ref ? `https://${split.repo}#${split.ref}` : undefined, `https://${url}`].filter((value) => Boolean(value));
|
|
145
|
+
for (const candidate of httpsCandidates) {
|
|
146
|
+
const info = hostedGitInfo.fromUrl(candidate);
|
|
147
|
+
if (info) {
|
|
148
|
+
if (split.ref && info.project?.includes("@")) {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
type: "git",
|
|
153
|
+
repo: `https://${split.repo}`,
|
|
154
|
+
host: info.domain || "",
|
|
155
|
+
path: `${info.user}/${info.project}`.replace(/\.git$/, ""),
|
|
156
|
+
ref: info.committish || split.ref || undefined,
|
|
157
|
+
pinned: Boolean(info.committish || split.ref),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return parseGenericGitUrl(url);
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAoB5C,SAAS,QAAQ,CAAC,GAAW,EAAkC;IAC9D,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACrD,IAAI,YAAY,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/C,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,YAAY,GAAG,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK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AAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,IAAI,EAAE,CAAC;YACV,IAAI,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9C,SAAS;YACV,CAAC;YACD,OAAO;gBACN,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,WAAW,KAAK,CAAC,IAAI,EAAE;gBAC7B,IAAI,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE;gBACvB,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;gBAC1D,GAAG,EAAE,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,IAAI,SAAS;gBAC9C,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,CAAC;aAC7C,CAAC;QACH,CAAC;IACF,CAAC;IAED,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAAA,CAC/B","sourcesContent":["import hostedGitInfo from \"hosted-git-info\";\n\n/**\n * Parsed git URL information.\n */\nexport type GitSource = {\n\t/** Always \"git\" for git sources */\n\ttype: \"git\";\n\t/** Clone URL (always valid for git clone, without ref suffix) */\n\trepo: string;\n\t/** Git host domain (e.g., \"github.com\") */\n\thost: string;\n\t/** Repository path (e.g., \"user/repo\") */\n\tpath: string;\n\t/** Git ref (branch, tag, commit) if specified */\n\tref?: string;\n\t/** True if ref was specified (package won't be auto-updated) */\n\tpinned: boolean;\n};\n\nfunction splitRef(url: string): { repo: string; ref?: string } {\n\tconst scpLikeMatch = url.match(/^git@([^:]+):(.+)$/);\n\tif (scpLikeMatch) {\n\t\tconst pathWithMaybeRef = scpLikeMatch[2] ?? \"\";\n\t\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\t\tif (refSeparator < 0) return { repo: url };\n\t\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\t\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\t\tif (!repoPath || !ref) return { repo: url };\n\t\treturn {\n\t\t\trepo: `git@${scpLikeMatch[1] ?? \"\"}:${repoPath}`,\n\t\t\tref,\n\t\t};\n\t}\n\n\tif (url.includes(\"://\")) {\n\t\ttry {\n\t\t\tconst parsed = new URL(url);\n\t\t\tconst pathWithMaybeRef = parsed.pathname.replace(/^\\/+/, \"\");\n\t\t\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\t\t\tif (refSeparator < 0) return { repo: url };\n\t\t\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\t\t\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\t\t\tif (!repoPath || !ref) return { repo: url };\n\t\t\tparsed.pathname = `/${repoPath}`;\n\t\t\treturn {\n\t\t\t\trepo: parsed.toString().replace(/\\/$/, \"\"),\n\t\t\t\tref,\n\t\t\t};\n\t\t} catch {\n\t\t\treturn { repo: url };\n\t\t}\n\t}\n\n\tconst slashIndex = url.indexOf(\"/\");\n\tif (slashIndex < 0) {\n\t\treturn { repo: url };\n\t}\n\tconst host = url.slice(0, slashIndex);\n\tconst pathWithMaybeRef = url.slice(slashIndex + 1);\n\tconst refSeparator = pathWithMaybeRef.indexOf(\"@\");\n\tif (refSeparator < 0) {\n\t\treturn { repo: url };\n\t}\n\tconst repoPath = pathWithMaybeRef.slice(0, refSeparator);\n\tconst ref = pathWithMaybeRef.slice(refSeparator + 1);\n\tif (!repoPath || !ref) {\n\t\treturn { repo: url };\n\t}\n\treturn {\n\t\trepo: `${host}/${repoPath}`,\n\t\tref,\n\t};\n}\n\nfunction parseGenericGitUrl(url: string): GitSource | null {\n\tconst { repo: repoWithoutRef, ref } = splitRef(url);\n\tlet repo = repoWithoutRef;\n\tlet host = \"\";\n\tlet path = \"\";\n\n\tconst scpLikeMatch = repoWithoutRef.match(/^git@([^:]+):(.+)$/);\n\tif (scpLikeMatch) {\n\t\thost = scpLikeMatch[1] ?? \"\";\n\t\tpath = scpLikeMatch[2] ?? \"\";\n\t} else if (\n\t\trepoWithoutRef.startsWith(\"https://\") ||\n\t\trepoWithoutRef.startsWith(\"http://\") ||\n\t\trepoWithoutRef.startsWith(\"ssh://\") ||\n\t\trepoWithoutRef.startsWith(\"git://\")\n\t) {\n\t\ttry {\n\t\t\tconst parsed = new URL(repoWithoutRef);\n\t\t\thost = parsed.hostname;\n\t\t\tpath = parsed.pathname.replace(/^\\/+/, \"\");\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t} else {\n\t\tconst slashIndex = repoWithoutRef.indexOf(\"/\");\n\t\tif (slashIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\thost = repoWithoutRef.slice(0, slashIndex);\n\t\tpath = repoWithoutRef.slice(slashIndex + 1);\n\t\tif (!host.includes(\".\") && host !== \"localhost\") {\n\t\t\treturn null;\n\t\t}\n\t\trepo = `https://${repoWithoutRef}`;\n\t}\n\n\tconst normalizedPath = path.replace(/\\.git$/, \"\").replace(/^\\/+/, \"\");\n\tif (!host || !normalizedPath || normalizedPath.split(\"/\").length < 2) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\ttype: \"git\",\n\t\trepo,\n\t\thost,\n\t\tpath: normalizedPath,\n\t\tref,\n\t\tpinned: Boolean(ref),\n\t};\n}\n\n/**\n * Parse git source into a GitSource.\n *\n * Rules:\n * - With git: prefix, accept all historical shorthand forms.\n * - Without git: prefix, only accept explicit protocol URLs.\n */\nexport function parseGitUrl(source: string): GitSource | null {\n\tconst trimmed = source.trim();\n\tconst hasGitPrefix = trimmed.startsWith(\"git:\");\n\tconst url = hasGitPrefix ? trimmed.slice(4).trim() : trimmed;\n\n\tif (!hasGitPrefix && !/^(https?|ssh|git):\\/\\//i.test(url)) {\n\t\treturn null;\n\t}\n\n\tconst split = splitRef(url);\n\n\tconst hostedCandidates = [split.ref ? `${split.repo}#${split.ref}` : undefined, url].filter(\n\t\t(value): value is string => Boolean(value),\n\t);\n\tfor (const candidate of hostedCandidates) {\n\t\tconst info = hostedGitInfo.fromUrl(candidate);\n\t\tif (info) {\n\t\t\tif (split.ref && info.project?.includes(\"@\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst useHttpsPrefix =\n\t\t\t\t!split.repo.startsWith(\"http://\") &&\n\t\t\t\t!split.repo.startsWith(\"https://\") &&\n\t\t\t\t!split.repo.startsWith(\"ssh://\") &&\n\t\t\t\t!split.repo.startsWith(\"git://\") &&\n\t\t\t\t!split.repo.startsWith(\"git@\");\n\t\t\treturn {\n\t\t\t\ttype: \"git\",\n\t\t\t\trepo: useHttpsPrefix ? `https://${split.repo}` : split.repo,\n\t\t\t\thost: info.domain || \"\",\n\t\t\t\tpath: `${info.user}/${info.project}`.replace(/\\.git$/, \"\"),\n\t\t\t\tref: info.committish || split.ref || undefined,\n\t\t\t\tpinned: Boolean(info.committish || split.ref),\n\t\t\t};\n\t\t}\n\t}\n\n\tconst httpsCandidates = [split.ref ? `https://${split.repo}#${split.ref}` : undefined, `https://${url}`].filter(\n\t\t(value): value is string => Boolean(value),\n\t);\n\tfor (const candidate of httpsCandidates) {\n\t\tconst info = hostedGitInfo.fromUrl(candidate);\n\t\tif (info) {\n\t\t\tif (split.ref && info.project?.includes(\"@\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: \"git\",\n\t\t\t\trepo: `https://${split.repo}`,\n\t\t\t\thost: info.domain || \"\",\n\t\t\t\tpath: `${info.user}/${info.project}`.replace(/\\.git$/, \"\"),\n\t\t\t\tref: info.committish || split.ref || undefined,\n\t\t\t\tpinned: Boolean(info.committish || split.ref),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn parseGenericGitUrl(url);\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface DecodedHtmlEntity {
|
|
2
|
+
text: string;
|
|
3
|
+
length: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function decodeHtmlEntity(entity: string): string | undefined;
|
|
6
|
+
export declare function decodeHtmlEntityAt(html: string, index: number): DecodedHtmlEntity | undefined;
|
|
7
|
+
//# sourceMappingURL=html.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/utils/html.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf;AASD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAuBnE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAa7F","sourcesContent":["export interface DecodedHtmlEntity {\n\ttext: string;\n\tlength: number;\n}\n\nfunction decodeCodePoint(codePoint: number): string | undefined {\n\tif (!Number.isInteger(codePoint) || codePoint < 0 || codePoint > 0x10ffff) {\n\t\treturn undefined;\n\t}\n\treturn String.fromCodePoint(codePoint);\n}\n\nexport function decodeHtmlEntity(entity: string): string | undefined {\n\tswitch (entity) {\n\t\tcase \"amp\":\n\t\t\treturn \"&\";\n\t\tcase \"lt\":\n\t\t\treturn \"<\";\n\t\tcase \"gt\":\n\t\t\treturn \">\";\n\t\tcase \"quot\":\n\t\t\treturn '\"';\n\t\tcase \"apos\":\n\t\t\treturn \"'\";\n\t}\n\n\tif (entity.startsWith(\"#x\") || entity.startsWith(\"#X\")) {\n\t\treturn decodeCodePoint(Number.parseInt(entity.slice(2), 16));\n\t}\n\n\tif (entity.startsWith(\"#\")) {\n\t\treturn decodeCodePoint(Number.parseInt(entity.slice(1), 10));\n\t}\n\n\treturn undefined;\n}\n\nexport function decodeHtmlEntityAt(html: string, index: number): DecodedHtmlEntity | undefined {\n\tconst semicolonIndex = html.indexOf(\";\", index + 1);\n\tif (semicolonIndex === -1 || semicolonIndex - index > 16) {\n\t\treturn undefined;\n\t}\n\n\tconst entity = html.slice(index + 1, semicolonIndex);\n\tconst decoded = decodeHtmlEntity(entity);\n\tif (decoded === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { text: decoded, length: semicolonIndex - index + 1 };\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function decodeCodePoint(codePoint) {
|
|
2
|
+
if (!Number.isInteger(codePoint) || codePoint < 0 || codePoint > 0x10ffff) {
|
|
3
|
+
return undefined;
|
|
4
|
+
}
|
|
5
|
+
return String.fromCodePoint(codePoint);
|
|
6
|
+
}
|
|
7
|
+
export function decodeHtmlEntity(entity) {
|
|
8
|
+
switch (entity) {
|
|
9
|
+
case "amp":
|
|
10
|
+
return "&";
|
|
11
|
+
case "lt":
|
|
12
|
+
return "<";
|
|
13
|
+
case "gt":
|
|
14
|
+
return ">";
|
|
15
|
+
case "quot":
|
|
16
|
+
return '"';
|
|
17
|
+
case "apos":
|
|
18
|
+
return "'";
|
|
19
|
+
}
|
|
20
|
+
if (entity.startsWith("#x") || entity.startsWith("#X")) {
|
|
21
|
+
return decodeCodePoint(Number.parseInt(entity.slice(2), 16));
|
|
22
|
+
}
|
|
23
|
+
if (entity.startsWith("#")) {
|
|
24
|
+
return decodeCodePoint(Number.parseInt(entity.slice(1), 10));
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
export function decodeHtmlEntityAt(html, index) {
|
|
29
|
+
const semicolonIndex = html.indexOf(";", index + 1);
|
|
30
|
+
if (semicolonIndex === -1 || semicolonIndex - index > 16) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
const entity = html.slice(index + 1, semicolonIndex);
|
|
34
|
+
const decoded = decodeHtmlEntity(entity);
|
|
35
|
+
if (decoded === undefined) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return { text: decoded, length: semicolonIndex - index + 1 };
|
|
39
|
+
}
|
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AC,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IACpD,IAAI,cAAc,KAAK,CAAC,CAAC,IAAI,cAAc,GAAG,KAAK,GAAG,EAAE,EAAE,CAAC;QAC1D,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC;AAAA,CAC7D","sourcesContent":["export interface DecodedHtmlEntity {\n\ttext: string;\n\tlength: number;\n}\n\nfunction decodeCodePoint(codePoint: number): string | undefined {\n\tif (!Number.isInteger(codePoint) || codePoint < 0 || codePoint > 0x10ffff) {\n\t\treturn undefined;\n\t}\n\treturn String.fromCodePoint(codePoint);\n}\n\nexport function decodeHtmlEntity(entity: string): string | undefined {\n\tswitch (entity) {\n\t\tcase \"amp\":\n\t\t\treturn \"&\";\n\t\tcase \"lt\":\n\t\t\treturn \"<\";\n\t\tcase \"gt\":\n\t\t\treturn \">\";\n\t\tcase \"quot\":\n\t\t\treturn '\"';\n\t\tcase \"apos\":\n\t\t\treturn \"'\";\n\t}\n\n\tif (entity.startsWith(\"#x\") || entity.startsWith(\"#X\")) {\n\t\treturn decodeCodePoint(Number.parseInt(entity.slice(2), 16));\n\t}\n\n\tif (entity.startsWith(\"#\")) {\n\t\treturn decodeCodePoint(Number.parseInt(entity.slice(1), 10));\n\t}\n\n\treturn undefined;\n}\n\nexport function decodeHtmlEntityAt(html: string, index: number): DecodedHtmlEntity | undefined {\n\tconst semicolonIndex = html.indexOf(\";\", index + 1);\n\tif (semicolonIndex === -1 || semicolonIndex - index > 16) {\n\t\treturn undefined;\n\t}\n\n\tconst entity = html.slice(index + 1, semicolonIndex);\n\tconst decoded = decodeHtmlEntity(entity);\n\tif (decoded === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { text: decoded, length: semicolonIndex - index + 1 };\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert image to PNG format for terminal display.
|
|
3
|
+
* Kitty graphics protocol requires PNG format (f=100).
|
|
4
|
+
*/
|
|
5
|
+
export declare function convertToPng(base64Data: string, mimeType: string): Promise<{
|
|
6
|
+
data: string;
|
|
7
|
+
mimeType: string;
|
|
8
|
+
} | null>;
|
|
9
|
+
//# sourceMappingURL=image-convert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-convert.d.ts","sourceRoot":"","sources":["../../src/utils/image-convert.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAsB,YAAY,CACjC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CA8BpD","sourcesContent":["import { applyExifOrientation } from \"./exif-orientation.ts\";\nimport { loadPhoton } from \"./photon.ts\";\n\n/**\n * Convert image to PNG format for terminal display.\n * Kitty graphics protocol requires PNG format (f=100).\n */\nexport async function convertToPng(\n\tbase64Data: string,\n\tmimeType: string,\n): Promise<{ data: string; mimeType: string } | null> {\n\t// Already PNG, no conversion needed\n\tif (mimeType === \"image/png\") {\n\t\treturn { data: base64Data, mimeType };\n\t}\n\n\tconst photon = await loadPhoton();\n\tif (!photon) {\n\t\t// Photon not available, can't convert\n\t\treturn null;\n\t}\n\n\ttry {\n\t\tconst bytes = new Uint8Array(Buffer.from(base64Data, \"base64\"));\n\t\tconst rawImage = photon.PhotonImage.new_from_byteslice(bytes);\n\t\tconst image = applyExifOrientation(photon, rawImage, bytes);\n\t\tif (image !== rawImage) rawImage.free();\n\t\ttry {\n\t\t\tconst pngBuffer = image.get_bytes();\n\t\t\treturn {\n\t\t\t\tdata: Buffer.from(pngBuffer).toString(\"base64\"),\n\t\t\t\tmimeType: \"image/png\",\n\t\t\t};\n\t\t} finally {\n\t\t\timage.free();\n\t\t}\n\t} catch {\n\t\t// Conversion failed\n\t\treturn null;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { applyExifOrientation } from "./exif-orientation.js";
|
|
2
|
+
import { loadPhoton } from "./photon.js";
|
|
3
|
+
/**
|
|
4
|
+
* Convert image to PNG format for terminal display.
|
|
5
|
+
* Kitty graphics protocol requires PNG format (f=100).
|
|
6
|
+
*/
|
|
7
|
+
export async function convertToPng(base64Data, mimeType) {
|
|
8
|
+
// Already PNG, no conversion needed
|
|
9
|
+
if (mimeType === "image/png") {
|
|
10
|
+
return { data: base64Data, mimeType };
|
|
11
|
+
}
|
|
12
|
+
const photon = await loadPhoton();
|
|
13
|
+
if (!photon) {
|
|
14
|
+
// Photon not available, can't convert
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
const bytes = new Uint8Array(Buffer.from(base64Data, "base64"));
|
|
19
|
+
const rawImage = photon.PhotonImage.new_from_byteslice(bytes);
|
|
20
|
+
const image = applyExifOrientation(photon, rawImage, bytes);
|
|
21
|
+
if (image !== rawImage)
|
|
22
|
+
rawImage.free();
|
|
23
|
+
try {
|
|
24
|
+
const pngBuffer = image.get_bytes();
|
|
25
|
+
return {
|
|
26
|
+
data: Buffer.from(pngBuffer).toString("base64"),
|
|
27
|
+
mimeType: "image/png",
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
image.free();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Conversion failed
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|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,MAAM,CAAC;QACR,oBAAoB;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;AAAA,CACD","sourcesContent":["import { applyExifOrientation } from \"./exif-orientation.ts\";\nimport { loadPhoton } from \"./photon.ts\";\n\n/**\n * Convert image to PNG format for terminal display.\n * Kitty graphics protocol requires PNG format (f=100).\n */\nexport async function convertToPng(\n\tbase64Data: string,\n\tmimeType: string,\n): Promise<{ data: string; mimeType: string } | null> {\n\t// Already PNG, no conversion needed\n\tif (mimeType === \"image/png\") {\n\t\treturn { data: base64Data, mimeType };\n\t}\n\n\tconst photon = await loadPhoton();\n\tif (!photon) {\n\t\t// Photon not available, can't convert\n\t\treturn null;\n\t}\n\n\ttry {\n\t\tconst bytes = new Uint8Array(Buffer.from(base64Data, \"base64\"));\n\t\tconst rawImage = photon.PhotonImage.new_from_byteslice(bytes);\n\t\tconst image = applyExifOrientation(photon, rawImage, bytes);\n\t\tif (image !== rawImage) rawImage.free();\n\t\ttry {\n\t\t\tconst pngBuffer = image.get_bytes();\n\t\t\treturn {\n\t\t\t\tdata: Buffer.from(pngBuffer).toString(\"base64\"),\n\t\t\t\tmimeType: \"image/png\",\n\t\t\t};\n\t\t} finally {\n\t\t\timage.free();\n\t\t}\n\t} catch {\n\t\t// Conversion failed\n\t\treturn null;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ImageResizeOptions {
|
|
2
|
+
maxWidth?: number;
|
|
3
|
+
maxHeight?: number;
|
|
4
|
+
maxBytes?: number;
|
|
5
|
+
jpegQuality?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ResizedImage {
|
|
8
|
+
data: string;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
originalWidth: number;
|
|
11
|
+
originalHeight: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
wasResized: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resize an image to fit within the specified max dimensions and encoded file size.
|
|
18
|
+
* Returns null if the image cannot be resized below maxBytes.
|
|
19
|
+
*
|
|
20
|
+
* Uses Photon (Rust/WASM) for image processing. If Photon is not available,
|
|
21
|
+
* returns null.
|
|
22
|
+
*
|
|
23
|
+
* Strategy for staying under maxBytes:
|
|
24
|
+
* 1. First resize to maxWidth/maxHeight
|
|
25
|
+
* 2. Try both PNG and JPEG formats, pick the smaller one
|
|
26
|
+
* 3. If still too large, try JPEG with decreasing quality
|
|
27
|
+
* 4. If still too large, progressively reduce dimensions until 1x1
|
|
28
|
+
*/
|
|
29
|
+
export declare function resizeImageInProcess(inputBytes: Uint8Array, mimeType: string, options?: ImageResizeOptions): Promise<ResizedImage | null>;
|
|
30
|
+
//# sourceMappingURL=image-resize-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-resize-core.d.ts","sourceRoot":"","sources":["../../src/utils/image-resize-core.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;CACpB;AA2BD;;;;;;;;;;;;GAYG;AACH,wBAAsB,oBAAoB,CACzC,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAqG9B","sourcesContent":["import { applyExifOrientation } from \"./exif-orientation.ts\";\nimport { loadPhoton } from \"./photon.ts\";\n\nexport interface ImageResizeOptions {\n\tmaxWidth?: number; // Default: 2000\n\tmaxHeight?: number; // Default: 2000\n\tmaxBytes?: number; // Default: 4.5MB of base64 payload (below Anthropic's 5MB limit)\n\tjpegQuality?: number; // Default: 80\n}\n\nexport interface ResizedImage {\n\tdata: string; // base64\n\tmimeType: string;\n\toriginalWidth: number;\n\toriginalHeight: number;\n\twidth: number;\n\theight: number;\n\twasResized: boolean;\n}\n\n// 4.5MB of base64 payload. Provides headroom below Anthropic's 5MB limit.\nconst DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024;\n\nconst DEFAULT_OPTIONS: Required<ImageResizeOptions> = {\n\tmaxWidth: 2000,\n\tmaxHeight: 2000,\n\tmaxBytes: DEFAULT_MAX_BYTES,\n\tjpegQuality: 80,\n};\n\ninterface EncodedCandidate {\n\tdata: string;\n\tencodedSize: number;\n\tmimeType: string;\n}\n\nfunction encodeCandidate(buffer: Uint8Array, mimeType: string): EncodedCandidate {\n\tconst data = Buffer.from(buffer).toString(\"base64\");\n\treturn {\n\t\tdata,\n\t\tencodedSize: Buffer.byteLength(data, \"utf-8\"),\n\t\tmimeType,\n\t};\n}\n\n/**\n * Resize an image to fit within the specified max dimensions and encoded file size.\n * Returns null if the image cannot be resized below maxBytes.\n *\n * Uses Photon (Rust/WASM) for image processing. If Photon is not available,\n * returns null.\n *\n * Strategy for staying under maxBytes:\n * 1. First resize to maxWidth/maxHeight\n * 2. Try both PNG and JPEG formats, pick the smaller one\n * 3. If still too large, try JPEG with decreasing quality\n * 4. If still too large, progressively reduce dimensions until 1x1\n */\nexport async function resizeImageInProcess(\n\tinputBytes: Uint8Array,\n\tmimeType: string,\n\toptions?: ImageResizeOptions,\n): Promise<ResizedImage | null> {\n\tconst opts = { ...DEFAULT_OPTIONS, ...options };\n\tconst inputBase64Size = Math.ceil(inputBytes.byteLength / 3) * 4;\n\n\tconst photon = await loadPhoton();\n\tif (!photon) {\n\t\treturn null;\n\t}\n\n\tlet image: ReturnType<typeof photon.PhotonImage.new_from_byteslice> | undefined;\n\ttry {\n\t\tconst rawImage = photon.PhotonImage.new_from_byteslice(inputBytes);\n\t\timage = applyExifOrientation(photon, rawImage, inputBytes);\n\t\tif (image !== rawImage) rawImage.free();\n\n\t\tconst originalWidth = image.get_width();\n\t\tconst originalHeight = image.get_height();\n\t\tconst format = mimeType.split(\"/\")[1] ?? \"png\";\n\n\t\t// Check if already within all limits (dimensions AND encoded size)\n\t\tif (originalWidth <= opts.maxWidth && originalHeight <= opts.maxHeight && inputBase64Size < opts.maxBytes) {\n\t\t\treturn {\n\t\t\t\tdata: Buffer.from(inputBytes).toString(\"base64\"),\n\t\t\t\tmimeType: mimeType || `image/${format}`,\n\t\t\t\toriginalWidth,\n\t\t\t\toriginalHeight,\n\t\t\t\twidth: originalWidth,\n\t\t\t\theight: originalHeight,\n\t\t\t\twasResized: false,\n\t\t\t};\n\t\t}\n\n\t\t// Calculate initial dimensions respecting max limits\n\t\tlet targetWidth = originalWidth;\n\t\tlet targetHeight = originalHeight;\n\n\t\tif (targetWidth > opts.maxWidth) {\n\t\t\ttargetHeight = Math.round((targetHeight * opts.maxWidth) / targetWidth);\n\t\t\ttargetWidth = opts.maxWidth;\n\t\t}\n\t\tif (targetHeight > opts.maxHeight) {\n\t\t\ttargetWidth = Math.round((targetWidth * opts.maxHeight) / targetHeight);\n\t\t\ttargetHeight = opts.maxHeight;\n\t\t}\n\n\t\tfunction tryEncodings(width: number, height: number, jpegQualities: number[]): EncodedCandidate[] {\n\t\t\tconst resized = photon!.resize(image!, width, height, photon!.SamplingFilter.Lanczos3);\n\n\t\t\ttry {\n\t\t\t\tconst candidates: EncodedCandidate[] = [encodeCandidate(resized.get_bytes(), \"image/png\")];\n\t\t\t\tfor (const quality of jpegQualities) {\n\t\t\t\t\tcandidates.push(encodeCandidate(resized.get_bytes_jpeg(quality), \"image/jpeg\"));\n\t\t\t\t}\n\t\t\t\treturn candidates;\n\t\t\t} finally {\n\t\t\t\tresized.free();\n\t\t\t}\n\t\t}\n\n\t\tconst qualitySteps = Array.from(new Set([opts.jpegQuality, 85, 70, 55, 40]));\n\t\tlet currentWidth = targetWidth;\n\t\tlet currentHeight = targetHeight;\n\n\t\twhile (true) {\n\t\t\tconst candidates = tryEncodings(currentWidth, currentHeight, qualitySteps);\n\t\t\tfor (const candidate of candidates) {\n\t\t\t\tif (candidate.encodedSize < opts.maxBytes) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: candidate.data,\n\t\t\t\t\t\tmimeType: candidate.mimeType,\n\t\t\t\t\t\toriginalWidth,\n\t\t\t\t\t\toriginalHeight,\n\t\t\t\t\t\twidth: currentWidth,\n\t\t\t\t\t\theight: currentHeight,\n\t\t\t\t\t\twasResized: true,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (currentWidth === 1 && currentHeight === 1) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst nextWidth = currentWidth === 1 ? 1 : Math.max(1, Math.floor(currentWidth * 0.75));\n\t\t\tconst nextHeight = currentHeight === 1 ? 1 : Math.max(1, Math.floor(currentHeight * 0.75));\n\t\t\tif (nextWidth === currentWidth && nextHeight === currentHeight) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcurrentWidth = nextWidth;\n\t\t\tcurrentHeight = nextHeight;\n\t\t}\n\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t} finally {\n\t\tif (image) {\n\t\t\timage.free();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { applyExifOrientation } from "./exif-orientation.js";
|
|
2
|
+
import { loadPhoton } from "./photon.js";
|
|
3
|
+
// 4.5MB of base64 payload. Provides headroom below Anthropic's 5MB limit.
|
|
4
|
+
const DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024;
|
|
5
|
+
const DEFAULT_OPTIONS = {
|
|
6
|
+
maxWidth: 2000,
|
|
7
|
+
maxHeight: 2000,
|
|
8
|
+
maxBytes: DEFAULT_MAX_BYTES,
|
|
9
|
+
jpegQuality: 80,
|
|
10
|
+
};
|
|
11
|
+
function encodeCandidate(buffer, mimeType) {
|
|
12
|
+
const data = Buffer.from(buffer).toString("base64");
|
|
13
|
+
return {
|
|
14
|
+
data,
|
|
15
|
+
encodedSize: Buffer.byteLength(data, "utf-8"),
|
|
16
|
+
mimeType,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resize an image to fit within the specified max dimensions and encoded file size.
|
|
21
|
+
* Returns null if the image cannot be resized below maxBytes.
|
|
22
|
+
*
|
|
23
|
+
* Uses Photon (Rust/WASM) for image processing. If Photon is not available,
|
|
24
|
+
* returns null.
|
|
25
|
+
*
|
|
26
|
+
* Strategy for staying under maxBytes:
|
|
27
|
+
* 1. First resize to maxWidth/maxHeight
|
|
28
|
+
* 2. Try both PNG and JPEG formats, pick the smaller one
|
|
29
|
+
* 3. If still too large, try JPEG with decreasing quality
|
|
30
|
+
* 4. If still too large, progressively reduce dimensions until 1x1
|
|
31
|
+
*/
|
|
32
|
+
export async function resizeImageInProcess(inputBytes, mimeType, options) {
|
|
33
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
34
|
+
const inputBase64Size = Math.ceil(inputBytes.byteLength / 3) * 4;
|
|
35
|
+
const photon = await loadPhoton();
|
|
36
|
+
if (!photon) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
let image;
|
|
40
|
+
try {
|
|
41
|
+
const rawImage = photon.PhotonImage.new_from_byteslice(inputBytes);
|
|
42
|
+
image = applyExifOrientation(photon, rawImage, inputBytes);
|
|
43
|
+
if (image !== rawImage)
|
|
44
|
+
rawImage.free();
|
|
45
|
+
const originalWidth = image.get_width();
|
|
46
|
+
const originalHeight = image.get_height();
|
|
47
|
+
const format = mimeType.split("/")[1] ?? "png";
|
|
48
|
+
// Check if already within all limits (dimensions AND encoded size)
|
|
49
|
+
if (originalWidth <= opts.maxWidth && originalHeight <= opts.maxHeight && inputBase64Size < opts.maxBytes) {
|
|
50
|
+
return {
|
|
51
|
+
data: Buffer.from(inputBytes).toString("base64"),
|
|
52
|
+
mimeType: mimeType || `image/${format}`,
|
|
53
|
+
originalWidth,
|
|
54
|
+
originalHeight,
|
|
55
|
+
width: originalWidth,
|
|
56
|
+
height: originalHeight,
|
|
57
|
+
wasResized: false,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
// Calculate initial dimensions respecting max limits
|
|
61
|
+
let targetWidth = originalWidth;
|
|
62
|
+
let targetHeight = originalHeight;
|
|
63
|
+
if (targetWidth > opts.maxWidth) {
|
|
64
|
+
targetHeight = Math.round((targetHeight * opts.maxWidth) / targetWidth);
|
|
65
|
+
targetWidth = opts.maxWidth;
|
|
66
|
+
}
|
|
67
|
+
if (targetHeight > opts.maxHeight) {
|
|
68
|
+
targetWidth = Math.round((targetWidth * opts.maxHeight) / targetHeight);
|
|
69
|
+
targetHeight = opts.maxHeight;
|
|
70
|
+
}
|
|
71
|
+
function tryEncodings(width, height, jpegQualities) {
|
|
72
|
+
const resized = photon.resize(image, width, height, photon.SamplingFilter.Lanczos3);
|
|
73
|
+
try {
|
|
74
|
+
const candidates = [encodeCandidate(resized.get_bytes(), "image/png")];
|
|
75
|
+
for (const quality of jpegQualities) {
|
|
76
|
+
candidates.push(encodeCandidate(resized.get_bytes_jpeg(quality), "image/jpeg"));
|
|
77
|
+
}
|
|
78
|
+
return candidates;
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
resized.free();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const qualitySteps = Array.from(new Set([opts.jpegQuality, 85, 70, 55, 40]));
|
|
85
|
+
let currentWidth = targetWidth;
|
|
86
|
+
let currentHeight = targetHeight;
|
|
87
|
+
while (true) {
|
|
88
|
+
const candidates = tryEncodings(currentWidth, currentHeight, qualitySteps);
|
|
89
|
+
for (const candidate of candidates) {
|
|
90
|
+
if (candidate.encodedSize < opts.maxBytes) {
|
|
91
|
+
return {
|
|
92
|
+
data: candidate.data,
|
|
93
|
+
mimeType: candidate.mimeType,
|
|
94
|
+
originalWidth,
|
|
95
|
+
originalHeight,
|
|
96
|
+
width: currentWidth,
|
|
97
|
+
height: currentHeight,
|
|
98
|
+
wasResized: true,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (currentWidth === 1 && currentHeight === 1) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
const nextWidth = currentWidth === 1 ? 1 : Math.max(1, Math.floor(currentWidth * 0.75));
|
|
106
|
+
const nextHeight = currentHeight === 1 ? 1 : Math.max(1, Math.floor(currentHeight * 0.75));
|
|
107
|
+
if (nextWidth === currentWidth && nextHeight === currentHeight) {
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
currentWidth = nextWidth;
|
|
111
|
+
currentHeight = nextHeight;
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
if (image) {
|
|
120
|
+
image.free();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=image-resize-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-resize-core.js","sourceRoot":"","sources":["../../src/utils/image-resize-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAmBzC,0EAA0E;AAC1E,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,eAAe,GAAiC;IACrD,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,iBAAiB;IAC3B,WAAW,EAAE,EAAE;CAC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C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC;YAC3F,IAAI,SAAS,KAAK,YAAY,IAAI,UAAU,KAAK,aAAa,EAAE,CAAC;gBAChE,MAAM;YACP,CAAC;YAED,YAAY,GAAG,SAAS,CAAC;YACzB,aAAa,GAAG,UAAU,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAC;IACb,CAAC;YAAS,CAAC;QACV,IAAI,KAAK,EAAE,CAAC;YACX,KAAK,CAAC,IAAI,EAAE,CAAC;QACd,CAAC;IACF,CAAC;AAAA,CACD","sourcesContent":["import { applyExifOrientation } from \"./exif-orientation.ts\";\nimport { loadPhoton } from \"./photon.ts\";\n\nexport interface ImageResizeOptions {\n\tmaxWidth?: number; // Default: 2000\n\tmaxHeight?: number; // Default: 2000\n\tmaxBytes?: number; // Default: 4.5MB of base64 payload (below Anthropic's 5MB limit)\n\tjpegQuality?: number; // Default: 80\n}\n\nexport interface ResizedImage {\n\tdata: string; // base64\n\tmimeType: string;\n\toriginalWidth: number;\n\toriginalHeight: number;\n\twidth: number;\n\theight: number;\n\twasResized: boolean;\n}\n\n// 4.5MB of base64 payload. Provides headroom below Anthropic's 5MB limit.\nconst DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024;\n\nconst DEFAULT_OPTIONS: Required<ImageResizeOptions> = {\n\tmaxWidth: 2000,\n\tmaxHeight: 2000,\n\tmaxBytes: DEFAULT_MAX_BYTES,\n\tjpegQuality: 80,\n};\n\ninterface EncodedCandidate {\n\tdata: string;\n\tencodedSize: number;\n\tmimeType: string;\n}\n\nfunction encodeCandidate(buffer: Uint8Array, mimeType: string): EncodedCandidate {\n\tconst data = Buffer.from(buffer).toString(\"base64\");\n\treturn {\n\t\tdata,\n\t\tencodedSize: Buffer.byteLength(data, \"utf-8\"),\n\t\tmimeType,\n\t};\n}\n\n/**\n * Resize an image to fit within the specified max dimensions and encoded file size.\n * Returns null if the image cannot be resized below maxBytes.\n *\n * Uses Photon (Rust/WASM) for image processing. If Photon is not available,\n * returns null.\n *\n * Strategy for staying under maxBytes:\n * 1. First resize to maxWidth/maxHeight\n * 2. Try both PNG and JPEG formats, pick the smaller one\n * 3. If still too large, try JPEG with decreasing quality\n * 4. If still too large, progressively reduce dimensions until 1x1\n */\nexport async function resizeImageInProcess(\n\tinputBytes: Uint8Array,\n\tmimeType: string,\n\toptions?: ImageResizeOptions,\n): Promise<ResizedImage | null> {\n\tconst opts = { ...DEFAULT_OPTIONS, ...options };\n\tconst inputBase64Size = Math.ceil(inputBytes.byteLength / 3) * 4;\n\n\tconst photon = await loadPhoton();\n\tif (!photon) {\n\t\treturn null;\n\t}\n\n\tlet image: ReturnType<typeof photon.PhotonImage.new_from_byteslice> | undefined;\n\ttry {\n\t\tconst rawImage = photon.PhotonImage.new_from_byteslice(inputBytes);\n\t\timage = applyExifOrientation(photon, rawImage, inputBytes);\n\t\tif (image !== rawImage) rawImage.free();\n\n\t\tconst originalWidth = image.get_width();\n\t\tconst originalHeight = image.get_height();\n\t\tconst format = mimeType.split(\"/\")[1] ?? \"png\";\n\n\t\t// Check if already within all limits (dimensions AND encoded size)\n\t\tif (originalWidth <= opts.maxWidth && originalHeight <= opts.maxHeight && inputBase64Size < opts.maxBytes) {\n\t\t\treturn {\n\t\t\t\tdata: Buffer.from(inputBytes).toString(\"base64\"),\n\t\t\t\tmimeType: mimeType || `image/${format}`,\n\t\t\t\toriginalWidth,\n\t\t\t\toriginalHeight,\n\t\t\t\twidth: originalWidth,\n\t\t\t\theight: originalHeight,\n\t\t\t\twasResized: false,\n\t\t\t};\n\t\t}\n\n\t\t// Calculate initial dimensions respecting max limits\n\t\tlet targetWidth = originalWidth;\n\t\tlet targetHeight = originalHeight;\n\n\t\tif (targetWidth > opts.maxWidth) {\n\t\t\ttargetHeight = Math.round((targetHeight * opts.maxWidth) / targetWidth);\n\t\t\ttargetWidth = opts.maxWidth;\n\t\t}\n\t\tif (targetHeight > opts.maxHeight) {\n\t\t\ttargetWidth = Math.round((targetWidth * opts.maxHeight) / targetHeight);\n\t\t\ttargetHeight = opts.maxHeight;\n\t\t}\n\n\t\tfunction tryEncodings(width: number, height: number, jpegQualities: number[]): EncodedCandidate[] {\n\t\t\tconst resized = photon!.resize(image!, width, height, photon!.SamplingFilter.Lanczos3);\n\n\t\t\ttry {\n\t\t\t\tconst candidates: EncodedCandidate[] = [encodeCandidate(resized.get_bytes(), \"image/png\")];\n\t\t\t\tfor (const quality of jpegQualities) {\n\t\t\t\t\tcandidates.push(encodeCandidate(resized.get_bytes_jpeg(quality), \"image/jpeg\"));\n\t\t\t\t}\n\t\t\t\treturn candidates;\n\t\t\t} finally {\n\t\t\t\tresized.free();\n\t\t\t}\n\t\t}\n\n\t\tconst qualitySteps = Array.from(new Set([opts.jpegQuality, 85, 70, 55, 40]));\n\t\tlet currentWidth = targetWidth;\n\t\tlet currentHeight = targetHeight;\n\n\t\twhile (true) {\n\t\t\tconst candidates = tryEncodings(currentWidth, currentHeight, qualitySteps);\n\t\t\tfor (const candidate of candidates) {\n\t\t\t\tif (candidate.encodedSize < opts.maxBytes) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: candidate.data,\n\t\t\t\t\t\tmimeType: candidate.mimeType,\n\t\t\t\t\t\toriginalWidth,\n\t\t\t\t\t\toriginalHeight,\n\t\t\t\t\t\twidth: currentWidth,\n\t\t\t\t\t\theight: currentHeight,\n\t\t\t\t\t\twasResized: true,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (currentWidth === 1 && currentHeight === 1) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst nextWidth = currentWidth === 1 ? 1 : Math.max(1, Math.floor(currentWidth * 0.75));\n\t\t\tconst nextHeight = currentHeight === 1 ? 1 : Math.max(1, Math.floor(currentHeight * 0.75));\n\t\t\tif (nextWidth === currentWidth && nextHeight === currentHeight) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcurrentWidth = nextWidth;\n\t\t\tcurrentHeight = nextHeight;\n\t\t}\n\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t} finally {\n\t\tif (image) {\n\t\t\timage.free();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-resize-worker.d.ts","sourceRoot":"","sources":["../../src/utils/image-resize-worker.ts"],"names":[],"mappings":"","sourcesContent":["import { parentPort } from \"node:worker_threads\";\nimport { type ImageResizeOptions, type ResizedImage, resizeImageInProcess } from \"./image-resize-core.ts\";\n\ninterface ResizeImageWorkerRequest {\n\tinputBytes: Uint8Array;\n\tmimeType: string;\n\toptions?: ImageResizeOptions;\n}\n\ninterface ResizeImageWorkerResponse {\n\tresult?: ResizedImage | null;\n\terror?: string;\n}\n\nfunction isResizeImageWorkerRequest(value: unknown): value is ResizeImageWorkerRequest {\n\tif (!value || typeof value !== \"object\") return false;\n\tconst record = value as Record<string, unknown>;\n\treturn record.inputBytes instanceof Uint8Array && typeof record.mimeType === \"string\";\n}\n\nconst port = parentPort;\nif (!port) {\n\tthrow new Error(\"image resize worker requires parentPort\");\n}\n\nport.once(\"message\", (message: unknown) => {\n\tvoid (async () => {\n\t\ttry {\n\t\t\tif (!isResizeImageWorkerRequest(message)) {\n\t\t\t\tthrow new Error(\"Invalid image resize worker request\");\n\t\t\t}\n\t\t\tconst result = await resizeImageInProcess(message.inputBytes, message.mimeType, message.options);\n\t\t\tconst response: ResizeImageWorkerResponse = { result };\n\t\t\tport.postMessage(response);\n\t\t} catch (error) {\n\t\t\tconst response: ResizeImageWorkerResponse = {\n\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t};\n\t\t\tport.postMessage(response);\n\t\t}\n\t})();\n});\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { parentPort } from "node:worker_threads";
|
|
2
|
+
import { resizeImageInProcess } from "./image-resize-core.js";
|
|
3
|
+
function isResizeImageWorkerRequest(value) {
|
|
4
|
+
if (!value || typeof value !== "object")
|
|
5
|
+
return false;
|
|
6
|
+
const record = value;
|
|
7
|
+
return record.inputBytes instanceof Uint8Array && typeof record.mimeType === "string";
|
|
8
|
+
}
|
|
9
|
+
const port = parentPort;
|
|
10
|
+
if (!port) {
|
|
11
|
+
throw new Error("image resize worker requires parentPort");
|
|
12
|
+
}
|
|
13
|
+
port.once("message", (message) => {
|
|
14
|
+
void (async () => {
|
|
15
|
+
try {
|
|
16
|
+
if (!isResizeImageWorkerRequest(message)) {
|
|
17
|
+
throw new Error("Invalid image resize worker request");
|
|
18
|
+
}
|
|
19
|
+
const result = await resizeImageInProcess(message.inputBytes, message.mimeType, message.options);
|
|
20
|
+
const response = { result };
|
|
21
|
+
port.postMessage(response);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
const response = {
|
|
25
|
+
error: error instanceof Error ? error.message : String(error),
|
|
26
|
+
};
|
|
27
|
+
port.postMessage(response);
|
|
28
|
+
}
|
|
29
|
+
})();
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=image-resize-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-resize-worker.js","sourceRoot":"","sources":["../../src/utils/image-resize-worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAA8C,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAa1G,SAAS,0BAA0B,CAAC,KAAc,EAAqC;IACtF,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,MAAM,GAAG,KAAgC,CAAC;IAChD,OAAO,MAAM,CAAC,UAAU,YAAY,UAAU,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAAA,CACtF;AAED,MAAM,IAAI,GAAG,UAAU,CAAC;AACxB,IAAI,CAAC,IAAI,EAAE,CAAC;IACX,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAC5D,CAAC;AAED,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC;IAC1C,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;QACjB,IAAI,CAAC;YACJ,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC1C,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;YACxD,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACjG,MAAM,QAAQ,GAA8B,EAAE,MAAM,EAAE,CAAC;YACvD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,QAAQ,GAA8B;gBAC3C,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC7D,CAAC;YACF,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC;IAAA,CACD,CAAC,EAAE,CAAC;AAAA,CACL,CAAC,CAAC","sourcesContent":["import { parentPort } from \"node:worker_threads\";\nimport { type ImageResizeOptions, type ResizedImage, resizeImageInProcess } from \"./image-resize-core.ts\";\n\ninterface ResizeImageWorkerRequest {\n\tinputBytes: Uint8Array;\n\tmimeType: string;\n\toptions?: ImageResizeOptions;\n}\n\ninterface ResizeImageWorkerResponse {\n\tresult?: ResizedImage | null;\n\terror?: string;\n}\n\nfunction isResizeImageWorkerRequest(value: unknown): value is ResizeImageWorkerRequest {\n\tif (!value || typeof value !== \"object\") return false;\n\tconst record = value as Record<string, unknown>;\n\treturn record.inputBytes instanceof Uint8Array && typeof record.mimeType === \"string\";\n}\n\nconst port = parentPort;\nif (!port) {\n\tthrow new Error(\"image resize worker requires parentPort\");\n}\n\nport.once(\"message\", (message: unknown) => {\n\tvoid (async () => {\n\t\ttry {\n\t\t\tif (!isResizeImageWorkerRequest(message)) {\n\t\t\t\tthrow new Error(\"Invalid image resize worker request\");\n\t\t\t}\n\t\t\tconst result = await resizeImageInProcess(message.inputBytes, message.mimeType, message.options);\n\t\t\tconst response: ResizeImageWorkerResponse = { result };\n\t\t\tport.postMessage(response);\n\t\t} catch (error) {\n\t\t\tconst response: ResizeImageWorkerResponse = {\n\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t};\n\t\t\tport.postMessage(response);\n\t\t}\n\t})();\n});\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ImageResizeOptions, type ResizedImage } from "./image-resize-core.ts";
|
|
2
|
+
export type { ImageResizeOptions, ResizedImage } from "./image-resize-core.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Resize an image to fit within the specified max dimensions and encoded file size.
|
|
5
|
+
* Runs Photon in a worker thread so WASM decoding, resizing, and encoding do not
|
|
6
|
+
* block the TUI event loop. If the worker cannot be loaded (for example in some
|
|
7
|
+
* Bun compiled executable layouts), fall back to in-process resizing so image
|
|
8
|
+
* reads still work.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resizeImage(inputBytes: Uint8Array, mimeType: string, options?: ImageResizeOptions): Promise<ResizedImage | null>;
|
|
11
|
+
/**
|
|
12
|
+
* Format a dimension note for resized images.
|
|
13
|
+
* This helps the model understand the coordinate mapping.
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatDimensionNote(result: ResizedImage): string | undefined;
|
|
16
|
+
//# sourceMappingURL=image-resize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-resize.d.ts","sourceRoot":"","sources":["../../src/utils/image-resize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,YAAY,EAAwB,MAAM,wBAAwB,CAAC;AAE1G,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA0E/E;;;;;;GAMG;AACH,wBAAsB,WAAW,CAChC,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAqB9B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAO5E","sourcesContent":["import { Worker } from \"node:worker_threads\";\nimport { type ImageResizeOptions, type ResizedImage, resizeImageInProcess } from \"./image-resize-core.ts\";\n\nexport type { ImageResizeOptions, ResizedImage } from \"./image-resize-core.ts\";\n\ninterface ResizeImageWorkerResponse {\n\tresult?: ResizedImage | null;\n\terror?: string;\n}\n\nfunction toTransferableBytes(input: Uint8Array): Uint8Array<ArrayBuffer> {\n\t// Transfer detaches the buffer, so transfer a worker-owned copy and leave the\n\t// caller's bytes intact.\n\treturn new Uint8Array(input);\n}\n\nfunction isResizeImageWorkerResponse(value: unknown): value is ResizeImageWorkerResponse {\n\treturn value !== null && typeof value === \"object\";\n}\n\nfunction createResizeWorker(workerSpecifier: string | URL): Worker {\n\treturn new Worker(workerSpecifier);\n}\n\nasync function resizeImageInWorker(\n\tworkerSpecifier: string | URL,\n\tinputBytes: Uint8Array,\n\tmimeType: string,\n\toptions?: ImageResizeOptions,\n): Promise<ResizedImage | null> {\n\tconst worker = createResizeWorker(workerSpecifier);\n\ttry {\n\t\tconst inputBytesForWorker = toTransferableBytes(inputBytes);\n\t\treturn await new Promise<ResizedImage | null>((resolve, reject) => {\n\t\t\tlet settled = false;\n\t\t\tconst settle = (result: ResizedImage | null): void => {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tresolve(result);\n\t\t\t};\n\t\t\tconst fail = (error: Error): void => {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\treject(error);\n\t\t\t};\n\n\t\t\tworker.once(\"message\", (message: unknown) => {\n\t\t\t\tif (!isResizeImageWorkerResponse(message)) {\n\t\t\t\t\tfail(new Error(\"Invalid image resize worker response\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (message.error) {\n\t\t\t\t\tfail(new Error(message.error));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsettle(message.result ?? null);\n\t\t\t});\n\t\t\tworker.once(\"error\", fail);\n\t\t\tworker.once(\"exit\", (code) => {\n\t\t\t\tif (!settled) {\n\t\t\t\t\tfail(new Error(`Image resize worker exited with code ${code}`));\n\t\t\t\t}\n\t\t\t});\n\t\t\tworker.postMessage(\n\t\t\t\t{\n\t\t\t\t\tinputBytes: inputBytesForWorker,\n\t\t\t\t\tmimeType,\n\t\t\t\t\toptions,\n\t\t\t\t},\n\t\t\t\t[inputBytesForWorker.buffer],\n\t\t\t);\n\t\t});\n\t} finally {\n\t\tvoid worker.terminate().catch(() => undefined);\n\t}\n}\n\n/**\n * Resize an image to fit within the specified max dimensions and encoded file size.\n * Runs Photon in a worker thread so WASM decoding, resizing, and encoding do not\n * block the TUI event loop. If the worker cannot be loaded (for example in some\n * Bun compiled executable layouts), fall back to in-process resizing so image\n * reads still work.\n */\nexport async function resizeImage(\n\tinputBytes: Uint8Array,\n\tmimeType: string,\n\toptions?: ImageResizeOptions,\n): Promise<ResizedImage | null> {\n\tconst isTypeScriptRuntime = import.meta.url.endsWith(\".ts\");\n\tconst workerUrl = new URL(\n\t\tisTypeScriptRuntime ? \"./image-resize-worker.ts\" : \"./image-resize-worker.js\",\n\t\timport.meta.url,\n\t);\n\n\t// Bun compiled executables resolve worker entrypoints by string path, not via\n\t// new URL(..., import.meta.url). Try the string path first under Bun so the\n\t// release binary uses the embedded worker instead of falling back in-process.\n\tif (typeof process.versions.bun === \"string\") {\n\t\ttry {\n\t\t\treturn await resizeImageInWorker(\"./src/utils/image-resize-worker.ts\", inputBytes, mimeType, options);\n\t\t} catch {}\n\t}\n\n\ttry {\n\t\treturn await resizeImageInWorker(workerUrl, inputBytes, mimeType, options);\n\t} catch {\n\t\treturn resizeImageInProcess(inputBytes, mimeType, options);\n\t}\n}\n\n/**\n * Format a dimension note for resized images.\n * This helps the model understand the coordinate mapping.\n */\nexport function formatDimensionNote(result: ResizedImage): string | undefined {\n\tif (!result.wasResized) {\n\t\treturn undefined;\n\t}\n\n\tconst scale = result.originalWidth / result.width;\n\treturn `[Image: original ${result.originalWidth}x${result.originalHeight}, displayed at ${result.width}x${result.height}. Multiply coordinates by ${scale.toFixed(2)} to map to original image.]`;\n}\n"]}
|