@draht/coding-agent 2026.7.30 → 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 +154 -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/cli/args.d.ts +10 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +69 -2
- 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/credential-print.d.ts +1 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +5 -4
- package/dist/cli/credential-print.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 +87 -30
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +35 -16
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +149 -64
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +5 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +72 -15
- 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/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 +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +9 -4
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +5 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +25 -4
- package/dist/core/compaction/compaction.js.map +1 -1
- 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 +83 -20
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +13 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +37 -2
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +189 -6
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.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 +5 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +1 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-registry.d.ts +3 -2
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +8 -8
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +34 -7
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +7 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +30 -10
- package/dist/core/model-runtime.js.map +1 -1
- 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 +21 -44
- 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/resource-loader.d.ts +21 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +101 -24
- package/dist/core/resource-loader.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 +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.map +1 -1
- package/dist/core/sdk.js +3 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +60 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +53 -6
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +21 -0
- 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 +8 -9
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +5 -2
- 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/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/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +5 -1
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +5 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- 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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +242 -45
- package/dist/main.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/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/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 +20 -2
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +21 -5
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +97 -3
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +394 -24
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +165 -7
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +68 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.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.d.ts +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +22 -2
- 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/docs/attachable-sessions.md +79 -0
- package/docs/compaction.md +21 -21
- package/docs/containerization.md +23 -23
- package/docs/custom-provider.md +16 -16
- package/docs/development.md +9 -9
- package/docs/docs.json +6 -2
- package/docs/duet.md +42 -0
- package/docs/extensions.md +58 -58
- package/docs/index.md +10 -10
- package/docs/json.md +7 -7
- package/docs/keybindings.md +6 -5
- package/docs/llama-cpp.md +6 -6
- package/docs/models.md +6 -6
- package/docs/packages.md +43 -43
- package/docs/prompt-templates.md +4 -4
- package/docs/providers.md +12 -12
- package/docs/quickstart.md +32 -32
- package/docs/rpc.md +83 -12
- package/docs/sdk.md +15 -15
- package/docs/security.md +18 -18
- package/docs/session-format.md +35 -13
- package/docs/sessions.md +17 -14
- package/docs/settings.md +25 -18
- 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 +5 -5
- package/docs/usage.md +50 -50
- package/docs/windows.md +2 -2
- package/examples/extensions/overlay-qa-tests.ts +3 -3
- package/hooks/gsd/draht-quality-gate.js +3 -3
- package/package.json +11 -10
- 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/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:
|
|
@@ -786,7 +786,7 @@ Response:
|
|
|
786
786
|
}
|
|
787
787
|
```
|
|
788
788
|
|
|
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 `
|
|
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.
|
|
790
790
|
|
|
791
791
|
### Commands
|
|
792
792
|
|
|
@@ -806,9 +806,9 @@ Response:
|
|
|
806
806
|
"success": true,
|
|
807
807
|
"data": {
|
|
808
808
|
"commands": [
|
|
809
|
-
{"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.
|
|
810
|
-
{"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "location": "project", "path": "/home/user/myproject/.
|
|
811
|
-
{"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"}
|
|
812
812
|
]
|
|
813
813
|
}
|
|
814
814
|
}
|
|
@@ -822,8 +822,8 @@ Each command has:
|
|
|
822
822
|
- `"prompt"`: Loaded from a prompt template `.md` file
|
|
823
823
|
- `"skill"`: Loaded from a skill directory (name is prefixed with `skill:`)
|
|
824
824
|
- `location`: Where it was loaded from (optional, not present for extensions):
|
|
825
|
-
- `"user"`: User-level (`~/.
|
|
826
|
-
- `"project"`: Project-level (`./.
|
|
825
|
+
- `"user"`: User-level (`~/.draht/agent/`)
|
|
826
|
+
- `"project"`: Project-level (`./.draht/agent/`)
|
|
827
827
|
- `"path"`: Explicit path via CLI or settings
|
|
828
828
|
- `path`: Absolute file path to the command source (optional)
|
|
829
829
|
|
|
@@ -881,7 +881,7 @@ Emitted when one low-level agent run completes. Contains all messages generated
|
|
|
881
881
|
|
|
882
882
|
### agent_settled
|
|
883
883
|
|
|
884
|
-
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.
|
|
885
885
|
|
|
886
886
|
```json
|
|
887
887
|
{"type": "agent_settled"}
|
|
@@ -1291,7 +1291,7 @@ Set the terminal window/tab title. Fire-and-forget.
|
|
|
1291
1291
|
"type": "extension_ui_request",
|
|
1292
1292
|
"id": "uuid-8",
|
|
1293
1293
|
"method": "setTitle",
|
|
1294
|
-
"title": "
|
|
1294
|
+
"title": "draht - my project"
|
|
1295
1295
|
}
|
|
1296
1296
|
```
|
|
1297
1297
|
|
|
@@ -1310,7 +1310,7 @@ Set the text in the input editor. Fire-and-forget.
|
|
|
1310
1310
|
|
|
1311
1311
|
### Extension UI Responses (stdin)
|
|
1312
1312
|
|
|
1313
|
-
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.
|
|
1314
1314
|
|
|
1315
1315
|
#### Value response (select, input, editor)
|
|
1316
1316
|
|
|
@@ -1324,6 +1324,77 @@ Responses are sent for dialog methods only (`select`, `confirm`, `input`, `edito
|
|
|
1324
1324
|
{"type": "extension_ui_response", "id": "uuid-2", "confirmed": true}
|
|
1325
1325
|
```
|
|
1326
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
|
+
|
|
1327
1398
|
#### Cancellation response (any dialog)
|
|
1328
1399
|
|
|
1329
1400
|
Dismiss any dialog method. The extension receives `undefined` (for select/input/editor) or `false` (for confirm).
|
|
@@ -1488,7 +1559,7 @@ import subprocess
|
|
|
1488
1559
|
import json
|
|
1489
1560
|
|
|
1490
1561
|
proc = subprocess.Popen(
|
|
1491
|
-
["
|
|
1562
|
+
["draht", "--mode", "rpc", "--no-session"],
|
|
1492
1563
|
stdin=subprocess.PIPE,
|
|
1493
1564
|
stdout=subprocess.PIPE,
|
|
1494
1565
|
text=True
|
|
@@ -1527,7 +1598,7 @@ For a complete example of handling the extension UI protocol, see [`examples/rpc
|
|
|
1527
1598
|
const { spawn } = require("child_process");
|
|
1528
1599
|
const { StringDecoder } = require("string_decoder");
|
|
1529
1600
|
|
|
1530
|
-
const agent = spawn("
|
|
1601
|
+
const agent = spawn("draht", ["--mode", "rpc", "--no-session"]);
|
|
1531
1602
|
|
|
1532
1603
|
function attachJsonlReader(stream, onLine) {
|
|
1533
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
|
|
|
@@ -341,23 +341,23 @@ const { session } = await createAgentSession({
|
|
|
341
341
|
cwd: process.cwd(), // default
|
|
342
342
|
|
|
343
343
|
// Global config directory
|
|
344
|
-
agentDir: "~/.
|
|
344
|
+
agentDir: "~/.draht/agent", // default (expands ~)
|
|
345
345
|
});
|
|
346
346
|
```
|
|
347
347
|
|
|
348
348
|
`cwd` is used by `DefaultResourceLoader` for:
|
|
349
|
-
- Project extensions (`.
|
|
349
|
+
- Project extensions (`.draht/extensions/`)
|
|
350
350
|
- Project skills:
|
|
351
|
-
- `.
|
|
351
|
+
- `.draht/skills/`
|
|
352
352
|
- `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
|
|
353
|
-
- Project prompts (`.
|
|
353
|
+
- Project prompts (`.draht/prompts/`)
|
|
354
354
|
- Context files (`AGENTS.md` walking up from cwd)
|
|
355
355
|
- Session directory naming
|
|
356
356
|
|
|
357
357
|
`agentDir` is used by `DefaultResourceLoader` for:
|
|
358
358
|
- Global extensions (`extensions/`)
|
|
359
359
|
- Global skills:
|
|
360
|
-
- `skills/` under `agentDir` (for example `~/.
|
|
360
|
+
- `skills/` under `agentDir` (for example `~/.draht/agent/skills/`)
|
|
361
361
|
- `~/.agents/skills/`
|
|
362
362
|
- Global prompts (`prompts/`)
|
|
363
363
|
- Global context file (`AGENTS.md`)
|
|
@@ -447,7 +447,7 @@ API key resolution priority (handled by AuthStorage):
|
|
|
447
447
|
```typescript
|
|
448
448
|
import { AuthStorage, ModelRegistry } from "@draht/coding-agent";
|
|
449
449
|
|
|
450
|
-
// Default: uses ~/.
|
|
450
|
+
// Default: uses ~/.draht/agent/auth.json and ~/.draht/agent/models.json
|
|
451
451
|
const authStorage = AuthStorage.create();
|
|
452
452
|
const modelRegistry = ModelRegistry.create(authStorage);
|
|
453
453
|
|
|
@@ -503,7 +503,7 @@ Specify which built-in tools to enable:
|
|
|
503
503
|
- `noTools: "builtin"` disables default built-ins while keeping extension and custom tools enabled
|
|
504
504
|
- `excludeTools` disables specific built-in, extension, or custom tool names after any `tools` allowlist is applied
|
|
505
505
|
|
|
506
|
-
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.
|
|
507
507
|
|
|
508
508
|
```typescript
|
|
509
509
|
import { createAgentSession } from "@draht/coding-agent";
|
|
@@ -585,7 +585,7 @@ If you pass `tools`, include each custom or extension tool name you want enabled
|
|
|
585
585
|
|
|
586
586
|
### Extensions
|
|
587
587
|
|
|
588
|
-
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.
|
|
589
589
|
|
|
590
590
|
```typescript
|
|
591
591
|
import { createAgentSession, DefaultResourceLoader } from "@draht/coding-agent";
|
|
@@ -864,8 +864,8 @@ const { session } = await createAgentSession({
|
|
|
864
864
|
**Project-specific settings:**
|
|
865
865
|
|
|
866
866
|
Settings load from two locations and merge:
|
|
867
|
-
1. Global: `~/.
|
|
868
|
-
2. Project: `<cwd>/.
|
|
867
|
+
1. Global: `~/.draht/agent/settings.json`
|
|
868
|
+
2. Project: `<cwd>/.draht/settings.json`
|
|
869
869
|
|
|
870
870
|
Project overrides global. Nested objects merge keys. Setters modify global settings by default.
|
|
871
871
|
|
|
@@ -1125,7 +1125,7 @@ See [RPC documentation](rpc.md) for the JSON protocol.
|
|
|
1125
1125
|
For subprocess-based integration without building with the SDK, use the CLI directly:
|
|
1126
1126
|
|
|
1127
1127
|
```bash
|
|
1128
|
-
|
|
1128
|
+
draht --mode rpc --no-session
|
|
1129
1129
|
```
|
|
1130
1130
|
|
|
1131
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.
|
package/docs/session-format.md
CHANGED
|
@@ -5,16 +5,16 @@ Sessions are stored as JSONL (JSON Lines) files. Each line is a JSON object with
|
|
|
5
5
|
## File Location
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
~/.
|
|
8
|
+
~/.draht/agent/sessions/--<path>--/<timestamp>_<uuid>.jsonl
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Where `<path>` is the working directory with `/` replaced by `-`.
|
|
12
12
|
|
|
13
13
|
## Deleting Sessions
|
|
14
14
|
|
|
15
|
-
Sessions can be removed by deleting their `.jsonl` files under `~/.
|
|
15
|
+
Sessions can be removed by deleting their `.jsonl` files under `~/.draht/agent/sessions/`.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
draht also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, draht uses the `trash` CLI to avoid permanent deletion.
|
|
18
18
|
|
|
19
19
|
## Session Version
|
|
20
20
|
|
|
@@ -28,11 +28,11 @@ Existing sessions are automatically migrated to the current version (v3) when lo
|
|
|
28
28
|
|
|
29
29
|
## Source Files
|
|
30
30
|
|
|
31
|
-
Source on GitHub ([
|
|
32
|
-
- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/
|
|
33
|
-
- [`packages/coding-agent/src/core/messages.ts`](https://github.com/
|
|
34
|
-
- [`packages/ai/src/types.ts`](https://github.com/
|
|
35
|
-
- [`packages/agent/src/types.ts`](https://github.com/
|
|
31
|
+
Source on GitHub ([draht](https://github.com/draht-dev/draht)):
|
|
32
|
+
- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
|
|
33
|
+
- [`packages/coding-agent/src/core/messages.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
|
|
34
|
+
- [`packages/ai/src/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
|
|
35
|
+
- [`packages/agent/src/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/agent/src/types.ts) - AgentMessage union type
|
|
36
36
|
|
|
37
37
|
For TypeScript definitions in your project, inspect `node_modules/@draht/coding-agent/dist/` and `node_modules/@draht/ai/dist/`.
|
|
38
38
|
|
|
@@ -69,7 +69,7 @@ interface ToolCall {
|
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
### Base Message Types (from
|
|
72
|
+
### Base Message Types (from @draht/ai)
|
|
73
73
|
|
|
74
74
|
```typescript
|
|
75
75
|
interface UserMessage {
|
|
@@ -117,9 +117,9 @@ interface Usage {
|
|
|
117
117
|
}
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
The exported
|
|
120
|
+
The exported @draht/ai `StopReason` type also includes `"pending"`, but that value is reserved for partial messages in streaming events. Terminal `done`/`error` messages replace it with a completion reason before draht persists the assistant message, so `"pending"` should never appear in session JSONL.
|
|
121
121
|
|
|
122
|
-
### Extended Message Types (from
|
|
122
|
+
### Extended Message Types (from @draht/coding-agent)
|
|
123
123
|
|
|
124
124
|
```typescript
|
|
125
125
|
interface BashExecutionMessage {
|
|
@@ -244,7 +244,7 @@ Optional fields:
|
|
|
244
244
|
- `usage`: LLM usage from generating the summary; included in session token and cost totals
|
|
245
245
|
- `retainedTail`: Materialized `AgentMessage[]` kept after compaction. This is optional only for backward compatibility with older sessions. Newer harness-generated compactions include it so we can rebuild context from this checkpoint without walking older entries before the compaction entry.
|
|
246
246
|
- `details`: Implementation-specific data (e.g., `{ readFiles: string[], modifiedFiles: string[] }` for default, or custom data for extensions)
|
|
247
|
-
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if
|
|
247
|
+
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if draht-generated (legacy field name)
|
|
248
248
|
- `firstKeptEntryId`: for compatibility with old entry format.
|
|
249
249
|
|
|
250
250
|
### BranchSummaryEntry
|
|
@@ -258,7 +258,7 @@ Created when switching branches via `/tree` with an LLM generated summary of the
|
|
|
258
258
|
Optional fields:
|
|
259
259
|
- `usage`: LLM usage from generating the summary; included in session token and cost totals
|
|
260
260
|
- `details`: File tracking data (`{ readFiles: string[], modifiedFiles: string[] }`) for default, or custom data for extensions
|
|
261
|
-
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if
|
|
261
|
+
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if draht-generated (legacy field name)
|
|
262
262
|
|
|
263
263
|
### CustomEntry
|
|
264
264
|
|
|
@@ -303,6 +303,26 @@ Session metadata (e.g., user-defined display name). Set via `/name`, `--name` /
|
|
|
303
303
|
|
|
304
304
|
The session name is displayed in the session selector (`/resume`) instead of the first message when set.
|
|
305
305
|
|
|
306
|
+
### PermissionResolutionEntry
|
|
307
|
+
|
|
308
|
+
Audit record of a resolved tool-permission request: what was asked, which options were offered, what was decided, and which surface decided it. Does NOT participate in LLM context.
|
|
309
|
+
|
|
310
|
+
```json
|
|
311
|
+
{"type":"permission_resolution","id":"l2m3n4o5","parentId":"k1l2m3n4","timestamp":"2024-12-03T14:40:02.000Z","requestId":"perm_01HV","toolCallId":"call_456","toolName":"bash","cwd":"/path/to/project","detail":{"command":"rm -rf build"},"offeredOptionIds":["approve","approve-always","deny"],"decision":"approved","chosenOptionId":"approve","decidedBy":{"surface":"attach","clientId":"client-7"},"requestedAt":"2024-12-03T14:40:00.000Z","deadline":"2024-12-03T14:45:00.000Z"}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Fields:
|
|
315
|
+
- `requestId`: relay-scoped id of the permission request this resolves
|
|
316
|
+
- `cwd`: canonical (realpath) working directory the tool call was evaluated against
|
|
317
|
+
- `detail`: `{ command?, path?, operation? }` — the decisive part of the tool input
|
|
318
|
+
- `offeredOptionIds`: the immutable option set that was offered, in the order it was offered
|
|
319
|
+
- `decision`: `approved` | `denied` | `cancelled` | `expired`
|
|
320
|
+
- `chosenOptionId`: `null` when nothing was chosen (cancelled/expired)
|
|
321
|
+
- `decidedBy.surface`: `tui` | `attach` | `rpc` | `acp` | `system`; `clientId` is `null` for local/system decisions
|
|
322
|
+
- `deadline`: advisory expiry communicated with the ask, or `null`
|
|
323
|
+
|
|
324
|
+
This is a RECORD ONLY and must never be treated as answerable state: `createBranchedSession` copies path entries verbatim into a fork (so `requestId`/`toolCallId` can appear in more than one session), the entry becomes the leaf on reload (the next appended message parents off it), and the RPC `get_entries` command ships it verbatim to connected clients.
|
|
325
|
+
|
|
306
326
|
## Tree Structure
|
|
307
327
|
|
|
308
328
|
Entries form a tree:
|
|
@@ -338,6 +358,7 @@ Entries form a tree:
|
|
|
338
358
|
- `branch_summary` -> `branchSummary`
|
|
339
359
|
- `custom_message` -> `CustomMessage`
|
|
340
360
|
- `custom` -> no context message
|
|
361
|
+
- `permission_resolution` -> no context message
|
|
341
362
|
|
|
342
363
|
This makes newer compactions act like self-contained checkpoints. `retainedTail` is optional only so older sessions that only store `firstKeptEntryId` continue to load correctly.
|
|
343
364
|
|
|
@@ -410,6 +431,7 @@ Key methods for working with sessions programmatically.
|
|
|
410
431
|
- `appendCompaction(summary, firstKeptEntryId, tokensBefore, details?, fromHook?)` - Add compaction
|
|
411
432
|
- `appendCustomEntry(customType, data?)` - Extension state (not in context)
|
|
412
433
|
- `appendSessionInfo(name)` - Set session display name
|
|
434
|
+
- `appendPermissionResolution(resolution)` - Record a resolved permission request (not in context)
|
|
413
435
|
- `appendCustomMessageEntry(customType, content, display, details?)` - Extension message (in context)
|
|
414
436
|
- `appendLabelChange(targetId, label)` - Set/clear label
|
|
415
437
|
|
package/docs/sessions.md
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
# Sessions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
draht saves conversations as sessions so you can continue work, branch from earlier turns, and revisit previous paths.
|
|
4
4
|
|
|
5
5
|
## Session Storage
|
|
6
6
|
|
|
7
|
-
Sessions auto-save to `~/.
|
|
7
|
+
Sessions auto-save to `~/.draht/agent/sessions/`, organized by working directory. Each session is a JSONL file with a tree structure.
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
draht -c # Continue most recent session
|
|
11
|
+
draht -r # Browse and select from past sessions
|
|
12
|
+
draht --no-session # Ephemeral mode; do not save
|
|
13
|
+
draht --name "my task" # Set session display name at startup
|
|
14
|
+
draht --session <path|id> # Use a specific session file or partial session ID
|
|
15
|
+
draht --fork <path|id> # Fork a session file or partial session ID into a new session
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Use `/session` in interactive mode to see the current session file, session ID, message count, tokens, and cost.
|
|
19
19
|
|
|
20
20
|
For the JSONL file format and SessionManager API, see [Session Format](session-format.md).
|
|
21
21
|
|
|
22
|
+
To expose a running session on a Unix socket and watch or drive it from another terminal, see
|
|
23
|
+
[Attachable Sessions](attachable-sessions.md) (`--attachable`, `--attach`, `--list-sessions`).
|
|
24
|
+
|
|
22
25
|
## Session Commands
|
|
23
26
|
|
|
24
27
|
| Command | Description |
|
|
@@ -36,7 +39,7 @@ For the JSONL file format and SessionManager API, see [Session Format](session-f
|
|
|
36
39
|
|
|
37
40
|
## Resuming and Deleting Sessions
|
|
38
41
|
|
|
39
|
-
`/resume` opens an interactive session picker for the current project. `
|
|
42
|
+
`/resume` opens an interactive session picker for the current project. `draht -r` opens the same picker at startup.
|
|
40
43
|
|
|
41
44
|
In the picker you can:
|
|
42
45
|
|
|
@@ -47,7 +50,7 @@ In the picker you can:
|
|
|
47
50
|
- rename with Ctrl+R
|
|
48
51
|
- delete with Ctrl+D, then confirm
|
|
49
52
|
|
|
50
|
-
When available,
|
|
53
|
+
When available, draht uses the `trash` CLI for deletion instead of permanently removing files.
|
|
51
54
|
|
|
52
55
|
## Naming Sessions
|
|
53
56
|
|
|
@@ -60,11 +63,11 @@ Use `/name <name>` to set a human-readable session name:
|
|
|
60
63
|
Set the name at startup with `--name` or `-n`:
|
|
61
64
|
|
|
62
65
|
```bash
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
draht --name "Refactor auth module"
|
|
67
|
+
draht --name "CI audit" -p "Review this build failure"
|
|
65
68
|
```
|
|
66
69
|
|
|
67
|
-
Named sessions are easier to find in `/resume` and `
|
|
70
|
+
Named sessions are easier to find in `/resume` and `draht -r`.
|
|
68
71
|
|
|
69
72
|
## Branching with `/tree`
|
|
70
73
|
|
|
@@ -128,7 +131,7 @@ Use `/tree` when you want to keep alternatives together. Use `/fork` or `/clone`
|
|
|
128
131
|
|
|
129
132
|
## Branch Summaries
|
|
130
133
|
|
|
131
|
-
When `/tree` switches away from one branch to another,
|
|
134
|
+
When `/tree` switches away from one branch to another, draht can summarize the abandoned branch and attach that summary at the new position. This preserves important context from the path you left without replaying the whole branch.
|
|
132
135
|
|
|
133
136
|
When prompted, choose one of:
|
|
134
137
|
|