@draht/coding-agent 2026.7.30 → 2026.10.4-2
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 +606 -0
- package/README.md +46 -2
- package/agents/debugger.md +12 -1
- package/agents/git-committer.md +1 -0
- package/agents/implementer.md +20 -0
- package/agents/investigator.md +75 -0
- package/agents/reviewer.md +7 -0
- package/agents/spec-reviewer.md +66 -0
- package/agents/verifier.md +4 -3
- package/bin/draht-tools.cjs +472 -41
- package/dist/agents/debugger.md +12 -1
- package/dist/agents/git-committer.md +1 -0
- package/dist/agents/implementer.md +20 -0
- package/dist/agents/investigator.md +75 -0
- package/dist/agents/reviewer.md +7 -0
- package/dist/agents/spec-reviewer.md +66 -0
- package/dist/agents/verifier.md +4 -3
- package/dist/bun/cli.d.ts +1 -1
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/cli.js +6 -3
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/sandbox-env-setup.d.ts +2 -0
- package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
- package/dist/bun/sandbox-env-setup.js +4 -0
- package/dist/bun/sandbox-env-setup.js.map +1 -0
- package/dist/bundle/chunks/anthropic-messages-GAKYXF65.js +6 -0
- package/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/bundle/chunks/azure-openai-responses-ZIXMK6JO.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +79 -0
- package/dist/bundle/chunks/chunk-2E5VODES.js +2 -0
- package/dist/bundle/chunks/chunk-2FBJKY7F.js +2 -0
- package/dist/bundle/chunks/chunk-2N4I6WXC.js +2 -0
- package/dist/bundle/chunks/chunk-5VZWYVZB.js +82 -0
- package/dist/bundle/chunks/chunk-63BK6WK2.js +2 -0
- package/dist/bundle/chunks/chunk-6MSE6LZ3.js +6 -0
- package/dist/bundle/chunks/chunk-6ZJKIMU7.js +2 -0
- package/dist/bundle/chunks/chunk-736QBNUZ.js +12 -0
- package/dist/bundle/chunks/chunk-BXSHCX3G.js +11 -0
- package/dist/bundle/chunks/chunk-CEJJ5XF2.js +170 -0
- package/dist/bundle/chunks/chunk-COF5JT7R.js +4 -0
- package/dist/bundle/chunks/chunk-D6TMD5Q2.js +44 -0
- package/dist/bundle/chunks/chunk-DPE4ALPU.js +146 -0
- package/dist/bundle/chunks/chunk-EBVYI75P.js +2 -0
- package/dist/bundle/chunks/chunk-GVXA72ZA.js +2 -0
- package/dist/bundle/chunks/chunk-H6FT43VC.js +137 -0
- package/dist/bundle/chunks/chunk-HJ72RANT.js +2 -0
- package/dist/bundle/chunks/chunk-HTJ3L72O.js +2 -0
- package/dist/bundle/chunks/chunk-HZ2UHMBT.js +2 -0
- package/dist/bundle/chunks/chunk-I5OKY6RH.js +11 -0
- package/dist/bundle/chunks/chunk-IWTUBX6V.js +4 -0
- package/dist/bundle/chunks/chunk-KPO5375S.js +2 -0
- package/dist/bundle/chunks/chunk-KVH4HR57.js +31 -0
- package/dist/bundle/chunks/chunk-LDAOC5RB.js +18 -0
- package/dist/bundle/chunks/chunk-ON6XU6AG.js +2 -0
- package/dist/bundle/chunks/chunk-QMN7OD6G.js +2 -0
- package/dist/bundle/chunks/chunk-RZKPFWMH.js +42 -0
- package/dist/bundle/chunks/chunk-SDRCE6OP.js +2 -0
- package/dist/bundle/chunks/chunk-SVNWI7EV.js +8 -0
- package/dist/bundle/chunks/chunk-TIA2T6EO.js +3 -0
- package/dist/bundle/chunks/chunk-VOFPZOUQ.js +1472 -0
- package/dist/bundle/chunks/chunk-XBUEMKIY.js +2 -0
- package/dist/bundle/chunks/chunk-XOGEYN4Q.js +2 -0
- package/dist/bundle/chunks/chunk-ZZD35WKM.js +2 -0
- package/dist/bundle/chunks/cli-SR5QBZH4.js +51 -0
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-MJKOAE5S.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +315 -0
- package/dist/bundle/chunks/execute-VCYDHEYA.js +328 -0
- package/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/bundle/chunks/google-antigravity.js +75 -0
- package/dist/bundle/chunks/google-gemini-cli.js +75 -0
- package/dist/bundle/chunks/google-generative-ai-RPUPQ6PM.js +2 -0
- package/dist/bundle/chunks/google-vertex-EZES5QVQ.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-O2PVUIOI.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/bundle/chunks/jiti-loader-RKXLMQV2.js +2 -0
- package/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/bundle/chunks/lib-XOG5PI3Y.js +9 -0
- package/dist/bundle/chunks/llama-cpp-classify-EJ5XMSQL.js +22 -0
- package/dist/bundle/chunks/meta.js +2 -0
- package/dist/bundle/chunks/mistral-conversations-AOYGU43Y.js +5 -0
- package/dist/bundle/chunks/multipart-parser-AZP5BX2W.js +3 -0
- package/dist/bundle/chunks/node-C2JGH2OB.js +2 -0
- package/dist/bundle/chunks/node-LQ52KV6B.js +16 -0
- package/dist/bundle/chunks/openai-chatgpt.js +75 -0
- package/dist/bundle/chunks/openai-codex-responses-M2Y77JEQ.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/bundle/chunks/openai-completions-A4OKYOYV.js +7 -0
- package/dist/bundle/chunks/openai-responses-6IXV53T3.js +3 -0
- package/dist/bundle/chunks/opencode-go.js +2 -0
- package/dist/bundle/chunks/openrouter-images-LYV4NKFM.js +2 -0
- package/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/bundle/chunks/pi-messages-KKMEUT3Z.js +8 -0
- package/dist/bundle/chunks/radius.js +75 -0
- package/dist/bundle/chunks/runtime-6YJPGSP7.js +2 -0
- package/dist/bundle/chunks/settings-manager-D2EG7WDO.js +2 -0
- package/dist/bundle/chunks/src-TIBHS42X.js +4 -0
- package/dist/bundle/chunks/typesafe-system-one-YBEEY5XU.js +2 -0
- package/dist/bundle/chunks/virtual-modules-CBOAFAFT.js +2 -0
- package/dist/bundle/chunks/xai.js +75 -0
- package/dist/bundle/cli-runtime.js +3 -0
- package/dist/bundle/cli.js +5 -0
- package/dist/bundle/index.js +2 -0
- package/dist/bundle/rpc-entry.js +3 -0
- package/dist/cli/args.d.ts +14 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +140 -22
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/attach-mode.d.ts +61 -0
- package/dist/cli/attach-mode.d.ts.map +1 -1
- package/dist/cli/attach-mode.js +243 -5
- package/dist/cli/attach-mode.js.map +1 -1
- package/dist/cli/auth-check.d.ts +19 -0
- package/dist/cli/auth-check.d.ts.map +1 -0
- package/dist/cli/auth-check.js +50 -0
- package/dist/cli/auth-check.js.map +1 -0
- package/dist/cli/auth-command.d.ts +24 -0
- package/dist/cli/auth-command.d.ts.map +1 -0
- package/dist/cli/auth-command.js +103 -0
- package/dist/cli/auth-command.js.map +1 -0
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +3 -2
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/credential-print.d.ts +6 -4
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +47 -34
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/cli/file-processor.d.ts +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +2 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/list-models.d.ts +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +2 -2
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/session-picker.d.ts +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/setup.d.ts +2 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +12 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +2 -2
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +42 -33
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/cli.js +3 -12
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +29 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +73 -10
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +17 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +98 -32
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +2 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +15 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +266 -49
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +1503 -597
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +25 -9
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +245 -45
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bug-report-upload.d.ts +11 -0
- package/dist/core/bug-report-upload.d.ts.map +1 -0
- package/dist/core/bug-report-upload.js +20 -0
- package/dist/core/bug-report-upload.js.map +1 -0
- package/dist/core/bug-report.d.ts +176 -0
- package/dist/core/bug-report.d.ts.map +1 -0
- package/dist/core/bug-report.js +292 -0
- package/dist/core/bug-report.js.map +1 -0
- package/dist/core/builtins/checkpoints.d.ts +20 -0
- package/dist/core/builtins/checkpoints.d.ts.map +1 -0
- package/dist/core/builtins/checkpoints.js +161 -0
- package/dist/core/builtins/checkpoints.js.map +1 -0
- package/dist/core/builtins/duet.d.ts +26 -0
- package/dist/core/builtins/duet.d.ts.map +1 -0
- package/dist/core/builtins/duet.js +660 -0
- package/dist/core/builtins/duet.js.map +1 -0
- package/dist/core/builtins/index.d.ts.map +1 -1
- package/dist/core/builtins/index.js +7 -1
- package/dist/core/builtins/index.js.map +1 -1
- package/dist/core/builtins/subagent.d.ts +24 -4
- package/dist/core/builtins/subagent.d.ts.map +1 -1
- package/dist/core/builtins/subagent.js +278 -35
- package/dist/core/builtins/subagent.js.map +1 -1
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +12 -1
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +103 -0
- package/dist/core/cache-warmer.d.ts.map +1 -0
- package/dist/core/cache-warmer.js +356 -0
- package/dist/core/cache-warmer.js.map +1 -0
- package/dist/core/checkpoints/checkpoint-cli.d.ts +17 -0
- package/dist/core/checkpoints/checkpoint-cli.d.ts.map +1 -0
- package/dist/core/checkpoints/checkpoint-cli.js +78 -0
- package/dist/core/checkpoints/checkpoint-cli.js.map +1 -0
- package/dist/core/checkpoints/checkpoint-manager.d.ts +298 -0
- package/dist/core/checkpoints/checkpoint-manager.d.ts.map +1 -0
- package/dist/core/checkpoints/checkpoint-manager.js +901 -0
- package/dist/core/checkpoints/checkpoint-manager.js.map +1 -0
- package/dist/core/checkpoints/rewind.d.ts +143 -0
- package/dist/core/checkpoints/rewind.d.ts.map +1 -0
- package/dist/core/checkpoints/rewind.js +247 -0
- package/dist/core/checkpoints/rewind.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +11 -6
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +14 -6
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +221 -122
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +2 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +25 -18
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/crash-log.d.ts +27 -0
- package/dist/core/crash-log.d.ts.map +1 -0
- package/dist/core/crash-log.js +140 -0
- package/dist/core/crash-log.js.map +1 -0
- package/dist/core/defaults.d.ts +1 -0
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/defaults.js +9 -0
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/experimental.js +1 -1
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/export-html/template.css +10 -0
- package/dist/core/export-html/template.js +72 -18
- package/dist/core/extensions/index.d.ts +2 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/jiti-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-loader.js +5 -0
- package/dist/core/extensions/jiti-loader.js.map +1 -0
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +298 -96
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +59 -9
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +410 -103
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +701 -85
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +3 -0
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts +3 -0
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
- package/dist/core/extensions/virtual-modules.js +37 -0
- package/dist/core/extensions/virtual-modules.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +2 -2
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +3 -22
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +1 -1
- package/dist/core/footer-data-provider.js +19 -18
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +7 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +88 -13
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +34 -7
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +119 -0
- package/dist/core/mcp-servers.d.ts.map +1 -0
- package/dist/core/mcp-servers.js +191 -0
- package/dist/core/mcp-servers.js.map +1 -0
- package/dist/core/messages.d.ts +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +1 -0
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +202 -20
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +53 -18
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +21 -3
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +47 -10
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +7 -5
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +62 -23
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +80 -15
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +466 -120
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/models-store.d.ts +12 -7
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js +87 -18
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/multi-agent/fsm.js +8 -3
- package/dist/core/multi-agent/fsm.js.map +1 -1
- package/dist/core/multi-agent/mailbox.js +1 -3
- package/dist/core/multi-agent/mailbox.js.map +1 -1
- package/dist/core/multi-agent/permission-gate.d.ts +5 -2
- package/dist/core/multi-agent/permission-gate.d.ts.map +1 -1
- package/dist/core/multi-agent/permission-gate.js +601 -37
- package/dist/core/multi-agent/permission-gate.js.map +1 -1
- package/dist/core/multi-agent/task-board.js +2 -4
- package/dist/core/multi-agent/task-board.js.map +1 -1
- package/dist/core/multi-agent/worktree.d.ts +2 -0
- package/dist/core/multi-agent/worktree.d.ts.map +1 -1
- package/dist/core/multi-agent/worktree.js +3 -5
- package/dist/core/multi-agent/worktree.js.map +1 -1
- package/dist/core/nested-tool-calls.d.ts +102 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -0
- package/dist/core/nested-tool-calls.js +178 -0
- package/dist/core/nested-tool-calls.js.map +1 -0
- package/dist/core/package-manager.d.ts +16 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +162 -69
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/permission-relay/index.d.ts +19 -0
- package/dist/core/permission-relay/index.d.ts.map +1 -0
- package/dist/core/permission-relay/index.js +49 -0
- package/dist/core/permission-relay/index.js.map +1 -0
- package/dist/core/permission-relay/relay-ui-context.d.ts +39 -0
- package/dist/core/permission-relay/relay-ui-context.d.ts.map +1 -0
- package/dist/core/permission-relay/relay-ui-context.js +788 -0
- package/dist/core/permission-relay/relay-ui-context.js.map +1 -0
- package/dist/core/permission-relay/types.d.ts +222 -0
- package/dist/core/permission-relay/types.d.ts.map +1 -0
- package/dist/core/permission-relay/types.js +15 -0
- package/dist/core/permission-relay/types.js.map +1 -0
- package/dist/core/pi-manifest.d.ts +14 -0
- package/dist/core/pi-manifest.d.ts.map +1 -0
- package/dist/core/pi-manifest.js +36 -0
- package/dist/core/pi-manifest.js.map +1 -0
- package/dist/core/project-trust.js +2 -2
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +6 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +63 -37
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-attribution.js +5 -5
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/provider-composer.d.ts +44 -20
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +151 -51
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/radius.d.ts +13 -0
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js +19 -0
- package/dist/core/radius.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +10 -3
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +105 -81
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +28 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +319 -65
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +5 -5
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +13 -9
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sandbox/bash-operations.d.ts +149 -0
- package/dist/core/sandbox/bash-operations.d.ts.map +1 -0
- package/dist/core/sandbox/bash-operations.js +163 -0
- package/dist/core/sandbox/bash-operations.js.map +1 -0
- package/dist/core/sandbox/env.d.ts +83 -0
- package/dist/core/sandbox/env.d.ts.map +1 -0
- package/dist/core/sandbox/env.js +123 -0
- package/dist/core/sandbox/env.js.map +1 -0
- package/dist/core/sandbox/executor.d.ts +104 -0
- package/dist/core/sandbox/executor.d.ts.map +1 -0
- package/dist/core/sandbox/executor.js +93 -0
- package/dist/core/sandbox/executor.js.map +1 -0
- package/dist/core/sandbox/index.d.ts +36 -0
- package/dist/core/sandbox/index.d.ts.map +1 -0
- package/dist/core/sandbox/index.js +36 -0
- package/dist/core/sandbox/index.js.map +1 -0
- package/dist/core/sandbox/linux.d.ts +121 -0
- package/dist/core/sandbox/linux.d.ts.map +1 -0
- package/dist/core/sandbox/linux.js +260 -0
- package/dist/core/sandbox/linux.js.map +1 -0
- package/dist/core/sandbox/policy.d.ts +142 -0
- package/dist/core/sandbox/policy.d.ts.map +1 -0
- package/dist/core/sandbox/policy.js +297 -0
- package/dist/core/sandbox/policy.js.map +1 -0
- package/dist/core/sandbox/real-path.d.ts +112 -0
- package/dist/core/sandbox/real-path.d.ts.map +1 -0
- package/dist/core/sandbox/real-path.js +158 -0
- package/dist/core/sandbox/real-path.js.map +1 -0
- package/dist/core/sandbox/seatbelt-profile.d.ts +95 -0
- package/dist/core/sandbox/seatbelt-profile.d.ts.map +1 -0
- package/dist/core/sandbox/seatbelt-profile.js +239 -0
- package/dist/core/sandbox/seatbelt-profile.js.map +1 -0
- package/dist/core/sandbox/seatbelt.d.ts +95 -0
- package/dist/core/sandbox/seatbelt.d.ts.map +1 -0
- package/dist/core/sandbox/seatbelt.js +154 -0
- package/dist/core/sandbox/seatbelt.js.map +1 -0
- package/dist/core/sandbox/self-test.d.ts +109 -0
- package/dist/core/sandbox/self-test.d.ts.map +1 -0
- package/dist/core/sandbox/self-test.js +369 -0
- package/dist/core/sandbox/self-test.js.map +1 -0
- package/dist/core/sandbox/spawn.d.ts +33 -0
- package/dist/core/sandbox/spawn.d.ts.map +1 -0
- package/dist/core/sandbox/spawn.js +87 -0
- package/dist/core/sandbox/spawn.js.map +1 -0
- package/dist/core/sdk.d.ts +7 -5
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +103 -53
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-cwd.js +1 -0
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/session-export.d.ts +8 -0
- package/dist/core/session-export.d.ts.map +1 -0
- package/dist/core/session-export.js +33 -0
- package/dist/core/session-export.js.map +1 -0
- package/dist/core/session-manager.d.ts +134 -15
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +366 -149
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-diagnostics.d.ts +9 -0
- package/dist/core/settings-diagnostics.d.ts.map +1 -0
- package/dist/core/settings-diagnostics.js +21 -0
- package/dist/core/settings-diagnostics.js.map +1 -0
- package/dist/core/settings-manager.d.ts +105 -4
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +274 -40
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +3 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +70 -39
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +4 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/soak/soak-log.d.ts +298 -0
- package/dist/core/soak/soak-log.d.ts.map +1 -0
- package/dist/core/soak/soak-log.js +666 -0
- package/dist/core/soak/soak-log.js.map +1 -0
- package/dist/core/soak/soak-reader.d.ts +60 -0
- package/dist/core/soak/soak-reader.d.ts.map +1 -0
- package/dist/core/soak/soak-reader.js +106 -0
- package/dist/core/soak/soak-reader.js.map +1 -0
- package/dist/core/socket-server/discovery.d.ts +78 -1
- package/dist/core/socket-server/discovery.d.ts.map +1 -1
- package/dist/core/socket-server/discovery.js +356 -37
- package/dist/core/socket-server/discovery.js.map +1 -1
- package/dist/core/socket-server/index.d.ts +10 -4
- package/dist/core/socket-server/index.d.ts.map +1 -1
- package/dist/core/socket-server/index.js +6 -3
- package/dist/core/socket-server/index.js.map +1 -1
- package/dist/core/socket-server/permission-delivery.d.ts +125 -0
- package/dist/core/socket-server/permission-delivery.d.ts.map +1 -0
- package/dist/core/socket-server/permission-delivery.js +152 -0
- package/dist/core/socket-server/permission-delivery.js.map +1 -0
- package/dist/core/socket-server/permission-registry.d.ts +301 -0
- package/dist/core/socket-server/permission-registry.d.ts.map +1 -0
- package/dist/core/socket-server/permission-registry.js +410 -0
- package/dist/core/socket-server/permission-registry.js.map +1 -0
- package/dist/core/socket-server/permission-relay.d.ts +81 -0
- package/dist/core/socket-server/permission-relay.d.ts.map +1 -0
- package/dist/core/socket-server/permission-relay.js +528 -0
- package/dist/core/socket-server/permission-relay.js.map +1 -0
- package/dist/core/socket-server/safe-text.d.ts +83 -0
- package/dist/core/socket-server/safe-text.d.ts.map +1 -0
- package/dist/core/socket-server/safe-text.js +277 -0
- package/dist/core/socket-server/safe-text.js.map +1 -0
- package/dist/core/socket-server/session-integration.d.ts +65 -2
- package/dist/core/socket-server/session-integration.d.ts.map +1 -1
- package/dist/core/socket-server/session-integration.js +434 -32
- package/dist/core/socket-server/session-integration.js.map +1 -1
- package/dist/core/socket-server/socket-client.d.ts +21 -2
- package/dist/core/socket-server/socket-client.d.ts.map +1 -1
- package/dist/core/socket-server/socket-client.js +52 -1
- package/dist/core/socket-server/socket-client.js.map +1 -1
- package/dist/core/socket-server/socket-server.d.ts +152 -1
- package/dist/core/socket-server/socket-server.d.ts.map +1 -1
- package/dist/core/socket-server/socket-server.js +786 -26
- package/dist/core/socket-server/socket-server.js.map +1 -1
- package/dist/core/socket-server/types.d.ts +108 -3
- package/dist/core/socket-server/types.d.ts.map +1 -1
- package/dist/core/socket-server/types.js +13 -1
- package/dist/core/socket-server/types.js.map +1 -1
- package/dist/core/source-info.d.ts +8 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +16 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/system-prompt.d.ts +49 -6
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +126 -90
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +32 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +83 -141
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +0 -5
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +2 -5
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +5 -12
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +36 -173
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +7 -0
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +22 -76
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +4 -0
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +10 -62
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +4 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +18 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +4 -0
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +9 -50
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +11 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +54 -12
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +16 -0
- package/dist/core/tools/powershell.d.ts.map +1 -0
- package/dist/core/tools/powershell.js +39 -0
- package/dist/core/tools/powershell.js.map +1 -0
- package/dist/core/tools/read.d.ts +8 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +16 -123
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +6 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +26 -0
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts +12 -0
- package/dist/core/tools/renderers/bash.d.ts.map +1 -0
- package/dist/core/tools/renderers/bash.js +117 -0
- package/dist/core/tools/renderers/bash.js.map +1 -0
- package/dist/core/tools/renderers/edit.d.ts +23 -0
- package/dist/core/tools/renderers/edit.d.ts.map +1 -0
- package/dist/core/tools/renderers/edit.js +167 -0
- package/dist/core/tools/renderers/edit.js.map +1 -0
- package/dist/core/tools/renderers/find.d.ts +10 -0
- package/dist/core/tools/renderers/find.d.ts.map +1 -0
- package/dist/core/tools/renderers/find.js +64 -0
- package/dist/core/tools/renderers/find.js.map +1 -0
- package/dist/core/tools/renderers/grep.d.ts +10 -0
- package/dist/core/tools/renderers/grep.d.ts.map +1 -0
- package/dist/core/tools/renderers/grep.js +69 -0
- package/dist/core/tools/renderers/grep.js.map +1 -0
- package/dist/core/tools/renderers/index.d.ts +28 -0
- package/dist/core/tools/renderers/index.d.ts.map +1 -0
- package/dist/core/tools/renderers/index.js +47 -0
- package/dist/core/tools/renderers/index.js.map +1 -0
- package/dist/core/tools/renderers/ls.d.ts +10 -0
- package/dist/core/tools/renderers/ls.d.ts.map +1 -0
- package/dist/core/tools/renderers/ls.js +58 -0
- package/dist/core/tools/renderers/ls.js.map +1 -0
- package/dist/core/tools/renderers/read.d.ts +11 -0
- package/dist/core/tools/renderers/read.d.ts.map +1 -0
- package/dist/core/tools/renderers/read.js +130 -0
- package/dist/core/tools/renderers/read.js.map +1 -0
- package/dist/core/tools/renderers/write.d.ts +10 -0
- package/dist/core/tools/renderers/write.d.ts.map +1 -0
- package/dist/core/tools/renderers/write.js +153 -0
- package/dist/core/tools/renderers/write.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +3 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +14 -0
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +29 -0
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write.d.ts +4 -0
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +12 -147
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts +6 -4
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +59 -22
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts +3 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +28 -1
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/core/virtual-models.d.ts +117 -0
- package/dist/core/virtual-models.d.ts.map +1 -0
- package/dist/core/virtual-models.js +124 -0
- package/dist/core/virtual-models.js.map +1 -0
- package/dist/experimental/micro/api.d.ts +81 -0
- package/dist/experimental/micro/api.d.ts.map +1 -0
- package/dist/experimental/micro/api.js +2 -0
- package/dist/experimental/micro/api.js.map +1 -0
- package/dist/experimental/micro/main.d.ts +3 -0
- package/dist/experimental/micro/main.d.ts.map +1 -0
- package/dist/experimental/micro/main.js +21 -0
- package/dist/experimental/micro/main.js.map +1 -0
- package/dist/experimental/micro/models.d.ts +11 -0
- package/dist/experimental/micro/models.d.ts.map +1 -0
- package/dist/experimental/micro/models.js +95 -0
- package/dist/experimental/micro/models.js.map +1 -0
- package/dist/experimental/micro/runtime.d.ts +12 -0
- package/dist/experimental/micro/runtime.d.ts.map +1 -0
- package/dist/experimental/micro/runtime.js +465 -0
- package/dist/experimental/micro/runtime.js.map +1 -0
- package/dist/experimental/micro/sessions.d.ts +10 -0
- package/dist/experimental/micro/sessions.d.ts.map +1 -0
- package/dist/experimental/micro/sessions.js +41 -0
- package/dist/experimental/micro/sessions.js.map +1 -0
- package/dist/experimental/micro/tools.d.ts +10 -0
- package/dist/experimental/micro/tools.d.ts.map +1 -0
- package/dist/experimental/micro/tools.js +96 -0
- package/dist/experimental/micro/tools.js.map +1 -0
- package/dist/experimental/micro/tui.d.ts +3 -0
- package/dist/experimental/micro/tui.d.ts.map +1 -0
- package/dist/experimental/micro/tui.js +510 -0
- package/dist/experimental/micro/tui.js.map +1 -0
- package/dist/experimental/mini/main.d.ts +7 -0
- package/dist/experimental/mini/main.d.ts.map +1 -0
- package/dist/experimental/mini/main.js +21 -0
- package/dist/experimental/mini/main.js.map +1 -0
- package/dist/experimental/mini/server/entry.d.ts +3 -0
- package/dist/experimental/mini/server/entry.d.ts.map +1 -0
- package/dist/experimental/mini/server/entry.js +11 -0
- package/dist/experimental/mini/server/entry.js.map +1 -0
- package/dist/experimental/mini/server/run.d.ts +13 -0
- package/dist/experimental/mini/server/run.d.ts.map +1 -0
- package/dist/experimental/mini/server/run.js +150 -0
- package/dist/experimental/mini/server/run.js.map +1 -0
- package/dist/experimental/mini/shared/protocol.d.ts +127 -0
- package/dist/experimental/mini/shared/protocol.d.ts.map +1 -0
- package/dist/experimental/mini/shared/protocol.js +13 -0
- package/dist/experimental/mini/shared/protocol.js.map +1 -0
- package/dist/experimental/mini/shared/rpc.d.ts +49 -0
- package/dist/experimental/mini/shared/rpc.d.ts.map +1 -0
- package/dist/experimental/mini/shared/rpc.js +171 -0
- package/dist/experimental/mini/shared/rpc.js.map +1 -0
- package/dist/experimental/mini/shared/transport.d.ts +35 -0
- package/dist/experimental/mini/shared/transport.d.ts.map +1 -0
- package/dist/experimental/mini/shared/transport.js +94 -0
- package/dist/experimental/mini/shared/transport.js.map +1 -0
- package/dist/experimental/mini/tui/run.d.ts +9 -0
- package/dist/experimental/mini/tui/run.d.ts.map +1 -0
- package/dist/experimental/mini/tui/run.js +62 -0
- package/dist/experimental/mini/tui/run.js.map +1 -0
- package/dist/experimental/mini/tui/session.d.ts +26 -0
- package/dist/experimental/mini/tui/session.d.ts.map +1 -0
- package/dist/experimental/mini/tui/session.js +94 -0
- package/dist/experimental/mini/tui/session.js.map +1 -0
- package/dist/experimental/mini/tui/view.d.ts +10 -0
- package/dist/experimental/mini/tui/view.d.ts.map +1 -0
- package/dist/experimental/mini/tui/view.js +461 -0
- package/dist/experimental/mini/tui/view.js.map +1 -0
- package/dist/experimental/mini/worker/entry.d.ts +3 -0
- package/dist/experimental/mini/worker/entry.d.ts.map +1 -0
- package/dist/experimental/mini/worker/entry.js +10 -0
- package/dist/experimental/mini/worker/entry.js.map +1 -0
- package/dist/experimental/mini/worker/lane-service.d.ts +44 -0
- package/dist/experimental/mini/worker/lane-service.d.ts.map +1 -0
- package/dist/experimental/mini/worker/lane-service.js +97 -0
- package/dist/experimental/mini/worker/lane-service.js.map +1 -0
- package/dist/experimental/mini/worker/models-service.d.ts +19 -0
- package/dist/experimental/mini/worker/models-service.d.ts.map +1 -0
- package/dist/experimental/mini/worker/models-service.js +136 -0
- package/dist/experimental/mini/worker/models-service.js.map +1 -0
- package/dist/experimental/mini/worker/run.d.ts +14 -0
- package/dist/experimental/mini/worker/run.d.ts.map +1 -0
- package/dist/experimental/mini/worker/run.js +88 -0
- package/dist/experimental/mini/worker/run.js.map +1 -0
- package/dist/extensions/codemode/execute.d.ts +16 -0
- package/dist/extensions/codemode/execute.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.js +429 -0
- package/dist/extensions/codemode/execute.js.map +1 -0
- package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
- package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.lazy.js +3 -0
- package/dist/extensions/codemode/execute.lazy.js.map +1 -0
- package/dist/extensions/codemode/index.d.ts +21 -0
- package/dist/extensions/codemode/index.d.ts.map +1 -0
- package/dist/extensions/codemode/index.js +31 -0
- package/dist/extensions/codemode/index.js.map +1 -0
- package/dist/extensions/codemode/renderer.d.ts +12 -0
- package/dist/extensions/codemode/renderer.d.ts.map +1 -0
- package/dist/extensions/codemode/renderer.js +137 -0
- package/dist/extensions/codemode/renderer.js.map +1 -0
- package/dist/extensions/codemode/tool.d.ts +123 -0
- package/dist/extensions/codemode/tool.d.ts.map +1 -0
- package/dist/extensions/codemode/tool.js +315 -0
- package/dist/extensions/codemode/tool.js.map +1 -0
- package/dist/extensions/codemode/worker.d.ts +7 -0
- package/dist/extensions/codemode/worker.d.ts.map +1 -0
- package/dist/extensions/codemode/worker.js +7 -0
- package/dist/extensions/codemode/worker.js.map +1 -0
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +13 -1
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +8 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +13 -0
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/huggingface.js +2 -0
- package/dist/extensions/llama/huggingface.js.map +1 -1
- package/dist/extensions/llama/index.d.ts.map +1 -1
- package/dist/extensions/llama/index.js +13 -2
- package/dist/extensions/llama/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +4 -2
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +121 -15
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/llama/ui.js +28 -12
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts +21 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.js +500 -0
- package/dist/extensions/mcp/cli.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
- package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.lazy.js +3 -0
- package/dist/extensions/mcp/cli.lazy.js.map +1 -0
- package/dist/extensions/mcp/config.d.ts +72 -0
- package/dist/extensions/mcp/config.d.ts.map +1 -0
- package/dist/extensions/mcp/config.js +158 -0
- package/dist/extensions/mcp/config.js.map +1 -0
- package/dist/extensions/mcp/index.d.ts +76 -0
- package/dist/extensions/mcp/index.d.ts.map +1 -0
- package/dist/extensions/mcp/index.js +1055 -0
- package/dist/extensions/mcp/index.js.map +1 -0
- package/dist/extensions/mcp/log.d.ts +16 -0
- package/dist/extensions/mcp/log.d.ts.map +1 -0
- package/dist/extensions/mcp/log.js +66 -0
- package/dist/extensions/mcp/log.js.map +1 -0
- package/dist/extensions/mcp/oauth.d.ts +96 -0
- package/dist/extensions/mcp/oauth.d.ts.map +1 -0
- package/dist/extensions/mcp/oauth.js +333 -0
- package/dist/extensions/mcp/oauth.js.map +1 -0
- package/dist/extensions/mcp/resources.d.ts +43 -0
- package/dist/extensions/mcp/resources.d.ts.map +1 -0
- package/dist/extensions/mcp/resources.js +262 -0
- package/dist/extensions/mcp/resources.js.map +1 -0
- package/dist/extensions/mcp/runtime.d.ts +98 -0
- package/dist/extensions/mcp/runtime.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.js +394 -0
- package/dist/extensions/mcp/runtime.js.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.js +3 -0
- package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
- package/dist/extensions/mcp/tools.d.ts +84 -0
- package/dist/extensions/mcp/tools.d.ts.map +1 -0
- package/dist/extensions/mcp/tools.js +251 -0
- package/dist/extensions/mcp/tools.js.map +1 -0
- package/dist/extensions/mcp/ui.d.ts +60 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -0
- package/dist/extensions/mcp/ui.js +174 -0
- package/dist/extensions/mcp/ui.js.map +1 -0
- package/dist/extensions/stub-provider/index.d.ts +9 -0
- package/dist/extensions/stub-provider/index.d.ts.map +1 -0
- package/dist/extensions/stub-provider/index.js +13 -0
- package/dist/extensions/stub-provider/index.js.map +1 -0
- package/dist/extensions/stub-provider/provider.d.ts +77 -0
- package/dist/extensions/stub-provider/provider.d.ts.map +1 -0
- package/dist/extensions/stub-provider/provider.js +194 -0
- package/dist/extensions/stub-provider/provider.js.map +1 -0
- package/dist/extensions/tool-search/index.d.ts +12 -0
- package/dist/extensions/tool-search/index.d.ts.map +1 -0
- package/dist/extensions/tool-search/index.js +15 -0
- package/dist/extensions/tool-search/index.js.map +1 -0
- package/dist/extensions/tool-search/tool.d.ts +73 -0
- package/dist/extensions/tool-search/tool.d.ts.map +1 -0
- package/dist/extensions/tool-search/tool.js +189 -0
- package/dist/extensions/tool-search/tool.js.map +1 -0
- package/dist/hooks/gsd/draht-quality-gate.js +3 -3
- package/dist/index.d.ts +20 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +4 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +365 -96
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +1 -1
- package/dist/migrations.js +7 -6
- package/dist/migrations.js.map +1 -1
- package/dist/modes/index.d.ts +1 -0
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/bug-report.d.ts +19 -0
- package/dist/modes/interactive/bug-report.d.ts.map +1 -0
- package/dist/modes/interactive/bug-report.js +211 -0
- package/dist/modes/interactive/bug-report.js.map +1 -0
- package/dist/modes/interactive/chat-viewport.d.ts +20 -0
- package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
- package/dist/modes/interactive/chat-viewport.js +28 -0
- package/dist/modes/interactive/chat-viewport.js.map +1 -0
- package/dist/modes/interactive/components/armin.js +10 -6
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +6 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +38 -15
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +9 -4
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +3 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +15 -6
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +15 -6
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +38 -10
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js +5 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +10 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +54 -2
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +4 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +7 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js +8 -6
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js +1 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +4 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +14 -3
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +2 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +14 -2
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +50 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +218 -6
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +12 -4
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +7 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +51 -6
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +9 -3
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/mermaid.d.ts +11 -0
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
- package/dist/modes/interactive/components/mermaid.js +75 -0
- package/dist/modes/interactive/components/mermaid.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +10 -4
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +101 -40
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +11 -3
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +4 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +60 -32
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +5 -5
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +138 -80
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +25 -4
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +240 -67
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.js +165 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +1 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +14 -5
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +3 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +12 -3
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +2 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/themed-text.d.ts +17 -0
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/themed-text.js +29 -0
- package/dist/modes/interactive/components/themed-text.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +76 -18
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +21 -4
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +88 -53
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +20 -2
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +65 -23
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +8 -2
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +6 -3
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +3 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +12 -2
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +27 -3
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +39 -6
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +2 -1
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +166 -8
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1690 -599
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts +7 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.js +34 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
- package/dist/modes/interactive/session-share.d.ts +23 -0
- package/dist/modes/interactive/session-share.d.ts.map +1 -0
- package/dist/modes/interactive/session-share.js +130 -0
- package/dist/modes/interactive/session-share.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +54 -63
- package/dist/modes/interactive/theme/light.json +52 -60
- package/dist/modes/interactive/theme/system-theme.d.ts +54 -0
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/system-theme.js +535 -0
- package/dist/modes/interactive/theme/system-theme.js.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +59 -7
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +164 -51
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +85 -0
- package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-json.js +132 -0
- package/dist/modes/interactive/theme/theme-json.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +24 -3
- package/dist/modes/interactive/theme/theme.d.ts +80 -42
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +274 -417
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tui-renderer.d.ts +22 -0
- package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
- package/dist/modes/interactive/tui-renderer.js +67 -0
- package/dist/modes/interactive/tui-renderer.js.map +1 -0
- package/dist/modes/json-event.d.ts +34 -0
- package/dist/modes/json-event.d.ts.map +1 -0
- package/dist/modes/json-event.js +29 -0
- package/dist/modes/json-event.js.map +1 -0
- package/dist/modes/print-mode.d.ts +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +12 -2
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +17 -9
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +27 -15
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +179 -19
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +90 -2
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts +1 -0
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +217 -63
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/prompts/commands/atomic-commit.md +1 -12
- package/dist/prompts/commands/brainstorm.md +12 -15
- package/dist/prompts/commands/create-verification-skill.md +108 -0
- package/dist/prompts/commands/discuss-phase.md +3 -14
- package/dist/prompts/commands/execute-phase.md +3 -11
- package/dist/prompts/commands/fix.md +41 -18
- package/dist/prompts/commands/grill.md +66 -0
- package/dist/prompts/commands/init-project.md +5 -15
- package/dist/prompts/commands/map-codebase.md +1 -13
- package/dist/prompts/commands/new-project.md +5 -15
- package/dist/prompts/commands/next-milestone.md +1 -13
- package/dist/prompts/commands/orchestrate.md +1 -1
- package/dist/prompts/commands/pause-work.md +1 -13
- package/dist/prompts/commands/plan-phase.md +3 -11
- package/dist/prompts/commands/progress.md +0 -13
- package/dist/prompts/commands/quick.md +3 -11
- package/dist/prompts/commands/resolve-conflicts.md +71 -0
- package/dist/prompts/commands/resume-work.md +0 -13
- package/dist/prompts/commands/review.md +6 -13
- package/dist/prompts/commands/triage.md +159 -0
- package/dist/prompts/commands/verify-work.md +5 -14
- package/dist/prompts/commands/why.md +139 -0
- package/dist/rpc-entry.js +1 -0
- package/dist/rpc-entry.js.map +1 -1
- package/dist/skills/atomic-reasoning/SKILL.md +115 -0
- package/dist/skills/blast-radius/SKILL.md +56 -0
- package/dist/skills/epistemics/SKILL.md +99 -0
- package/dist/skills/explainers/SKILL.md +65 -0
- package/dist/skills/hexagon-animation/SKILL.md +49 -0
- package/dist/skills/hexagon-animation/generate.mjs +81 -0
- package/dist/skills/hexagon-animation/template.html +361 -0
- package/dist/skills/typescript-discipline/SKILL.md +50 -0
- package/dist/skills/typescript-discipline/references/patterns.md +294 -0
- package/dist/skills/unslop/SKILL.md +119 -0
- package/dist/utils/abort.d.ts +5 -0
- package/dist/utils/abort.d.ts.map +1 -0
- package/dist/utils/abort.js +48 -0
- package/dist/utils/abort.js.map +1 -0
- package/dist/utils/canonical-path.d.ts +28 -0
- package/dist/utils/canonical-path.d.ts.map +1 -0
- package/dist/utils/canonical-path.js +90 -0
- package/dist/utils/canonical-path.js.map +1 -0
- package/dist/utils/changelog.js +1 -1
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/child-process.d.ts +13 -2
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +26 -9
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts +7 -0
- package/dist/utils/clipboard-command.d.ts.map +1 -0
- package/dist/utils/clipboard-command.js +45 -0
- package/dist/utils/clipboard-command.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +60 -91
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts +3 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +123 -108
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/draht-user-agent.d.ts +2 -0
- package/dist/utils/draht-user-agent.d.ts.map +1 -0
- package/dist/utils/draht-user-agent.js +5 -0
- package/dist/utils/draht-user-agent.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +2 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js +2 -3
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +2 -1
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/management-http.d.ts +25 -0
- package/dist/utils/management-http.d.ts.map +1 -0
- package/dist/utils/management-http.js +54 -0
- package/dist/utils/management-http.js.map +1 -0
- package/dist/utils/mime.js +1 -1
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/paths.d.ts +6 -10
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +23 -14
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/photon.d.ts +2 -1
- package/dist/utils/photon.d.ts.map +1 -1
- package/dist/utils/photon.js.map +1 -1
- package/dist/utils/shell.d.ts +4 -3
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +26 -39
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +1 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +62 -1
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/text.d.ts +8 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +9 -0
- package/dist/utils/text.js.map +1 -0
- package/dist/utils/tool-result-images.d.ts +21 -0
- package/dist/utils/tool-result-images.d.ts.map +1 -0
- package/dist/utils/tool-result-images.js +48 -0
- package/dist/utils/tool-result-images.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +11 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +56 -41
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +4 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +30 -9
- package/dist/utils/version-check.js.map +1 -1
- package/dist/utils/wsl.d.ts +3 -0
- package/dist/utils/wsl.d.ts.map +1 -0
- package/dist/utils/wsl.js +15 -0
- package/dist/utils/wsl.js.map +1 -0
- package/dist/utils/zip.d.ts +7 -0
- package/dist/utils/zip.d.ts.map +1 -0
- package/dist/utils/zip.js +60 -0
- package/dist/utils/zip.js.map +1 -0
- package/docs/attachable-sessions.md +79 -0
- package/docs/cli-integration.md +106 -0
- package/docs/cli.md +374 -0
- package/docs/compaction.md +107 -45
- package/docs/configuration.md +47 -0
- package/docs/containerization.md +100 -66
- package/docs/custom-provider.md +109 -707
- package/docs/docs.json +155 -95
- package/docs/duet.md +42 -0
- package/docs/environment-variables.md +30 -17
- package/docs/extensions.md +169 -2811
- package/docs/how-pi-works.md +53 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/index.md +25 -69
- package/docs/json.md +198 -57
- package/docs/keybindings.md +89 -92
- package/docs/llama-cpp.md +23 -8
- package/docs/mcp.md +231 -0
- package/docs/message-types.md +261 -0
- package/docs/models.md +94 -478
- package/docs/packages.md +68 -164
- package/docs/prompt-templates.md +31 -68
- package/docs/providers.md +118 -215
- package/docs/quickstart.md +56 -109
- package/docs/rpc-commands.md +860 -0
- package/docs/rpc-extension-ui.md +200 -0
- package/docs/rpc.md +186 -1494
- package/docs/sdk.md +79 -1127
- package/docs/security.md +77 -33
- package/docs/session-format.md +98 -222
- package/docs/sessions.md +36 -113
- package/docs/settings.md +125 -251
- package/docs/shell-aliases.md +85 -5
- package/docs/skills.md +52 -188
- package/docs/slash-commands.md +61 -0
- package/docs/terminal-setup.md +132 -61
- package/docs/termux.md +74 -84
- package/docs/themes.md +91 -252
- package/docs/tmux.md +31 -39
- package/docs/tui.md +74 -891
- package/docs/usage.md +54 -255
- package/docs/virtual-models.md +114 -0
- package/docs/windows.md +57 -7
- package/examples/extensions/antigravity-image-gen.ts +9 -9
- package/examples/extensions/bash-spawn-hook.ts +1 -1
- package/examples/extensions/border-status-editor.ts +1 -1
- package/examples/extensions/built-in-tool-renderer.ts +16 -40
- package/examples/extensions/custom-compaction.ts +1 -16
- package/examples/extensions/custom-provider-anthropic/index.ts +20 -13
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +4 -3
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
- package/examples/extensions/debug-provider.ts +90 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +7 -3
- package/examples/extensions/dynamic-resources/dynamic.json +3 -1
- package/examples/extensions/git-checkpoint.ts +2 -2
- package/examples/extensions/handoff.ts +2 -11
- package/examples/extensions/jev-router.ts +113 -0
- package/examples/extensions/minimal-mode.ts +24 -96
- package/examples/extensions/notify.ts +3 -1
- package/examples/extensions/overlay-qa-tests.ts +3 -3
- package/examples/extensions/prompt-customizer.ts +19 -67
- package/examples/extensions/qna.ts +3 -7
- package/examples/extensions/subagent/agents.ts +40 -9
- package/examples/extensions/subagent/index.ts +27 -4
- package/examples/extensions/summarize.ts +7 -18
- package/examples/extensions/titlebar-spinner.ts +1 -1
- package/examples/rpc-client.ts +35 -0
- package/examples/rpc-extension-ui.ts +38 -9
- package/examples/sdk/02-custom-model.ts +1 -2
- package/examples/sdk/06-extensions.ts +1 -1
- package/examples/sdk/09-api-keys-and-oauth.ts +1 -1
- package/examples/sdk/12-full-control.ts +1 -1
- package/examples/sdk/14-codemode-mcp.ts +61 -0
- package/hooks/gsd/draht-quality-gate.js +3 -3
- package/package.json +28 -32
- package/prompts/commands/atomic-commit.md +1 -12
- package/prompts/commands/brainstorm.md +12 -15
- package/prompts/commands/create-verification-skill.md +108 -0
- package/prompts/commands/discuss-phase.md +3 -14
- package/prompts/commands/execute-phase.md +3 -11
- package/prompts/commands/fix.md +41 -18
- package/prompts/commands/grill.md +66 -0
- package/prompts/commands/init-project.md +5 -15
- package/prompts/commands/map-codebase.md +1 -13
- package/prompts/commands/new-project.md +5 -15
- package/prompts/commands/next-milestone.md +1 -13
- package/prompts/commands/orchestrate.md +1 -1
- package/prompts/commands/pause-work.md +1 -13
- package/prompts/commands/plan-phase.md +3 -11
- package/prompts/commands/progress.md +0 -13
- package/prompts/commands/quick.md +3 -11
- package/prompts/commands/resolve-conflicts.md +71 -0
- package/prompts/commands/resume-work.md +0 -13
- package/prompts/commands/review.md +6 -13
- package/prompts/commands/triage.md +159 -0
- package/prompts/commands/verify-work.md +5 -14
- package/prompts/commands/why.md +139 -0
- package/skills/atomic-reasoning/SKILL.md +115 -0
- package/skills/blast-radius/SKILL.md +56 -0
- package/skills/epistemics/SKILL.md +99 -0
- package/skills/explainers/SKILL.md +65 -0
- package/skills/hexagon-animation/SKILL.md +49 -0
- package/skills/hexagon-animation/generate.mjs +81 -0
- package/skills/hexagon-animation/template.html +361 -0
- package/skills/typescript-discipline/SKILL.md +50 -0
- package/skills/typescript-discipline/references/patterns.md +294 -0
- package/skills/unslop/SKILL.md +119 -0
- package/dist/prompts/agents/build.md +0 -86
- package/dist/prompts/agents/plan.md +0 -79
- package/dist/prompts/agents/verify.md +0 -69
- package/dist/utils/clipboard-native.d.ts +0 -11
- package/dist/utils/clipboard-native.d.ts.map +0 -1
- package/dist/utils/clipboard-native.js +0 -20
- package/dist/utils/clipboard-native.js.map +0 -1
- package/dist/utils/pi-user-agent.d.ts +0 -2
- package/dist/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/utils/pi-user-agent.js +0 -5
- package/dist/utils/pi-user-agent.js.map +0 -1
- package/docs/development.md +0 -71
- package/docs/tree.md +0 -231
- package/examples/extensions/kimi-deferred-tools.ts +0 -61
- package/prompts/agents/build.md +0 -86
- package/prompts/agents/plan.md +0 -79
- package/prompts/agents/verify.md +0 -69
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
import { Text } from "@draht/tui";
|
|
2
|
+
import { Type } from "@sinclair/typebox";
|
|
3
|
+
import { parseModelPattern } from "../model-resolver.js";
|
|
4
|
+
import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead } from "../tools/truncate.js";
|
|
5
|
+
import { runParallelTasks } from "./subagent.js";
|
|
6
|
+
const DUET_STATE_ENTRY = "duet-state";
|
|
7
|
+
const DUET_DELEGATE_TOOL = "duet_delegate";
|
|
8
|
+
const MAX_DUET_PARTICIPANTS = 8;
|
|
9
|
+
const READ_ONLY_TEAMMATE_TOOLS = ["read", "grep", "find", "ls"];
|
|
10
|
+
const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
11
|
+
function isThinkingLevel(value) {
|
|
12
|
+
return typeof value === "string" && THINKING_LEVELS.includes(value);
|
|
13
|
+
}
|
|
14
|
+
function isDuetStrategy(value) {
|
|
15
|
+
return value === "turns" || value === "triage";
|
|
16
|
+
}
|
|
17
|
+
function modelKey(model) {
|
|
18
|
+
return `${model.provider}/${model.id}`;
|
|
19
|
+
}
|
|
20
|
+
function sanitizeRole(value) {
|
|
21
|
+
let role = value
|
|
22
|
+
.toLowerCase()
|
|
23
|
+
.replace(/[^a-z0-9_-]+/g, "-")
|
|
24
|
+
.replace(/^-+|-+$/g, "");
|
|
25
|
+
if (!role)
|
|
26
|
+
return "teammate";
|
|
27
|
+
if (!/^[a-z]/.test(role))
|
|
28
|
+
role = `model-${role}`;
|
|
29
|
+
return role.slice(0, 42);
|
|
30
|
+
}
|
|
31
|
+
function validateExplicitRole(role) {
|
|
32
|
+
if (!/^[a-zA-Z][a-zA-Z0-9_-]{0,47}$/.test(role)) {
|
|
33
|
+
throw new Error(`Invalid duet role "${role}". Use 1-48 letters, numbers, underscores, or hyphens.`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function uniqueDefaultRole(model, usedRoles) {
|
|
37
|
+
const shortRole = sanitizeRole(model.id.split("/").pop() ?? model.id);
|
|
38
|
+
if (!usedRoles.has(shortRole))
|
|
39
|
+
return shortRole;
|
|
40
|
+
const providerRole = sanitizeRole(`${model.provider}-${model.id}`);
|
|
41
|
+
if (!usedRoles.has(providerRole))
|
|
42
|
+
return providerRole;
|
|
43
|
+
let suffix = 2;
|
|
44
|
+
while (true) {
|
|
45
|
+
const suffixText = `-${suffix}`;
|
|
46
|
+
const candidate = `${providerRole.slice(0, 48 - suffixText.length)}${suffixText}`;
|
|
47
|
+
if (!usedRoles.has(candidate))
|
|
48
|
+
return candidate;
|
|
49
|
+
suffix++;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Resolve comma-separated `[role=]provider/model[:thinking]` participant specifications. */
|
|
53
|
+
export function parseDuetParticipantSpecs(specs, availableModels) {
|
|
54
|
+
const rawSpecs = specs
|
|
55
|
+
.split(",")
|
|
56
|
+
.map((spec) => spec.trim())
|
|
57
|
+
.filter(Boolean);
|
|
58
|
+
if (rawSpecs.length < 2)
|
|
59
|
+
throw new Error("Duet mode requires at least two models.");
|
|
60
|
+
if (rawSpecs.length > MAX_DUET_PARTICIPANTS) {
|
|
61
|
+
throw new Error(`Duet mode supports at most ${MAX_DUET_PARTICIPANTS} models.`);
|
|
62
|
+
}
|
|
63
|
+
const participants = [];
|
|
64
|
+
const usedModels = new Set();
|
|
65
|
+
const usedRoles = new Set();
|
|
66
|
+
for (const rawSpec of rawSpecs) {
|
|
67
|
+
const equalsIndex = rawSpec.indexOf("=");
|
|
68
|
+
const explicitRole = equalsIndex === -1 ? undefined : rawSpec.slice(0, equalsIndex).trim();
|
|
69
|
+
const modelSpec = equalsIndex === -1 ? rawSpec : rawSpec.slice(equalsIndex + 1).trim();
|
|
70
|
+
if (explicitRole !== undefined)
|
|
71
|
+
validateExplicitRole(explicitRole);
|
|
72
|
+
if (!modelSpec)
|
|
73
|
+
throw new Error(`Missing model in duet participant "${rawSpec}".`);
|
|
74
|
+
const resolved = parseModelPattern(modelSpec, availableModels, {
|
|
75
|
+
allowInvalidThinkingLevelFallback: false,
|
|
76
|
+
});
|
|
77
|
+
if (!resolved.model) {
|
|
78
|
+
throw new Error(`Duet model "${modelSpec}" is unavailable. Authenticate it or use /scoped-models.`);
|
|
79
|
+
}
|
|
80
|
+
const key = modelKey(resolved.model);
|
|
81
|
+
if (usedModels.has(key))
|
|
82
|
+
throw new Error(`Duet model "${key}" was selected more than once.`);
|
|
83
|
+
const role = explicitRole || uniqueDefaultRole(resolved.model, usedRoles);
|
|
84
|
+
if (usedRoles.has(role))
|
|
85
|
+
throw new Error(`Duet role "${role}" was selected more than once.`);
|
|
86
|
+
usedModels.add(key);
|
|
87
|
+
usedRoles.add(role);
|
|
88
|
+
participants.push({
|
|
89
|
+
role,
|
|
90
|
+
model: resolved.model,
|
|
91
|
+
modelRef: key,
|
|
92
|
+
thinkingLevel: resolved.thinkingLevel,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return participants;
|
|
96
|
+
}
|
|
97
|
+
export function advanceDuetTurn(state) {
|
|
98
|
+
const index = ((state.nextIndex % state.participants.length) + state.participants.length) % state.participants.length;
|
|
99
|
+
const participant = state.participants[index];
|
|
100
|
+
state.nextIndex = (index + 1) % state.participants.length;
|
|
101
|
+
return participant;
|
|
102
|
+
}
|
|
103
|
+
function participantsFromScopedModels(ctx) {
|
|
104
|
+
if (ctx.scopedModels.length < 2) {
|
|
105
|
+
throw new Error("Pass models to /duet or configure at least two models with /scoped-models.");
|
|
106
|
+
}
|
|
107
|
+
const specs = ctx.scopedModels
|
|
108
|
+
.map(({ model, thinkingLevel }) => `${modelKey(model)}${thinkingLevel ? `:${thinkingLevel}` : ""}`)
|
|
109
|
+
.join(",");
|
|
110
|
+
return parseDuetParticipantSpecs(specs, ctx.modelRegistry.getAvailable());
|
|
111
|
+
}
|
|
112
|
+
function toPersistedState(state) {
|
|
113
|
+
if (!state)
|
|
114
|
+
return { version: 1, enabled: false };
|
|
115
|
+
return {
|
|
116
|
+
version: 1,
|
|
117
|
+
enabled: true,
|
|
118
|
+
strategy: state.strategy,
|
|
119
|
+
participants: state.participants.map(({ role, modelRef, thinkingLevel }) => ({
|
|
120
|
+
role,
|
|
121
|
+
modelRef,
|
|
122
|
+
thinkingLevel,
|
|
123
|
+
})),
|
|
124
|
+
nextIndex: state.nextIndex,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function isPersistedParticipant(value) {
|
|
128
|
+
if (typeof value !== "object" || value === null)
|
|
129
|
+
return false;
|
|
130
|
+
const participant = value;
|
|
131
|
+
return (typeof participant.role === "string" &&
|
|
132
|
+
typeof participant.modelRef === "string" &&
|
|
133
|
+
(participant.thinkingLevel === undefined || isThinkingLevel(participant.thinkingLevel)));
|
|
134
|
+
}
|
|
135
|
+
function isPersistedState(value) {
|
|
136
|
+
if (typeof value !== "object" || value === null)
|
|
137
|
+
return false;
|
|
138
|
+
const state = value;
|
|
139
|
+
if (state.version !== 1 || typeof state.enabled !== "boolean")
|
|
140
|
+
return false;
|
|
141
|
+
if (!state.enabled)
|
|
142
|
+
return true;
|
|
143
|
+
return (isDuetStrategy(state.strategy) &&
|
|
144
|
+
Array.isArray(state.participants) &&
|
|
145
|
+
state.participants.every(isPersistedParticipant) &&
|
|
146
|
+
(state.nextIndex === undefined || (typeof state.nextIndex === "number" && Number.isInteger(state.nextIndex))));
|
|
147
|
+
}
|
|
148
|
+
function restoreState(value, availableModels) {
|
|
149
|
+
if (!value.enabled || !value.strategy || !value.participants)
|
|
150
|
+
return undefined;
|
|
151
|
+
const specs = value.participants
|
|
152
|
+
.map(({ role, modelRef, thinkingLevel }) => `${role}=${modelRef}${thinkingLevel ? `:${thinkingLevel}` : ""}`)
|
|
153
|
+
.join(",");
|
|
154
|
+
const participants = parseDuetParticipantSpecs(specs, availableModels);
|
|
155
|
+
return {
|
|
156
|
+
strategy: value.strategy,
|
|
157
|
+
participants,
|
|
158
|
+
nextIndex: Math.max(0, value.nextIndex ?? 0) % participants.length,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export function restoreDuetTurnFromBranch(state, branch) {
|
|
162
|
+
if (state.strategy !== "turns")
|
|
163
|
+
return;
|
|
164
|
+
let stateEntryIndex = -1;
|
|
165
|
+
for (let index = branch.length - 1; index >= 0; index--) {
|
|
166
|
+
const entry = branch[index];
|
|
167
|
+
if (entry.type === "custom" && entry.customType === DUET_STATE_ENTRY) {
|
|
168
|
+
stateEntryIndex = index;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
for (let index = branch.length - 1; index > stateEntryIndex; index--) {
|
|
173
|
+
const entry = branch[index];
|
|
174
|
+
if (entry.type !== "message")
|
|
175
|
+
continue;
|
|
176
|
+
const message = entry.message;
|
|
177
|
+
if (message.role !== "assistant")
|
|
178
|
+
continue;
|
|
179
|
+
const participantIndex = state.participants.findIndex((participant) => participant.model.provider === message.provider && participant.model.id === message.model);
|
|
180
|
+
if (participantIndex !== -1)
|
|
181
|
+
state.nextIndex = (participantIndex + 1) % state.participants.length;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function formatParticipant(participant) {
|
|
186
|
+
return `${participant.role}=${participant.modelRef}${participant.thinkingLevel ? `:${participant.thinkingLevel}` : ""}`;
|
|
187
|
+
}
|
|
188
|
+
export function buildDuetSystemPrompt(state, activeParticipant) {
|
|
189
|
+
if (state.strategy === "turns") {
|
|
190
|
+
const participant = activeParticipant ?? state.participants[0];
|
|
191
|
+
return [
|
|
192
|
+
"You are working in Draht duet turn-taking mode.",
|
|
193
|
+
`Your role for this turn is "${participant.role}" using ${participant.modelRef}.`,
|
|
194
|
+
"Other duet models share this same persisted conversation, tool history, and working tree.",
|
|
195
|
+
"Build on their work, state disagreements directly, and leave the session in a useful state for the next model.",
|
|
196
|
+
].join("\n");
|
|
197
|
+
}
|
|
198
|
+
const lead = state.participants[0];
|
|
199
|
+
const teammates = state.participants.slice(1).map(formatParticipant).join(", ");
|
|
200
|
+
return [
|
|
201
|
+
"You are the lead in Draht duet triage mode.",
|
|
202
|
+
`Lead role: ${formatParticipant(lead)}. Read-only teammates: ${teammates}.`,
|
|
203
|
+
"For non-trivial requests, triage the work into independent investigations and use duet_delegate once to run useful assignments in parallel.",
|
|
204
|
+
"Assignments must be self-contained and should request evidence, file paths, risks, or recommendations rather than edits.",
|
|
205
|
+
"Teammates cannot modify files. Synthesize their results, resolve disagreements, and perform all edits and commands in the shared session yourself.",
|
|
206
|
+
"Skip delegation for trivial work where it would only add latency or cost.",
|
|
207
|
+
].join("\n");
|
|
208
|
+
}
|
|
209
|
+
export function createDuetTeammateAgent(participant) {
|
|
210
|
+
return {
|
|
211
|
+
name: participant.role,
|
|
212
|
+
description: `Read-only duet teammate using ${participant.modelRef}`,
|
|
213
|
+
model: `${participant.modelRef}${participant.thinkingLevel ? `:${participant.thinkingLevel}` : ""}`,
|
|
214
|
+
tools: [...READ_ONLY_TEAMMATE_TOOLS],
|
|
215
|
+
disableExtensions: true,
|
|
216
|
+
source: "user",
|
|
217
|
+
systemPrompt: [
|
|
218
|
+
`You are "${participant.role}", a read-only teammate in a Draht duet session.`,
|
|
219
|
+
"Investigate only the assignment from the lead. Use read-only tools as needed.",
|
|
220
|
+
"Do not modify files and do not ask the user questions.",
|
|
221
|
+
"Return concise findings with evidence, file paths, risks, and a concrete recommendation for the lead.",
|
|
222
|
+
].join("\n"),
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
export function combineDuetUsage(results) {
|
|
226
|
+
const usages = results.map((result) => result.usage).filter((usage) => usage !== undefined);
|
|
227
|
+
if (usages.length === 0)
|
|
228
|
+
return undefined;
|
|
229
|
+
return usages.reduce((total, usage) => ({
|
|
230
|
+
input: total.input + usage.input,
|
|
231
|
+
output: total.output + usage.output,
|
|
232
|
+
cacheRead: total.cacheRead + usage.cacheRead,
|
|
233
|
+
cacheWrite: total.cacheWrite + usage.cacheWrite,
|
|
234
|
+
...(total.cacheWrite1h !== undefined || usage.cacheWrite1h !== undefined
|
|
235
|
+
? { cacheWrite1h: (total.cacheWrite1h ?? 0) + (usage.cacheWrite1h ?? 0) }
|
|
236
|
+
: {}),
|
|
237
|
+
...(total.reasoning !== undefined || usage.reasoning !== undefined
|
|
238
|
+
? { reasoning: (total.reasoning ?? 0) + (usage.reasoning ?? 0) }
|
|
239
|
+
: {}),
|
|
240
|
+
totalTokens: total.totalTokens + usage.totalTokens,
|
|
241
|
+
cost: {
|
|
242
|
+
input: total.cost.input + usage.cost.input,
|
|
243
|
+
output: total.cost.output + usage.cost.output,
|
|
244
|
+
cacheRead: total.cost.cacheRead + usage.cost.cacheRead,
|
|
245
|
+
cacheWrite: total.cost.cacheWrite + usage.cost.cacheWrite,
|
|
246
|
+
total: total.cost.total + usage.cost.total,
|
|
247
|
+
},
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
250
|
+
function truncateParticipantOutput(output) {
|
|
251
|
+
const truncated = truncateHead(output, {
|
|
252
|
+
maxBytes: Math.floor(DEFAULT_MAX_BYTES / 2),
|
|
253
|
+
maxLines: Math.floor(DEFAULT_MAX_LINES / 2),
|
|
254
|
+
});
|
|
255
|
+
if (!truncated.truncated)
|
|
256
|
+
return output;
|
|
257
|
+
return `${truncated.content}\n\n[Participant output truncated: showing ${formatSize(truncated.outputBytes)} of ${formatSize(truncated.totalBytes)}.]`;
|
|
258
|
+
}
|
|
259
|
+
function formatDelegateResults(results) {
|
|
260
|
+
const successful = results.filter((result) => result.exitCode === 0).length;
|
|
261
|
+
const sections = results.map((result) => {
|
|
262
|
+
const status = result.exitCode === 0 ? "completed" : "failed";
|
|
263
|
+
const output = truncateParticipantOutput(result.output || result.stderr || "(no output)");
|
|
264
|
+
return `## ${result.agent} (${status})\n\n${output}`;
|
|
265
|
+
});
|
|
266
|
+
const fullOutput = `Duet delegation: ${successful}/${results.length} completed\n\n${sections.join("\n\n---\n\n")}`;
|
|
267
|
+
const truncated = truncateHead(fullOutput, { maxBytes: DEFAULT_MAX_BYTES, maxLines: DEFAULT_MAX_LINES });
|
|
268
|
+
if (!truncated.truncated)
|
|
269
|
+
return fullOutput;
|
|
270
|
+
return `${truncated.content}\n\n[Duet output truncated: showing ${formatSize(truncated.outputBytes)} of ${formatSize(truncated.totalBytes)}.]`;
|
|
271
|
+
}
|
|
272
|
+
const DuetAssignment = Type.Object({
|
|
273
|
+
participant: Type.String({ description: "Configured teammate role to receive this assignment" }),
|
|
274
|
+
task: Type.String({ description: "Self-contained read-only investigation for the teammate" }),
|
|
275
|
+
});
|
|
276
|
+
const DuetDelegateParams = Type.Object({
|
|
277
|
+
assignments: Type.Array(DuetAssignment, {
|
|
278
|
+
description: "Independent assignments to run concurrently, at most one per teammate",
|
|
279
|
+
minItems: 1,
|
|
280
|
+
maxItems: MAX_DUET_PARTICIPANTS - 1,
|
|
281
|
+
}),
|
|
282
|
+
});
|
|
283
|
+
export default function duetBuiltin(pi) {
|
|
284
|
+
let state;
|
|
285
|
+
let activeTurnParticipant;
|
|
286
|
+
let pendingTurnParticipant;
|
|
287
|
+
let runningTurnParticipant;
|
|
288
|
+
let delegatedForPrompt = false;
|
|
289
|
+
let selectingParticipant = false;
|
|
290
|
+
pi.registerFlag("duet", {
|
|
291
|
+
description: "Comma-separated duet models: [role=]provider/model[:thinking]",
|
|
292
|
+
type: "string",
|
|
293
|
+
});
|
|
294
|
+
pi.registerFlag("duet-strategy", {
|
|
295
|
+
description: "Duet strategy: turns or triage",
|
|
296
|
+
type: "string",
|
|
297
|
+
default: "triage",
|
|
298
|
+
});
|
|
299
|
+
function persistState() {
|
|
300
|
+
pi.appendEntry(DUET_STATE_ENTRY, toPersistedState(state));
|
|
301
|
+
}
|
|
302
|
+
function setDelegateToolActive(active) {
|
|
303
|
+
if (active && !registerDuetDelegateTool())
|
|
304
|
+
return false;
|
|
305
|
+
if (!active && !duetDelegateToolRegistered)
|
|
306
|
+
return true;
|
|
307
|
+
const names = pi.getActiveTools().filter((name) => name !== DUET_DELEGATE_TOOL);
|
|
308
|
+
if (active)
|
|
309
|
+
names.push(DUET_DELEGATE_TOOL);
|
|
310
|
+
pi.setActiveTools(names);
|
|
311
|
+
return pi.getActiveTools().includes(DUET_DELEGATE_TOOL) === active;
|
|
312
|
+
}
|
|
313
|
+
function updateStatus(ctx) {
|
|
314
|
+
if (!state) {
|
|
315
|
+
ctx.ui.setStatus("duet", undefined);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
const role = state.strategy === "triage" ? state.participants[0].role : activeTurnParticipant?.role;
|
|
319
|
+
ctx.ui.setStatus("duet", `duet:${state.strategy}${role ? ` ${role}` : ""}`);
|
|
320
|
+
}
|
|
321
|
+
async function setParticipantModel(participant, ctx) {
|
|
322
|
+
selectingParticipant = true;
|
|
323
|
+
try {
|
|
324
|
+
if (!ctx.model || modelKey(ctx.model) !== participant.modelRef) {
|
|
325
|
+
const selected = await pi.setModel(participant.model, { persist: false });
|
|
326
|
+
if (!selected) {
|
|
327
|
+
ctx.ui.notify(`No authentication available for ${participant.modelRef}`, "error");
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (participant.thinkingLevel && ctx.thinkingLevel !== participant.thinkingLevel) {
|
|
332
|
+
pi.setThinkingLevel(participant.thinkingLevel, { persist: false });
|
|
333
|
+
}
|
|
334
|
+
return true;
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
ctx.ui.notify(`Could not select duet participant ${participant.role}: ${error instanceof Error ? error.message : String(error)}`, "error");
|
|
338
|
+
return false;
|
|
339
|
+
}
|
|
340
|
+
finally {
|
|
341
|
+
selectingParticipant = false;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
async function enableDuet(strategy, participants, ctx, persist) {
|
|
345
|
+
if (!ctx.isIdle()) {
|
|
346
|
+
ctx.ui.notify("Wait for the active response to finish before changing duet mode.", "warning");
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
const previousState = state;
|
|
350
|
+
const previousActiveParticipant = activeTurnParticipant;
|
|
351
|
+
state = { strategy, participants, nextIndex: 0 };
|
|
352
|
+
activeTurnParticipant =
|
|
353
|
+
strategy === "triage"
|
|
354
|
+
? participants[0]
|
|
355
|
+
: participants.find((participant) => participant.modelRef === (ctx.model ? modelKey(ctx.model) : undefined));
|
|
356
|
+
pendingTurnParticipant = undefined;
|
|
357
|
+
runningTurnParticipant = undefined;
|
|
358
|
+
if (strategy === "triage") {
|
|
359
|
+
const extensionProviders = new Set(ctx.modelRegistry.getRegisteredProviderIds());
|
|
360
|
+
const unsupported = participants
|
|
361
|
+
.slice(1)
|
|
362
|
+
.filter((participant) => extensionProviders.has(participant.model.provider));
|
|
363
|
+
if (unsupported.length > 0) {
|
|
364
|
+
state = previousState;
|
|
365
|
+
activeTurnParticipant = previousActiveParticipant;
|
|
366
|
+
ctx.ui.notify(`Duet teammates cannot use extension-provided models because teammate extensions are disabled: ${unsupported.map(formatParticipant).join(", ")}`, "error");
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (!setDelegateToolActive(strategy === "triage")) {
|
|
371
|
+
state = previousState;
|
|
372
|
+
activeTurnParticipant = previousActiveParticipant;
|
|
373
|
+
ctx.ui.notify(`Cannot enable duet triage because ${DUET_DELEGATE_TOOL} is excluded by the active tool configuration.`, "error");
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
if (strategy === "triage" && !(await setParticipantModel(participants[0], ctx))) {
|
|
377
|
+
state = previousState;
|
|
378
|
+
activeTurnParticipant = previousActiveParticipant;
|
|
379
|
+
setDelegateToolActive(previousState?.strategy === "triage");
|
|
380
|
+
return false;
|
|
381
|
+
}
|
|
382
|
+
if (persist)
|
|
383
|
+
persistState();
|
|
384
|
+
updateStatus(ctx);
|
|
385
|
+
return true;
|
|
386
|
+
}
|
|
387
|
+
function disableDuet(ctx, persist) {
|
|
388
|
+
if (persist && !ctx.isIdle()) {
|
|
389
|
+
ctx.ui.notify("Wait for the active response to finish before changing duet mode.", "warning");
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
state = undefined;
|
|
393
|
+
activeTurnParticipant = undefined;
|
|
394
|
+
pendingTurnParticipant = undefined;
|
|
395
|
+
runningTurnParticipant = undefined;
|
|
396
|
+
delegatedForPrompt = false;
|
|
397
|
+
setDelegateToolActive(false);
|
|
398
|
+
if (persist)
|
|
399
|
+
persistState();
|
|
400
|
+
updateStatus(ctx);
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
async function restoreDuetFromBranch(ctx) {
|
|
404
|
+
disableDuet(ctx, false);
|
|
405
|
+
const entry = [...ctx.sessionManager.getBranch()]
|
|
406
|
+
.reverse()
|
|
407
|
+
.find((candidate) => candidate.type === "custom" && candidate.customType === DUET_STATE_ENTRY);
|
|
408
|
+
if (!entry || entry.type !== "custom" || !isPersistedState(entry.data) || !entry.data.enabled)
|
|
409
|
+
return;
|
|
410
|
+
try {
|
|
411
|
+
const restored = restoreState(entry.data, ctx.modelRegistry.getAvailable());
|
|
412
|
+
if (restored && (await enableDuet(restored.strategy, restored.participants, ctx, false))) {
|
|
413
|
+
restoreDuetTurnFromBranch(restored, ctx.sessionManager.getBranch());
|
|
414
|
+
state = restored;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
disableDuet(ctx, false);
|
|
419
|
+
ctx.ui.notify(`Could not restore duet mode: ${error instanceof Error ? error.message : String(error)}`, "warning");
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
let duetDelegateToolRegistered = false;
|
|
423
|
+
function registerDuetDelegateTool() {
|
|
424
|
+
if (duetDelegateToolRegistered)
|
|
425
|
+
return true;
|
|
426
|
+
if (pi.getAllTools().some((tool) => tool.name === DUET_DELEGATE_TOOL))
|
|
427
|
+
return false;
|
|
428
|
+
pi.registerTool({
|
|
429
|
+
name: DUET_DELEGATE_TOOL,
|
|
430
|
+
label: "Duet Delegate",
|
|
431
|
+
description: "Delegate independent, read-only investigations to configured duet teammates in parallel. Available only in duet triage mode.",
|
|
432
|
+
parameters: DuetDelegateParams,
|
|
433
|
+
renderCall(args, theme) {
|
|
434
|
+
const lines = [theme.fg("toolTitle", theme.bold(`duet delegate (${args.assignments.length})`))];
|
|
435
|
+
for (const assignment of args.assignments) {
|
|
436
|
+
lines.push(` ${theme.fg("accent", assignment.participant)} ${theme.fg("toolOutput", assignment.task)}`);
|
|
437
|
+
}
|
|
438
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
439
|
+
},
|
|
440
|
+
renderResult(result, options, theme) {
|
|
441
|
+
const details = result.details;
|
|
442
|
+
const text = result.content
|
|
443
|
+
.filter((part) => part.type === "text")
|
|
444
|
+
.map((part) => part.text)
|
|
445
|
+
.join("\n");
|
|
446
|
+
if (options.isPartial && details?.status)
|
|
447
|
+
return new Text(theme.fg("muted", details.status), 0, 0);
|
|
448
|
+
const lines = text.split("\n");
|
|
449
|
+
const visible = options.expanded ? lines : lines.slice(0, 10);
|
|
450
|
+
if (!options.expanded && lines.length > visible.length)
|
|
451
|
+
visible.push(`... (${lines.length - visible.length} more lines)`);
|
|
452
|
+
return new Text(theme.fg("toolOutput", visible.join("\n")), 0, 0);
|
|
453
|
+
},
|
|
454
|
+
async execute(_toolCallId, params, signal, onUpdate, ctx) {
|
|
455
|
+
if (!state || state.strategy !== "triage") {
|
|
456
|
+
return {
|
|
457
|
+
content: [
|
|
458
|
+
{ type: "text", text: "Duet triage mode is not enabled. Use /duet triage first." },
|
|
459
|
+
],
|
|
460
|
+
details: { results: [] },
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
if (delegatedForPrompt) {
|
|
464
|
+
return {
|
|
465
|
+
content: [
|
|
466
|
+
{
|
|
467
|
+
type: "text",
|
|
468
|
+
text: "Duet delegation already ran for this user prompt. Synthesize the existing teammate results.",
|
|
469
|
+
},
|
|
470
|
+
],
|
|
471
|
+
details: { results: [] },
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
const teammates = new Map(state.participants.slice(1).map((participant) => [participant.role, participant]));
|
|
475
|
+
const assignedRoles = new Set();
|
|
476
|
+
const items = [];
|
|
477
|
+
for (const assignment of params.assignments) {
|
|
478
|
+
const participant = teammates.get(assignment.participant);
|
|
479
|
+
if (!participant) {
|
|
480
|
+
return {
|
|
481
|
+
content: [
|
|
482
|
+
{
|
|
483
|
+
type: "text",
|
|
484
|
+
text: `Unknown duet teammate "${assignment.participant}". Available: ${[...teammates.keys()].join(", ")}`,
|
|
485
|
+
},
|
|
486
|
+
],
|
|
487
|
+
details: { results: [] },
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
if (assignedRoles.has(participant.role)) {
|
|
491
|
+
return {
|
|
492
|
+
content: [
|
|
493
|
+
{
|
|
494
|
+
type: "text",
|
|
495
|
+
text: `Participant "${participant.role}" can receive only one assignment per delegation.`,
|
|
496
|
+
},
|
|
497
|
+
],
|
|
498
|
+
details: { results: [] },
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
assignedRoles.add(participant.role);
|
|
502
|
+
items.push({ agent: createDuetTeammateAgent(participant), task: assignment.task });
|
|
503
|
+
}
|
|
504
|
+
delegatedForPrompt = true;
|
|
505
|
+
const activity = new Map();
|
|
506
|
+
const results = await runParallelTasks(ctx.cwd, items, {
|
|
507
|
+
signal,
|
|
508
|
+
makeOnProgress: (role) => (message) => {
|
|
509
|
+
activity.set(role, message);
|
|
510
|
+
onUpdate?.({
|
|
511
|
+
content: [
|
|
512
|
+
{
|
|
513
|
+
type: "text",
|
|
514
|
+
text: [...activity].map(([name, text]) => `${name}: ${text}`).join("\n"),
|
|
515
|
+
},
|
|
516
|
+
],
|
|
517
|
+
details: {
|
|
518
|
+
results: [],
|
|
519
|
+
status: `${activity.size}/${items.length} teammates active`,
|
|
520
|
+
},
|
|
521
|
+
});
|
|
522
|
+
},
|
|
523
|
+
});
|
|
524
|
+
return {
|
|
525
|
+
content: [{ type: "text", text: formatDelegateResults(results) }],
|
|
526
|
+
usage: combineDuetUsage(results),
|
|
527
|
+
details: {
|
|
528
|
+
results: results.map((result) => ({ participant: result.agent, exitCode: result.exitCode })),
|
|
529
|
+
},
|
|
530
|
+
};
|
|
531
|
+
},
|
|
532
|
+
});
|
|
533
|
+
duetDelegateToolRegistered = true;
|
|
534
|
+
return true;
|
|
535
|
+
}
|
|
536
|
+
pi.registerCommand("duet", {
|
|
537
|
+
description: "Configure multi-model collaboration. Usage: /duet [turns|triage] [[role=]model,...] | off | status",
|
|
538
|
+
handler: async (args, ctx) => {
|
|
539
|
+
const trimmed = args.trim();
|
|
540
|
+
if (!trimmed || trimmed === "status") {
|
|
541
|
+
if (!state) {
|
|
542
|
+
ctx.ui.notify("Duet mode is off.", "info");
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
ctx.ui.notify(`Duet ${state.strategy}: ${state.participants.map(formatParticipant).join(", ")}`, "info");
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
if (["off", "none", "clear"].includes(trimmed)) {
|
|
549
|
+
if (disableDuet(ctx, true))
|
|
550
|
+
ctx.ui.notify("Duet mode disabled.", "info");
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
const firstSpace = trimmed.indexOf(" ");
|
|
554
|
+
const strategyText = firstSpace === -1 ? trimmed : trimmed.slice(0, firstSpace);
|
|
555
|
+
if (!isDuetStrategy(strategyText)) {
|
|
556
|
+
ctx.ui.notify("Usage: /duet [turns|triage] [[role=]provider/model,...] | off | status", "error");
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
try {
|
|
560
|
+
const specs = firstSpace === -1 ? "" : trimmed.slice(firstSpace + 1).trim();
|
|
561
|
+
const participants = specs
|
|
562
|
+
? parseDuetParticipantSpecs(specs, ctx.modelRegistry.getAvailable())
|
|
563
|
+
: participantsFromScopedModels(ctx);
|
|
564
|
+
if (await enableDuet(strategyText, participants, ctx, true)) {
|
|
565
|
+
ctx.ui.notify(`Duet ${strategyText} enabled: ${participants.map(formatParticipant).join(", ")}`, "info");
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
catch (error) {
|
|
569
|
+
ctx.ui.notify(error instanceof Error ? error.message : String(error), "error");
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
getArgumentCompletions: (partial) => {
|
|
573
|
+
const options = ["status", "off", "turns", "triage"];
|
|
574
|
+
return options
|
|
575
|
+
.filter((option) => option.startsWith(partial))
|
|
576
|
+
.map((option) => ({ value: option, label: option }));
|
|
577
|
+
},
|
|
578
|
+
});
|
|
579
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
580
|
+
disableDuet(ctx, false);
|
|
581
|
+
const duetFlag = pi.getFlag("duet");
|
|
582
|
+
const strategyFlag = pi.getFlag("duet-strategy");
|
|
583
|
+
if (typeof duetFlag === "string" && duetFlag.trim()) {
|
|
584
|
+
if (!isDuetStrategy(strategyFlag)) {
|
|
585
|
+
ctx.ui.notify(`Invalid --duet-strategy "${String(strategyFlag)}". Use turns or triage.`, "error");
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
try {
|
|
589
|
+
const participants = parseDuetParticipantSpecs(duetFlag, ctx.modelRegistry.getAvailable());
|
|
590
|
+
await enableDuet(strategyFlag, participants, ctx, true);
|
|
591
|
+
}
|
|
592
|
+
catch (error) {
|
|
593
|
+
ctx.ui.notify(error instanceof Error ? error.message : String(error), "error");
|
|
594
|
+
}
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
await restoreDuetFromBranch(ctx);
|
|
598
|
+
});
|
|
599
|
+
pi.on("session_tree", async (_event, ctx) => restoreDuetFromBranch(ctx));
|
|
600
|
+
pi.on("input", async (event, ctx) => {
|
|
601
|
+
if (!state || !ctx.isIdle() || event.text.startsWith("!"))
|
|
602
|
+
return { action: "continue" };
|
|
603
|
+
const participant = state.strategy === "triage" ? state.participants[0] : state.participants[state.nextIndex];
|
|
604
|
+
if (!(await setParticipantModel(participant, ctx)))
|
|
605
|
+
return { action: "handled" };
|
|
606
|
+
activeTurnParticipant = participant;
|
|
607
|
+
pendingTurnParticipant = state.strategy === "turns" ? participant : undefined;
|
|
608
|
+
updateStatus(ctx);
|
|
609
|
+
return { action: "continue" };
|
|
610
|
+
});
|
|
611
|
+
pi.on("agent_start", (_event, ctx) => {
|
|
612
|
+
if (!state || state.strategy !== "turns" || !pendingTurnParticipant)
|
|
613
|
+
return;
|
|
614
|
+
runningTurnParticipant = pendingTurnParticipant;
|
|
615
|
+
activeTurnParticipant = pendingTurnParticipant;
|
|
616
|
+
pendingTurnParticipant = undefined;
|
|
617
|
+
updateStatus(ctx);
|
|
618
|
+
});
|
|
619
|
+
pi.on("agent_settled", (_event, ctx) => {
|
|
620
|
+
if (!state || state.strategy !== "turns" || !runningTurnParticipant)
|
|
621
|
+
return;
|
|
622
|
+
const participantIndex = state.participants.findIndex((participant) => participant.role === runningTurnParticipant?.role);
|
|
623
|
+
if (participantIndex !== -1)
|
|
624
|
+
state.nextIndex = (participantIndex + 1) % state.participants.length;
|
|
625
|
+
runningTurnParticipant = undefined;
|
|
626
|
+
updateStatus(ctx);
|
|
627
|
+
});
|
|
628
|
+
pi.on("message_start", (event) => {
|
|
629
|
+
if (event.message.role === "user")
|
|
630
|
+
delegatedForPrompt = false;
|
|
631
|
+
});
|
|
632
|
+
pi.on("thinking_level_select", async (event, ctx) => {
|
|
633
|
+
if (!state || selectingParticipant)
|
|
634
|
+
return;
|
|
635
|
+
const expected = state.strategy === "triage"
|
|
636
|
+
? state.participants[0]
|
|
637
|
+
: (runningTurnParticipant ?? pendingTurnParticipant ?? activeTurnParticipant);
|
|
638
|
+
if (!expected?.thinkingLevel || event.level === expected.thinkingLevel)
|
|
639
|
+
return;
|
|
640
|
+
ctx.ui.notify(`Duet mode keeps the thinking level on ${expected.thinkingLevel} for ${expected.role}. Use /duet off to change it freely.`, "warning");
|
|
641
|
+
await setParticipantModel(expected, ctx);
|
|
642
|
+
});
|
|
643
|
+
pi.on("model_select", async (event, ctx) => {
|
|
644
|
+
if (!state || selectingParticipant)
|
|
645
|
+
return;
|
|
646
|
+
const expected = state.strategy === "triage"
|
|
647
|
+
? state.participants[0]
|
|
648
|
+
: (runningTurnParticipant ?? pendingTurnParticipant ?? activeTurnParticipant);
|
|
649
|
+
if (!expected || modelKey(event.model) === expected.modelRef)
|
|
650
|
+
return;
|
|
651
|
+
ctx.ui.notify(`Duet mode keeps the active model on ${formatParticipant(expected)}. Use /duet off to switch freely.`, "warning");
|
|
652
|
+
await setParticipantModel(expected, ctx);
|
|
653
|
+
});
|
|
654
|
+
pi.on("before_agent_start", (event) => {
|
|
655
|
+
if (!state)
|
|
656
|
+
return;
|
|
657
|
+
return { systemPrompt: `${event.systemPrompt}\n\n${buildDuetSystemPrompt(state, activeTurnParticipant)}` };
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
//# sourceMappingURL=duet.js.map
|