@dimivelev/chimera 0.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4443 -0
- package/README.md +600 -0
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +9 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -0
- package/dist/bun/register-bedrock.js +4 -0
- package/dist/bun/register-bedrock.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +13 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +32 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/cli/args.d.ts +56 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +368 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/config-selector.d.ts +14 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +31 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +82 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/initial-message.d.ts +18 -0
- package/dist/cli/initial-message.d.ts.map +1 -0
- package/dist/cli/initial-message.js +22 -0
- package/dist/cli/initial-message.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +98 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/session-picker.d.ts +9 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +35 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +18 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +92 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +428 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +117 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +300 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +87 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +119 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session.d.ts +604 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +2526 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +141 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +442 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +32 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +111 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +88 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +243 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +121 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +619 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +38 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +153 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/defaults.d.ts +3 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +2 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +75 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +37 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +226 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1851 -0
- package/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +108 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +6 -0
- package/dist/core/extensions/index.d.ts +12 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +24 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +481 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +160 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +836 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1178 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +45 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +22 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +54 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +338 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +21 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +48 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +12 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/keybindings.d.ts +353 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +295 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/messages.d.ts +77 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +123 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-registry.d.ts +150 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +784 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +110 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +495 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/output-guard.d.ts +7 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +89 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +204 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +2040 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +52 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +238 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-display-names.d.ts +2 -0
- package/dist/core/provider-display-names.d.ts.map +1 -0
- package/dist/core/provider-display-names.js +33 -0
- package/dist/core/provider-display-names.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +31 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +249 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +194 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +734 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/sdk.d.ts +109 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +291 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/session-manager.d.ts +332 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1218 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-manager.d.ts +266 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +800 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +60 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +387 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +14 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +25 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/source-info.d.ts +18 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +19 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/system-prompt.d.ts +28 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +120 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/telemetry.d.ts +3 -0
- package/dist/core/telemetry.d.ts.map +1 -0
- package/dist/core/telemetry.js +9 -0
- package/dist/core/telemetry.js.map +1 -0
- package/dist/core/timings.d.ts +8 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +31 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +68 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +337 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +87 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +345 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +51 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +284 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +52 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +35 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +297 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +37 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +304 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +40 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +112 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +37 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +167 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +99 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/read.d.ts +35 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +289 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +65 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +34 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +70 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +215 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +26 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +197 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +12 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +631 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +33 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +398 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +9 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +333 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +20 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +121 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +175 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +54 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +71 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +506 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +70 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +79 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/dist/modes/interactive/components/daxnuts.js +140 -0
- package/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.js +40 -0
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +20 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +119 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-input.js +61 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +26 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +83 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +28 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +210 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +32 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +33 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +183 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +47 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +278 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +31 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +165 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +290 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +96 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +861 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +69 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +390 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +39 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +50 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +51 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +63 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +295 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +89 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +1093 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +114 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +10 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +29 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +373 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +4723 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +86 -0
- package/dist/modes/interactive/theme/light.json +85 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +100 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +1034 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/print-mode.d.ts +28 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +132 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +227 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +467 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +616 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +420 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/package-manager-cli.d.ts +4 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +515 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +52 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +21 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +87 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/child-process.d.ts +15 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +88 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/chimera-user-agent.d.ts +2 -0
- package/dist/utils/chimera-user-agent.d.ts.map +1 -0
- package/dist/utils/chimera-user-agent.js +5 -0
- package/dist/utils/chimera-user-agent.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +245 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +10 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +20 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +117 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +158 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +26 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +163 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +9 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +39 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +124 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +16 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +97 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/mime.d.ts +3 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +69 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/paths.d.ts +31 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +92 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/photon.d.ts +21 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +121 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/shell.d.ts +30 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +195 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +118 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +3 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +328 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +15 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +82 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/docs/compaction.md +394 -0
- package/docs/custom-provider.md +736 -0
- package/docs/development.md +71 -0
- package/docs/docs.json +148 -0
- package/docs/extensions.md +2613 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +80 -0
- package/docs/json.md +82 -0
- package/docs/keybindings.md +197 -0
- package/docs/models.md +493 -0
- package/docs/packages.md +226 -0
- package/docs/prompt-templates.md +88 -0
- package/docs/providers.md +251 -0
- package/docs/quickstart.md +165 -0
- package/docs/rpc.md +1408 -0
- package/docs/sdk.md +1137 -0
- package/docs/session-format.md +412 -0
- package/docs/sessions.md +145 -0
- package/docs/settings.md +281 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +231 -0
- package/docs/terminal-setup.md +114 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tmux.md +61 -0
- package/docs/tui.md +927 -0
- package/docs/usage.md +288 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +209 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +145 -0
- package/examples/extensions/built-in-tool-renderer.ts +249 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +127 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +400 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +45 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/handoff.ts +191 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +426 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +55 -0
- package/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/examples/extensions/overlay-test.ts +153 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +65 -0
- package/examples/extensions/plan-mode/index.ts +340 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +430 -0
- package/examples/extensions/prompt-customizer.ts +97 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +122 -0
- package/examples/extensions/question.ts +264 -0
- package/examples/extensions/questionnaire.ts +427 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +321 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +175 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +126 -0
- package/examples/extensions/subagent/index.ts +1009 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +206 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/rpc-extension-ui.ts +632 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +53 -0
- package/examples/sdk/03-custom-prompt.ts +70 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/06-extensions.ts +94 -0
- package/examples/sdk/07-context-files.ts +42 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +52 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +77 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +144 -0
- package/node_modules/@anthropic-ai/sdk/CHANGELOG.md +1677 -0
- package/node_modules/@anthropic-ai/sdk/LICENSE +8 -0
- package/node_modules/@anthropic-ai/sdk/README.md +674 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +226 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +223 -0
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.js +6 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/bin/cli +53 -0
- package/node_modules/@anthropic-ai/sdk/bin/migration-config.json +7 -0
- package/node_modules/@anthropic-ai/sdk/client.d.mts +225 -0
- package/node_modules/@anthropic-ai/sdk/client.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/client.d.ts +225 -0
- package/node_modules/@anthropic-ai/sdk/client.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/client.js +536 -0
- package/node_modules/@anthropic-ai/sdk/client.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/client.mjs +531 -0
- package/node_modules/@anthropic-ai/sdk/client.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts +49 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts +49 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js +76 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs +72 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.mts +47 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.ts +47 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/error.js +114 -0
- package/node_modules/@anthropic-ai/sdk/core/error.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/error.mjs +98 -0
- package/node_modules/@anthropic-ai/sdk/core/error.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts +63 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts +63 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.js +123 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs +117 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.js +11 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.mjs +7 -0
- package/node_modules/@anthropic-ai/sdk/core/resource.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts +31 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts +31 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.js +282 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs +277 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.js +6 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/core/uploads.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/error.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/error.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/error.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/error.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/error.js +6 -0
- package/node_modules/@anthropic-ai/sdk/error.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/error.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/error.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/index.d.mts +7 -0
- package/node_modules/@anthropic-ai/sdk/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/index.d.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/index.js +35 -0
- package/node_modules/@anthropic-ai/sdk/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/index.mjs +8 -0
- package/node_modules/@anthropic-ai/sdk/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.mts +73 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.ts +73 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.js +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.mts +5 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.ts +5 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.js +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.mjs +12 -0
- package/node_modules/@anthropic-ai/sdk/internal/constants.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js +39 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs +35 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.mts +17 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.ts +17 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.js +113 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs +108 -0
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.mts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.ts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js +162 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs +157 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.js +41 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs +36 -0
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts +22 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts +22 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.js +79 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs +74 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts +17 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts +17 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.js +55 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs +51 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts +34 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts +34 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js +14 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/shim-types.d.mts +28 -0
- package/node_modules/@anthropic-ai/sdk/internal/shim-types.d.ts +28 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts +20 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts +20 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.js +92 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.mjs +85 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.mts +8 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.ts +8 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.js +38 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.mjs +35 -0
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts +45 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts +45 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.js +96 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.mjs +93 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/tslib.js +81 -0
- package/node_modules/@anthropic-ai/sdk/internal/tslib.mjs +17 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.d.mts +67 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.d.ts +67 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.js +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/types.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts +42 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts +42 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js +146 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs +136 -0
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.js +38 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs +33 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.mts +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js +31 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs +26 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.mts +9 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.ts +9 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.js +22 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs +18 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts +37 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts +37 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js +86 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +80 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.mts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.ts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.js +58 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs +53 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.mts +5 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.ts +5 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js +19 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts +16 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts +16 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js +109 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs +92 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.mts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.js +11 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.mjs +8 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts +114 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts +114 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +553 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +549 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts +114 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts +114 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +553 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +549 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/package.json +185 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.js +6 -0
- package/node_modules/@anthropic-ai/sdk/pagination.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/pagination.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resource.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/resource.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +61 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +61 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +25 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +20 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +151 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts +151 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js +122 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +118 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +5 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +5 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js +13 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts +343 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts +343 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js +204 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +200 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts +1561 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts +1561 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js +86 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs +81 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts +74 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts +74 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.js +60 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs +56 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts +183 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts +183 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.js +23 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.mjs +19 -0
- package/node_modules/@anthropic-ai/sdk/resources/completions.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.js +15 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs +7 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts +304 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts +304 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js +153 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +149 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +1264 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts +1264 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js +72 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +67 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/messages.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.d.mts +59 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.d.ts +59 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.js +45 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.mjs +41 -0
- package/node_modules/@anthropic-ai/sdk/resources/models.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.mts +42 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.ts +42 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.js +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/shared.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.js +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/top-level.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources.js +5 -0
- package/node_modules/@anthropic-ai/sdk/resources.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/resources.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/README.md +3 -0
- package/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts +264 -0
- package/node_modules/@anthropic-ai/sdk/src/api-promise.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/client.ts +1070 -0
- package/node_modules/@anthropic-ai/sdk/src/core/README.md +3 -0
- package/node_modules/@anthropic-ai/sdk/src/core/api-promise.ts +101 -0
- package/node_modules/@anthropic-ai/sdk/src/core/error.ts +133 -0
- package/node_modules/@anthropic-ai/sdk/src/core/pagination.ts +201 -0
- package/node_modules/@anthropic-ai/sdk/src/core/resource.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/src/core/streaming.ts +331 -0
- package/node_modules/@anthropic-ai/sdk/src/core/uploads.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/error.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/index.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/README.md +3 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/builtin-types.ts +93 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/constants.ts +12 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/decoders/jsonl.ts +48 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/decoders/line.ts +135 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/detect-platform.ts +196 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/errors.ts +33 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/headers.ts +99 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +84 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/request-options.ts +39 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/shim-types.d.ts +28 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/shims.ts +107 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/stream-utils.ts +32 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/to-file.ts +159 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/types.ts +92 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/uploads.ts +193 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/base64.ts +40 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/bytes.ts +32 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/env.ts +18 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/log.ts +127 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/path.ts +65 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/sleep.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/uuid.ts +17 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/values.ts +102 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils.ts +8 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/.keep +4 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +683 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +684 -0
- package/node_modules/@anthropic-ai/sdk/src/pagination.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/resource.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +380 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +258 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +148 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/batches.ts +502 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +135 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +2249 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/models.ts +118 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +231 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/index.ts +121 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/batches.ts +396 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/index.ts +110 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +1783 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/models.ts +103 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/shared.ts +72 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/top-level.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/src/streaming.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/tsconfig.json +11 -0
- package/node_modules/@anthropic-ai/sdk/src/uploads.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/src/version.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.js +6 -0
- package/node_modules/@anthropic-ai/sdk/streaming.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/streaming.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.js +6 -0
- package/node_modules/@anthropic-ai/sdk/uploads.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/uploads.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/version.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/version.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/version.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/version.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/version.js +5 -0
- package/node_modules/@anthropic-ai/sdk/version.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/version.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/version.mjs.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.d.ts +24 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.js +502 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.d.ts +118 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.js +402 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.d.ts +95 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.js +963 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.d.ts +53 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.js +175 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.d.ts +95 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.js +528 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.d.ts +25 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.js +131 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.d.ts +51 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.js +486 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.d.ts +51 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.js +102 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.d.ts +48 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.js +230 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.d.ts +26 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.js +101 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.d.ts +33 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.js +231 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.d.ts +18 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.js +42 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.d.ts +25 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.js +114 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.d.ts +11 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.js +39 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.d.ts +33 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.js +210 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.d.ts +2 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.js +50 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.d.ts +44 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.js +311 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.js +30 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.d.ts +615 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.js +94 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.d.ts +14 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.js +126 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.d.ts +70 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.js +290 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.d.ts +20 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.js +25 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.js +3 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.d.ts +69 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.js +278 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.d.ts +393 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.js +2 -0
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.js.map +1 -0
- package/node_modules/@dimivelev/chimera-agent-core/package.json +60 -0
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.d.ts +20 -0
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.js +44 -0
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.d.ts +5 -0
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.js +6 -0
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/cli.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-ai/dist/cli.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/cli.js +130 -0
- package/node_modules/@dimivelev/chimera-ai/dist/cli.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.d.ts +18 -0
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.js +178 -0
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.d.ts +10 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.d.ts +4 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.js +6 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.js +23 -0
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.d.ts +14 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.js +22 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images.d.ts +4 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images.js +14 -0
- package/node_modules/@dimivelev/chimera-ai/dist/images.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/index.d.ts +32 -0
- package/node_modules/@dimivelev/chimera-ai/dist/index.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/index.js +20 -0
- package/node_modules/@dimivelev/chimera-ai/dist/index.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.d.ts +18 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.d.ts +14714 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.js +13379 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.js +71 -0
- package/node_modules/@dimivelev/chimera-ai/dist/models.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.d.ts +2 -0
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.js +2 -0
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.d.ts +38 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.js +826 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.d.ts +71 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.js +959 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.d.ts +15 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.js +221 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.d.ts +13 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.js +26 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.d.ts +56 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.js +368 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.d.ts +8 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.js +29 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.d.ts +70 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.js +329 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.d.ts +15 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.js +442 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.d.ts +13 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.js +402 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.js +128 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.d.ts +4 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.js +34 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.d.ts +25 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.js +534 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.d.ts +30 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.js +1171 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.d.ts +19 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.js +956 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.js +10 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.d.ts +18 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.js +495 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.d.ts +13 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.js +233 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.d.ts +35 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.js +254 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.d.ts +8 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.js +42 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.d.ts +8 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.js +184 -0
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.d.ts +4 -0
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.js +22 -0
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/stream.d.ts +8 -0
- package/node_modules/@dimivelev/chimera-ai/dist/stream.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/stream.js +39 -0
- package/node_modules/@dimivelev/chimera-ai/dist/stream.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/types.d.ts +514 -0
- package/node_modules/@dimivelev/chimera-ai/dist/types.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/types.js +2 -0
- package/node_modules/@dimivelev/chimera-ai/dist/types.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.d.ts +6 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.js +34 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.d.ts +19 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.js +25 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.d.ts +21 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.js +81 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.js +14 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.d.ts +2 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.js +8 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.d.ts +16 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.js +113 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.d.ts +10 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.js +97 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.d.ts +25 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.js +335 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.d.ts +21 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.js +56 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.d.ts +30 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.js +268 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.d.ts +58 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.js +122 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.js +105 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.d.ts +43 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.js +485 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.d.ts +13 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.js +31 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.d.ts +64 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.js +2 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.d.ts +57 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.js +154 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.d.ts +22 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.js +26 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.d.ts +17 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.js +21 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.d.ts +18 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.js +281 -0
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.js.map +1 -0
- package/node_modules/@dimivelev/chimera-ai/package.json +106 -0
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.d.ts +54 -0
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.js +632 -0
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.d.ts +22 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.js +104 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.js +35 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.d.ts +249 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.js +1857 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.d.ts +28 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.js +89 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.d.ts +37 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.js +378 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.d.ts +31 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.js +69 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.d.ts +96 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.js +644 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.d.ts +50 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.js +159 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.d.ts +50 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.js +185 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.d.ts +12 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.js +23 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.d.ts +19 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.js +89 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.d.ts +13 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.js +51 -0
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.d.ts +39 -0
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.js +2 -0
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.d.ts +16 -0
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.js +110 -0
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/index.d.ts +23 -0
- package/node_modules/@dimivelev/chimera-tui/dist/index.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/index.js +32 -0
- package/node_modules/@dimivelev/chimera-tui/dist/index.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.d.ts +193 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.js +174 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keys.d.ts +184 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keys.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keys.js +1173 -0
- package/node_modules/@dimivelev/chimera-tui/dist/keys.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.d.ts +28 -0
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.js +44 -0
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.d.ts +3 -0
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.js +53 -0
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.d.ts +50 -0
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.js +361 -0
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.d.ts +90 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.js +366 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.d.ts +113 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.js +472 -0
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/tui.d.ts +242 -0
- package/node_modules/@dimivelev/chimera-tui/dist/tui.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/tui.js +1221 -0
- package/node_modules/@dimivelev/chimera-tui/dist/tui.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.d.ts +17 -0
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.js +25 -0
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/utils.d.ts +84 -0
- package/node_modules/@dimivelev/chimera-tui/dist/utils.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/utils.js +1029 -0
- package/node_modules/@dimivelev/chimera-tui/dist/utils.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.d.ts +25 -0
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.d.ts.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.js +96 -0
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.js.map +1 -0
- package/node_modules/@dimivelev/chimera-tui/package.json +47 -0
- package/npm-shrinkwrap.json +1783 -0
- package/package.json +104 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compaction.js","sourceRoot":"","sources":["../../../src/harness/compaction/compaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EACN,YAAY,EACZ,0BAA0B,EAC1B,8BAA8B,E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GAAG,EAAE;SACrB;KACD,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,cAAc,CACpC,KAAK,EACL,EAAE,YAAY,EAAE,2BAA2B,EAAE,QAAQ,EAAE,qBAAqB,EAAE,EAC9E,KAAK,CAAC,SAAS,IAAI,aAAa,IAAI,aAAa,KAAK,KAAK;QAC1D,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE;QAClE,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CACzC,CAAC;IACF,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO,GAAG,CAAC,IAAI,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC,YAAY,IAAI,mCAAmC,CAAC,CAAC,CAAC;IAC1G,CAAC;IACD,IAAI,QAAQ,CAAC,UAAU,KAAK,OAAO,EAAE,CAAC;QACrC,OAAO,GAAG,CACT,IAAI,eAAe,CAClB,sBAAsB,EACtB,qCAAqC,QAAQ,CAAC,YAAY,IAAI,eAAe,EAAE,CAC/E,CACD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,CACR,QAAQ,CAAC,OAAO;SACd,MAAM,CAAC,CAAC,CAAC,EAAuC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;SACrE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SAClB,IAAI,CAAC,IAAI,CAAC,CACZ,CAAC;AAAA,CACF","sourcesContent":["import type { AssistantMessage, ImageContent, Model, TextContent, Usage } from \"@dimivelev/chimera-ai\";\nimport { completeSimple } from \"@dimivelev/chimera-ai\";\nimport type { AgentMessage, ThinkingLevel } from \"../../types.ts\";\nimport {\n\tconvertToLlm,\n\tcreateBranchSummaryMessage,\n\tcreateCompactionSummaryMessage,\n\tcreateCustomMessage,\n} from \"../messages.ts\";\nimport { buildSessionContext } from \"../session/session.ts\";\nimport { type CompactionEntry, CompactionError, err, ok, type Result, type SessionTreeEntry } from \"../types.ts\";\nimport {\n\tcomputeFileLists,\n\tcreateFileOps,\n\textractFileOpsFromMessage,\n\ttype FileOperations,\n\tformatFileOperations,\n\tserializeConversation,\n} from \"./utils.ts\";\n\n/** File-operation details stored on generated compaction entries. */\nexport interface CompactionDetails {\n\t/** Files read in the compacted history. */\n\treadFiles: string[];\n\t/** Files modified in the compacted history. */\n\tmodifiedFiles: string[];\n}\nfunction safeJsonStringify(value: unknown): string {\n\ttry {\n\t\treturn JSON.stringify(value) ?? \"undefined\";\n\t} catch {\n\t\treturn \"[unserializable]\";\n\t}\n}\n\nfunction extractFileOperations(\n\tmessages: AgentMessage[],\n\tentries: SessionTreeEntry[],\n\tprevCompactionIndex: number,\n): FileOperations {\n\tconst fileOps = createFileOps();\n\tif (prevCompactionIndex >= 0) {\n\t\tconst prevCompaction = entries[prevCompactionIndex] as CompactionEntry;\n\t\tif (!prevCompaction.fromHook && prevCompaction.details) {\n\t\t\tconst details = prevCompaction.details as CompactionDetails;\n\t\t\tif (Array.isArray(details.readFiles)) {\n\t\t\t\tfor (const f of details.readFiles) fileOps.read.add(f);\n\t\t\t}\n\t\t\tif (Array.isArray(details.modifiedFiles)) {\n\t\t\t\tfor (const f of details.modifiedFiles) fileOps.edited.add(f);\n\t\t\t}\n\t\t}\n\t}\n\tfor (const msg of messages) {\n\t\textractFileOpsFromMessage(msg, fileOps);\n\t}\n\n\treturn fileOps;\n}\nfunction getMessageFromEntry(entry: SessionTreeEntry): AgentMessage | undefined {\n\tif (entry.type === \"message\") {\n\t\treturn entry.message as AgentMessage;\n\t}\n\tif (entry.type === \"custom_message\") {\n\t\treturn createCustomMessage(\n\t\t\tentry.customType,\n\t\t\tentry.content as string | (TextContent | ImageContent)[],\n\t\t\tentry.display,\n\t\t\tentry.details,\n\t\t\tentry.timestamp,\n\t\t);\n\t}\n\tif (entry.type === \"branch_summary\") {\n\t\treturn createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp);\n\t}\n\tif (entry.type === \"compaction\") {\n\t\treturn createCompactionSummaryMessage(entry.summary, entry.tokensBefore, entry.timestamp);\n\t}\n\treturn undefined;\n}\n\nfunction getMessageFromEntryForCompaction(entry: SessionTreeEntry): AgentMessage | undefined {\n\tif (entry.type === \"compaction\") {\n\t\treturn undefined;\n\t}\n\treturn getMessageFromEntry(entry);\n}\n\n/** Generated compaction data ready to be persisted as a compaction entry. */\nexport interface CompactionResult<T = unknown> {\n\t/** Summary text that replaces compacted history in future context. */\n\tsummary: string;\n\t/** Entry id where retained history starts. */\n\tfirstKeptEntryId: string;\n\t/** Estimated context tokens before compaction. */\n\ttokensBefore: number;\n\t/** Optional implementation-specific details stored with the compaction entry. */\n\tdetails?: T;\n}\n\n/** Compaction thresholds and retention settings. */\nexport interface CompactionSettings {\n\t/** Enable automatic compaction decisions. */\n\tenabled: boolean;\n\t/** Tokens reserved for summary prompt and output. */\n\treserveTokens: number;\n\t/** Approximate recent-context tokens to keep after compaction. */\n\tkeepRecentTokens: number;\n}\n\n/** Default compaction settings used by the harness. */\nexport const DEFAULT_COMPACTION_SETTINGS: CompactionSettings = {\n\tenabled: true,\n\treserveTokens: 16384,\n\tkeepRecentTokens: 20000,\n};\n\n/** Calculate total context tokens from provider usage. */\nexport function calculateContextTokens(usage: Usage): number {\n\treturn usage.totalTokens || usage.input + usage.output + usage.cacheRead + usage.cacheWrite;\n}\nfunction getAssistantUsage(msg: AgentMessage): Usage | undefined {\n\tif (msg.role === \"assistant\" && \"usage\" in msg) {\n\t\tconst assistantMsg = msg as AssistantMessage;\n\t\tif (assistantMsg.stopReason !== \"aborted\" && assistantMsg.stopReason !== \"error\" && assistantMsg.usage) {\n\t\t\treturn assistantMsg.usage;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/** Return usage from the last successful assistant message in session entries. */\nexport function getLastAssistantUsage(entries: SessionTreeEntry[]): Usage | undefined {\n\tfor (let i = entries.length - 1; i >= 0; i--) {\n\t\tconst entry = entries[i];\n\t\tif (entry.type === \"message\") {\n\t\t\tconst usage = getAssistantUsage(entry.message as AgentMessage);\n\t\t\tif (usage) return usage;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/** Estimated context-token usage for a message list. */\nexport interface ContextUsageEstimate {\n\t/** Estimated total context tokens. */\n\ttokens: number;\n\t/** Tokens reported by the most recent assistant usage block. */\n\tusageTokens: number;\n\t/** Estimated tokens after the most recent assistant usage block. */\n\ttrailingTokens: number;\n\t/** Index of the message that provided usage, or null when none exists. */\n\tlastUsageIndex: number | null;\n}\n\nfunction getLastAssistantUsageInfo(messages: AgentMessage[]): { usage: Usage; index: number } | undefined {\n\tfor (let i = messages.length - 1; i >= 0; i--) {\n\t\tconst usage = getAssistantUsage(messages[i]);\n\t\tif (usage) return { usage, index: i };\n\t}\n\treturn undefined;\n}\n\n/** Estimate context tokens for messages using provider usage when available. */\nexport function estimateContextTokens(messages: AgentMessage[]): ContextUsageEstimate {\n\tconst usageInfo = getLastAssistantUsageInfo(messages);\n\n\tif (!usageInfo) {\n\t\tlet estimated = 0;\n\t\tfor (const message of messages) {\n\t\t\testimated += estimateTokens(message);\n\t\t}\n\t\treturn {\n\t\t\ttokens: estimated,\n\t\t\tusageTokens: 0,\n\t\t\ttrailingTokens: estimated,\n\t\t\tlastUsageIndex: null,\n\t\t};\n\t}\n\n\tconst usageTokens = calculateContextTokens(usageInfo.usage);\n\tlet trailingTokens = 0;\n\tfor (let i = usageInfo.index + 1; i < messages.length; i++) {\n\t\ttrailingTokens += estimateTokens(messages[i]);\n\t}\n\n\treturn {\n\t\ttokens: usageTokens + trailingTokens,\n\t\tusageTokens,\n\t\ttrailingTokens,\n\t\tlastUsageIndex: usageInfo.index,\n\t};\n}\n\n/** Return whether context usage exceeds the configured compaction threshold. */\nexport function shouldCompact(contextTokens: number, contextWindow: number, settings: CompactionSettings): boolean {\n\tif (!settings.enabled) return false;\n\treturn contextTokens > contextWindow - settings.reserveTokens;\n}\n\nconst ESTIMATED_IMAGE_CHARS = 4800;\n\nfunction estimateTextAndImageContentChars(content: string | Array<{ type: string; text?: string }>): number {\n\tif (typeof content === \"string\") {\n\t\treturn content.length;\n\t}\n\n\tlet chars = 0;\n\tfor (const block of content) {\n\t\tif (block.type === \"text\" && block.text) {\n\t\t\tchars += block.text.length;\n\t\t} else if (block.type === \"image\") {\n\t\t\tchars += ESTIMATED_IMAGE_CHARS;\n\t\t}\n\t}\n\treturn chars;\n}\n\n/** Estimate token count for one message using a conservative character heuristic. */\nexport function estimateTokens(message: AgentMessage): number {\n\tlet chars = 0;\n\n\tswitch (message.role) {\n\t\tcase \"user\": {\n\t\t\tchars = estimateTextAndImageContentChars(\n\t\t\t\t(message as { content: string | Array<{ type: string; text?: string }> }).content,\n\t\t\t);\n\t\t\treturn Math.ceil(chars / 4);\n\t\t}\n\t\tcase \"assistant\": {\n\t\t\tconst assistant = message as AssistantMessage;\n\t\t\tfor (const block of assistant.content) {\n\t\t\t\tif (block.type === \"text\") {\n\t\t\t\t\tchars += block.text.length;\n\t\t\t\t} else if (block.type === \"thinking\") {\n\t\t\t\t\tchars += block.thinking.length;\n\t\t\t\t} else if (block.type === \"toolCall\") {\n\t\t\t\t\tchars += block.name.length + safeJsonStringify(block.arguments).length;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Math.ceil(chars / 4);\n\t\t}\n\t\tcase \"custom\":\n\t\tcase \"toolResult\": {\n\t\t\tchars = estimateTextAndImageContentChars(message.content);\n\t\t\treturn Math.ceil(chars / 4);\n\t\t}\n\t\tcase \"bashExecution\": {\n\t\t\tchars = message.command.length + message.output.length;\n\t\t\treturn Math.ceil(chars / 4);\n\t\t}\n\t\tcase \"branchSummary\":\n\t\tcase \"compactionSummary\": {\n\t\t\tchars = message.summary.length;\n\t\t\treturn Math.ceil(chars / 4);\n\t\t}\n\t}\n\n\treturn 0;\n}\nfunction findValidCutPoints(entries: SessionTreeEntry[], startIndex: number, endIndex: number): number[] {\n\tconst cutPoints: number[] = [];\n\tfor (let i = startIndex; i < endIndex; i++) {\n\t\tconst entry = entries[i];\n\t\tswitch (entry.type) {\n\t\t\tcase \"message\": {\n\t\t\t\tconst role = entry.message.role;\n\t\t\t\tswitch (role) {\n\t\t\t\t\tcase \"bashExecution\":\n\t\t\t\t\tcase \"custom\":\n\t\t\t\t\tcase \"branchSummary\":\n\t\t\t\t\tcase \"compactionSummary\":\n\t\t\t\t\tcase \"user\":\n\t\t\t\t\tcase \"assistant\":\n\t\t\t\t\t\tcutPoints.push(i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"toolResult\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"thinking_level_change\":\n\t\t\tcase \"model_change\":\n\t\t\tcase \"active_tools_change\":\n\t\t\tcase \"compaction\":\n\t\t\tcase \"branch_summary\":\n\t\t\tcase \"custom\":\n\t\t\tcase \"custom_message\":\n\t\t\tcase \"label\":\n\t\t\tcase \"session_info\":\n\t\t\tcase \"leaf\":\n\t\t\t\tbreak;\n\t\t}\n\t\tif (entry.type === \"branch_summary\" || entry.type === \"custom_message\") {\n\t\t\tcutPoints.push(i);\n\t\t}\n\t}\n\treturn cutPoints;\n}\n\n/** Find the user-visible message that starts the turn containing an entry. */\nexport function findTurnStartIndex(entries: SessionTreeEntry[], entryIndex: number, startIndex: number): number {\n\tfor (let i = entryIndex; i >= startIndex; i--) {\n\t\tconst entry = entries[i];\n\t\tif (entry.type === \"branch_summary\" || entry.type === \"custom_message\") {\n\t\t\treturn i;\n\t\t}\n\t\tif (entry.type === \"message\") {\n\t\t\tconst role = entry.message.role;\n\t\t\tif (role === \"user\" || role === \"bashExecution\") {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\n/** Cut point selected for compaction. */\nexport interface CutPointResult {\n\t/** Index of the first entry retained after compaction. */\n\tfirstKeptEntryIndex: number;\n\t/** Index of the turn-start entry when the cut splits a turn, otherwise -1. */\n\tturnStartIndex: number;\n\t/** Whether the selected cut point splits an in-progress turn. */\n\tisSplitTurn: boolean;\n}\n\n/** Find the compaction cut point that keeps approximately the requested recent-token budget. */\nexport function findCutPoint(\n\tentries: SessionTreeEntry[],\n\tstartIndex: number,\n\tendIndex: number,\n\tkeepRecentTokens: number,\n): CutPointResult {\n\tconst cutPoints = findValidCutPoints(entries, startIndex, endIndex);\n\n\tif (cutPoints.length === 0) {\n\t\treturn { firstKeptEntryIndex: startIndex, turnStartIndex: -1, isSplitTurn: false };\n\t}\n\tlet accumulatedTokens = 0;\n\tlet cutIndex = cutPoints[0];\n\n\tfor (let i = endIndex - 1; i >= startIndex; i--) {\n\t\tconst entry = entries[i];\n\t\tif (entry.type !== \"message\") continue;\n\t\tconst messageTokens = estimateTokens(entry.message as AgentMessage);\n\t\taccumulatedTokens += messageTokens;\n\t\tif (accumulatedTokens >= keepRecentTokens) {\n\t\t\tfor (let c = 0; c < cutPoints.length; c++) {\n\t\t\t\tif (cutPoints[c] >= i) {\n\t\t\t\t\tcutIndex = cutPoints[c];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\twhile (cutIndex > startIndex) {\n\t\tconst prevEntry = entries[cutIndex - 1];\n\t\tif (prevEntry.type === \"compaction\") {\n\t\t\tbreak;\n\t\t}\n\t\tif (prevEntry.type === \"message\") {\n\t\t\tbreak;\n\t\t}\n\t\tcutIndex--;\n\t}\n\tconst cutEntry = entries[cutIndex];\n\tconst isUserMessage = cutEntry.type === \"message\" && cutEntry.message.role === \"user\";\n\tconst turnStartIndex = isUserMessage ? -1 : findTurnStartIndex(entries, cutIndex, startIndex);\n\n\treturn {\n\t\tfirstKeptEntryIndex: cutIndex,\n\t\tturnStartIndex,\n\t\tisSplitTurn: !isUserMessage && turnStartIndex !== -1,\n\t};\n}\n\nexport const SUMMARIZATION_SYSTEM_PROMPT = `You are a context summarization assistant. Your task is to read a conversation between a user and an AI coding assistant, then produce a structured summary following the exact format specified.\n\nDo NOT continue the conversation. Do NOT respond to any questions in the conversation. ONLY output the structured summary.`;\n\nconst SUMMARIZATION_PROMPT = `The messages above are a conversation to summarize. Create a structured context checkpoint summary that another LLM will use to continue the work.\n\nUse this EXACT format:\n\n## Goal\n[What is the user trying to accomplish? Can be multiple items if the session covers different tasks.]\n\n## Constraints & Preferences\n- [Any constraints, preferences, or requirements mentioned by user]\n- [Or \"(none)\" if none were mentioned]\n\n## Progress\n### Done\n- [x] [Completed tasks/changes]\n\n### In Progress\n- [ ] [Current work]\n\n### Blocked\n- [Issues preventing progress, if any]\n\n## Key Decisions\n- **[Decision]**: [Brief rationale]\n\n## Next Steps\n1. [Ordered list of what should happen next]\n\n## Critical Context\n- [Any data, examples, or references needed to continue]\n- [Or \"(none)\" if not applicable]\n\nKeep each section concise. Preserve exact file paths, function names, and error messages.`;\n\nconst UPDATE_SUMMARIZATION_PROMPT = `The messages above are NEW conversation messages to incorporate into the existing summary provided in <previous-summary> tags.\n\nUpdate the existing structured summary with new information. RULES:\n- PRESERVE all existing information from the previous summary\n- ADD new progress, decisions, and context from the new messages\n- UPDATE the Progress section: move items from \"In Progress\" to \"Done\" when completed\n- UPDATE \"Next Steps\" based on what was accomplished\n- PRESERVE exact file paths, function names, and error messages\n- If something is no longer relevant, you may remove it\n\nUse this EXACT format:\n\n## Goal\n[Preserve existing goals, add new ones if the task expanded]\n\n## Constraints & Preferences\n- [Preserve existing, add new ones discovered]\n\n## Progress\n### Done\n- [x] [Include previously done items AND newly completed items]\n\n### In Progress\n- [ ] [Current work - update based on progress]\n\n### Blocked\n- [Current blockers - remove if resolved]\n\n## Key Decisions\n- **[Decision]**: [Brief rationale] (preserve all previous, add new)\n\n## Next Steps\n1. [Update based on current state]\n\n## Critical Context\n- [Preserve important context, add new if needed]\n\nKeep each section concise. Preserve exact file paths, function names, and error messages.`;\n\n/** Generate or update a conversation summary for compaction. */\nexport async function generateSummary(\n\tcurrentMessages: AgentMessage[],\n\tmodel: Model<any>,\n\treserveTokens: number,\n\tapiKey: string,\n\theaders?: Record<string, string>,\n\tsignal?: AbortSignal,\n\tcustomInstructions?: string,\n\tpreviousSummary?: string,\n\tthinkingLevel?: ThinkingLevel,\n): Promise<Result<string, CompactionError>> {\n\tconst maxTokens = Math.min(\n\t\tMath.floor(0.8 * reserveTokens),\n\t\tmodel.maxTokens > 0 ? model.maxTokens : Number.POSITIVE_INFINITY,\n\t);\n\tlet basePrompt = previousSummary ? UPDATE_SUMMARIZATION_PROMPT : SUMMARIZATION_PROMPT;\n\tif (customInstructions) {\n\t\tbasePrompt = `${basePrompt}\\n\\nAdditional focus: ${customInstructions}`;\n\t}\n\tconst llmMessages = convertToLlm(currentMessages);\n\tconst conversationText = serializeConversation(llmMessages);\n\tlet promptText = `<conversation>\\n${conversationText}\\n</conversation>\\n\\n`;\n\tif (previousSummary) {\n\t\tpromptText += `<previous-summary>\\n${previousSummary}\\n</previous-summary>\\n\\n`;\n\t}\n\tpromptText += basePrompt;\n\n\tconst summarizationMessages = [\n\t\t{\n\t\t\trole: \"user\" as const,\n\t\t\tcontent: [{ type: \"text\" as const, text: promptText }],\n\t\t\ttimestamp: Date.now(),\n\t\t},\n\t];\n\n\tconst completionOptions =\n\t\tmodel.reasoning && thinkingLevel && thinkingLevel !== \"off\"\n\t\t\t? { maxTokens, signal, apiKey, headers, reasoning: thinkingLevel }\n\t\t\t: { maxTokens, signal, apiKey, headers };\n\n\tconst response = await completeSimple(\n\t\tmodel,\n\t\t{ systemPrompt: SUMMARIZATION_SYSTEM_PROMPT, messages: summarizationMessages },\n\t\tcompletionOptions,\n\t);\n\tif (response.stopReason === \"aborted\") {\n\t\treturn err(new CompactionError(\"aborted\", response.errorMessage || \"Summarization aborted\"));\n\t}\n\tif (response.stopReason === \"error\") {\n\t\treturn err(\n\t\t\tnew CompactionError(\n\t\t\t\t\"summarization_failed\",\n\t\t\t\t`Summarization failed: ${response.errorMessage || \"Unknown error\"}`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst textContent = response.content\n\t\t.filter((c): c is { type: \"text\"; text: string } => c.type === \"text\")\n\t\t.map((c) => c.text)\n\t\t.join(\"\\n\");\n\n\treturn ok(textContent);\n}\n\n/** Prepared inputs for a compaction run. */\nexport interface CompactionPreparation {\n\t/** Entry id where retained history starts. */\n\tfirstKeptEntryId: string;\n\t/** Messages summarized into the history summary. */\n\tmessagesToSummarize: AgentMessage[];\n\t/** Prefix messages summarized separately when compaction splits a turn. */\n\tturnPrefixMessages: AgentMessage[];\n\t/** Whether compaction splits a turn. */\n\tisSplitTurn: boolean;\n\t/** Estimated context tokens before compaction. */\n\ttokensBefore: number;\n\t/** Previous compaction summary used for iterative updates. */\n\tpreviousSummary?: string;\n\t/** File operations extracted from summarized history. */\n\tfileOps: FileOperations;\n\t/** Settings used to prepare compaction. */\n\tsettings: CompactionSettings;\n}\n\n/** Prepare session entries for compaction, or return undefined when compaction is not applicable. */\nexport function prepareCompaction(\n\tpathEntries: SessionTreeEntry[],\n\tsettings: CompactionSettings,\n): Result<CompactionPreparation | undefined, CompactionError> {\n\tif (pathEntries.length === 0 || pathEntries[pathEntries.length - 1].type === \"compaction\") {\n\t\treturn ok(undefined);\n\t}\n\n\tlet prevCompactionIndex = -1;\n\tfor (let i = pathEntries.length - 1; i >= 0; i--) {\n\t\tif (pathEntries[i].type === \"compaction\") {\n\t\t\tprevCompactionIndex = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tlet previousSummary: string | undefined;\n\tlet boundaryStart = 0;\n\tif (prevCompactionIndex >= 0) {\n\t\tconst prevCompaction = pathEntries[prevCompactionIndex] as CompactionEntry;\n\t\tpreviousSummary = prevCompaction.summary;\n\t\tconst firstKeptEntryIndex = pathEntries.findIndex((entry) => entry.id === prevCompaction.firstKeptEntryId);\n\t\tboundaryStart = firstKeptEntryIndex >= 0 ? firstKeptEntryIndex : prevCompactionIndex + 1;\n\t}\n\tconst boundaryEnd = pathEntries.length;\n\n\tconst tokensBefore = estimateContextTokens(buildSessionContext(pathEntries).messages).tokens;\n\n\tconst cutPoint = findCutPoint(pathEntries, boundaryStart, boundaryEnd, settings.keepRecentTokens);\n\tconst firstKeptEntry = pathEntries[cutPoint.firstKeptEntryIndex];\n\tif (!firstKeptEntry?.id) {\n\t\treturn err(new CompactionError(\"invalid_session\", \"First kept entry has no UUID - session may need migration\"));\n\t}\n\tconst firstKeptEntryId = firstKeptEntry.id;\n\n\tconst historyEnd = cutPoint.isSplitTurn ? cutPoint.turnStartIndex : cutPoint.firstKeptEntryIndex;\n\tconst messagesToSummarize: AgentMessage[] = [];\n\tfor (let i = boundaryStart; i < historyEnd; i++) {\n\t\tconst msg = getMessageFromEntryForCompaction(pathEntries[i]);\n\t\tif (msg) messagesToSummarize.push(msg);\n\t}\n\tconst turnPrefixMessages: AgentMessage[] = [];\n\tif (cutPoint.isSplitTurn) {\n\t\tfor (let i = cutPoint.turnStartIndex; i < cutPoint.firstKeptEntryIndex; i++) {\n\t\t\tconst msg = getMessageFromEntryForCompaction(pathEntries[i]);\n\t\t\tif (msg) turnPrefixMessages.push(msg);\n\t\t}\n\t}\n\tconst fileOps = extractFileOperations(messagesToSummarize, pathEntries, prevCompactionIndex);\n\tif (cutPoint.isSplitTurn) {\n\t\tfor (const msg of turnPrefixMessages) {\n\t\t\textractFileOpsFromMessage(msg, fileOps);\n\t\t}\n\t}\n\n\treturn ok({\n\t\tfirstKeptEntryId,\n\t\tmessagesToSummarize,\n\t\tturnPrefixMessages,\n\t\tisSplitTurn: cutPoint.isSplitTurn,\n\t\ttokensBefore,\n\t\tpreviousSummary,\n\t\tfileOps,\n\t\tsettings,\n\t});\n}\n\nconst TURN_PREFIX_SUMMARIZATION_PROMPT = `This is the PREFIX of a turn that was too large to keep. The SUFFIX (recent work) is retained.\n\nSummarize the prefix to provide context for the retained suffix:\n\n## Original Request\n[What did the user ask for in this turn?]\n\n## Early Progress\n- [Key decisions and work done in the prefix]\n\n## Context for Suffix\n- [Information needed to understand the retained recent work]\n\nBe concise. Focus on what's needed to understand the kept suffix.`;\n\nexport { serializeConversation } from \"./utils.ts\";\n\n/** Generate compaction summary data from prepared session history. */\nexport async function compact(\n\tpreparation: CompactionPreparation,\n\tmodel: Model<any>,\n\tapiKey: string,\n\theaders?: Record<string, string>,\n\tcustomInstructions?: string,\n\tsignal?: AbortSignal,\n\tthinkingLevel?: ThinkingLevel,\n): Promise<Result<CompactionResult, CompactionError>> {\n\tconst {\n\t\tfirstKeptEntryId,\n\t\tmessagesToSummarize,\n\t\tturnPrefixMessages,\n\t\tisSplitTurn,\n\t\ttokensBefore,\n\t\tpreviousSummary,\n\t\tfileOps,\n\t\tsettings,\n\t} = preparation;\n\n\tif (!firstKeptEntryId) {\n\t\treturn err(new CompactionError(\"invalid_session\", \"First kept entry has no UUID - session may need migration\"));\n\t}\n\n\tlet summary: string;\n\n\tif (isSplitTurn && turnPrefixMessages.length > 0) {\n\t\tconst [historyResult, turnPrefixResult] = await Promise.all([\n\t\t\tmessagesToSummarize.length > 0\n\t\t\t\t? generateSummary(\n\t\t\t\t\t\tmessagesToSummarize,\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\tsettings.reserveTokens,\n\t\t\t\t\t\tapiKey,\n\t\t\t\t\t\theaders,\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t\tcustomInstructions,\n\t\t\t\t\t\tpreviousSummary,\n\t\t\t\t\t\tthinkingLevel,\n\t\t\t\t\t)\n\t\t\t\t: Promise.resolve(ok<string, CompactionError>(\"No prior history.\")),\n\t\t\tgenerateTurnPrefixSummary(\n\t\t\t\tturnPrefixMessages,\n\t\t\t\tmodel,\n\t\t\t\tsettings.reserveTokens,\n\t\t\t\tapiKey,\n\t\t\t\theaders,\n\t\t\t\tsignal,\n\t\t\t\tthinkingLevel,\n\t\t\t),\n\t\t]);\n\t\tif (!historyResult.ok) return err(historyResult.error);\n\t\tif (!turnPrefixResult.ok) return err(turnPrefixResult.error);\n\t\tsummary = `${historyResult.value}\\n\\n---\\n\\n**Turn Context (split turn):**\\n\\n${turnPrefixResult.value}`;\n\t} else {\n\t\tconst summaryResult = await generateSummary(\n\t\t\tmessagesToSummarize,\n\t\t\tmodel,\n\t\t\tsettings.reserveTokens,\n\t\t\tapiKey,\n\t\t\theaders,\n\t\t\tsignal,\n\t\t\tcustomInstructions,\n\t\t\tpreviousSummary,\n\t\t\tthinkingLevel,\n\t\t);\n\t\tif (!summaryResult.ok) return err(summaryResult.error);\n\t\tsummary = summaryResult.value;\n\t}\n\n\tconst { readFiles, modifiedFiles } = computeFileLists(fileOps);\n\tsummary += formatFileOperations(readFiles, modifiedFiles);\n\n\treturn ok({\n\t\tsummary,\n\t\tfirstKeptEntryId,\n\t\ttokensBefore,\n\t\tdetails: { readFiles, modifiedFiles } as CompactionDetails,\n\t});\n}\nasync function generateTurnPrefixSummary(\n\tmessages: AgentMessage[],\n\tmodel: Model<any>,\n\treserveTokens: number,\n\tapiKey: string,\n\theaders?: Record<string, string>,\n\tsignal?: AbortSignal,\n\tthinkingLevel?: ThinkingLevel,\n): Promise<Result<string, CompactionError>> {\n\tconst maxTokens = Math.min(\n\t\tMath.floor(0.5 * reserveTokens),\n\t\tmodel.maxTokens > 0 ? model.maxTokens : Number.POSITIVE_INFINITY,\n\t);\n\tconst llmMessages = convertToLlm(messages);\n\tconst conversationText = serializeConversation(llmMessages);\n\tconst promptText = `<conversation>\\n${conversationText}\\n</conversation>\\n\\n${TURN_PREFIX_SUMMARIZATION_PROMPT}`;\n\tconst summarizationMessages = [\n\t\t{\n\t\t\trole: \"user\" as const,\n\t\t\tcontent: [{ type: \"text\" as const, text: promptText }],\n\t\t\ttimestamp: Date.now(),\n\t\t},\n\t];\n\n\tconst response = await completeSimple(\n\t\tmodel,\n\t\t{ systemPrompt: SUMMARIZATION_SYSTEM_PROMPT, messages: summarizationMessages },\n\t\tmodel.reasoning && thinkingLevel && thinkingLevel !== \"off\"\n\t\t\t? { maxTokens, signal, apiKey, headers, reasoning: thinkingLevel }\n\t\t\t: { maxTokens, signal, apiKey, headers },\n\t);\n\tif (response.stopReason === \"aborted\") {\n\t\treturn err(new CompactionError(\"aborted\", response.errorMessage || \"Turn prefix summarization aborted\"));\n\t}\n\tif (response.stopReason === \"error\") {\n\t\treturn err(\n\t\t\tnew CompactionError(\n\t\t\t\t\"summarization_failed\",\n\t\t\t\t`Turn prefix summarization failed: ${response.errorMessage || \"Unknown error\"}`,\n\t\t\t),\n\t\t);\n\t}\n\n\treturn ok(\n\t\tresponse.content\n\t\t\t.filter((c): c is { type: \"text\"; text: string } => c.type === \"text\")\n\t\t\t.map((c) => c.text)\n\t\t\t.join(\"\\n\"),\n\t);\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Message } from "@dimivelev/chimera-ai";
|
|
2
|
+
import type { AgentMessage } from "../../types.ts";
|
|
3
|
+
/** File paths touched by a session branch or compaction range. */
|
|
4
|
+
export interface FileOperations {
|
|
5
|
+
/** Files read but not necessarily modified. */
|
|
6
|
+
read: Set<string>;
|
|
7
|
+
/** Files written by full-file write operations. */
|
|
8
|
+
written: Set<string>;
|
|
9
|
+
/** Files modified by edit operations. */
|
|
10
|
+
edited: Set<string>;
|
|
11
|
+
}
|
|
12
|
+
/** Create an empty file-operation accumulator. */
|
|
13
|
+
export declare function createFileOps(): FileOperations;
|
|
14
|
+
/** Add file operations from assistant tool calls to an accumulator. */
|
|
15
|
+
export declare function extractFileOpsFromMessage(message: AgentMessage, fileOps: FileOperations): void;
|
|
16
|
+
/** Compute sorted read-only and modified file lists from accumulated operations. */
|
|
17
|
+
export declare function computeFileLists(fileOps: FileOperations): {
|
|
18
|
+
readFiles: string[];
|
|
19
|
+
modifiedFiles: string[];
|
|
20
|
+
};
|
|
21
|
+
/** Format file lists as summary metadata tags. */
|
|
22
|
+
export declare function formatFileOperations(readFiles: string[], modifiedFiles: string[]): string;
|
|
23
|
+
/** Serialize LLM messages to plain text for summarization prompts. */
|
|
24
|
+
export declare function serializeConversation(messages: Message[]): string;
|
|
25
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/harness/compaction/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,kEAAkE;AAClE,MAAM,WAAW,cAAc;IAC9B,+CAA+C;IAC/C,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClB,mDAAmD;IACnD,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,yCAAyC;IACzC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACpB;AAED,kDAAkD;AAClD,wBAAgB,aAAa,IAAI,cAAc,CAM9C;AAED,uEAAuE;AACvE,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CA2B9F;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG;IAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAK1G;AAED,kDAAkD;AAClD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,CAUzF;AAkBD,sEAAsE;AACtE,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAqDjE","sourcesContent":["import type { Message } from \"@dimivelev/chimera-ai\";\nimport type { AgentMessage } from \"../../types.ts\";\n\n/** File paths touched by a session branch or compaction range. */\nexport interface FileOperations {\n\t/** Files read but not necessarily modified. */\n\tread: Set<string>;\n\t/** Files written by full-file write operations. */\n\twritten: Set<string>;\n\t/** Files modified by edit operations. */\n\tedited: Set<string>;\n}\n\n/** Create an empty file-operation accumulator. */\nexport function createFileOps(): FileOperations {\n\treturn {\n\t\tread: new Set(),\n\t\twritten: new Set(),\n\t\tedited: new Set(),\n\t};\n}\n\n/** Add file operations from assistant tool calls to an accumulator. */\nexport function extractFileOpsFromMessage(message: AgentMessage, fileOps: FileOperations): void {\n\tif (message.role !== \"assistant\") return;\n\tif (!(\"content\" in message) || !Array.isArray(message.content)) return;\n\n\tfor (const block of message.content) {\n\t\tif (typeof block !== \"object\" || block === null) continue;\n\t\tif (!(\"type\" in block) || block.type !== \"toolCall\") continue;\n\t\tif (!(\"arguments\" in block) || !(\"name\" in block)) continue;\n\n\t\tconst args = block.arguments as Record<string, unknown> | undefined;\n\t\tif (!args) continue;\n\n\t\tconst path = typeof args.path === \"string\" ? args.path : undefined;\n\t\tif (!path) continue;\n\n\t\tswitch (block.name) {\n\t\t\tcase \"read\":\n\t\t\t\tfileOps.read.add(path);\n\t\t\t\tbreak;\n\t\t\tcase \"write\":\n\t\t\t\tfileOps.written.add(path);\n\t\t\t\tbreak;\n\t\t\tcase \"edit\":\n\t\t\t\tfileOps.edited.add(path);\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/** Compute sorted read-only and modified file lists from accumulated operations. */\nexport function computeFileLists(fileOps: FileOperations): { readFiles: string[]; modifiedFiles: string[] } {\n\tconst modified = new Set([...fileOps.edited, ...fileOps.written]);\n\tconst readOnly = [...fileOps.read].filter((f) => !modified.has(f)).sort();\n\tconst modifiedFiles = [...modified].sort();\n\treturn { readFiles: readOnly, modifiedFiles };\n}\n\n/** Format file lists as summary metadata tags. */\nexport function formatFileOperations(readFiles: string[], modifiedFiles: string[]): string {\n\tconst sections: string[] = [];\n\tif (readFiles.length > 0) {\n\t\tsections.push(`<read-files>\\n${readFiles.join(\"\\n\")}\\n</read-files>`);\n\t}\n\tif (modifiedFiles.length > 0) {\n\t\tsections.push(`<modified-files>\\n${modifiedFiles.join(\"\\n\")}\\n</modified-files>`);\n\t}\n\tif (sections.length === 0) return \"\";\n\treturn `\\n\\n${sections.join(\"\\n\\n\")}`;\n}\n\nconst TOOL_RESULT_MAX_CHARS = 2000;\n\nfunction safeJsonStringify(value: unknown): string {\n\ttry {\n\t\treturn JSON.stringify(value) ?? \"undefined\";\n\t} catch {\n\t\treturn \"[unserializable]\";\n\t}\n}\n\nfunction truncateForSummary(text: string, maxChars: number): string {\n\tif (text.length <= maxChars) return text;\n\tconst truncatedChars = text.length - maxChars;\n\treturn `${text.slice(0, maxChars)}\\n\\n[... ${truncatedChars} more characters truncated]`;\n}\n\n/** Serialize LLM messages to plain text for summarization prompts. */\nexport function serializeConversation(messages: Message[]): string {\n\tconst parts: string[] = [];\n\n\tfor (const msg of messages) {\n\t\tif (msg.role === \"user\") {\n\t\t\tconst content =\n\t\t\t\ttypeof msg.content === \"string\"\n\t\t\t\t\t? msg.content\n\t\t\t\t\t: msg.content\n\t\t\t\t\t\t\t.filter((c): c is { type: \"text\"; text: string } => c.type === \"text\")\n\t\t\t\t\t\t\t.map((c) => c.text)\n\t\t\t\t\t\t\t.join(\"\");\n\t\t\tif (content) parts.push(`[User]: ${content}`);\n\t\t} else if (msg.role === \"assistant\") {\n\t\t\tconst textParts: string[] = [];\n\t\t\tconst thinkingParts: string[] = [];\n\t\t\tconst toolCalls: string[] = [];\n\n\t\t\tfor (const block of msg.content) {\n\t\t\t\tif (block.type === \"text\") {\n\t\t\t\t\ttextParts.push(block.text);\n\t\t\t\t} else if (block.type === \"thinking\") {\n\t\t\t\t\tthinkingParts.push(block.thinking);\n\t\t\t\t} else if (block.type === \"toolCall\") {\n\t\t\t\t\tconst args = block.arguments as Record<string, unknown>;\n\t\t\t\t\tconst argsStr = Object.entries(args)\n\t\t\t\t\t\t.map(([k, v]) => `${k}=${safeJsonStringify(v)}`)\n\t\t\t\t\t\t.join(\", \");\n\t\t\t\t\ttoolCalls.push(`${block.name}(${argsStr})`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (thinkingParts.length > 0) {\n\t\t\t\tparts.push(`[Assistant thinking]: ${thinkingParts.join(\"\\n\")}`);\n\t\t\t}\n\t\t\tif (textParts.length > 0) {\n\t\t\t\tparts.push(`[Assistant]: ${textParts.join(\"\\n\")}`);\n\t\t\t}\n\t\t\tif (toolCalls.length > 0) {\n\t\t\t\tparts.push(`[Assistant tool calls]: ${toolCalls.join(\"; \")}`);\n\t\t\t}\n\t\t} else if (msg.role === \"toolResult\") {\n\t\t\tconst content = msg.content\n\t\t\t\t.filter((c): c is { type: \"text\"; text: string } => c.type === \"text\")\n\t\t\t\t.map((c) => c.text)\n\t\t\t\t.join(\"\");\n\t\t\tif (content) {\n\t\t\t\tparts.push(`[Tool result]: ${truncateForSummary(content, TOOL_RESULT_MAX_CHARS)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn parts.join(\"\\n\\n\");\n}\n"]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/** Create an empty file-operation accumulator. */
|
|
2
|
+
export function createFileOps() {
|
|
3
|
+
return {
|
|
4
|
+
read: new Set(),
|
|
5
|
+
written: new Set(),
|
|
6
|
+
edited: new Set(),
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/** Add file operations from assistant tool calls to an accumulator. */
|
|
10
|
+
export function extractFileOpsFromMessage(message, fileOps) {
|
|
11
|
+
if (message.role !== "assistant")
|
|
12
|
+
return;
|
|
13
|
+
if (!("content" in message) || !Array.isArray(message.content))
|
|
14
|
+
return;
|
|
15
|
+
for (const block of message.content) {
|
|
16
|
+
if (typeof block !== "object" || block === null)
|
|
17
|
+
continue;
|
|
18
|
+
if (!("type" in block) || block.type !== "toolCall")
|
|
19
|
+
continue;
|
|
20
|
+
if (!("arguments" in block) || !("name" in block))
|
|
21
|
+
continue;
|
|
22
|
+
const args = block.arguments;
|
|
23
|
+
if (!args)
|
|
24
|
+
continue;
|
|
25
|
+
const path = typeof args.path === "string" ? args.path : undefined;
|
|
26
|
+
if (!path)
|
|
27
|
+
continue;
|
|
28
|
+
switch (block.name) {
|
|
29
|
+
case "read":
|
|
30
|
+
fileOps.read.add(path);
|
|
31
|
+
break;
|
|
32
|
+
case "write":
|
|
33
|
+
fileOps.written.add(path);
|
|
34
|
+
break;
|
|
35
|
+
case "edit":
|
|
36
|
+
fileOps.edited.add(path);
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Compute sorted read-only and modified file lists from accumulated operations. */
|
|
42
|
+
export function computeFileLists(fileOps) {
|
|
43
|
+
const modified = new Set([...fileOps.edited, ...fileOps.written]);
|
|
44
|
+
const readOnly = [...fileOps.read].filter((f) => !modified.has(f)).sort();
|
|
45
|
+
const modifiedFiles = [...modified].sort();
|
|
46
|
+
return { readFiles: readOnly, modifiedFiles };
|
|
47
|
+
}
|
|
48
|
+
/** Format file lists as summary metadata tags. */
|
|
49
|
+
export function formatFileOperations(readFiles, modifiedFiles) {
|
|
50
|
+
const sections = [];
|
|
51
|
+
if (readFiles.length > 0) {
|
|
52
|
+
sections.push(`<read-files>\n${readFiles.join("\n")}\n</read-files>`);
|
|
53
|
+
}
|
|
54
|
+
if (modifiedFiles.length > 0) {
|
|
55
|
+
sections.push(`<modified-files>\n${modifiedFiles.join("\n")}\n</modified-files>`);
|
|
56
|
+
}
|
|
57
|
+
if (sections.length === 0)
|
|
58
|
+
return "";
|
|
59
|
+
return `\n\n${sections.join("\n\n")}`;
|
|
60
|
+
}
|
|
61
|
+
const TOOL_RESULT_MAX_CHARS = 2000;
|
|
62
|
+
function safeJsonStringify(value) {
|
|
63
|
+
try {
|
|
64
|
+
return JSON.stringify(value) ?? "undefined";
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return "[unserializable]";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function truncateForSummary(text, maxChars) {
|
|
71
|
+
if (text.length <= maxChars)
|
|
72
|
+
return text;
|
|
73
|
+
const truncatedChars = text.length - maxChars;
|
|
74
|
+
return `${text.slice(0, maxChars)}\n\n[... ${truncatedChars} more characters truncated]`;
|
|
75
|
+
}
|
|
76
|
+
/** Serialize LLM messages to plain text for summarization prompts. */
|
|
77
|
+
export function serializeConversation(messages) {
|
|
78
|
+
const parts = [];
|
|
79
|
+
for (const msg of messages) {
|
|
80
|
+
if (msg.role === "user") {
|
|
81
|
+
const content = typeof msg.content === "string"
|
|
82
|
+
? msg.content
|
|
83
|
+
: msg.content
|
|
84
|
+
.filter((c) => c.type === "text")
|
|
85
|
+
.map((c) => c.text)
|
|
86
|
+
.join("");
|
|
87
|
+
if (content)
|
|
88
|
+
parts.push(`[User]: ${content}`);
|
|
89
|
+
}
|
|
90
|
+
else if (msg.role === "assistant") {
|
|
91
|
+
const textParts = [];
|
|
92
|
+
const thinkingParts = [];
|
|
93
|
+
const toolCalls = [];
|
|
94
|
+
for (const block of msg.content) {
|
|
95
|
+
if (block.type === "text") {
|
|
96
|
+
textParts.push(block.text);
|
|
97
|
+
}
|
|
98
|
+
else if (block.type === "thinking") {
|
|
99
|
+
thinkingParts.push(block.thinking);
|
|
100
|
+
}
|
|
101
|
+
else if (block.type === "toolCall") {
|
|
102
|
+
const args = block.arguments;
|
|
103
|
+
const argsStr = Object.entries(args)
|
|
104
|
+
.map(([k, v]) => `${k}=${safeJsonStringify(v)}`)
|
|
105
|
+
.join(", ");
|
|
106
|
+
toolCalls.push(`${block.name}(${argsStr})`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (thinkingParts.length > 0) {
|
|
110
|
+
parts.push(`[Assistant thinking]: ${thinkingParts.join("\n")}`);
|
|
111
|
+
}
|
|
112
|
+
if (textParts.length > 0) {
|
|
113
|
+
parts.push(`[Assistant]: ${textParts.join("\n")}`);
|
|
114
|
+
}
|
|
115
|
+
if (toolCalls.length > 0) {
|
|
116
|
+
parts.push(`[Assistant tool calls]: ${toolCalls.join("; ")}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else if (msg.role === "toolResult") {
|
|
120
|
+
const content = msg.content
|
|
121
|
+
.filter((c) => c.type === "text")
|
|
122
|
+
.map((c) => c.text)
|
|
123
|
+
.join("");
|
|
124
|
+
if (content) {
|
|
125
|
+
parts.push(`[Tool result]: ${truncateForSummary(content, TOOL_RESULT_MAX_CHARS)}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return parts.join("\n\n");
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/harness/compaction/utils.ts"],"names":[],"mappings":"AAaA,kDAAkD;AAClD,MAAM,UAAU,aAAa,GAAmB;IAC/C,OAAO;QACN,IAAI,EAAE,IAAI,GAAG,EAAE;QACf,OAAO,EAAE,IAAI,GAAG,EAAE;QAClB,MAAM,EAAE,IAAI,GAAG,EAAE;KACjB,CAAC;AAAA,CACF;AAED,uEAAuE;AACvE,MAAM,UAAU,yBAAyB,CAAC,OAAqB,EAAE,OAAuB,EAAQ;IAC/F,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO;IACzC,IAAI,CAAC,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO;IAEvE,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;YAAE,SAAS;QAC1D,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;YAAE,SAAS;QAC9D,IAAI,CAAC,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC;YAA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S,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,GAAG,CAAC,CAAC;gBAC7C,CAAC;YACF,CAAC;YAED,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9B,KAAK,CAAC,IAAI,CAAC,yBAAyB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjE,CAAC;YACD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1B,KAAK,CAAC,IAAI,CAAC,gBAAgB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACpD,CAAC;YACD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1B,KAAK,CAAC,IAAI,CAAC,2BAA2B,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC/D,CAAC;QACF,CAAC;aAAM,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACtC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO;iBACzB,MAAM,CAAC,CAAC,CAAC,EAAuC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;iBACrE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;iBAClB,IAAI,CAAC,EAAE,CAAC,CAAC;YACX,IAAI,OAAO,EAAE,CAAC;gBACb,KAAK,CAAC,IAAI,CAAC,kBAAkB,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAC;YACpF,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAAA,CAC1B","sourcesContent":["import type { Message } from \"@dimivelev/chimera-ai\";\nimport type { AgentMessage } from \"../../types.ts\";\n\n/** File paths touched by a session branch or compaction range. */\nexport interface FileOperations {\n\t/** Files read but not necessarily modified. */\n\tread: Set<string>;\n\t/** Files written by full-file write operations. */\n\twritten: Set<string>;\n\t/** Files modified by edit operations. */\n\tedited: Set<string>;\n}\n\n/** Create an empty file-operation accumulator. */\nexport function createFileOps(): FileOperations {\n\treturn {\n\t\tread: new Set(),\n\t\twritten: new Set(),\n\t\tedited: new Set(),\n\t};\n}\n\n/** Add file operations from assistant tool calls to an accumulator. */\nexport function extractFileOpsFromMessage(message: AgentMessage, fileOps: FileOperations): void {\n\tif (message.role !== \"assistant\") return;\n\tif (!(\"content\" in message) || !Array.isArray(message.content)) return;\n\n\tfor (const block of message.content) {\n\t\tif (typeof block !== \"object\" || block === null) continue;\n\t\tif (!(\"type\" in block) || block.type !== \"toolCall\") continue;\n\t\tif (!(\"arguments\" in block) || !(\"name\" in block)) continue;\n\n\t\tconst args = block.arguments as Record<string, unknown> | undefined;\n\t\tif (!args) continue;\n\n\t\tconst path = typeof args.path === \"string\" ? args.path : undefined;\n\t\tif (!path) continue;\n\n\t\tswitch (block.name) {\n\t\t\tcase \"read\":\n\t\t\t\tfileOps.read.add(path);\n\t\t\t\tbreak;\n\t\t\tcase \"write\":\n\t\t\t\tfileOps.written.add(path);\n\t\t\t\tbreak;\n\t\t\tcase \"edit\":\n\t\t\t\tfileOps.edited.add(path);\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/** Compute sorted read-only and modified file lists from accumulated operations. */\nexport function computeFileLists(fileOps: FileOperations): { readFiles: string[]; modifiedFiles: string[] } {\n\tconst modified = new Set([...fileOps.edited, ...fileOps.written]);\n\tconst readOnly = [...fileOps.read].filter((f) => !modified.has(f)).sort();\n\tconst modifiedFiles = [...modified].sort();\n\treturn { readFiles: readOnly, modifiedFiles };\n}\n\n/** Format file lists as summary metadata tags. */\nexport function formatFileOperations(readFiles: string[], modifiedFiles: string[]): string {\n\tconst sections: string[] = [];\n\tif (readFiles.length > 0) {\n\t\tsections.push(`<read-files>\\n${readFiles.join(\"\\n\")}\\n</read-files>`);\n\t}\n\tif (modifiedFiles.length > 0) {\n\t\tsections.push(`<modified-files>\\n${modifiedFiles.join(\"\\n\")}\\n</modified-files>`);\n\t}\n\tif (sections.length === 0) return \"\";\n\treturn `\\n\\n${sections.join(\"\\n\\n\")}`;\n}\n\nconst TOOL_RESULT_MAX_CHARS = 2000;\n\nfunction safeJsonStringify(value: unknown): string {\n\ttry {\n\t\treturn JSON.stringify(value) ?? \"undefined\";\n\t} catch {\n\t\treturn \"[unserializable]\";\n\t}\n}\n\nfunction truncateForSummary(text: string, maxChars: number): string {\n\tif (text.length <= maxChars) return text;\n\tconst truncatedChars = text.length - maxChars;\n\treturn `${text.slice(0, maxChars)}\\n\\n[... ${truncatedChars} more characters truncated]`;\n}\n\n/** Serialize LLM messages to plain text for summarization prompts. */\nexport function serializeConversation(messages: Message[]): string {\n\tconst parts: string[] = [];\n\n\tfor (const msg of messages) {\n\t\tif (msg.role === \"user\") {\n\t\t\tconst content =\n\t\t\t\ttypeof msg.content === \"string\"\n\t\t\t\t\t? msg.content\n\t\t\t\t\t: msg.content\n\t\t\t\t\t\t\t.filter((c): c is { type: \"text\"; text: string } => c.type === \"text\")\n\t\t\t\t\t\t\t.map((c) => c.text)\n\t\t\t\t\t\t\t.join(\"\");\n\t\t\tif (content) parts.push(`[User]: ${content}`);\n\t\t} else if (msg.role === \"assistant\") {\n\t\t\tconst textParts: string[] = [];\n\t\t\tconst thinkingParts: string[] = [];\n\t\t\tconst toolCalls: string[] = [];\n\n\t\t\tfor (const block of msg.content) {\n\t\t\t\tif (block.type === \"text\") {\n\t\t\t\t\ttextParts.push(block.text);\n\t\t\t\t} else if (block.type === \"thinking\") {\n\t\t\t\t\tthinkingParts.push(block.thinking);\n\t\t\t\t} else if (block.type === \"toolCall\") {\n\t\t\t\t\tconst args = block.arguments as Record<string, unknown>;\n\t\t\t\t\tconst argsStr = Object.entries(args)\n\t\t\t\t\t\t.map(([k, v]) => `${k}=${safeJsonStringify(v)}`)\n\t\t\t\t\t\t.join(\", \");\n\t\t\t\t\ttoolCalls.push(`${block.name}(${argsStr})`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (thinkingParts.length > 0) {\n\t\t\t\tparts.push(`[Assistant thinking]: ${thinkingParts.join(\"\\n\")}`);\n\t\t\t}\n\t\t\tif (textParts.length > 0) {\n\t\t\t\tparts.push(`[Assistant]: ${textParts.join(\"\\n\")}`);\n\t\t\t}\n\t\t\tif (toolCalls.length > 0) {\n\t\t\t\tparts.push(`[Assistant tool calls]: ${toolCalls.join(\"; \")}`);\n\t\t\t}\n\t\t} else if (msg.role === \"toolResult\") {\n\t\t\tconst content = msg.content\n\t\t\t\t.filter((c): c is { type: \"text\"; text: string } => c.type === \"text\")\n\t\t\t\t.map((c) => c.text)\n\t\t\t\t.join(\"\");\n\t\t\tif (content) {\n\t\t\t\tparts.push(`[Tool result]: ${truncateForSummary(content, TOOL_RESULT_MAX_CHARS)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn parts.join(\"\\n\\n\");\n}\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ExecutionEnv, ExecutionError, FileError, type FileInfo, type Result } from "../types.ts";
|
|
2
|
+
export declare class NodeExecutionEnv implements ExecutionEnv {
|
|
3
|
+
cwd: string;
|
|
4
|
+
private shellPath?;
|
|
5
|
+
private shellEnv?;
|
|
6
|
+
constructor(options: {
|
|
7
|
+
cwd: string;
|
|
8
|
+
shellPath?: string;
|
|
9
|
+
shellEnv?: NodeJS.ProcessEnv;
|
|
10
|
+
});
|
|
11
|
+
absolutePath(path: string): Promise<Result<string, FileError>>;
|
|
12
|
+
joinPath(parts: string[]): Promise<Result<string, FileError>>;
|
|
13
|
+
exec(command: string, options?: {
|
|
14
|
+
cwd?: string;
|
|
15
|
+
env?: Record<string, string>;
|
|
16
|
+
timeout?: number;
|
|
17
|
+
abortSignal?: AbortSignal;
|
|
18
|
+
onStdout?: (chunk: string) => void;
|
|
19
|
+
onStderr?: (chunk: string) => void;
|
|
20
|
+
}): Promise<Result<{
|
|
21
|
+
stdout: string;
|
|
22
|
+
stderr: string;
|
|
23
|
+
exitCode: number;
|
|
24
|
+
}, ExecutionError>>;
|
|
25
|
+
readTextFile(path: string, abortSignal?: AbortSignal): Promise<Result<string, FileError>>;
|
|
26
|
+
readTextLines(path: string, options?: {
|
|
27
|
+
maxLines?: number;
|
|
28
|
+
abortSignal?: AbortSignal;
|
|
29
|
+
}): Promise<Result<string[], FileError>>;
|
|
30
|
+
readBinaryFile(path: string, abortSignal?: AbortSignal): Promise<Result<Uint8Array, FileError>>;
|
|
31
|
+
writeFile(path: string, content: string | Uint8Array, abortSignal?: AbortSignal): Promise<Result<void, FileError>>;
|
|
32
|
+
appendFile(path: string, content: string | Uint8Array): Promise<Result<void, FileError>>;
|
|
33
|
+
fileInfo(path: string): Promise<Result<FileInfo, FileError>>;
|
|
34
|
+
listDir(path: string, abortSignal?: AbortSignal): Promise<Result<FileInfo[], FileError>>;
|
|
35
|
+
canonicalPath(path: string): Promise<Result<string, FileError>>;
|
|
36
|
+
exists(path: string): Promise<Result<boolean, FileError>>;
|
|
37
|
+
createDir(path: string, options?: {
|
|
38
|
+
recursive?: boolean;
|
|
39
|
+
}): Promise<Result<void, FileError>>;
|
|
40
|
+
remove(path: string, options?: {
|
|
41
|
+
recursive?: boolean;
|
|
42
|
+
force?: boolean;
|
|
43
|
+
}): Promise<Result<void, FileError>>;
|
|
44
|
+
createTempDir(prefix?: string): Promise<Result<string, FileError>>;
|
|
45
|
+
createTempFile(options?: {
|
|
46
|
+
prefix?: string;
|
|
47
|
+
suffix?: string;
|
|
48
|
+
}): Promise<Result<string, FileError>>;
|
|
49
|
+
cleanup(): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=nodejs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodejs.d.ts","sourceRoot":"","sources":["../../../src/harness/env/nodejs.ts"],"names":[],"mappings":"AAkBA,OA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,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAQjG;IAEK,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAQ/G;IAEK,aAAa,CAAC,MAAM,GAAE,MAAe,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAM/E;IAEK,cAAc,CAAC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAUvG;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7B;CACD","sourcesContent":["import { spawn } from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport { constants, createReadStream } from \"node:fs\";\nimport {\n\taccess,\n\tappendFile,\n\tlstat,\n\tmkdir,\n\tmkdtemp,\n\treaddir,\n\treadFile,\n\trealpath,\n\trm,\n\twriteFile,\n} from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { createInterface } from \"node:readline\";\nimport {\n\ttype ExecutionEnv,\n\tExecutionError,\n\terr,\n\tFileError,\n\ttype FileInfo,\n\ttype FileKind,\n\tok,\n\ttype Result,\n\ttoError,\n} from \"../types.ts\";\n\nfunction resolvePath(cwd: string, path: string): string {\n\treturn isAbsolute(path) ? path : resolve(cwd, path);\n}\n\nfunction fileKindFromStats(stats: {\n\tisFile(): boolean;\n\tisDirectory(): boolean;\n\tisSymbolicLink(): boolean;\n}): FileKind | undefined {\n\tif (stats.isFile()) return \"file\";\n\tif (stats.isDirectory()) return \"directory\";\n\tif (stats.isSymbolicLink()) return \"symlink\";\n\treturn undefined;\n}\n\nfunction fileInfoFromStats(\n\tpath: string,\n\tstats: { isFile(): boolean; isDirectory(): boolean; isSymbolicLink(): boolean; size: number; mtimeMs: number },\n): Result<FileInfo, FileError> {\n\tconst kind = fileKindFromStats(stats);\n\tif (!kind) return err(new FileError(\"invalid\", \"Unsupported file type\", path));\n\treturn ok({\n\t\tname: path.replace(/\\/+$/, \"\").split(\"/\").pop() ?? path,\n\t\tpath,\n\t\tkind,\n\t\tsize: stats.size,\n\t\tmtimeMs: stats.mtimeMs,\n\t});\n}\n\nfunction isNodeError(error: unknown): error is NodeJS.ErrnoException {\n\treturn error instanceof Error && \"code\" in error;\n}\n\nfunction toFileError(error: unknown, path?: string): FileError {\n\tif (error instanceof FileError) return error;\n\tconst cause = toError(error);\n\tif (isNodeError(error)) {\n\t\tconst message = error.message;\n\t\tswitch (error.code) {\n\t\t\tcase \"ABORT_ERR\":\n\t\t\t\treturn new FileError(\"aborted\", message, path, cause);\n\t\t\tcase \"ENOENT\":\n\t\t\t\treturn new FileError(\"not_found\", message, path, cause);\n\t\t\tcase \"EACCES\":\n\t\t\tcase \"EPERM\":\n\t\t\t\treturn new FileError(\"permission_denied\", message, path, cause);\n\t\t\tcase \"ENOTDIR\":\n\t\t\t\treturn new FileError(\"not_directory\", message, path, cause);\n\t\t\tcase \"EISDIR\":\n\t\t\t\treturn new FileError(\"is_directory\", message, path, cause);\n\t\t\tcase \"EINVAL\":\n\t\t\t\treturn new FileError(\"invalid\", message, path, cause);\n\t\t}\n\t}\n\treturn new FileError(\"unknown\", cause.message, path, cause);\n}\n\nfunction abortResult<TValue>(signal: AbortSignal | undefined, path?: string): Result<TValue, FileError> | undefined {\n\treturn signal?.aborted ? err(new FileError(\"aborted\", \"aborted\", path)) : undefined;\n}\n\nasync function pathExists(path: string): Promise<boolean> {\n\ttry {\n\t\tawait access(path, constants.F_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nasync function runCommand(\n\tcommand: string,\n\targs: string[],\n\ttimeoutMs: number,\n): Promise<{ stdout: string; status: number | null }> {\n\treturn await new Promise((resolve) => {\n\t\tlet stdout = \"\";\n\t\tlet child: ReturnType<typeof spawn>;\n\t\ttry {\n\t\t\tchild = spawn(command, args, {\n\t\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t\t\twindowsHide: true,\n\t\t\t});\n\t\t} catch {\n\t\t\tresolve({ stdout: \"\", status: null });\n\t\t\treturn;\n\t\t}\n\t\tconst timeout = setTimeout(() => {\n\t\t\tif (child.pid) killProcessTree(child.pid);\n\t\t}, timeoutMs);\n\t\tchild.stdout?.setEncoding(\"utf8\");\n\t\tchild.stdout?.on(\"data\", (chunk: string) => {\n\t\t\tstdout += chunk;\n\t\t});\n\t\tchild.on(\"error\", () => {\n\t\t\tclearTimeout(timeout);\n\t\t\tresolve({ stdout: \"\", status: null });\n\t\t});\n\t\tchild.on(\"close\", (status) => {\n\t\t\tclearTimeout(timeout);\n\t\t\tresolve({ stdout, status });\n\t\t});\n\t});\n}\n\nasync function findBashOnPath(): Promise<string | null> {\n\tconst result =\n\t\tprocess.platform === \"win32\"\n\t\t\t? await runCommand(\"where\", [\"bash.exe\"], 5000)\n\t\t\t: await runCommand(\"which\", [\"bash\"], 5000);\n\tif (result.status !== 0 || !result.stdout) return null;\n\tconst firstMatch = result.stdout.trim().split(/\\r?\\n/)[0];\n\treturn firstMatch && (await pathExists(firstMatch)) ? firstMatch : null;\n}\n\nasync function getShellConfig(\n\tcustomShellPath?: string,\n): Promise<Result<{ shell: string; args: string[] }, ExecutionError>> {\n\tif (customShellPath) {\n\t\tif (await pathExists(customShellPath)) {\n\t\t\treturn ok({ shell: customShellPath, args: [\"-c\"] });\n\t\t}\n\t\treturn err(new ExecutionError(\"shell_unavailable\", `Custom shell path not found: ${customShellPath}`));\n\t}\n\tif (process.platform === \"win32\") {\n\t\tconst candidates: string[] = [];\n\t\tconst programFiles = process.env.ProgramFiles;\n\t\tif (programFiles) candidates.push(`${programFiles}\\\\Git\\\\bin\\\\bash.exe`);\n\t\tconst programFilesX86 = process.env[\"ProgramFiles(x86)\"];\n\t\tif (programFilesX86) candidates.push(`${programFilesX86}\\\\Git\\\\bin\\\\bash.exe`);\n\t\tfor (const candidate of candidates) {\n\t\t\tif (await pathExists(candidate)) {\n\t\t\t\treturn ok({ shell: candidate, args: [\"-c\"] });\n\t\t\t}\n\t\t}\n\t\tconst bashOnPath = await findBashOnPath();\n\t\tif (bashOnPath) {\n\t\t\treturn ok({ shell: bashOnPath, args: [\"-c\"] });\n\t\t}\n\t\treturn err(new ExecutionError(\"shell_unavailable\", \"No bash shell found\"));\n\t}\n\n\tif (await pathExists(\"/bin/bash\")) {\n\t\treturn ok({ shell: \"/bin/bash\", args: [\"-c\"] });\n\t}\n\tconst bashOnPath = await findBashOnPath();\n\tif (bashOnPath) {\n\t\treturn ok({ shell: bashOnPath, args: [\"-c\"] });\n\t}\n\treturn ok({ shell: \"sh\", args: [\"-c\"] });\n}\n\nfunction getShellEnv(baseEnv?: NodeJS.ProcessEnv, extraEnv?: Record<string, string>): NodeJS.ProcessEnv {\n\treturn {\n\t\t...process.env,\n\t\t...baseEnv,\n\t\t...extraEnv,\n\t};\n}\n\nfunction killProcessTree(pid: number): void {\n\tif (process.platform === \"win32\") {\n\t\ttry {\n\t\t\tspawn(\"taskkill\", [\"/F\", \"/T\", \"/PID\", String(pid)], {\n\t\t\t\tstdio: \"ignore\",\n\t\t\t\tdetached: true,\n\t\t\t\twindowsHide: true,\n\t\t\t});\n\t\t} catch {\n\t\t\t// Ignore errors.\n\t\t}\n\t\treturn;\n\t}\n\n\ttry {\n\t\tprocess.kill(-pid, \"SIGKILL\");\n\t} catch {\n\t\ttry {\n\t\t\tprocess.kill(pid, \"SIGKILL\");\n\t\t} catch {\n\t\t\t// Process already dead.\n\t\t}\n\t}\n}\n\nexport class NodeExecutionEnv implements ExecutionEnv {\n\tcwd: string;\n\tprivate shellPath?: string;\n\tprivate shellEnv?: NodeJS.ProcessEnv;\n\n\tconstructor(options: { cwd: string; shellPath?: string; shellEnv?: NodeJS.ProcessEnv }) {\n\t\tthis.cwd = options.cwd;\n\t\tthis.shellPath = options.shellPath;\n\t\tthis.shellEnv = options.shellEnv;\n\t}\n\n\tasync absolutePath(path: string): Promise<Result<string, FileError>> {\n\t\treturn ok(resolvePath(this.cwd, path));\n\t}\n\n\tasync joinPath(parts: string[]): Promise<Result<string, FileError>> {\n\t\treturn ok(join(...parts));\n\t}\n\n\tasync exec(\n\t\tcommand: string,\n\t\toptions?: {\n\t\t\tcwd?: string;\n\t\t\tenv?: Record<string, string>;\n\t\t\ttimeout?: number;\n\t\t\tabortSignal?: AbortSignal;\n\t\t\tonStdout?: (chunk: string) => void;\n\t\t\tonStderr?: (chunk: string) => void;\n\t\t},\n\t): Promise<Result<{ stdout: string; stderr: string; exitCode: number }, ExecutionError>> {\n\t\tif (options?.abortSignal?.aborted) return err(new ExecutionError(\"aborted\", \"aborted\"));\n\n\t\tconst cwd = options?.cwd ? resolvePath(this.cwd, options.cwd) : this.cwd;\n\t\tconst shellConfig = await getShellConfig(this.shellPath);\n\t\tif (!shellConfig.ok) return shellConfig;\n\n\t\treturn await new Promise((resolvePromise) => {\n\t\t\tlet stdout = \"\";\n\t\t\tlet stderr = \"\";\n\t\t\tlet settled = false;\n\t\t\tlet timedOut = false;\n\t\t\tlet callbackError: ExecutionError | undefined;\n\t\t\tlet child: ReturnType<typeof spawn> | undefined;\n\t\t\tlet timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n\t\t\tconst onAbort = () => {\n\t\t\t\tif (child?.pid) {\n\t\t\t\t\tkillProcessTree(child.pid);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst settle = (result: Result<{ stdout: string; stderr: string; exitCode: number }, ExecutionError>) => {\n\t\t\t\tif (timeoutId) clearTimeout(timeoutId);\n\t\t\t\tif (options?.abortSignal) options.abortSignal.removeEventListener(\"abort\", onAbort);\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tresolvePromise(result);\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\tchild = spawn(shellConfig.value.shell, [...shellConfig.value.args, command], {\n\t\t\t\t\tcwd,\n\t\t\t\t\tdetached: process.platform !== \"win32\",\n\t\t\t\t\tenv: getShellEnv(this.shellEnv, options?.env),\n\t\t\t\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\t\t\t\twindowsHide: true,\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tconst cause = toError(error);\n\t\t\t\tsettle(err(new ExecutionError(\"spawn_error\", cause.message, cause)));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttimeoutId =\n\t\t\t\ttypeof options?.timeout === \"number\"\n\t\t\t\t\t? setTimeout(() => {\n\t\t\t\t\t\t\ttimedOut = true;\n\t\t\t\t\t\t\tif (child?.pid) {\n\t\t\t\t\t\t\t\tkillProcessTree(child.pid);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, options.timeout * 1000)\n\t\t\t\t\t: undefined;\n\n\t\t\tif (options?.abortSignal) {\n\t\t\t\tif (options.abortSignal.aborted) {\n\t\t\t\t\tonAbort();\n\t\t\t\t} else {\n\t\t\t\t\toptions.abortSignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchild.stdout?.setEncoding(\"utf8\");\n\t\t\tchild.stderr?.setEncoding(\"utf8\");\n\t\t\tchild.stdout?.on(\"data\", (chunk: string) => {\n\t\t\t\tstdout += chunk;\n\t\t\t\ttry {\n\t\t\t\t\toptions?.onStdout?.(chunk);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst cause = toError(error);\n\t\t\t\t\tcallbackError = new ExecutionError(\"callback_error\", cause.message, cause);\n\t\t\t\t\tonAbort();\n\t\t\t\t}\n\t\t\t});\n\t\t\tchild.stderr?.on(\"data\", (chunk: string) => {\n\t\t\t\tstderr += chunk;\n\t\t\t\ttry {\n\t\t\t\t\toptions?.onStderr?.(chunk);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst cause = toError(error);\n\t\t\t\t\tcallbackError = new ExecutionError(\"callback_error\", cause.message, cause);\n\t\t\t\t\tonAbort();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tchild.on(\"error\", (error) => {\n\t\t\t\tsettle(err(new ExecutionError(\"spawn_error\", error.message, error)));\n\t\t\t});\n\n\t\t\tchild.on(\"close\", (code) => {\n\t\t\t\tif (callbackError) {\n\t\t\t\t\tsettle(err(callbackError));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (timedOut) {\n\t\t\t\t\tsettle(err(new ExecutionError(\"timeout\", `timeout:${options?.timeout}`)));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (options?.abortSignal?.aborted) {\n\t\t\t\t\tsettle(err(new ExecutionError(\"aborted\", \"aborted\")));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsettle(ok({ stdout, stderr, exitCode: code ?? 0 }));\n\t\t\t});\n\t\t});\n\t}\n\n\tasync readTextFile(path: string, abortSignal?: AbortSignal): Promise<Result<string, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\tconst aborted = abortResult<string>(abortSignal, resolved);\n\t\tif (aborted) return aborted;\n\t\ttry {\n\t\t\treturn ok(await readFile(resolved, { encoding: \"utf8\", signal: abortSignal }));\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync readTextLines(\n\t\tpath: string,\n\t\toptions?: { maxLines?: number; abortSignal?: AbortSignal },\n\t): Promise<Result<string[], FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\tconst aborted = abortResult<string[]>(options?.abortSignal, resolved);\n\t\tif (aborted) return aborted;\n\t\tif (options?.maxLines !== undefined && options.maxLines <= 0) return ok([]);\n\t\tlet stream: ReturnType<typeof createReadStream> | undefined;\n\t\tlet lineReader: ReturnType<typeof createInterface> | undefined;\n\t\ttry {\n\t\t\tstream = createReadStream(resolved, { encoding: \"utf8\", signal: options?.abortSignal });\n\t\t\tlineReader = createInterface({ input: stream, crlfDelay: Infinity });\n\t\t\tconst lines: string[] = [];\n\t\t\tfor await (const line of lineReader) {\n\t\t\t\tconst loopAbort = abortResult<string[]>(options?.abortSignal, resolved);\n\t\t\t\tif (loopAbort) return loopAbort;\n\t\t\t\tlines.push(line);\n\t\t\t\tif (options?.maxLines !== undefined && lines.length >= options.maxLines) break;\n\t\t\t}\n\t\t\tconst afterReadAbort = abortResult<string[]>(options?.abortSignal, resolved);\n\t\t\tif (afterReadAbort) return afterReadAbort;\n\t\t\treturn ok(lines);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t} finally {\n\t\t\tlineReader?.close();\n\t\t\tstream?.destroy();\n\t\t}\n\t}\n\n\tasync readBinaryFile(path: string, abortSignal?: AbortSignal): Promise<Result<Uint8Array, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\tconst aborted = abortResult<Uint8Array>(abortSignal, resolved);\n\t\tif (aborted) return aborted;\n\t\ttry {\n\t\t\treturn ok(await readFile(resolved, { signal: abortSignal }));\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync writeFile(\n\t\tpath: string,\n\t\tcontent: string | Uint8Array,\n\t\tabortSignal?: AbortSignal,\n\t): Promise<Result<void, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\tconst aborted = abortResult<void>(abortSignal, resolved);\n\t\tif (aborted) return aborted;\n\t\ttry {\n\t\t\tawait mkdir(resolve(resolved, \"..\"), { recursive: true });\n\t\t\tconst afterMkdirAbort = abortResult<void>(abortSignal, resolved);\n\t\t\tif (afterMkdirAbort) return afterMkdirAbort;\n\t\t\tawait writeFile(resolved, content, { signal: abortSignal });\n\t\t\treturn ok(undefined);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync appendFile(path: string, content: string | Uint8Array): Promise<Result<void, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\ttry {\n\t\t\tawait mkdir(resolve(resolved, \"..\"), { recursive: true });\n\t\t\tawait appendFile(resolved, content);\n\t\t\treturn ok(undefined);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync fileInfo(path: string): Promise<Result<FileInfo, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\ttry {\n\t\t\treturn fileInfoFromStats(resolved, await lstat(resolved));\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync listDir(path: string, abortSignal?: AbortSignal): Promise<Result<FileInfo[], FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\tconst aborted = abortResult<FileInfo[]>(abortSignal, resolved);\n\t\tif (aborted) return aborted;\n\t\ttry {\n\t\t\tconst entries = await readdir(resolved, { withFileTypes: true });\n\t\t\tconst infos: FileInfo[] = [];\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst loopAbort = abortResult<FileInfo[]>(abortSignal, resolved);\n\t\t\t\tif (loopAbort) return loopAbort;\n\t\t\t\tconst entryPath = resolve(resolved, entry.name);\n\t\t\t\ttry {\n\t\t\t\t\tconst info = fileInfoFromStats(entryPath, await lstat(entryPath));\n\t\t\t\t\tif (info.ok) infos.push(info.value);\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn err(toFileError(error, entryPath));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ok(infos);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync canonicalPath(path: string): Promise<Result<string, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\ttry {\n\t\t\treturn ok(await realpath(resolved));\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync exists(path: string): Promise<Result<boolean, FileError>> {\n\t\tconst result = await this.fileInfo(path);\n\t\tif (result.ok) return ok(true);\n\t\tif (result.error.code === \"not_found\") return ok(false);\n\t\treturn err(result.error);\n\t}\n\n\tasync createDir(path: string, options?: { recursive?: boolean }): Promise<Result<void, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\ttry {\n\t\t\tawait mkdir(resolved, { recursive: options?.recursive ?? true });\n\t\t\treturn ok(undefined);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync remove(path: string, options?: { recursive?: boolean; force?: boolean }): Promise<Result<void, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\ttry {\n\t\t\tawait rm(resolved, { recursive: options?.recursive ?? false, force: options?.force ?? false });\n\t\t\treturn ok(undefined);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync createTempDir(prefix: string = \"tmp-\"): Promise<Result<string, FileError>> {\n\t\ttry {\n\t\t\treturn ok(await mkdtemp(join(tmpdir(), prefix)));\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error));\n\t\t}\n\t}\n\n\tasync createTempFile(options?: { prefix?: string; suffix?: string }): Promise<Result<string, FileError>> {\n\t\tconst dir = await this.createTempDir(\"tmp-\");\n\t\tif (!dir.ok) return dir;\n\t\tconst filePath = join(dir.value, `${options?.prefix ?? \"\"}${randomUUID()}${options?.suffix ?? \"\"}`);\n\t\ttry {\n\t\t\tawait writeFile(filePath, \"\");\n\t\t\treturn ok(filePath);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, filePath));\n\t\t}\n\t}\n\n\tasync cleanup(): Promise<void> {\n\t\t// nothing to clean up for the local node implementation\n\t}\n}\n"]}
|