threadwell 0.0.0 → 0.0.1
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 +4170 -0
- package/README.md +668 -13
- 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 +53 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +341 -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 +83 -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 +19 -3
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +93 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +404 -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 +86 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +117 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session.d.ts +659 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +3210 -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 +441 -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 +615 -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/continuity/continuity-files.d.ts +79 -0
- package/dist/core/continuity/continuity-files.d.ts.map +1 -0
- package/dist/core/continuity/continuity-files.js +326 -0
- package/dist/core/continuity/continuity-files.js.map +1 -0
- package/dist/core/continuity/continuity-intent-router.d.ts +9 -0
- package/dist/core/continuity/continuity-intent-router.d.ts.map +1 -0
- package/dist/core/continuity/continuity-intent-router.js +96 -0
- package/dist/core/continuity/continuity-intent-router.js.map +1 -0
- package/dist/core/continuity/continuity-manager.d.ts +28 -0
- package/dist/core/continuity/continuity-manager.d.ts.map +1 -0
- package/dist/core/continuity/continuity-manager.js +288 -0
- package/dist/core/continuity/continuity-manager.js.map +1 -0
- package/dist/core/continuity/continuity-service.d.ts +22 -0
- package/dist/core/continuity/continuity-service.d.ts.map +1 -0
- package/dist/core/continuity/continuity-service.js +34 -0
- package/dist/core/continuity/continuity-service.js.map +1 -0
- package/dist/core/continuity/index.d.ts +5 -0
- package/dist/core/continuity/index.d.ts.map +1 -0
- package/dist/core/continuity/index.js +5 -0
- package/dist/core/continuity/index.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 +224 -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 +1834 -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 +485 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +159 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +824 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1173 -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 +72 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +374 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/identity.d.ts +8 -0
- package/dist/core/identity.d.ts.map +1 -0
- package/dist/core/identity.js +8 -0
- package/dist/core/identity.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/memory/adr/adr-candidates.d.ts +15 -0
- package/dist/core/memory/adr/adr-candidates.d.ts.map +1 -0
- package/dist/core/memory/adr/adr-candidates.js +63 -0
- package/dist/core/memory/adr/adr-candidates.js.map +1 -0
- package/dist/core/memory/adr/adr-format.d.ts +31 -0
- package/dist/core/memory/adr/adr-format.d.ts.map +1 -0
- package/dist/core/memory/adr/adr-format.js +138 -0
- package/dist/core/memory/adr/adr-format.js.map +1 -0
- package/dist/core/memory/adr/adr-service.d.ts +19 -0
- package/dist/core/memory/adr/adr-service.d.ts.map +1 -0
- package/dist/core/memory/adr/adr-service.js +63 -0
- package/dist/core/memory/adr/adr-service.js.map +1 -0
- package/dist/core/memory/adr/index.d.ts +4 -0
- package/dist/core/memory/adr/index.d.ts.map +1 -0
- package/dist/core/memory/adr/index.js +4 -0
- package/dist/core/memory/adr/index.js.map +1 -0
- package/dist/core/memory/content-ref.d.ts +22 -0
- package/dist/core/memory/content-ref.d.ts.map +1 -0
- package/dist/core/memory/content-ref.js +34 -0
- package/dist/core/memory/content-ref.js.map +1 -0
- package/dist/core/memory/context/context-candidates.d.ts +9 -0
- package/dist/core/memory/context/context-candidates.d.ts.map +1 -0
- package/dist/core/memory/context/context-candidates.js +64 -0
- package/dist/core/memory/context/context-candidates.js.map +1 -0
- package/dist/core/memory/context/context-diagnostics.d.ts +12 -0
- package/dist/core/memory/context/context-diagnostics.d.ts.map +1 -0
- package/dist/core/memory/context/context-diagnostics.js +50 -0
- package/dist/core/memory/context/context-diagnostics.js.map +1 -0
- package/dist/core/memory/context/context-format.d.ts +41 -0
- package/dist/core/memory/context/context-format.d.ts.map +1 -0
- package/dist/core/memory/context/context-format.js +199 -0
- package/dist/core/memory/context/context-format.js.map +1 -0
- package/dist/core/memory/context/index.d.ts +4 -0
- package/dist/core/memory/context/index.d.ts.map +1 -0
- package/dist/core/memory/context/index.js +4 -0
- package/dist/core/memory/context/index.js.map +1 -0
- package/dist/core/memory/context-pressure.d.ts +15 -0
- package/dist/core/memory/context-pressure.d.ts.map +1 -0
- package/dist/core/memory/context-pressure.js +36 -0
- package/dist/core/memory/context-pressure.js.map +1 -0
- package/dist/core/memory/continuity-import.d.ts +6 -0
- package/dist/core/memory/continuity-import.d.ts.map +1 -0
- package/dist/core/memory/continuity-import.js +63 -0
- package/dist/core/memory/continuity-import.js.map +1 -0
- package/dist/core/memory/dedupe.d.ts +10 -0
- package/dist/core/memory/dedupe.d.ts.map +1 -0
- package/dist/core/memory/dedupe.js +36 -0
- package/dist/core/memory/dedupe.js.map +1 -0
- package/dist/core/memory/embedding-adapter.d.ts +20 -0
- package/dist/core/memory/embedding-adapter.d.ts.map +1 -0
- package/dist/core/memory/embedding-adapter.js +11 -0
- package/dist/core/memory/embedding-adapter.js.map +1 -0
- package/dist/core/memory/event-summary.d.ts +7 -0
- package/dist/core/memory/event-summary.d.ts.map +1 -0
- package/dist/core/memory/event-summary.js +23 -0
- package/dist/core/memory/event-summary.js.map +1 -0
- package/dist/core/memory/feature/feature-format.d.ts +30 -0
- package/dist/core/memory/feature/feature-format.d.ts.map +1 -0
- package/dist/core/memory/feature/feature-format.js +121 -0
- package/dist/core/memory/feature/feature-format.js.map +1 -0
- package/dist/core/memory/feature/index.d.ts +2 -0
- package/dist/core/memory/feature/index.d.ts.map +1 -0
- package/dist/core/memory/feature/index.js +2 -0
- package/dist/core/memory/feature/index.js.map +1 -0
- package/dist/core/memory/ignore.d.ts +5 -0
- package/dist/core/memory/ignore.d.ts.map +1 -0
- package/dist/core/memory/ignore.js +26 -0
- package/dist/core/memory/ignore.js.map +1 -0
- package/dist/core/memory/index.d.ts +21 -0
- package/dist/core/memory/index.d.ts.map +1 -0
- package/dist/core/memory/index.js +20 -0
- package/dist/core/memory/index.js.map +1 -0
- package/dist/core/memory/memory-anchors.d.ts +11 -0
- package/dist/core/memory/memory-anchors.d.ts.map +1 -0
- package/dist/core/memory/memory-anchors.js +35 -0
- package/dist/core/memory/memory-anchors.js.map +1 -0
- package/dist/core/memory/memory-identity.d.ts +11 -0
- package/dist/core/memory/memory-identity.d.ts.map +1 -0
- package/dist/core/memory/memory-identity.js +19 -0
- package/dist/core/memory/memory-identity.js.map +1 -0
- package/dist/core/memory/memory-retrieval.d.ts +55 -0
- package/dist/core/memory/memory-retrieval.d.ts.map +1 -0
- package/dist/core/memory/memory-retrieval.js +128 -0
- package/dist/core/memory/memory-retrieval.js.map +1 -0
- package/dist/core/memory/memory-schema.d.ts +11 -0
- package/dist/core/memory/memory-schema.d.ts.map +1 -0
- package/dist/core/memory/memory-schema.js +111 -0
- package/dist/core/memory/memory-schema.js.map +1 -0
- package/dist/core/memory/memory-service.d.ts +35 -0
- package/dist/core/memory/memory-service.d.ts.map +1 -0
- package/dist/core/memory/memory-service.js +125 -0
- package/dist/core/memory/memory-service.js.map +1 -0
- package/dist/core/memory/memory-store.d.ts +37 -0
- package/dist/core/memory/memory-store.d.ts.map +1 -0
- package/dist/core/memory/memory-store.js +109 -0
- package/dist/core/memory/memory-store.js.map +1 -0
- package/dist/core/memory/memory-types.d.ts +55 -0
- package/dist/core/memory/memory-types.d.ts.map +1 -0
- package/dist/core/memory/memory-types.js +2 -0
- package/dist/core/memory/memory-types.js.map +1 -0
- package/dist/core/memory/redaction.d.ts +4 -0
- package/dist/core/memory/redaction.d.ts.map +1 -0
- package/dist/core/memory/redaction.js +49 -0
- package/dist/core/memory/redaction.js.map +1 -0
- package/dist/core/memory/sqlite-memory-store.d.ts +30 -0
- package/dist/core/memory/sqlite-memory-store.d.ts.map +1 -0
- package/dist/core/memory/sqlite-memory-store.js +300 -0
- package/dist/core/memory/sqlite-memory-store.js.map +1 -0
- package/dist/core/memory/startup-order.d.ts +9 -0
- package/dist/core/memory/startup-order.d.ts.map +1 -0
- package/dist/core/memory/startup-order.js +39 -0
- package/dist/core/memory/startup-order.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 +727 -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 +494 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/output-guard.d.ts +6 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +59 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +198 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +1961 -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 +250 -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 +32 -0
- package/dist/core/provider-display-names.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +23 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +126 -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 +731 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/sdk.d.ts +107 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +282 -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 +333 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1109 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-manager.d.ts +295 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +842 -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 +404 -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 +32 -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 +335 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +85 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +338 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +49 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +324 -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 +37 -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 +298 -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 +169 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +50 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +178 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +8 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +81 -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 +288 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +21 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +49 -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 +205 -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 +213 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -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 +583 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +31 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +279 -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 +122 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +36 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +182 -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 +481 -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 +26 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +58 -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 +111 -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 +24 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +78 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/flexible-viewport-spacer.d.ts +10 -0
- package/dist/modes/interactive/components/flexible-viewport-spacer.d.ts.map +1 -0
- package/dist/modes/interactive/components/flexible-viewport-spacer.js +20 -0
- package/dist/modes/interactive/components/flexible-viewport-spacer.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +27 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +272 -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 +8 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +22 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +46 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +160 -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 +271 -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 +73 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +531 -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/split-info-card.d.ts +18 -0
- package/dist/modes/interactive/components/split-info-card.d.ts.map +1 -0
- package/dist/modes/interactive/components/split-info-card.js +82 -0
- package/dist/modes/interactive/components/split-info-card.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 +66 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +313 -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 +1092 -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 +369 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +4899 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +85 -0
- package/dist/modes/interactive/theme/light.json +84 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +81 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +971 -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 +131 -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 +224 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +410 -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 +601 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +419 -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 +460 -0
- package/dist/package-manager-cli.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 +12 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +86 -0
- package/dist/utils/child-process.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 +8 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +14 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard-text.d.ts +4 -0
- package/dist/utils/clipboard-text.d.ts.map +1 -0
- package/dist/utils/clipboard-text.js +37 -0
- package/dist/utils/clipboard-text.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/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/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.d.ts +36 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +137 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/mime.d.ts +2 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +26 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/paths.d.ts +14 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +34 -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 +190 -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/threadwell-user-agent.d.ts +2 -0
- package/dist/utils/threadwell-user-agent.d.ts.map +1 -0
- package/dist/utils/threadwell-user-agent.js +5 -0
- package/dist/utils/threadwell-user-agent.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 +256 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +14 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +77 -0
- package/dist/utils/version-check.js.map +1 -0
- package/docs/compaction.md +394 -0
- package/docs/custom-provider.md +646 -0
- package/docs/development.md +71 -0
- package/docs/docs.json +148 -0
- package/docs/extensions.md +2596 -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 +64 -0
- package/docs/json.md +82 -0
- package/docs/keybindings.md +197 -0
- package/docs/memory.md +484 -0
- package/docs/models.md +474 -0
- package/docs/packages.md +223 -0
- package/docs/prompt-templates.md +88 -0
- package/docs/providers.md +241 -0
- package/docs/quickstart.md +142 -0
- package/docs/rpc.md +1407 -0
- package/docs/sdk.md +1149 -0
- package/docs/session-format.md +412 -0
- package/docs/sessions.md +137 -0
- package/docs/settings.md +378 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +232 -0
- package/docs/terminal-setup.md +106 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tmux.md +61 -0
- package/docs/tui.md +918 -0
- package/docs/usage.md +277 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +208 -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 +147 -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 +349 -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 +46 -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/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.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 +1348 -0
- package/examples/extensions/overlay-test.ts +150 -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 +436 -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 +172 -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 +987 -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 +141 -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 +22 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +62 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +44 -0
- package/examples/sdk/06-extensions.ts +90 -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 +48 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +48 -0
- package/examples/sdk/12-full-control.ts +73 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +147 -0
- package/package.json +101 -33
- package/LICENSE +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-check.d.ts","sourceRoot":"","sources":["../../src/utils/version-check.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,uBAAuB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAsBD,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAcpG;AAED,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAM/F;AAED,wBAAsB,0BAA0B,CAC/C,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAmB9C;AAED,wBAAsB,0BAA0B,CAC/C,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;AAED,wBAAsB,4BAA4B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAUtG","sourcesContent":["import { getThreadwellUserAgent } from \"./threadwell-user-agent.js\";\n\nconst LATEST_VERSION_URL = \"https://threadwell.local/api/latest-version\";\nconst DEFAULT_VERSION_CHECK_TIMEOUT_MS = 10000;\n\nexport interface LatestThreadwellRelease {\n\tversion: string;\n\tpackageName?: string;\n}\n\ninterface ParsedVersion {\n\tmajor: number;\n\tminor: number;\n\tpatch: number;\n\tprerelease?: string;\n}\n\nfunction parsePackageVersion(version: string): ParsedVersion | undefined {\n\tconst match = version.trim().match(/^v?(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?(?:\\+.*)?$/);\n\tif (!match) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\tmajor: Number.parseInt(match[1], 10),\n\t\tminor: Number.parseInt(match[2], 10),\n\t\tpatch: Number.parseInt(match[3], 10),\n\t\tprerelease: match[4],\n\t};\n}\n\nexport function comparePackageVersions(leftVersion: string, rightVersion: string): number | undefined {\n\tconst left = parsePackageVersion(leftVersion);\n\tconst right = parsePackageVersion(rightVersion);\n\tif (!left || !right) {\n\t\treturn undefined;\n\t}\n\n\tif (left.major !== right.major) return left.major - right.major;\n\tif (left.minor !== right.minor) return left.minor - right.minor;\n\tif (left.patch !== right.patch) return left.patch - right.patch;\n\tif (left.prerelease === right.prerelease) return 0;\n\tif (!left.prerelease) return 1;\n\tif (!right.prerelease) return -1;\n\treturn left.prerelease.localeCompare(right.prerelease);\n}\n\nexport function isNewerPackageVersion(candidateVersion: string, currentVersion: string): boolean {\n\tconst comparison = comparePackageVersions(candidateVersion, currentVersion);\n\tif (comparison !== undefined) {\n\t\treturn comparison > 0;\n\t}\n\treturn candidateVersion.trim() !== currentVersion.trim();\n}\n\nexport async function getLatestThreadwellRelease(\n\tcurrentVersion: string,\n\toptions: { timeoutMs?: number } = {},\n): Promise<LatestThreadwellRelease | undefined> {\n\tif (process.env.THREADWELL_SKIP_VERSION_CHECK || process.env.THREADWELL_OFFLINE) return undefined;\n\n\tconst response = await fetch(LATEST_VERSION_URL, {\n\t\theaders: {\n\t\t\t\"User-Agent\": getThreadwellUserAgent(currentVersion),\n\t\t\taccept: \"application/json\",\n\t\t},\n\t\tsignal: AbortSignal.timeout(options.timeoutMs ?? DEFAULT_VERSION_CHECK_TIMEOUT_MS),\n\t});\n\tif (!response.ok) return undefined;\n\n\tconst data = (await response.json()) as { packageName?: unknown; version?: unknown };\n\tif (typeof data.version !== \"string\" || !data.version.trim()) {\n\t\treturn undefined;\n\t}\n\tconst packageName =\n\t\ttypeof data.packageName === \"string\" && data.packageName.trim() ? data.packageName.trim() : undefined;\n\treturn { version: data.version.trim(), packageName };\n}\n\nexport async function getLatestThreadwellVersion(\n\tcurrentVersion: string,\n\toptions: { timeoutMs?: number } = {},\n): Promise<string | undefined> {\n\treturn (await getLatestThreadwellRelease(currentVersion, options))?.version;\n}\n\nexport async function checkForNewThreadwellVersion(currentVersion: string): Promise<string | undefined> {\n\ttry {\n\t\tconst latestVersion = await getLatestThreadwellVersion(currentVersion);\n\t\tif (latestVersion && isNewerPackageVersion(latestVersion, currentVersion)) {\n\t\t\treturn latestVersion;\n\t\t}\n\t\treturn undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { getThreadwellUserAgent } from "./threadwell-user-agent.js";
|
|
2
|
+
const LATEST_VERSION_URL = "https://threadwell.local/api/latest-version";
|
|
3
|
+
const DEFAULT_VERSION_CHECK_TIMEOUT_MS = 10000;
|
|
4
|
+
function parsePackageVersion(version) {
|
|
5
|
+
const match = version.trim().match(/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+.*)?$/);
|
|
6
|
+
if (!match) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
major: Number.parseInt(match[1], 10),
|
|
11
|
+
minor: Number.parseInt(match[2], 10),
|
|
12
|
+
patch: Number.parseInt(match[3], 10),
|
|
13
|
+
prerelease: match[4],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function comparePackageVersions(leftVersion, rightVersion) {
|
|
17
|
+
const left = parsePackageVersion(leftVersion);
|
|
18
|
+
const right = parsePackageVersion(rightVersion);
|
|
19
|
+
if (!left || !right) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
if (left.major !== right.major)
|
|
23
|
+
return left.major - right.major;
|
|
24
|
+
if (left.minor !== right.minor)
|
|
25
|
+
return left.minor - right.minor;
|
|
26
|
+
if (left.patch !== right.patch)
|
|
27
|
+
return left.patch - right.patch;
|
|
28
|
+
if (left.prerelease === right.prerelease)
|
|
29
|
+
return 0;
|
|
30
|
+
if (!left.prerelease)
|
|
31
|
+
return 1;
|
|
32
|
+
if (!right.prerelease)
|
|
33
|
+
return -1;
|
|
34
|
+
return left.prerelease.localeCompare(right.prerelease);
|
|
35
|
+
}
|
|
36
|
+
export function isNewerPackageVersion(candidateVersion, currentVersion) {
|
|
37
|
+
const comparison = comparePackageVersions(candidateVersion, currentVersion);
|
|
38
|
+
if (comparison !== undefined) {
|
|
39
|
+
return comparison > 0;
|
|
40
|
+
}
|
|
41
|
+
return candidateVersion.trim() !== currentVersion.trim();
|
|
42
|
+
}
|
|
43
|
+
export async function getLatestThreadwellRelease(currentVersion, options = {}) {
|
|
44
|
+
if (process.env.THREADWELL_SKIP_VERSION_CHECK || process.env.THREADWELL_OFFLINE)
|
|
45
|
+
return undefined;
|
|
46
|
+
const response = await fetch(LATEST_VERSION_URL, {
|
|
47
|
+
headers: {
|
|
48
|
+
"User-Agent": getThreadwellUserAgent(currentVersion),
|
|
49
|
+
accept: "application/json",
|
|
50
|
+
},
|
|
51
|
+
signal: AbortSignal.timeout(options.timeoutMs ?? DEFAULT_VERSION_CHECK_TIMEOUT_MS),
|
|
52
|
+
});
|
|
53
|
+
if (!response.ok)
|
|
54
|
+
return undefined;
|
|
55
|
+
const data = (await response.json());
|
|
56
|
+
if (typeof data.version !== "string" || !data.version.trim()) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
const packageName = typeof data.packageName === "string" && data.packageName.trim() ? data.packageName.trim() : undefined;
|
|
60
|
+
return { version: data.version.trim(), packageName };
|
|
61
|
+
}
|
|
62
|
+
export async function getLatestThreadwellVersion(currentVersion, options = {}) {
|
|
63
|
+
return (await getLatestThreadwellRelease(currentVersion, options))?.version;
|
|
64
|
+
}
|
|
65
|
+
export async function checkForNewThreadwellVersion(currentVersion) {
|
|
66
|
+
try {
|
|
67
|
+
const latestVersion = await getLatestThreadwellVersion(currentVersion);
|
|
68
|
+
if (latestVersion && isNewerPackageVersion(latestVersion, currentVersion)) {
|
|
69
|
+
return latestVersion;
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=version-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-check.js","sourceRoot":"","sources":["../../src/utils/version-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,MAAM,kBAAkB,GAAG,6CAA6C,CAAC;AACzE,MAAM,gCAAgC,GAAG,KAAK,CAAC;AAc/C,SAAS,mBAAmB,CAAC,OAAe,EAA6B;IACxE,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC7F,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO;QACN,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACpC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACpC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACpC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;KACpB,CAAC;AAAA,CACF;AAED,MAAM,UAAU,sBAAsB,CAAC,WAAmB,EAAE,YAAoB,EAAsB;IACrG,MAAM,IAAI,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAChD,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAChE,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAChE,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAChE,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU;QAAE,OAAO,CAAC,CAAC;IACnD,IAAI,CAAC,IAAI,CAAC,UAAU;QAAE,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,CAAC,UAAU;QAAE,OAAO,CAAC,CAAC,CAAC;IACjC,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAAA,CACvD;AAED,MAAM,UAAU,qBAAqB,CAAC,gBAAwB,EAAE,cAAsB,EAAW;IAChG,MAAM,UAAU,GAAG,sBAAsB,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAC5E,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,UAAU,GAAG,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,gBAAgB,CAAC,IAAI,EAAE,KAAK,cAAc,CAAC,IAAI,EAAE,CAAC;AAAA,CACzD;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC/C,cAAsB,EACtB,OAAO,GAA2B,EAAE,EACW;IAC/C,IAAI,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB;QAAE,OAAO,SAAS,CAAC;IAElG,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,kBAAkB,EAAE;QAChD,OAAO,EAAE;YACR,YAAY,EAAE,sBAAsB,CAAC,cAAc,CAAC;YACpD,MAAM,EAAE,kBAAkB;SAC1B;QACD,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,gCAAgC,CAAC;KAClF,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,SAAS,CAAC;IAEnC,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAiD,CAAC;IACrF,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QAC9D,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,WAAW,GAChB,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC;AAAA,CACrD;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC/C,cAAsB,EACtB,OAAO,GAA2B,EAAE,EACN;IAC9B,OAAO,CAAC,MAAM,0BAA0B,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC;AAAA,CAC5E;AAED,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,cAAsB,EAA+B;IACvG,IAAI,CAAC;QACJ,MAAM,aAAa,GAAG,MAAM,0BAA0B,CAAC,cAAc,CAAC,CAAC;QACvE,IAAI,aAAa,IAAI,qBAAqB,CAAC,aAAa,EAAE,cAAc,CAAC,EAAE,CAAC;YAC3E,OAAO,aAAa,CAAC;QACtB,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AAAA,CACD","sourcesContent":["import { getThreadwellUserAgent } from \"./threadwell-user-agent.js\";\n\nconst LATEST_VERSION_URL = \"https://threadwell.local/api/latest-version\";\nconst DEFAULT_VERSION_CHECK_TIMEOUT_MS = 10000;\n\nexport interface LatestThreadwellRelease {\n\tversion: string;\n\tpackageName?: string;\n}\n\ninterface ParsedVersion {\n\tmajor: number;\n\tminor: number;\n\tpatch: number;\n\tprerelease?: string;\n}\n\nfunction parsePackageVersion(version: string): ParsedVersion | undefined {\n\tconst match = version.trim().match(/^v?(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?(?:\\+.*)?$/);\n\tif (!match) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\tmajor: Number.parseInt(match[1], 10),\n\t\tminor: Number.parseInt(match[2], 10),\n\t\tpatch: Number.parseInt(match[3], 10),\n\t\tprerelease: match[4],\n\t};\n}\n\nexport function comparePackageVersions(leftVersion: string, rightVersion: string): number | undefined {\n\tconst left = parsePackageVersion(leftVersion);\n\tconst right = parsePackageVersion(rightVersion);\n\tif (!left || !right) {\n\t\treturn undefined;\n\t}\n\n\tif (left.major !== right.major) return left.major - right.major;\n\tif (left.minor !== right.minor) return left.minor - right.minor;\n\tif (left.patch !== right.patch) return left.patch - right.patch;\n\tif (left.prerelease === right.prerelease) return 0;\n\tif (!left.prerelease) return 1;\n\tif (!right.prerelease) return -1;\n\treturn left.prerelease.localeCompare(right.prerelease);\n}\n\nexport function isNewerPackageVersion(candidateVersion: string, currentVersion: string): boolean {\n\tconst comparison = comparePackageVersions(candidateVersion, currentVersion);\n\tif (comparison !== undefined) {\n\t\treturn comparison > 0;\n\t}\n\treturn candidateVersion.trim() !== currentVersion.trim();\n}\n\nexport async function getLatestThreadwellRelease(\n\tcurrentVersion: string,\n\toptions: { timeoutMs?: number } = {},\n): Promise<LatestThreadwellRelease | undefined> {\n\tif (process.env.THREADWELL_SKIP_VERSION_CHECK || process.env.THREADWELL_OFFLINE) return undefined;\n\n\tconst response = await fetch(LATEST_VERSION_URL, {\n\t\theaders: {\n\t\t\t\"User-Agent\": getThreadwellUserAgent(currentVersion),\n\t\t\taccept: \"application/json\",\n\t\t},\n\t\tsignal: AbortSignal.timeout(options.timeoutMs ?? DEFAULT_VERSION_CHECK_TIMEOUT_MS),\n\t});\n\tif (!response.ok) return undefined;\n\n\tconst data = (await response.json()) as { packageName?: unknown; version?: unknown };\n\tif (typeof data.version !== \"string\" || !data.version.trim()) {\n\t\treturn undefined;\n\t}\n\tconst packageName =\n\t\ttypeof data.packageName === \"string\" && data.packageName.trim() ? data.packageName.trim() : undefined;\n\treturn { version: data.version.trim(), packageName };\n}\n\nexport async function getLatestThreadwellVersion(\n\tcurrentVersion: string,\n\toptions: { timeoutMs?: number } = {},\n): Promise<string | undefined> {\n\treturn (await getLatestThreadwellRelease(currentVersion, options))?.version;\n}\n\nexport async function checkForNewThreadwellVersion(currentVersion: string): Promise<string | undefined> {\n\ttry {\n\t\tconst latestVersion = await getLatestThreadwellVersion(currentVersion);\n\t\tif (latestVersion && isNewerPackageVersion(latestVersion, currentVersion)) {\n\t\t\treturn latestVersion;\n\t\t}\n\t\treturn undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
# Compaction & Branch Summarization
|
|
2
|
+
|
|
3
|
+
LLMs have limited context windows. When conversations grow too long, Threadwell uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
|
|
4
|
+
|
|
5
|
+
**Source files** ([threadwell](local Threadwell source)):
|
|
6
|
+
- [`packages/coding-agent/src/core/compaction/compaction.ts`](local Threadwell source/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
|
|
7
|
+
- [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](local Threadwell source/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
|
|
8
|
+
- [`packages/coding-agent/src/core/compaction/utils.ts`](local Threadwell source/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
|
|
9
|
+
- [`packages/coding-agent/src/core/session-manager.ts`](local Threadwell source/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
|
|
10
|
+
- [`packages/coding-agent/src/core/extensions/types.ts`](local Threadwell source/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
|
|
11
|
+
|
|
12
|
+
For TypeScript definitions in your project, inspect `node_modules/threadwell/dist/`.
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
Threadwell has two summarization mechanisms:
|
|
17
|
+
|
|
18
|
+
| Mechanism | Trigger | Purpose |
|
|
19
|
+
|-----------|---------|---------|
|
|
20
|
+
| Compaction | Context exceeds threshold, or `/compact` | Summarize old messages to free up context |
|
|
21
|
+
| Branch summarization | `/tree` navigation | Preserve context when switching branches |
|
|
22
|
+
|
|
23
|
+
Both use the same structured summary format and track file operations cumulatively.
|
|
24
|
+
|
|
25
|
+
## Compaction
|
|
26
|
+
|
|
27
|
+
### When It Triggers
|
|
28
|
+
|
|
29
|
+
Auto-compaction triggers when:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
contextTokens > contextWindow - reserveTokens
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
By default, `reserveTokens` is 16384 tokens (configurable in `~/.threadwell/agent/settings.json` or `<project-dir>/.threadwell/settings.json`). This leaves room for the LLM's response.
|
|
36
|
+
|
|
37
|
+
You can also trigger manually with `/compact [instructions]`, where optional instructions focus the summary.
|
|
38
|
+
|
|
39
|
+
### How It Works
|
|
40
|
+
|
|
41
|
+
1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.threadwell/agent/settings.json` or `<project-dir>/.threadwell/settings.json`) is reached
|
|
42
|
+
2. **Extract messages**: Collect messages from the previous kept boundary (or session start) up to the cut point
|
|
43
|
+
3. **Generate summary**: Call LLM to summarize with structured format, passing the previous summary as iterative context when present
|
|
44
|
+
4. **Append entry**: Save `CompactionEntry` with summary and `firstKeptEntryId`
|
|
45
|
+
5. **Reload**: Session reloads, using summary + messages from `firstKeptEntryId` onwards
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Before compaction:
|
|
49
|
+
|
|
50
|
+
entry: 0 1 2 3 4 5 6 7 8 9
|
|
51
|
+
┌─────┬─────┬─────┬─────┬──────┬─────┬─────┬──────┬──────┬─────┐
|
|
52
|
+
│ hdr │ usr │ ass │ tool │ usr │ ass │ tool │ tool │ ass │ tool│
|
|
53
|
+
└─────┴─────┴─────┴──────┴─────┴─────┴──────┴──────┴─────┴─────┘
|
|
54
|
+
└────────┬───────┘ └──────────────┬──────────────┘
|
|
55
|
+
messagesToSummarize kept messages
|
|
56
|
+
↑
|
|
57
|
+
firstKeptEntryId (entry 4)
|
|
58
|
+
|
|
59
|
+
After compaction (new entry appended):
|
|
60
|
+
|
|
61
|
+
entry: 0 1 2 3 4 5 6 7 8 9 10
|
|
62
|
+
┌─────┬─────┬─────┬─────┬──────┬─────┬─────┬──────┬──────┬─────┬─────┐
|
|
63
|
+
│ hdr │ usr │ ass │ tool │ usr │ ass │ tool │ tool │ ass │ tool│ cmp │
|
|
64
|
+
└─────┴─────┴─────┴──────┴─────┴─────┴──────┴──────┴─────┴─────┴─────┘
|
|
65
|
+
└──────────┬──────┘ └──────────────────────┬───────────────────┘
|
|
66
|
+
not sent to LLM sent to LLM
|
|
67
|
+
↑
|
|
68
|
+
starts from firstKeptEntryId
|
|
69
|
+
|
|
70
|
+
What the LLM sees:
|
|
71
|
+
|
|
72
|
+
┌────────┬─────────┬─────┬─────┬──────┬──────┬─────┬──────┐
|
|
73
|
+
│ system │ summary │ usr │ ass │ tool │ tool │ ass │ tool │
|
|
74
|
+
└────────┴─────────┴─────┴─────┴──────┴──────┴─────┴──────┘
|
|
75
|
+
↑ ↑ └─────────────────┬────────────────┘
|
|
76
|
+
prompt from cmp messages from firstKeptEntryId
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
On repeated compactions, the summarized span starts at the previous compaction's kept boundary (`firstKeptEntryId`), not at the compaction entry itself, falling back to the entry after the previous compaction if that kept entry cannot be found in the path. This preserves messages that survived the earlier compaction by including them in the next summarization pass as well. Threadwell also recalculates `tokensBefore` from the rebuilt session context before writing the new `CompactionEntry`, so the token count reflects the actual pre-compaction context being replaced.
|
|
80
|
+
|
|
81
|
+
### Split Turns
|
|
82
|
+
|
|
83
|
+
A "turn" starts with a user message and includes all assistant responses and tool calls until the next user message. Normally, compaction cuts at turn boundaries.
|
|
84
|
+
|
|
85
|
+
When a single turn exceeds `keepRecentTokens`, the cut point lands mid-turn at an assistant message. This is a "split turn":
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
Split turn (one huge turn exceeds budget):
|
|
89
|
+
|
|
90
|
+
entry: 0 1 2 3 4 5 6 7 8
|
|
91
|
+
┌─────┬─────┬─────┬──────┬─────┬──────┬──────┬─────┬──────┐
|
|
92
|
+
│ hdr │ usr │ ass │ tool │ ass │ tool │ tool │ ass │ tool │
|
|
93
|
+
└─────┴─────┴─────┴──────┴─────┴──────┴──────┴─────┴──────┘
|
|
94
|
+
↑ ↑
|
|
95
|
+
turnStartIndex = 1 firstKeptEntryId = 7
|
|
96
|
+
│ │
|
|
97
|
+
└──── turnPrefixMessages (1-6) ───────┘
|
|
98
|
+
└── kept (7-8)
|
|
99
|
+
|
|
100
|
+
isSplitTurn = true
|
|
101
|
+
messagesToSummarize = [] (no complete turns before)
|
|
102
|
+
turnPrefixMessages = [usr, ass, tool, ass, tool, tool]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
For split turns, Threadwell generates two summaries and merges them:
|
|
106
|
+
1. **History summary**: Previous context (if any)
|
|
107
|
+
2. **Turn prefix summary**: The early part of the split turn
|
|
108
|
+
|
|
109
|
+
### Cut Point Rules
|
|
110
|
+
|
|
111
|
+
Valid cut points are:
|
|
112
|
+
- User messages
|
|
113
|
+
- Assistant messages
|
|
114
|
+
- BashExecution messages
|
|
115
|
+
- Custom messages (custom_message, branch_summary)
|
|
116
|
+
|
|
117
|
+
Never cut at tool results (they must stay with their tool call).
|
|
118
|
+
|
|
119
|
+
### CompactionEntry Structure
|
|
120
|
+
|
|
121
|
+
Defined in [`session-manager.ts`](local Threadwell source/blob/main/packages/coding-agent/src/core/session-manager.ts):
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
interface CompactionEntry<T = unknown> {
|
|
125
|
+
type: "compaction";
|
|
126
|
+
id: string;
|
|
127
|
+
parentId: string;
|
|
128
|
+
timestamp: number;
|
|
129
|
+
summary: string;
|
|
130
|
+
firstKeptEntryId: string;
|
|
131
|
+
tokensBefore: number;
|
|
132
|
+
fromHook?: boolean; // true if provided by extension (legacy field name)
|
|
133
|
+
details?: T; // implementation-specific data
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Default compaction uses this for details (from compaction.ts):
|
|
137
|
+
interface CompactionDetails {
|
|
138
|
+
readFiles: string[];
|
|
139
|
+
modifiedFiles: string[];
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Extensions can store any JSON-serializable data in `details`. The default compaction tracks file operations, but custom extension implementations can use their own structure.
|
|
144
|
+
|
|
145
|
+
See [`prepareCompaction()`](local Threadwell source/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](local Threadwell source/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation.
|
|
146
|
+
|
|
147
|
+
## Branch Summarization
|
|
148
|
+
|
|
149
|
+
### When It Triggers
|
|
150
|
+
|
|
151
|
+
When you use `/tree` to navigate to a different branch, Threadwell offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
|
|
152
|
+
|
|
153
|
+
### How It Works
|
|
154
|
+
|
|
155
|
+
1. **Find common ancestor**: Deepest node shared by old and new positions
|
|
156
|
+
2. **Collect entries**: Walk from old leaf back to common ancestor
|
|
157
|
+
3. **Prepare with budget**: Include messages up to token budget (newest first)
|
|
158
|
+
4. **Generate summary**: Call LLM with structured format
|
|
159
|
+
5. **Append entry**: Save `BranchSummaryEntry` at navigation point
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Tree before navigation:
|
|
163
|
+
|
|
164
|
+
┌─ B ─ C ─ D (old leaf, being abandoned)
|
|
165
|
+
A ───┤
|
|
166
|
+
└─ E ─ F (target)
|
|
167
|
+
|
|
168
|
+
Common ancestor: A
|
|
169
|
+
Entries to summarize: B, C, D
|
|
170
|
+
|
|
171
|
+
After navigation with summary:
|
|
172
|
+
|
|
173
|
+
┌─ B ─ C ─ D ─ [summary of B,C,D]
|
|
174
|
+
A ───┤
|
|
175
|
+
└─ E ─ F (new leaf)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Cumulative File Tracking
|
|
179
|
+
|
|
180
|
+
Both compaction and branch summarization track files cumulatively. When generating a summary, Threadwell extracts file operations from:
|
|
181
|
+
- Tool calls in the messages being summarized
|
|
182
|
+
- Previous compaction or branch summary `details` (if any)
|
|
183
|
+
|
|
184
|
+
This means file tracking accumulates across multiple compactions or nested branch summaries, preserving the full history of read and modified files.
|
|
185
|
+
|
|
186
|
+
### BranchSummaryEntry Structure
|
|
187
|
+
|
|
188
|
+
Defined in [`session-manager.ts`](local Threadwell source/blob/main/packages/coding-agent/src/core/session-manager.ts):
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
interface BranchSummaryEntry<T = unknown> {
|
|
192
|
+
type: "branch_summary";
|
|
193
|
+
id: string;
|
|
194
|
+
parentId: string;
|
|
195
|
+
timestamp: number;
|
|
196
|
+
summary: string;
|
|
197
|
+
fromId: string; // Entry we navigated from
|
|
198
|
+
fromHook?: boolean; // true if provided by extension (legacy field name)
|
|
199
|
+
details?: T; // implementation-specific data
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Default branch summarization uses this for details (from branch-summarization.ts):
|
|
203
|
+
interface BranchSummaryDetails {
|
|
204
|
+
readFiles: string[];
|
|
205
|
+
modifiedFiles: string[];
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Same as compaction, extensions can store custom data in `details`.
|
|
210
|
+
|
|
211
|
+
See [`collectEntriesForBranchSummary()`](local Threadwell source/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](local Threadwell source/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](local Threadwell source/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
|
|
212
|
+
|
|
213
|
+
## Summary Format
|
|
214
|
+
|
|
215
|
+
Both compaction and branch summarization use the same structured format:
|
|
216
|
+
|
|
217
|
+
```markdown
|
|
218
|
+
## Goal
|
|
219
|
+
[What the user is trying to accomplish]
|
|
220
|
+
|
|
221
|
+
## Constraints & Preferences
|
|
222
|
+
- [Requirements mentioned by user]
|
|
223
|
+
|
|
224
|
+
## Progress
|
|
225
|
+
### Done
|
|
226
|
+
- [x] [Completed tasks]
|
|
227
|
+
|
|
228
|
+
### In Progress
|
|
229
|
+
- [ ] [Current work]
|
|
230
|
+
|
|
231
|
+
### Blocked
|
|
232
|
+
- [Issues, if any]
|
|
233
|
+
|
|
234
|
+
## Key Decisions
|
|
235
|
+
- **[Decision]**: [Rationale]
|
|
236
|
+
|
|
237
|
+
## Next Steps
|
|
238
|
+
1. [What should happen next]
|
|
239
|
+
|
|
240
|
+
## Critical Context
|
|
241
|
+
- [Data needed to continue]
|
|
242
|
+
|
|
243
|
+
<read-files>
|
|
244
|
+
path/to/file1.ts
|
|
245
|
+
path/to/file2.ts
|
|
246
|
+
</read-files>
|
|
247
|
+
|
|
248
|
+
<modified-files>
|
|
249
|
+
path/to/changed.ts
|
|
250
|
+
</modified-files>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Message Serialization
|
|
254
|
+
|
|
255
|
+
Before summarization, messages are serialized to text via [`serializeConversation()`](local Threadwell source/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
[User]: What they said
|
|
259
|
+
[Assistant thinking]: Internal reasoning
|
|
260
|
+
[Assistant]: Response text
|
|
261
|
+
[Assistant tool calls]: read(path="foo.ts"); edit(path="bar.ts", ...)
|
|
262
|
+
[Tool result]: Output from tool
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
This prevents the model from treating it as a conversation to continue.
|
|
266
|
+
|
|
267
|
+
Tool results are truncated to 2000 characters during serialization. Content beyond that limit is replaced with a marker indicating how many characters were truncated. This keeps summarization requests within reasonable token budgets, since tool results (especially from `read` and `bash`) are typically the largest contributors to context size.
|
|
268
|
+
|
|
269
|
+
## Custom Summarization via Extensions
|
|
270
|
+
|
|
271
|
+
Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](local Threadwell source/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
|
|
272
|
+
|
|
273
|
+
### session_before_compact
|
|
274
|
+
|
|
275
|
+
Fired before auto-compaction or `/compact`. Can cancel or provide custom summary. See `SessionBeforeCompactEvent` and `CompactionPreparation` in the types file.
|
|
276
|
+
|
|
277
|
+
```typescript
|
|
278
|
+
threadwell.on("session_before_compact", async (event, ctx) => {
|
|
279
|
+
const { preparation, branchEntries, customInstructions, signal } = event;
|
|
280
|
+
|
|
281
|
+
// preparation.messagesToSummarize - messages to summarize
|
|
282
|
+
// preparation.turnPrefixMessages - split turn prefix (if isSplitTurn)
|
|
283
|
+
// preparation.previousSummary - previous compaction summary
|
|
284
|
+
// preparation.fileOps - extracted file operations
|
|
285
|
+
// preparation.tokensBefore - context tokens before compaction
|
|
286
|
+
// preparation.firstKeptEntryId - where kept messages start
|
|
287
|
+
// preparation.settings - compaction settings
|
|
288
|
+
|
|
289
|
+
// branchEntries - all entries on current branch (for custom state)
|
|
290
|
+
// signal - AbortSignal (pass to LLM calls)
|
|
291
|
+
|
|
292
|
+
// Cancel:
|
|
293
|
+
return { cancel: true };
|
|
294
|
+
|
|
295
|
+
// Custom summary:
|
|
296
|
+
return {
|
|
297
|
+
compaction: {
|
|
298
|
+
summary: "Your summary...",
|
|
299
|
+
firstKeptEntryId: preparation.firstKeptEntryId,
|
|
300
|
+
tokensBefore: preparation.tokensBefore,
|
|
301
|
+
details: { /* custom data */ },
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
});
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
#### Converting Messages to Text
|
|
308
|
+
|
|
309
|
+
To generate a summary with your own model, convert messages to text using `serializeConversation`:
|
|
310
|
+
|
|
311
|
+
```typescript
|
|
312
|
+
import { convertToLlm, serializeConversation } from "threadwell";
|
|
313
|
+
|
|
314
|
+
threadwell.on("session_before_compact", async (event, ctx) => {
|
|
315
|
+
const { preparation } = event;
|
|
316
|
+
|
|
317
|
+
// Convert AgentMessage[] to Message[], then serialize to text
|
|
318
|
+
const conversationText = serializeConversation(
|
|
319
|
+
convertToLlm(preparation.messagesToSummarize)
|
|
320
|
+
);
|
|
321
|
+
// Returns:
|
|
322
|
+
// [User]: message text
|
|
323
|
+
// [Assistant thinking]: thinking content
|
|
324
|
+
// [Assistant]: response text
|
|
325
|
+
// [Assistant tool calls]: read(path="..."); bash(command="...")
|
|
326
|
+
// [Tool result]: output text
|
|
327
|
+
|
|
328
|
+
// Now send to your model for summarization
|
|
329
|
+
const summary = await myModel.summarize(conversationText);
|
|
330
|
+
|
|
331
|
+
return {
|
|
332
|
+
compaction: {
|
|
333
|
+
summary,
|
|
334
|
+
firstKeptEntryId: preparation.firstKeptEntryId,
|
|
335
|
+
tokensBefore: preparation.tokensBefore,
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
});
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
See [custom-compaction.ts](../examples/extensions/custom-compaction.ts) for a complete example using a different model.
|
|
342
|
+
|
|
343
|
+
### session_before_tree
|
|
344
|
+
|
|
345
|
+
Fired before `/tree` navigation. Always fires regardless of whether user chose to summarize. Can cancel navigation or provide custom summary.
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
threadwell.on("session_before_tree", async (event, ctx) => {
|
|
349
|
+
const { preparation, signal } = event;
|
|
350
|
+
|
|
351
|
+
// preparation.targetId - where we're navigating to
|
|
352
|
+
// preparation.oldLeafId - current position (being abandoned)
|
|
353
|
+
// preparation.commonAncestorId - shared ancestor
|
|
354
|
+
// preparation.entriesToSummarize - entries that would be summarized
|
|
355
|
+
// preparation.userWantsSummary - whether user chose to summarize
|
|
356
|
+
|
|
357
|
+
// Cancel navigation entirely:
|
|
358
|
+
return { cancel: true };
|
|
359
|
+
|
|
360
|
+
// Provide custom summary (only used if userWantsSummary is true):
|
|
361
|
+
if (preparation.userWantsSummary) {
|
|
362
|
+
return {
|
|
363
|
+
summary: {
|
|
364
|
+
summary: "Your summary...",
|
|
365
|
+
details: { /* custom data */ },
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
See `SessionBeforeTreeEvent` and `TreePreparation` in the types file.
|
|
373
|
+
|
|
374
|
+
## Settings
|
|
375
|
+
|
|
376
|
+
Configure compaction in `~/.threadwell/agent/settings.json` or `<project-dir>/.threadwell/settings.json`:
|
|
377
|
+
|
|
378
|
+
```json
|
|
379
|
+
{
|
|
380
|
+
"compaction": {
|
|
381
|
+
"enabled": true,
|
|
382
|
+
"reserveTokens": 16384,
|
|
383
|
+
"keepRecentTokens": 20000
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
| Setting | Default | Description |
|
|
389
|
+
|---------|---------|-------------|
|
|
390
|
+
| `enabled` | `true` | Enable auto-compaction |
|
|
391
|
+
| `reserveTokens` | `16384` | Tokens to reserve for LLM response |
|
|
392
|
+
| `keepRecentTokens` | `20000` | Recent tokens to keep (not summarized) |
|
|
393
|
+
|
|
394
|
+
Disable auto-compaction with `"enabled": false`. You can still compact manually with `/compact`.
|