@draht/coding-agent 2026.7.13 → 2026.9.5-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +241 -0
- package/README.md +47 -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.js +2 -0
- package/dist/bun/cli.js.map +1 -1
- package/dist/cli/args.d.ts +10 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +80 -3
- 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/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/credential-print.d.ts +23 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +117 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/cli/list-models.d.ts +2 -2
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/startup-ui.js +1 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +31 -4
- 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 +90 -30
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +4 -7
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +24 -9
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +87 -27
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +337 -154
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +20 -104
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +104 -260
- package/dist/core/auth-storage.js.map +1 -1
- 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 +2 -2
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +1 -1
- package/dist/core/cache-stats.js.map +1 -1
- 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 +294 -0
- package/dist/core/checkpoints/checkpoint-manager.d.ts.map +1 -0
- package/dist/core/checkpoints/checkpoint-manager.js +865 -0
- package/dist/core/checkpoints/checkpoint-manager.js.map +1 -0
- package/dist/core/checkpoints/rewind.d.ts +141 -0
- package/dist/core/checkpoints/rewind.d.ts.map +1 -0
- package/dist/core/checkpoints/rewind.js +246 -0
- package/dist/core/checkpoints/rewind.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +9 -3
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +16 -14
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +24 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +96 -30
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +6 -17
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/context-windows.d.ts +7 -0
- package/dist/core/context-windows.d.ts.map +1 -0
- package/dist/core/context-windows.js +35 -0
- package/dist/core/context-windows.js.map +1 -0
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +101 -23
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +19 -3
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +117 -2
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +236 -9
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +22 -3
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +10 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- 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 +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +18 -3
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +12 -3
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config.d.ts +542 -0
- package/dist/core/model-config.d.ts.map +1 -0
- package/dist/core/model-config.js +247 -0
- package/dist/core/model-config.js.map +1 -0
- package/dist/core/model-registry.d.ts +19 -124
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +56 -727
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +7 -6
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +74 -27
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +89 -0
- package/dist/core/model-runtime.d.ts.map +1 -0
- package/dist/core/model-runtime.js +451 -0
- package/dist/core/model-runtime.js.map +1 -0
- package/dist/core/models-store.d.ts +17 -0
- package/dist/core/models-store.d.ts.map +1 -0
- package/dist/core/models-store.js +46 -0
- package/dist/core/models-store.js.map +1 -0
- package/dist/core/multi-agent/permission-gate.d.ts.map +1 -1
- package/dist/core/multi-agent/permission-gate.js +4 -3
- package/dist/core/multi-agent/permission-gate.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 +2 -2
- package/dist/core/multi-agent/worktree.js.map +1 -1
- package/dist/core/package-manager.d.ts +7 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +41 -45
- 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 +35 -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 +1 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +4 -4
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts +55 -0
- package/dist/core/provider-composer.d.ts.map +1 -0
- package/dist/core/provider-composer.js +375 -0
- package/dist/core/provider-composer.js.map +1 -0
- package/dist/core/radius.d.ts +2 -0
- package/dist/core/radius.d.ts.map +1 -0
- package/dist/core/radius.js +2 -0
- package/dist/core/radius.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -0
- package/dist/core/remote-catalog-provider.js +115 -0
- package/dist/core/remote-catalog-provider.js.map +1 -0
- package/dist/core/resource-loader.d.ts +36 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +159 -27
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -0
- package/dist/core/runtime-credentials.js +35 -0
- package/dist/core/runtime-credentials.js.map +1 -0
- 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 +92 -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 +3 -6
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +25 -22
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +74 -7
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +169 -34
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +22 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +36 -16
- 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 +19 -6
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- 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 +660 -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 +775 -26
- package/dist/core/socket-server/socket-server.js.map +1 -1
- package/dist/core/socket-server/types.d.ts +106 -2
- 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/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +10 -21
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +3 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +39 -7
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +17 -2
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +3 -0
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +11 -18
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/read.js +1 -1
- package/dist/core/tools/read.js.map +1 -1
- 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/trust-manager.d.ts +6 -4
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +55 -21
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts +19 -0
- package/dist/core/usage-totals.d.ts.map +1 -0
- package/dist/core/usage-totals.js +52 -0
- package/dist/core/usage-totals.js.map +1 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +7 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/llama/client.d.ts.map +1 -0
- package/dist/extensions/llama/client.js +300 -0
- package/dist/extensions/llama/client.js.map +1 -0
- package/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/llama/huggingface.d.ts.map +1 -0
- package/dist/extensions/llama/huggingface.js +139 -0
- package/dist/extensions/llama/huggingface.js.map +1 -0
- package/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/llama/index.d.ts.map +1 -0
- package/dist/extensions/llama/index.js +208 -0
- package/dist/extensions/llama/index.js.map +1 -0
- package/dist/extensions/llama/provider.d.ts +10 -0
- package/dist/extensions/llama/provider.d.ts.map +1 -0
- package/dist/extensions/llama/provider.js +111 -0
- package/dist/extensions/llama/provider.js.map +1 -0
- package/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/llama/ui.d.ts.map +1 -0
- package/dist/extensions/llama/ui.js +400 -0
- package/dist/extensions/llama/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 +193 -0
- package/dist/extensions/stub-provider/provider.js.map +1 -0
- package/dist/hooks/gsd/draht-quality-gate.js +3 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +305 -61
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +22 -10
- package/dist/modes/interactive/components/assistant-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 +3 -2
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +1 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +3 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +9 -2
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +1 -2
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +16 -46
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +49 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +202 -5
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +24 -23
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +5 -5
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +17 -8
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +11 -4
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +74 -41
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +4 -4
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +14 -25
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +22 -13
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +10 -2
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +10 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +10 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +25 -2
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +68 -17
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +12 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +37 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +107 -10
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +763 -285
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +4 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +7 -0
- 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 +185 -9
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +79 -1
- 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.map +1 -1
- package/dist/package-manager-cli.js +67 -5
- 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 +2 -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 +4 -13
- package/dist/prompts/commands/triage.md +159 -0
- package/dist/prompts/commands/verify-work.md +4 -14
- package/dist/prompts/commands/why.md +135 -0
- package/dist/skills/atomic-reasoning/SKILL.md +115 -0
- package/dist/skills/blast-radius/SKILL.md +55 -0
- package/dist/skills/epistemics/SKILL.md +99 -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 +101 -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/child-process.d.ts +12 -1
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +25 -8
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +1 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +53 -9
- package/dist/utils/clipboard.js.map +1 -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/paths.d.ts +2 -7
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +13 -15
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +6 -4
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +3 -5
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +3 -1
- package/dist/utils/version-check.js.map +1 -1
- package/docs/attachable-sessions.md +79 -0
- package/docs/compaction.md +29 -24
- package/docs/containerization.md +23 -23
- package/docs/custom-provider.md +66 -32
- package/docs/development.md +9 -9
- package/docs/docs.json +6 -2
- package/docs/duet.md +42 -0
- package/docs/environment-variables.md +88 -0
- package/docs/extensions.md +278 -65
- package/docs/index.md +12 -10
- package/docs/json.md +12 -8
- package/docs/keybindings.md +8 -5
- package/docs/llama-cpp.md +99 -0
- package/docs/models.md +19 -8
- package/docs/packages.md +43 -42
- package/docs/prompt-templates.md +5 -4
- package/docs/providers.md +45 -11
- package/docs/quickstart.md +33 -33
- package/docs/rpc.md +190 -19
- package/docs/sdk.md +18 -15
- package/docs/security.md +18 -18
- package/docs/session-format.md +53 -15
- package/docs/sessions.md +17 -14
- package/docs/settings.md +26 -19
- package/docs/shell-aliases.md +2 -2
- package/docs/skills.md +12 -11
- package/docs/terminal-setup.md +12 -12
- package/docs/termux.md +6 -6
- package/docs/themes.md +11 -11
- package/docs/tmux.md +4 -4
- package/docs/tui.md +46 -31
- package/docs/usage.md +53 -63
- package/docs/windows.md +2 -2
- package/examples/extensions/custom-compaction.ts +4 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +9 -3
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
- package/examples/extensions/gondolin/package.json +2 -2
- package/examples/extensions/handoff.ts +9 -1
- package/examples/extensions/kimi-deferred-tools.ts +61 -0
- package/examples/extensions/message-renderer.ts +2 -2
- package/examples/extensions/overlay-qa-tests.ts +3 -3
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/summarize.ts +3 -0
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/02-custom-model.ts +5 -8
- package/examples/sdk/09-api-keys-and-oauth.ts +15 -31
- package/examples/sdk/12-full-control.ts +9 -12
- package/hooks/gsd/draht-quality-gate.js +3 -3
- package/package.json +14 -11
- 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 +2 -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 +4 -13
- package/prompts/commands/triage.md +159 -0
- package/prompts/commands/verify-work.md +4 -14
- package/prompts/commands/why.md +135 -0
- package/skills/atomic-reasoning/SKILL.md +115 -0
- package/skills/blast-radius/SKILL.md +55 -0
- package/skills/epistemics/SKILL.md +99 -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 +101 -0
- package/dist/core/provider-display-names.d.ts +0 -2
- package/dist/core/provider-display-names.d.ts.map +0 -1
- package/dist/core/provider-display-names.js +0 -36
- package/dist/core/provider-display-names.js.map +0 -1
- 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/prompts/agents/build.md +0 -86
- package/prompts/agents/plan.md +0 -79
- package/prompts/agents/verify.md +0 -69
package/docs/rpc.md
CHANGED
|
@@ -7,7 +7,7 @@ RPC mode enables headless operation of the coding agent via a JSON protocol over
|
|
|
7
7
|
## Starting RPC Mode
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
draht --mode rpc [options]
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Common options:
|
|
@@ -23,7 +23,7 @@ Common options:
|
|
|
23
23
|
- **Responses**: JSON objects with `type: "response"` indicating command success/failure
|
|
24
24
|
- **Events**: Agent events streamed to stdout as JSON lines
|
|
25
25
|
|
|
26
|
-
All commands support an optional `id` field for request/response correlation. If provided, the corresponding response will include the same `id`.
|
|
26
|
+
All commands support an optional `id` field for request/response correlation. If provided, the corresponding response will include the same `id`. `bash_execution_update` events also include the `id` of their originating `bash` command.
|
|
27
27
|
|
|
28
28
|
### Framing
|
|
29
29
|
|
|
@@ -313,6 +313,26 @@ Response:
|
|
|
313
313
|
}
|
|
314
314
|
```
|
|
315
315
|
|
|
316
|
+
#### get_available_thinking_levels
|
|
317
|
+
|
|
318
|
+
List the thinking levels supported by the current model. Returns `["off"]` for a model without reasoning support.
|
|
319
|
+
|
|
320
|
+
```json
|
|
321
|
+
{"type": "get_available_thinking_levels"}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Response:
|
|
325
|
+
```json
|
|
326
|
+
{
|
|
327
|
+
"type": "response",
|
|
328
|
+
"command": "get_available_thinking_levels",
|
|
329
|
+
"success": true,
|
|
330
|
+
"data": {
|
|
331
|
+
"levels": ["off", "minimal", "low", "medium", "high"]
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
316
336
|
### Queue Modes
|
|
317
337
|
|
|
318
338
|
#### set_steering_mode
|
|
@@ -374,11 +394,22 @@ Response:
|
|
|
374
394
|
"summary": "Summary of conversation...",
|
|
375
395
|
"firstKeptEntryId": "abc123",
|
|
376
396
|
"tokensBefore": 150000,
|
|
397
|
+
"estimatedTokensAfter": 32000,
|
|
398
|
+
"usage": {
|
|
399
|
+
"input": 32000,
|
|
400
|
+
"output": 1200,
|
|
401
|
+
"cacheRead": 0,
|
|
402
|
+
"cacheWrite": 0,
|
|
403
|
+
"totalTokens": 33200,
|
|
404
|
+
"cost": {"input": 0.01, "output": 0.02, "cacheRead": 0, "cacheWrite": 0, "total": 0.03}
|
|
405
|
+
},
|
|
377
406
|
"details": {}
|
|
378
407
|
}
|
|
379
408
|
}
|
|
380
409
|
```
|
|
381
410
|
|
|
411
|
+
`estimatedTokensAfter` is a heuristic estimate over the rebuilt message context immediately after compaction, not a provider-exact token count. `usage` reports the LLM call or calls that generated the summary and may be omitted by custom compaction handlers.
|
|
412
|
+
|
|
382
413
|
#### set_auto_compaction
|
|
383
414
|
|
|
384
415
|
Enable or disable automatic compaction when context is nearly full.
|
|
@@ -424,15 +455,18 @@ Response:
|
|
|
424
455
|
|
|
425
456
|
#### bash
|
|
426
457
|
|
|
427
|
-
Execute a shell command and add output to conversation context.
|
|
458
|
+
Execute a shell command and add output to conversation context. Output streams as `bash_execution_update` events while the command runs; the response contains the final result.
|
|
428
459
|
|
|
429
460
|
```json
|
|
430
|
-
{"type": "bash", "command": "ls -la"}
|
|
461
|
+
{"id": "req-1", "type": "bash", "command": "ls -la"}
|
|
431
462
|
```
|
|
432
463
|
|
|
464
|
+
Include an `id` to associate streamed `bash_execution_update` events with this command.
|
|
465
|
+
|
|
433
466
|
Response:
|
|
434
467
|
```json
|
|
435
468
|
{
|
|
469
|
+
"id": "req-1",
|
|
436
470
|
"type": "response",
|
|
437
471
|
"command": "bash",
|
|
438
472
|
"success": true,
|
|
@@ -463,7 +497,7 @@ If output was truncated, includes `fullOutputPath`:
|
|
|
463
497
|
|
|
464
498
|
**How bash results reach the LLM:**
|
|
465
499
|
|
|
466
|
-
The `bash` command executes immediately and returns a `BashResult`. Internally, a `BashExecutionMessage` is created and stored in the agent's message state.
|
|
500
|
+
The `bash` command executes immediately and returns a `BashResult`. Internally, a `BashExecutionMessage` is created and stored in the agent's message state.
|
|
467
501
|
|
|
468
502
|
When the next `prompt` command is sent, all messages (including `BashExecutionMessage`) are transformed before being sent to the LLM. The `BashExecutionMessage` is converted to a `UserMessage` with this format:
|
|
469
503
|
|
|
@@ -478,7 +512,6 @@ drwxr-xr-x ...
|
|
|
478
512
|
This means:
|
|
479
513
|
1. Bash output is included in the LLM context on the **next prompt**, not immediately
|
|
480
514
|
2. Multiple bash commands can be executed before a prompt; all outputs will be included
|
|
481
|
-
3. No event is emitted for the `BashExecutionMessage` itself
|
|
482
515
|
|
|
483
516
|
#### abort_bash
|
|
484
517
|
|
|
@@ -534,7 +567,7 @@ Response:
|
|
|
534
567
|
}
|
|
535
568
|
```
|
|
536
569
|
|
|
537
|
-
`tokens`
|
|
570
|
+
`tokens` and `cost` include assistant messages, usage reported by tools, and compaction/branch-summary generation across the full session. `contextUsage` contains the actual current context-window estimate used for compaction and footer display.
|
|
538
571
|
|
|
539
572
|
`contextUsage` is omitted when no model or context window is available. `contextUsage.tokens` and `contextUsage.percent` are `null` immediately after compaction until a fresh post-compaction assistant response provides valid usage data.
|
|
540
573
|
|
|
@@ -753,7 +786,7 @@ Response:
|
|
|
753
786
|
}
|
|
754
787
|
```
|
|
755
788
|
|
|
756
|
-
The current session name is available via `get_state` in the `sessionName` field. To set the initial name when starting RPC mode, pass `--name <name>` or `-n <name>` to the `
|
|
789
|
+
The current session name is available via `get_state` in the `sessionName` field. To set the initial name when starting RPC mode, pass `--name <name>` or `-n <name>` to the `draht --mode rpc` process.
|
|
757
790
|
|
|
758
791
|
### Commands
|
|
759
792
|
|
|
@@ -773,9 +806,9 @@ Response:
|
|
|
773
806
|
"success": true,
|
|
774
807
|
"data": {
|
|
775
808
|
"commands": [
|
|
776
|
-
{"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.
|
|
777
|
-
{"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "location": "project", "path": "/home/user/myproject/.
|
|
778
|
-
{"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "location": "user", "path": "/home/user/.
|
|
809
|
+
{"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.draht/agent/extensions/session.ts"},
|
|
810
|
+
{"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "location": "project", "path": "/home/user/myproject/.draht/agent/prompts/fix-tests.md"},
|
|
811
|
+
{"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "location": "user", "path": "/home/user/.draht/agent/skills/brave-search/SKILL.md"}
|
|
779
812
|
]
|
|
780
813
|
}
|
|
781
814
|
}
|
|
@@ -789,8 +822,8 @@ Each command has:
|
|
|
789
822
|
- `"prompt"`: Loaded from a prompt template `.md` file
|
|
790
823
|
- `"skill"`: Loaded from a skill directory (name is prefixed with `skill:`)
|
|
791
824
|
- `location`: Where it was loaded from (optional, not present for extensions):
|
|
792
|
-
- `"user"`: User-level (`~/.
|
|
793
|
-
- `"project"`: Project-level (`./.
|
|
825
|
+
- `"user"`: User-level (`~/.draht/agent/`)
|
|
826
|
+
- `"project"`: Project-level (`./.draht/agent/`)
|
|
794
827
|
- `"path"`: Explicit path via CLI or settings
|
|
795
828
|
- `path`: Absolute file path to the command source (optional)
|
|
796
829
|
|
|
@@ -798,7 +831,7 @@ Each command has:
|
|
|
798
831
|
|
|
799
832
|
## Events
|
|
800
833
|
|
|
801
|
-
Events are streamed to stdout as JSON lines during agent operation. Events do
|
|
834
|
+
Events are streamed to stdout as JSON lines during agent operation. Events do not generally include an `id` field; `bash_execution_update` includes the `id` of its originating `bash` command when one was provided.
|
|
802
835
|
|
|
803
836
|
### Event Types
|
|
804
837
|
|
|
@@ -812,6 +845,7 @@ Events are streamed to stdout as JSON lines during agent operation. Events do NO
|
|
|
812
845
|
| `message_start` | Message begins |
|
|
813
846
|
| `message_update` | Streaming update (text/thinking/toolcall deltas) |
|
|
814
847
|
| `message_end` | Message completes |
|
|
848
|
+
| `bash_execution_update` | Direct RPC bash command output chunk |
|
|
815
849
|
| `tool_execution_start` | Tool begins execution |
|
|
816
850
|
| `tool_execution_update` | Tool execution progress (streaming output) |
|
|
817
851
|
| `tool_execution_end` | Tool completes |
|
|
@@ -820,6 +854,9 @@ Events are streamed to stdout as JSON lines during agent operation. Events do NO
|
|
|
820
854
|
| `compaction_end` | Compaction completes |
|
|
821
855
|
| `auto_retry_start` | Auto-retry begins (after transient error) |
|
|
822
856
|
| `auto_retry_end` | Auto-retry completes (success or final failure) |
|
|
857
|
+
| `summarization_retry_scheduled` | Retry scheduled for a transient compaction or branch-summary summarization error |
|
|
858
|
+
| `summarization_retry_attempt_start` | Retried summarization request starts |
|
|
859
|
+
| `summarization_retry_finished` | Summarization retry loop completes |
|
|
823
860
|
| `extension_error` | Extension threw an error |
|
|
824
861
|
|
|
825
862
|
### agent_start
|
|
@@ -844,7 +881,7 @@ Emitted when one low-level agent run completes. Contains all messages generated
|
|
|
844
881
|
|
|
845
882
|
### agent_settled
|
|
846
883
|
|
|
847
|
-
Emitted after the full session-level run settles. At this point
|
|
884
|
+
Emitted after the full session-level run settles. At this point draht will not continue automatically through retry, compaction retry, or queued follow-up messages.
|
|
848
885
|
|
|
849
886
|
```json
|
|
850
887
|
{"type": "agent_settled"}
|
|
@@ -917,6 +954,20 @@ Example streaming a text response:
|
|
|
917
954
|
{"type":"message_update","message":{...},"assistantMessageEvent":{"type":"text_end","contentIndex":0,"content":"Hello world","partial":{...}}}
|
|
918
955
|
```
|
|
919
956
|
|
|
957
|
+
### bash_execution_update
|
|
958
|
+
|
|
959
|
+
Emitted once for each output chunk from a direct `bash` command. `id` matches the command's `id`, allowing clients to associate output with the correct command.
|
|
960
|
+
|
|
961
|
+
Events stream all output while the command runs, even if the final `bash` response's `output` is truncated.
|
|
962
|
+
|
|
963
|
+
```json
|
|
964
|
+
{
|
|
965
|
+
"type": "bash_execution_update",
|
|
966
|
+
"id": "req-1",
|
|
967
|
+
"delta": "total 48\n"
|
|
968
|
+
}
|
|
969
|
+
```
|
|
970
|
+
|
|
920
971
|
### tool_execution_start / tool_execution_update / tool_execution_end
|
|
921
972
|
|
|
922
973
|
Emitted when a tool begins, streams progress, and completes execution.
|
|
@@ -992,6 +1043,15 @@ The `reason` field is `"manual"`, `"threshold"`, or `"overflow"`.
|
|
|
992
1043
|
"summary": "Summary of conversation...",
|
|
993
1044
|
"firstKeptEntryId": "abc123",
|
|
994
1045
|
"tokensBefore": 150000,
|
|
1046
|
+
"estimatedTokensAfter": 32000,
|
|
1047
|
+
"usage": {
|
|
1048
|
+
"input": 32000,
|
|
1049
|
+
"output": 1200,
|
|
1050
|
+
"cacheRead": 0,
|
|
1051
|
+
"cacheWrite": 0,
|
|
1052
|
+
"totalTokens": 33200,
|
|
1053
|
+
"cost": {"input": 0.01, "output": 0.02, "cacheRead": 0, "cacheWrite": 0, "total": 0.03}
|
|
1054
|
+
},
|
|
995
1055
|
"details": {}
|
|
996
1056
|
},
|
|
997
1057
|
"aborted": false,
|
|
@@ -1037,6 +1097,36 @@ On final failure (max retries exceeded):
|
|
|
1037
1097
|
}
|
|
1038
1098
|
```
|
|
1039
1099
|
|
|
1100
|
+
### summarization_retry_scheduled / summarization_retry_attempt_start / summarization_retry_finished
|
|
1101
|
+
|
|
1102
|
+
Emitted when compaction or branch-summary summarization retries after a transient provider error. These events use the same retry settings as automatic assistant-turn retries.
|
|
1103
|
+
|
|
1104
|
+
```json
|
|
1105
|
+
{
|
|
1106
|
+
"type": "summarization_retry_scheduled",
|
|
1107
|
+
"attempt": 1,
|
|
1108
|
+
"maxAttempts": 3,
|
|
1109
|
+
"delayMs": 2000,
|
|
1110
|
+
"errorMessage": "terminated"
|
|
1111
|
+
}
|
|
1112
|
+
```
|
|
1113
|
+
|
|
1114
|
+
```json
|
|
1115
|
+
{
|
|
1116
|
+
"type": "summarization_retry_attempt_start",
|
|
1117
|
+
"source": "compaction",
|
|
1118
|
+
"reason": "threshold"
|
|
1119
|
+
}
|
|
1120
|
+
```
|
|
1121
|
+
|
|
1122
|
+
For branch summaries, `source` is `"branchSummary"` and no `reason` is present.
|
|
1123
|
+
|
|
1124
|
+
```json
|
|
1125
|
+
{
|
|
1126
|
+
"type": "summarization_retry_finished"
|
|
1127
|
+
}
|
|
1128
|
+
```
|
|
1129
|
+
|
|
1040
1130
|
### extension_error
|
|
1041
1131
|
|
|
1042
1132
|
Emitted when an extension throws an error.
|
|
@@ -1201,7 +1291,7 @@ Set the terminal window/tab title. Fire-and-forget.
|
|
|
1201
1291
|
"type": "extension_ui_request",
|
|
1202
1292
|
"id": "uuid-8",
|
|
1203
1293
|
"method": "setTitle",
|
|
1204
|
-
"title": "
|
|
1294
|
+
"title": "draht - my project"
|
|
1205
1295
|
}
|
|
1206
1296
|
```
|
|
1207
1297
|
|
|
@@ -1220,7 +1310,7 @@ Set the text in the input editor. Fire-and-forget.
|
|
|
1220
1310
|
|
|
1221
1311
|
### Extension UI Responses (stdin)
|
|
1222
1312
|
|
|
1223
|
-
Responses are sent for dialog methods only (`select`, `confirm`, `input`, `editor`). The `id` must match the request.
|
|
1313
|
+
Responses are sent for dialog methods only (`select`, `confirm`, `input`, `editor`). The `id` must match the request. An answer whose `id` matches no open dialog is silently dropped.
|
|
1224
1314
|
|
|
1225
1315
|
#### Value response (select, input, editor)
|
|
1226
1316
|
|
|
@@ -1234,6 +1324,77 @@ Responses are sent for dialog methods only (`select`, `confirm`, `input`, `edito
|
|
|
1234
1324
|
{"type": "extension_ui_response", "id": "uuid-2", "confirmed": true}
|
|
1235
1325
|
```
|
|
1236
1326
|
|
|
1327
|
+
#### Naming the option that was chosen (`optionId`)
|
|
1328
|
+
|
|
1329
|
+
A request may carry a `detail` object describing what is being decided. When it does, `detail.options`
|
|
1330
|
+
is the immutable set of options that request offered, each stating its own meaning:
|
|
1331
|
+
|
|
1332
|
+
```json
|
|
1333
|
+
{
|
|
1334
|
+
"type": "extension_ui_request",
|
|
1335
|
+
"id": "uuid-2",
|
|
1336
|
+
"method": "confirm",
|
|
1337
|
+
"title": "Approve tool call?",
|
|
1338
|
+
"message": "bash wants to run a command",
|
|
1339
|
+
"detail": {
|
|
1340
|
+
"kind": "tool_permission",
|
|
1341
|
+
"toolCallId": "call-1",
|
|
1342
|
+
"toolName": "bash",
|
|
1343
|
+
"cwd": "/private/tmp/project",
|
|
1344
|
+
"command": "rm -rf build",
|
|
1345
|
+
"reason": "bash commands require approval by default",
|
|
1346
|
+
"options": [
|
|
1347
|
+
{"id": "approve", "label": "Yes", "decision": "approve"},
|
|
1348
|
+
{"id": "deny", "label": "No", "decision": "deny"}
|
|
1349
|
+
]
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
```
|
|
1353
|
+
|
|
1354
|
+
An answer may name which of those options was chosen by adding `optionId`:
|
|
1355
|
+
|
|
1356
|
+
```json
|
|
1357
|
+
{"type": "extension_ui_response", "id": "uuid-2", "confirmed": false, "optionId": "deny"}
|
|
1358
|
+
```
|
|
1359
|
+
|
|
1360
|
+
Rules, all enforced by the agent:
|
|
1361
|
+
|
|
1362
|
+
- `optionId` is **optional**. Clients that only know yes/no keep sending `confirmed` alone and are
|
|
1363
|
+
unaffected.
|
|
1364
|
+
- When present, it **decides**: the named option's own `decision` (`"approve"` or `"deny"`) wins over
|
|
1365
|
+
`confirmed`, in both directions. `{"confirmed": true, "optionId": "deny"}` denies. Never infer an
|
|
1366
|
+
option's meaning from its position in the array, from the array's length, or from its id — read
|
|
1367
|
+
`decision`.
|
|
1368
|
+
- When present, it must be **one of the ids that this request offered**. An id nobody offered, an id
|
|
1369
|
+
that appears twice in the offered set, and a present-but-non-string value such as
|
|
1370
|
+
`{"optionId": 123}` are all refused (see below). A wrongly-typed `optionId` is *not* treated as
|
|
1371
|
+
absent.
|
|
1372
|
+
- When the matching request offered **no options** — any dialog raised without `detail`, such as
|
|
1373
|
+
`/rewind`'s "Restore files?" confirm or `/agent`'s picker — there is nothing to validate against,
|
|
1374
|
+
so `optionId` is ignored and the answer decides on `confirmed` / `value` as usual. A client may
|
|
1375
|
+
therefore attach `optionId` unconditionally without risk of stranding those dialogs.
|
|
1376
|
+
|
|
1377
|
+
#### Refused response (`command: "extension_ui_response"`)
|
|
1378
|
+
|
|
1379
|
+
A rejected `optionId` is reported on stdout as an ordinary failed-command response — note that
|
|
1380
|
+
`command` here is `"extension_ui_response"`, a value **no client ever sends as a command**. Clients
|
|
1381
|
+
that switch exhaustively on `command` must expect it:
|
|
1382
|
+
|
|
1383
|
+
```json
|
|
1384
|
+
{
|
|
1385
|
+
"id": "uuid-2",
|
|
1386
|
+
"type": "response",
|
|
1387
|
+
"command": "extension_ui_response",
|
|
1388
|
+
"success": false,
|
|
1389
|
+
"error": "optionId \"not-an-option\" is not one of the options offered for this request; the request is still pending"
|
|
1390
|
+
}
|
|
1391
|
+
```
|
|
1392
|
+
|
|
1393
|
+
The `id` is the **dialog request id**, not a command id. The refusal does **not** consume the
|
|
1394
|
+
request: the dialog is still open and still answerable, and a subsequent valid answer — with a good
|
|
1395
|
+
`optionId`, or with none at all — decides it. A client that receives this line should correct its
|
|
1396
|
+
answer and send it again; ignoring it leaves the agent waiting.
|
|
1397
|
+
|
|
1237
1398
|
#### Cancellation response (any dialog)
|
|
1238
1399
|
|
|
1239
1400
|
Dismiss any dialog method. The extension receives `undefined` (for select/input/editor) or `false` (for confirm).
|
|
@@ -1344,11 +1505,21 @@ Stop reasons: `"stop"`, `"length"`, `"toolUse"`, `"error"`, `"aborted"`
|
|
|
1344
1505
|
"toolCallId": "call_123",
|
|
1345
1506
|
"toolName": "bash",
|
|
1346
1507
|
"content": [{"type": "text", "text": "total 48\ndrwxr-xr-x ..."}],
|
|
1508
|
+
"usage": {
|
|
1509
|
+
"input": 100,
|
|
1510
|
+
"output": 50,
|
|
1511
|
+
"cacheRead": 0,
|
|
1512
|
+
"cacheWrite": 0,
|
|
1513
|
+
"totalTokens": 150,
|
|
1514
|
+
"cost": {"input": 0.0003, "output": 0.00075, "cacheRead": 0, "cacheWrite": 0, "total": 0.00105}
|
|
1515
|
+
},
|
|
1347
1516
|
"isError": false,
|
|
1348
1517
|
"timestamp": 1733234567890
|
|
1349
1518
|
}
|
|
1350
1519
|
```
|
|
1351
1520
|
|
|
1521
|
+
`usage` is optional and reports nested LLM work performed by the tool. When present, it contributes to session token and cost totals.
|
|
1522
|
+
|
|
1352
1523
|
### BashExecutionMessage
|
|
1353
1524
|
|
|
1354
1525
|
Created by the `bash` RPC command (not by LLM tool calls):
|
|
@@ -1388,7 +1559,7 @@ import subprocess
|
|
|
1388
1559
|
import json
|
|
1389
1560
|
|
|
1390
1561
|
proc = subprocess.Popen(
|
|
1391
|
-
["
|
|
1562
|
+
["draht", "--mode", "rpc", "--no-session"],
|
|
1392
1563
|
stdin=subprocess.PIPE,
|
|
1393
1564
|
stdout=subprocess.PIPE,
|
|
1394
1565
|
text=True
|
|
@@ -1427,7 +1598,7 @@ For a complete example of handling the extension UI protocol, see [`examples/rpc
|
|
|
1427
1598
|
const { spawn } = require("child_process");
|
|
1428
1599
|
const { StringDecoder } = require("string_decoder");
|
|
1429
1600
|
|
|
1430
|
-
const agent = spawn("
|
|
1601
|
+
const agent = spawn("draht", ["--mode", "rpc", "--no-session"]);
|
|
1431
1602
|
|
|
1432
1603
|
function attachJsonlReader(stream, onLine) {
|
|
1433
1604
|
const decoder = new StringDecoder("utf8");
|
package/docs/sdk.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
>
|
|
1
|
+
> draht can help you use the SDK. Ask it to build an integration for your use case.
|
|
2
2
|
|
|
3
3
|
# SDK
|
|
4
4
|
|
|
5
|
-
The SDK provides programmatic access to
|
|
5
|
+
The SDK provides programmatic access to draht's agent capabilities. Use it to embed draht in other applications, build custom interfaces, or integrate with automated workflows.
|
|
6
6
|
|
|
7
7
|
**Example use cases:**
|
|
8
8
|
- Build a custom UI (web, desktop, mobile)
|
|
@@ -88,8 +88,8 @@ interface AgentSession {
|
|
|
88
88
|
sessionId: string;
|
|
89
89
|
|
|
90
90
|
// Model control
|
|
91
|
-
setModel(model: Model): Promise<void>;
|
|
92
|
-
setThinkingLevel(level: ThinkingLevel): void;
|
|
91
|
+
setModel(model: Model, options?: { persistDefault?: boolean }): Promise<void>;
|
|
92
|
+
setThinkingLevel(level: ThinkingLevel, options?: { persistDefault?: boolean }): void;
|
|
93
93
|
cycleModel(): Promise<ModelCycleResult | undefined>;
|
|
94
94
|
cycleThinkingLevel(): ThinkingLevel | undefined;
|
|
95
95
|
|
|
@@ -323,6 +323,9 @@ session.subscribe((event) => {
|
|
|
323
323
|
case "compaction_end":
|
|
324
324
|
case "auto_retry_start":
|
|
325
325
|
case "auto_retry_end":
|
|
326
|
+
case "summarization_retry_scheduled":
|
|
327
|
+
case "summarization_retry_attempt_start":
|
|
328
|
+
case "summarization_retry_finished":
|
|
326
329
|
break;
|
|
327
330
|
}
|
|
328
331
|
});
|
|
@@ -338,23 +341,23 @@ const { session } = await createAgentSession({
|
|
|
338
341
|
cwd: process.cwd(), // default
|
|
339
342
|
|
|
340
343
|
// Global config directory
|
|
341
|
-
agentDir: "~/.
|
|
344
|
+
agentDir: "~/.draht/agent", // default (expands ~)
|
|
342
345
|
});
|
|
343
346
|
```
|
|
344
347
|
|
|
345
348
|
`cwd` is used by `DefaultResourceLoader` for:
|
|
346
|
-
- Project extensions (`.
|
|
349
|
+
- Project extensions (`.draht/extensions/`)
|
|
347
350
|
- Project skills:
|
|
348
|
-
- `.
|
|
351
|
+
- `.draht/skills/`
|
|
349
352
|
- `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
|
|
350
|
-
- Project prompts (`.
|
|
353
|
+
- Project prompts (`.draht/prompts/`)
|
|
351
354
|
- Context files (`AGENTS.md` walking up from cwd)
|
|
352
355
|
- Session directory naming
|
|
353
356
|
|
|
354
357
|
`agentDir` is used by `DefaultResourceLoader` for:
|
|
355
358
|
- Global extensions (`extensions/`)
|
|
356
359
|
- Global skills:
|
|
357
|
-
- `skills/` under `agentDir` (for example `~/.
|
|
360
|
+
- `skills/` under `agentDir` (for example `~/.draht/agent/skills/`)
|
|
358
361
|
- `~/.agents/skills/`
|
|
359
362
|
- Global prompts (`prompts/`)
|
|
360
363
|
- Global context file (`AGENTS.md`)
|
|
@@ -444,7 +447,7 @@ API key resolution priority (handled by AuthStorage):
|
|
|
444
447
|
```typescript
|
|
445
448
|
import { AuthStorage, ModelRegistry } from "@draht/coding-agent";
|
|
446
449
|
|
|
447
|
-
// Default: uses ~/.
|
|
450
|
+
// Default: uses ~/.draht/agent/auth.json and ~/.draht/agent/models.json
|
|
448
451
|
const authStorage = AuthStorage.create();
|
|
449
452
|
const modelRegistry = ModelRegistry.create(authStorage);
|
|
450
453
|
|
|
@@ -500,7 +503,7 @@ Specify which built-in tools to enable:
|
|
|
500
503
|
- `noTools: "builtin"` disables default built-ins while keeping extension and custom tools enabled
|
|
501
504
|
- `excludeTools` disables specific built-in, extension, or custom tool names after any `tools` allowlist is applied
|
|
502
505
|
|
|
503
|
-
The `edit` tool returns `details.diff` for
|
|
506
|
+
The `edit` tool returns `details.diff` for draht's TUI display and `details.patch` as a standard unified patch for SDK consumers.
|
|
504
507
|
|
|
505
508
|
```typescript
|
|
506
509
|
import { createAgentSession } from "@draht/coding-agent";
|
|
@@ -582,7 +585,7 @@ If you pass `tools`, include each custom or extension tool name you want enabled
|
|
|
582
585
|
|
|
583
586
|
### Extensions
|
|
584
587
|
|
|
585
|
-
Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.
|
|
588
|
+
Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.draht/agent/extensions/`, `.draht/extensions/`, and settings.json extension sources.
|
|
586
589
|
|
|
587
590
|
```typescript
|
|
588
591
|
import { createAgentSession, DefaultResourceLoader } from "@draht/coding-agent";
|
|
@@ -861,8 +864,8 @@ const { session } = await createAgentSession({
|
|
|
861
864
|
**Project-specific settings:**
|
|
862
865
|
|
|
863
866
|
Settings load from two locations and merge:
|
|
864
|
-
1. Global: `~/.
|
|
865
|
-
2. Project: `<cwd>/.
|
|
867
|
+
1. Global: `~/.draht/agent/settings.json`
|
|
868
|
+
2. Project: `<cwd>/.draht/settings.json`
|
|
866
869
|
|
|
867
870
|
Project overrides global. Nested objects merge keys. Setters modify global settings by default.
|
|
868
871
|
|
|
@@ -1122,7 +1125,7 @@ See [RPC documentation](rpc.md) for the JSON protocol.
|
|
|
1122
1125
|
For subprocess-based integration without building with the SDK, use the CLI directly:
|
|
1123
1126
|
|
|
1124
1127
|
```bash
|
|
1125
|
-
|
|
1128
|
+
draht --mode rpc --no-session
|
|
1126
1129
|
```
|
|
1127
1130
|
|
|
1128
1131
|
See [RPC documentation](rpc.md) for the JSON protocol.
|
package/docs/security.md
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
# Security
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
draht is a local coding agent. It runs with the permissions of the user account that starts it, and it treats files writable by that user as inside the same local trust boundary.
|
|
4
4
|
|
|
5
5
|
## Project Trust
|
|
6
6
|
|
|
7
|
-
Project trust controls whether
|
|
7
|
+
Project trust controls whether draht loads project-local settings, resources, packages, and extensions. It is not a sandbox and it does not restrict what the model can ask tools to do after you start working in a directory.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
draht considers a project to have trust inputs when it finds any of these from the current working directory:
|
|
10
10
|
|
|
11
|
-
- `.
|
|
11
|
+
- `.draht/` in the current directory
|
|
12
12
|
- `.agents/skills` in the current directory or an ancestor directory
|
|
13
13
|
|
|
14
|
-
When an interactive session starts in a project with configs in `.
|
|
14
|
+
When an interactive session starts in a project with configs in `.draht` or `.agents/skills` and no saved decision for the current directory or a parent directory, draht follows `defaultProjectTrust` from global settings. The default value is `"ask"`, which asks whether to trust the project when UI is available. Saved decisions are stored by canonical directory in `~/.draht/agent/trust.json`, and the closest saved decision on the current or parent path applies before the global default.
|
|
15
15
|
|
|
16
|
-
Trusting a project allows
|
|
16
|
+
Trusting a project allows draht to load trust-gated project inputs, including:
|
|
17
17
|
|
|
18
|
-
- `.
|
|
19
|
-
- `.
|
|
18
|
+
- `.draht/settings.json`
|
|
19
|
+
- `.draht` resources such as extensions, skills, prompt templates, themes, and system prompt files
|
|
20
20
|
- missing project packages configured through project settings
|
|
21
21
|
- project-local extensions and project package-managed extensions
|
|
22
22
|
|
|
23
|
-
Declining trust skips protected resources. `AGENTS.md` and `CLAUDE.md` context files are loaded regardless of project trust unless context loading is disabled. Before trust is resolved,
|
|
23
|
+
Declining trust skips protected resources. `AGENTS.md` and `CLAUDE.md` context files are loaded regardless of project trust unless context loading is disabled. Before trust is resolved, draht only loads context files, user/global extensions, and CLI `-e` extensions. User/global and CLI extensions can handle the `project_trust` event; the first extension that returns a yes/no decision owns the decision.
|
|
24
24
|
|
|
25
25
|
Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, `defaultProjectTrust: "ask"` and `"never"` ignore such resources, while `"always"` trusts them. Use `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
|
|
26
26
|
|
|
27
27
|
## No Built-in Sandbox
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
draht does not include a built-in sandbox. Built-in tools can read files, write files, edit files, and run shell commands with the permissions of the draht process. Extensions are TypeScript modules that run with the same permissions. Package installs, shell commands, language servers, test commands, and other developer tools behave as ordinary local processes.
|
|
30
30
|
|
|
31
|
-
This is intentional.
|
|
31
|
+
This is intentional. draht is designed to operate on local source trees, invoke project toolchains, and integrate with the user's existing development environment. A partial in-process sandbox would be easy to misunderstand as a security boundary while still depending on the host shell, filesystem, package managers, credentials, and extension code. Real isolation needs to come from the operating system or a virtualization/container boundary.
|
|
32
32
|
|
|
33
|
-
Project trust is only an input-loading guard. It prevents a repository from silently changing
|
|
33
|
+
Project trust is only an input-loading guard. It prevents a repository from silently changing draht's settings or extensions before you approve it. It does not make untrusted code, untrusted prompts, or untrusted model output safe. Prompt injection from repository files, comments, documentation, context files, or build output is expected local-agent risk and cannot be reliably prevented by draht.
|
|
34
34
|
|
|
35
35
|
## Running Untrusted or Unmonitored Work
|
|
36
36
|
|
|
37
|
-
For untrusted repositories, generated code you do not intend to monitor closely, or unattended automation, run
|
|
37
|
+
For untrusted repositories, generated code you do not intend to monitor closely, or unattended automation, run draht in a contained environment. Use a container, VM, micro-VM, remote sandbox, or policy-controlled sandbox with only the files and credentials required for the task.
|
|
38
38
|
|
|
39
39
|
Common patterns are documented in [Containerization](containerization.md):
|
|
40
40
|
|
|
41
|
-
- run the whole `
|
|
42
|
-
- run host
|
|
41
|
+
- run the whole `draht` process inside OpenShell or Docker
|
|
42
|
+
- run host draht while routing built-in tool execution into a Gondolin micro-VM
|
|
43
43
|
- mount only the workspace paths the agent should access
|
|
44
|
-
- avoid mounting host `~/.
|
|
44
|
+
- avoid mounting host `~/.draht/agent` unless the container should access host sessions, settings, and credentials
|
|
45
45
|
- pass the minimum required API keys or use short-lived credentials
|
|
46
46
|
- restrict network access when the task does not need it
|
|
47
47
|
- review diffs and outputs before copying results back to trusted systems
|
|
@@ -50,6 +50,6 @@ If you bind-mount a host workspace read/write, writes from inside the container
|
|
|
50
50
|
|
|
51
51
|
## Reporting Security Issues
|
|
52
52
|
|
|
53
|
-
To report a security issue, follow the repository [Security Policy](https://github.com/
|
|
53
|
+
To report a security issue, follow the repository [Security Policy](https://github.com/draht-dev/draht/blob/main/SECURITY.md). Do not open a public issue for security-sensitive reports.
|
|
54
54
|
|
|
55
|
-
Expected local-agent behavior, lack of a built-in sandbox, prompt injection from untrusted content, and behavior of user-installed extensions or skills are generally outside the security boundary unless the report demonstrates a real privilege-boundary bypass or shows how
|
|
55
|
+
Expected local-agent behavior, lack of a built-in sandbox, prompt injection from untrusted content, and behavior of user-installed extensions or skills are generally outside the security boundary unless the report demonstrates a real privilege-boundary bypass or shows how draht grants access that the local user did not already have.
|