@draht/coding-agent 2026.10.20-1 → 2026.10.23-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 +138 -0
- package/agents/advisor.md +2 -2
- package/agents/architect.md +11 -33
- package/agents/debugger.md +13 -54
- package/agents/git-committer.md +18 -42
- package/agents/implementer.md +14 -36
- package/agents/investigator.md +12 -63
- package/agents/reviewer.md +16 -44
- package/agents/security-auditor.md +22 -56
- package/agents/spec-reviewer.md +13 -53
- package/agents/verifier.md +14 -33
- package/bin/drahtbank.mjs +4 -0
- package/dist/agents/advisor.md +2 -2
- package/dist/agents/architect.md +11 -33
- package/dist/agents/debugger.md +13 -54
- package/dist/agents/git-committer.md +18 -42
- package/dist/agents/implementer.md +14 -36
- package/dist/agents/investigator.md +12 -63
- package/dist/agents/reviewer.md +16 -44
- package/dist/agents/security-auditor.md +22 -56
- package/dist/agents/spec-reviewer.md +13 -53
- package/dist/agents/verifier.md +14 -33
- package/dist/bundle/chunks/anthropic-messages-G57VPNTF.js +6 -0
- package/dist/bundle/chunks/anthropic.js +1 -1
- package/dist/bundle/chunks/azure-openai-responses-AYUCZ5WN.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +23 -20
- package/dist/bundle/chunks/chunk-3GDEPGTR.js +16 -0
- package/dist/bundle/chunks/chunk-5JW3NSTV.js +2 -0
- package/dist/bundle/chunks/{chunk-FHX2S5IG.js → chunk-6WESOD4H.js} +1 -1
- package/dist/bundle/chunks/chunk-76YNMQ57.js +2 -0
- package/dist/bundle/chunks/chunk-AC3MSTC6.js +2 -0
- package/dist/bundle/chunks/chunk-ACLWH5WQ.js +2 -0
- package/dist/bundle/chunks/chunk-BL72B6LV.js +82 -0
- package/dist/bundle/chunks/{chunk-5QJFWTKA.js → chunk-CLKG6K6Z.js} +5 -2
- package/dist/bundle/chunks/chunk-DN7SM3LX.js +479 -0
- package/dist/bundle/chunks/{chunk-UTRX2VHB.js → chunk-DOUMZTXH.js} +3 -3
- package/dist/bundle/chunks/chunk-DQ4G4IS4.js +20 -0
- package/dist/bundle/chunks/chunk-E4VZJRJ2.js +9 -0
- package/dist/bundle/chunks/chunk-FOYIPAAD.js +6 -0
- package/dist/bundle/chunks/chunk-FXCTQRNN.js +2 -0
- package/dist/bundle/chunks/chunk-GQXRTK54.js +20 -0
- package/dist/bundle/chunks/chunk-IGO52ZOY.js +132 -0
- package/dist/bundle/chunks/{chunk-VXUJMEMO.js → chunk-IT4RIOZD.js} +1 -1
- package/dist/bundle/chunks/chunk-JJKPUMH2.js +1424 -0
- package/dist/bundle/chunks/chunk-JNWRE5F4.js +2 -0
- package/dist/bundle/chunks/chunk-KSGHCBHT.js +2 -0
- package/dist/bundle/chunks/chunk-MBFTIGLS.js +2 -0
- package/dist/bundle/chunks/chunk-N26RGV3K.js +11 -0
- package/dist/bundle/chunks/{chunk-KPO5375S.js → chunk-RCRGGYLW.js} +1 -1
- package/dist/bundle/chunks/chunk-UCJ7FLSO.js +166 -0
- package/dist/bundle/chunks/chunk-USCN7R2E.js +2 -0
- package/dist/bundle/chunks/chunk-WFHH5SX6.js +4 -0
- package/dist/bundle/chunks/chunk-WYWBXNDO.js +6 -0
- package/dist/bundle/chunks/chunk-ZRPAOMVB.js +2 -0
- package/dist/bundle/chunks/{cli-VCHSHNKT.js → cli-HTUB6WOG.js} +6 -6
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-RRSO6OXX.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +188 -21
- package/dist/bundle/chunks/execute-UUPNZJJG.js +31 -0
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-VJSS5EBX.js +2 -0
- package/dist/bundle/chunks/google-vertex-K23DBWTT.js +2 -0
- package/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-EJ5XMSQL.js → llama-cpp-classify-3VDXTYVJ.js} +3 -3
- package/dist/bundle/chunks/mistral-conversations-SKVQJGFZ.js +5 -0
- package/dist/bundle/chunks/node-DXZFQBEO.js +16 -0
- package/dist/bundle/chunks/{node-6IIDYB3K.js → node-LBZLUIBE.js} +1 -1
- package/dist/bundle/chunks/openai-chatgpt.js +1 -1
- package/dist/bundle/chunks/openai-codex-responses-LV4RIZL3.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +1 -1
- package/dist/bundle/chunks/openai-completions-PUIR2V25.js +7 -0
- package/dist/bundle/chunks/openai-decisions-2DJLSYQF.js +5 -0
- package/dist/bundle/chunks/openai-responses-6ESQOXAF.js +4 -0
- package/dist/bundle/chunks/opencode-go.js +1 -1
- package/dist/bundle/chunks/openrouter-images-TVXBMY3V.js +2 -0
- package/dist/bundle/chunks/pi-messages-XS7FDWQI.js +8 -0
- package/dist/bundle/chunks/runtime-IB3XQ7E3.js +2 -0
- package/dist/bundle/chunks/runtime-LB35PK4J.js +3 -0
- package/dist/bundle/chunks/settings-manager-YNY5F4RU.js +2 -0
- package/dist/bundle/chunks/typesafe-system-one-67GAWZXE.js +2 -0
- package/dist/bundle/chunks/virtual-modules-U4CBGVMI.js +2 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts +2 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +30 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +4 -4
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/config.d.ts +18 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +44 -6
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +65 -8
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +240 -102
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +20 -13
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +42 -52
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/bug-report.d.ts +9 -1
- package/dist/core/bug-report.d.ts.map +1 -1
- package/dist/core/builtins/completion-checks.d.ts +3 -0
- package/dist/core/builtins/completion-checks.d.ts.map +1 -0
- package/dist/core/builtins/completion-checks.js +142 -0
- package/dist/core/builtins/completion-checks.js.map +1 -0
- package/dist/core/builtins/duet.d.ts.map +1 -1
- package/dist/core/builtins/duet.js +7 -5
- package/dist/core/builtins/duet.js.map +1 -1
- package/dist/core/builtins/git-safety.d.ts +3 -0
- package/dist/core/builtins/git-safety.d.ts.map +1 -0
- package/dist/core/builtins/git-safety.js +34 -0
- package/dist/core/builtins/git-safety.js.map +1 -0
- package/dist/core/builtins/index.d.ts.map +1 -1
- package/dist/core/builtins/index.js +4 -0
- package/dist/core/builtins/index.js.map +1 -1
- package/dist/core/client-identity.d.ts +8 -0
- package/dist/core/client-identity.d.ts.map +1 -0
- package/dist/core/client-identity.js +15 -0
- package/dist/core/client-identity.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +20 -15
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +6 -0
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +7 -8
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +2 -0
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.html +1 -0
- package/dist/core/export-html/template.js +23 -17
- package/dist/core/export-html/tool-renderer.d.ts +3 -3
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +5 -3
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/dist/core/export-html/vendor/marked.min.js +30 -29
- 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 +7 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +6 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +16 -4
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +61 -7
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +2 -0
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/key-id-schema.d.ts +6 -0
- package/dist/core/key-id-schema.d.ts.map +1 -0
- package/dist/core/key-id-schema.js +16 -0
- package/dist/core/key-id-schema.js.map +1 -0
- package/dist/core/keybindings-schema.d.ts +4 -0
- package/dist/core/keybindings-schema.d.ts.map +1 -0
- package/dist/core/keybindings-schema.js +16 -0
- package/dist/core/keybindings-schema.js.map +1 -0
- package/dist/core/keybindings.d.ts +242 -75
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +30 -23
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +22 -0
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +72 -11
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +1623 -74
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +70 -184
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +3 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +4 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +56 -43
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +253 -358
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +19 -10
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/nested-tool-calls.d.ts +1 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -1
- package/dist/core/nested-tool-calls.js +1 -0
- package/dist/core/nested-tool-calls.js.map +1 -1
- package/dist/core/package-manager.js +3 -3
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/polyphase/keyword.js +1 -1
- package/dist/core/polyphase/keyword.js.map +1 -1
- package/dist/core/polyphase/model-selection.d.ts.map +1 -1
- package/dist/core/polyphase/model-selection.js +15 -7
- package/dist/core/polyphase/model-selection.js.map +1 -1
- package/dist/core/polyphase/workflow/prelude.d.ts +2 -0
- package/dist/core/polyphase/workflow/prelude.d.ts.map +1 -1
- package/dist/core/polyphase/workflow/prelude.js +12 -16
- package/dist/core/polyphase/workflow/prelude.js.map +1 -1
- package/dist/core/polyphase/workflow/runtime.d.ts.map +1 -1
- package/dist/core/polyphase/workflow/runtime.js +2 -1
- package/dist/core/polyphase/workflow/runtime.js.map +1 -1
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +2 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +7 -2
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts +2 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +13 -0
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/radius.d.ts +2 -0
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js +2 -0
- package/dist/core/radius.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +12 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +84 -24
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +3 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +7 -4
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +13 -4
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +27 -15
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +65 -0
- package/dist/core/settings-defaults.d.ts.map +1 -0
- package/dist/core/settings-defaults.js +66 -0
- package/dist/core/settings-defaults.js.map +1 -0
- package/dist/core/settings-manager.d.ts +17 -178
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +86 -57
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +269 -0
- package/dist/core/settings-schema.d.ts.map +1 -0
- package/dist/core/settings-schema.js +318 -0
- package/dist/core/settings-schema.js.map +1 -0
- package/dist/core/skills.d.ts +4 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt.d.ts +6 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +10 -5
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +3 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/grep.d.ts +8 -0
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +19 -7
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +2 -0
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +2 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +4 -10
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/path-utils.d.ts +1 -1
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js +6 -6
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/core/tools/read.d.ts +13 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +32 -2
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +20 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +67 -0
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +7 -35
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/renderers/edit.d.ts.map +1 -1
- package/dist/core/tools/renderers/edit.js +5 -4
- package/dist/core/tools/renderers/edit.js.map +1 -1
- package/dist/core/tools/renderers/index.d.ts +2 -2
- package/dist/core/tools/renderers/index.d.ts.map +1 -1
- package/dist/core/tools/renderers/index.js.map +1 -1
- package/dist/core/tools/renderers/read.d.ts.map +1 -1
- package/dist/core/tools/renderers/read.js +7 -11
- package/dist/core/tools/renderers/read.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +391 -80
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/index.d.ts.map +1 -1
- package/dist/extensions/codemode/index.js +3 -1
- package/dist/extensions/codemode/index.js.map +1 -1
- package/dist/extensions/codemode/renderer.d.ts +2 -2
- package/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/dist/extensions/codemode/renderer.js +9 -3
- package/dist/extensions/codemode/renderer.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +22 -21
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +96 -123
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +34 -11
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +27 -33
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts +15 -3
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +49 -12
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts +4 -1
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +279 -129
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +21 -11
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +166 -45
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/resources.d.ts +3 -10
- package/dist/extensions/mcp/resources.d.ts.map +1 -1
- package/dist/extensions/mcp/resources.js +4 -5
- package/dist/extensions/mcp/resources.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts +7 -7
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +31 -45
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/mcp/tools.d.ts +7 -5
- package/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/dist/extensions/mcp/tools.js +87 -29
- package/dist/extensions/mcp/tools.js.map +1 -1
- package/dist/extensions/mcp/ui.d.ts +3 -3
- package/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/dist/extensions/mcp/ui.js +18 -6
- package/dist/extensions/mcp/ui.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts +0 -2
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +2 -4
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/hooks/checks/checks-runtime.cjs +215 -0
- package/dist/hooks/checks/git-safety.cjs +198 -0
- package/dist/hooks/checks/git-safety.d.cts +1 -0
- package/dist/hooks/gsd/draht-post-task.js +78 -39
- package/dist/hooks/gsd/draht-quality-gate.js +210 -122
- package/dist/hooks/gsd/package.json +3 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +11 -3
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/auth-url.d.ts +14 -0
- package/dist/modes/interactive/components/auth-url.d.ts.map +1 -0
- package/dist/modes/interactive/components/auth-url.js +37 -0
- package/dist/modes/interactive/components/auth-url.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +5 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +17 -14
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +5 -2
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +5 -2
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +3 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +8 -2
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +1 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +3 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +38 -10
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +8 -2
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +24 -21
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.d.ts +15 -0
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/radius-login-selector.js +85 -0
- package/dist/modes/interactive/components/radius-login-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -3
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +9 -8
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +5 -2
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +2 -2
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +12 -13
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +32 -45
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +2 -9
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +5 -4
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +43 -48
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +362 -278
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/program-status-reporter.d.ts +34 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
- package/dist/modes/interactive/program-status-reporter.js +110 -0
- package/dist/modes/interactive/program-status-reporter.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +1 -1
- package/dist/modes/interactive/theme/light.json +1 -1
- package/dist/modes/interactive/theme/system-theme.d.ts +2 -1
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/system-theme.js +16 -5
- package/dist/modes/interactive/theme/system-theme.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.js +105 -0
- package/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-tokens.js +94 -0
- package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
- package/dist/modes/interactive/theme/theme.d.ts +13 -16
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +22 -29
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +4 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +26 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/prompts/commands/atomic-commit.md +8 -6
- package/dist/prompts/commands/brainstorm.md +5 -149
- package/dist/prompts/commands/create-verification-skill.md +8 -48
- package/dist/prompts/commands/discuss-phase.md +6 -10
- package/dist/prompts/commands/execute-phase.md +18 -45
- package/dist/prompts/commands/fix.md +16 -128
- package/dist/prompts/commands/grill.md +6 -53
- package/dist/prompts/commands/init-project.md +13 -18
- package/dist/prompts/commands/map-codebase.md +3 -3
- package/dist/prompts/commands/new-project.md +12 -17
- package/dist/prompts/commands/next-milestone.md +4 -8
- package/dist/prompts/commands/orchestrate-loop.md +12 -12
- package/dist/prompts/commands/orchestrate.md +12 -11
- package/dist/prompts/commands/pause-work.md +1 -1
- package/dist/prompts/commands/plan-phase.md +15 -37
- package/dist/prompts/commands/quick.md +11 -64
- package/dist/prompts/commands/resolve-conflicts.md +2 -15
- package/dist/prompts/commands/triage.md +3 -14
- package/dist/prompts/commands/verify-work.md +15 -63
- package/dist/prompts/commands/why.md +18 -118
- package/dist/skills/atomic-reasoning/SKILL.md +6 -105
- package/dist/skills/blast-radius/SKILL.md +1 -1
- package/dist/skills/epistemics/SKILL.md +12 -87
- package/dist/skills/explainers/SKILL.md +1 -1
- package/dist/skills/typescript-discipline/SKILL.md +12 -42
- package/dist/skills/typescript-discipline/references/patterns.md +25 -266
- package/dist/skills/unslop/SKILL.md +14 -105
- package/dist/utils/ansi.d.ts +8 -0
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/ansi.js +30 -11
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js +3 -0
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +18 -12
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/draht-user-agent.d.ts +1 -0
- package/dist/utils/draht-user-agent.d.ts.map +1 -1
- package/dist/utils/draht-user-agent.js +3 -2
- package/dist/utils/draht-user-agent.js.map +1 -1
- package/dist/utils/image-convert.d.ts +12 -0
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js +45 -6
- package/dist/utils/image-convert.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts +12 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +5 -0
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/image-resize-worker.js +3 -2
- package/dist/utils/image-resize-worker.js.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +9 -10
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/output-files.d.ts +15 -0
- package/dist/utils/output-files.d.ts.map +1 -0
- package/dist/utils/output-files.js +30 -0
- package/dist/utils/output-files.js.map +1 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +43 -13
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +6 -1
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +4 -3
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/cli-integration.md +1 -1
- package/docs/cli.md +30 -26
- package/docs/codemode.md +230 -0
- package/docs/compaction.md +5 -5
- package/docs/containerization.md +1 -1
- package/docs/custom-provider.md +53 -1
- package/docs/docs.json +17 -1
- package/docs/drahtbank.md +163 -0
- package/docs/environment-variables.md +5 -2
- package/docs/extensions.md +143 -13
- package/docs/index.md +1 -1
- package/docs/json.md +3 -3
- package/docs/keybindings.md +9 -5
- package/docs/llama-cpp.md +9 -2
- package/docs/mcp.md +59 -3
- package/docs/message-types.md +22 -4
- package/docs/models-configuration.md +187 -0
- package/docs/models.md +67 -4
- package/docs/nvidia-rtx-llama-cpp.md +96 -0
- package/docs/providers.md +70 -5
- package/docs/sdk.md +1 -1
- package/docs/settings.md +10 -8
- package/docs/terminal-setup.md +14 -0
- package/docs/themes.md +4 -2
- package/docs/tui.md +71 -1
- package/docs/usage.md +1 -1
- package/docs/windows.md +16 -2
- package/eval/drahtbank/adapters.d.mts +35 -0
- package/eval/drahtbank/adapters.mjs +192 -0
- package/eval/drahtbank/bank.d.mts +141 -0
- package/eval/drahtbank/bank.mjs +515 -0
- package/eval/drahtbank/cases-v2.d.mts +28 -0
- package/eval/drahtbank/cases-v2.mjs +164 -0
- package/eval/drahtbank/cases.d.mts +17 -0
- package/eval/drahtbank/cases.mjs +198 -0
- package/eval/drahtbank/cli.mjs +120 -0
- package/eval/drahtbank/grading-v2.d.mts +26 -0
- package/eval/drahtbank/grading-v2.mjs +227 -0
- package/eval/drahtbank/isolated-tools.ts +223 -0
- package/eval/drahtbank/isolation-worker.mjs +53 -0
- package/eval/drahtbank/isolation.d.mts +52 -0
- package/eval/drahtbank/isolation.mjs +345 -0
- package/eval/drahtbank/runtime-checks.d.mts +15 -0
- package/eval/drahtbank/runtime-checks.mjs +187 -0
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/minimal-mode.ts +4 -5
- package/examples/extensions/overlay-test.ts +2 -2
- package/examples/extensions/plan-mode/index.ts +6 -2
- package/examples/extensions/subagent/index.ts +4 -6
- package/hooks/checks/checks-runtime.cjs +215 -0
- package/hooks/checks/git-safety.cjs +198 -0
- package/hooks/checks/git-safety.d.cts +1 -0
- package/hooks/gsd/draht-post-task.js +78 -39
- package/hooks/gsd/draht-quality-gate.js +210 -122
- package/hooks/gsd/package.json +3 -0
- package/package.json +21 -16
- package/prompts/commands/atomic-commit.md +8 -6
- package/prompts/commands/brainstorm.md +5 -149
- package/prompts/commands/create-verification-skill.md +8 -48
- package/prompts/commands/discuss-phase.md +6 -10
- package/prompts/commands/execute-phase.md +18 -45
- package/prompts/commands/fix.md +16 -128
- package/prompts/commands/grill.md +6 -53
- package/prompts/commands/init-project.md +13 -18
- package/prompts/commands/map-codebase.md +3 -3
- package/prompts/commands/new-project.md +12 -17
- package/prompts/commands/next-milestone.md +4 -8
- package/prompts/commands/orchestrate-loop.md +12 -12
- package/prompts/commands/orchestrate.md +12 -11
- package/prompts/commands/pause-work.md +1 -1
- package/prompts/commands/plan-phase.md +15 -37
- package/prompts/commands/quick.md +11 -64
- package/prompts/commands/resolve-conflicts.md +2 -15
- package/prompts/commands/triage.md +3 -14
- package/prompts/commands/verify-work.md +15 -63
- package/prompts/commands/why.md +18 -118
- package/schemas/keybindings.schema.json +433 -0
- package/schemas/models.schema.json +1190 -0
- package/schemas/settings.schema.json +849 -0
- package/schemas/theme.schema.json +365 -0
- package/skills/atomic-reasoning/SKILL.md +6 -105
- package/skills/blast-radius/SKILL.md +1 -1
- package/skills/epistemics/SKILL.md +12 -87
- package/skills/explainers/SKILL.md +1 -1
- package/skills/typescript-discipline/SKILL.md +12 -42
- package/skills/typescript-discipline/references/patterns.md +25 -266
- package/skills/unslop/SKILL.md +14 -105
- package/dist/bundle/chunks/anthropic-messages-E2P6C3P7.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-JZMSTDIM.js +0 -2
- package/dist/bundle/chunks/chunk-2E5VODES.js +0 -2
- package/dist/bundle/chunks/chunk-3DQNSI5W.js +0 -137
- package/dist/bundle/chunks/chunk-4COXSQRQ.js +0 -18
- package/dist/bundle/chunks/chunk-D3HO453P.js +0 -42
- package/dist/bundle/chunks/chunk-GVXA72ZA.js +0 -2
- package/dist/bundle/chunks/chunk-I2SOJ4JN.js +0 -65
- package/dist/bundle/chunks/chunk-I5OKY6RH.js +0 -11
- package/dist/bundle/chunks/chunk-ILSPVHVH.js +0 -1623
- package/dist/bundle/chunks/chunk-KY2BG6BC.js +0 -11
- package/dist/bundle/chunks/chunk-PGJAHC3R.js +0 -107
- package/dist/bundle/chunks/chunk-QVFELZW2.js +0 -312
- package/dist/bundle/chunks/chunk-QVTLBSTH.js +0 -4
- package/dist/bundle/chunks/chunk-SDRCE6OP.js +0 -2
- package/dist/bundle/chunks/chunk-U6LDZZGM.js +0 -146
- package/dist/bundle/chunks/chunk-X3YFUSCK.js +0 -82
- package/dist/bundle/chunks/chunk-XBUEMKIY.js +0 -2
- package/dist/bundle/chunks/chunk-XHCO4PPH.js +0 -8
- package/dist/bundle/chunks/chunk-YH7HNI7D.js +0 -2
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-MJKOAE5S.js +0 -2
- package/dist/bundle/chunks/execute-AGEWJLIO.js +0 -18
- package/dist/bundle/chunks/google-generative-ai-HPNDIAZD.js +0 -2
- package/dist/bundle/chunks/google-vertex-KPAWJ4SP.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-FMSPWQ7A.js +0 -5
- package/dist/bundle/chunks/node-4JNG6XQO.js +0 -16
- package/dist/bundle/chunks/openai-codex-responses-TU7NGPXE.js +0 -10
- package/dist/bundle/chunks/openai-completions-GANCQQO5.js +0 -7
- package/dist/bundle/chunks/openai-responses-ASDPAX3E.js +0 -3
- package/dist/bundle/chunks/openrouter-images-NROSQXMZ.js +0 -2
- package/dist/bundle/chunks/pi-messages-2QEJYOAO.js +0 -8
- package/dist/bundle/chunks/runtime-2B56SZM6.js +0 -2
- package/dist/bundle/chunks/runtime-TJ3EAMJK.js +0 -3
- package/dist/bundle/chunks/settings-manager-HC5RR36T.js +0 -2
- package/dist/bundle/chunks/typesafe-system-one-YBEEY5XU.js +0 -2
- package/dist/bundle/chunks/virtual-modules-XKLDADFR.js +0 -2
- package/dist/core/provider-attribution.d.ts +0 -4
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js +0 -72
- package/dist/core/provider-attribution.js.map +0 -1
- package/dist/experimental/micro/api.d.ts +0 -81
- package/dist/experimental/micro/api.d.ts.map +0 -1
- package/dist/experimental/micro/api.js +0 -2
- package/dist/experimental/micro/api.js.map +0 -1
- package/dist/experimental/micro/main.d.ts +0 -3
- package/dist/experimental/micro/main.d.ts.map +0 -1
- package/dist/experimental/micro/main.js +0 -21
- package/dist/experimental/micro/main.js.map +0 -1
- package/dist/experimental/micro/models.d.ts +0 -11
- package/dist/experimental/micro/models.d.ts.map +0 -1
- package/dist/experimental/micro/models.js +0 -95
- package/dist/experimental/micro/models.js.map +0 -1
- package/dist/experimental/micro/runtime.d.ts +0 -12
- package/dist/experimental/micro/runtime.d.ts.map +0 -1
- package/dist/experimental/micro/runtime.js +0 -465
- package/dist/experimental/micro/runtime.js.map +0 -1
- package/dist/experimental/micro/sessions.d.ts +0 -10
- package/dist/experimental/micro/sessions.d.ts.map +0 -1
- package/dist/experimental/micro/sessions.js +0 -41
- package/dist/experimental/micro/sessions.js.map +0 -1
- package/dist/experimental/micro/tools.d.ts +0 -10
- package/dist/experimental/micro/tools.d.ts.map +0 -1
- package/dist/experimental/micro/tools.js +0 -96
- package/dist/experimental/micro/tools.js.map +0 -1
- package/dist/experimental/micro/tui.d.ts +0 -3
- package/dist/experimental/micro/tui.d.ts.map +0 -1
- package/dist/experimental/micro/tui.js +0 -510
- package/dist/experimental/micro/tui.js.map +0 -1
- package/dist/experimental/mini/main.d.ts +0 -7
- package/dist/experimental/mini/main.d.ts.map +0 -1
- package/dist/experimental/mini/main.js +0 -21
- package/dist/experimental/mini/main.js.map +0 -1
- package/dist/experimental/mini/server/entry.d.ts +0 -3
- package/dist/experimental/mini/server/entry.d.ts.map +0 -1
- package/dist/experimental/mini/server/entry.js +0 -11
- package/dist/experimental/mini/server/entry.js.map +0 -1
- package/dist/experimental/mini/server/run.d.ts +0 -13
- package/dist/experimental/mini/server/run.d.ts.map +0 -1
- package/dist/experimental/mini/server/run.js +0 -150
- package/dist/experimental/mini/server/run.js.map +0 -1
- package/dist/experimental/mini/shared/protocol.d.ts +0 -127
- package/dist/experimental/mini/shared/protocol.d.ts.map +0 -1
- package/dist/experimental/mini/shared/protocol.js +0 -13
- package/dist/experimental/mini/shared/protocol.js.map +0 -1
- package/dist/experimental/mini/shared/rpc.d.ts +0 -49
- package/dist/experimental/mini/shared/rpc.d.ts.map +0 -1
- package/dist/experimental/mini/shared/rpc.js +0 -171
- package/dist/experimental/mini/shared/rpc.js.map +0 -1
- package/dist/experimental/mini/shared/transport.d.ts +0 -35
- package/dist/experimental/mini/shared/transport.d.ts.map +0 -1
- package/dist/experimental/mini/shared/transport.js +0 -94
- package/dist/experimental/mini/shared/transport.js.map +0 -1
- package/dist/experimental/mini/tui/run.d.ts +0 -9
- package/dist/experimental/mini/tui/run.d.ts.map +0 -1
- package/dist/experimental/mini/tui/run.js +0 -62
- package/dist/experimental/mini/tui/run.js.map +0 -1
- package/dist/experimental/mini/tui/session.d.ts +0 -26
- package/dist/experimental/mini/tui/session.d.ts.map +0 -1
- package/dist/experimental/mini/tui/session.js +0 -94
- package/dist/experimental/mini/tui/session.js.map +0 -1
- package/dist/experimental/mini/tui/view.d.ts +0 -10
- package/dist/experimental/mini/tui/view.d.ts.map +0 -1
- package/dist/experimental/mini/tui/view.js +0 -461
- package/dist/experimental/mini/tui/view.js.map +0 -1
- package/dist/experimental/mini/worker/entry.d.ts +0 -3
- package/dist/experimental/mini/worker/entry.d.ts.map +0 -1
- package/dist/experimental/mini/worker/entry.js +0 -10
- package/dist/experimental/mini/worker/entry.js.map +0 -1
- package/dist/experimental/mini/worker/lane-service.d.ts +0 -44
- package/dist/experimental/mini/worker/lane-service.d.ts.map +0 -1
- package/dist/experimental/mini/worker/lane-service.js +0 -97
- package/dist/experimental/mini/worker/lane-service.js.map +0 -1
- package/dist/experimental/mini/worker/models-service.d.ts +0 -19
- package/dist/experimental/mini/worker/models-service.d.ts.map +0 -1
- package/dist/experimental/mini/worker/models-service.js +0 -136
- package/dist/experimental/mini/worker/models-service.js.map +0 -1
- package/dist/experimental/mini/worker/run.d.ts +0 -14
- package/dist/experimental/mini/worker/run.d.ts.map +0 -1
- package/dist/experimental/mini/worker/run.js +0 -88
- package/dist/experimental/mini/worker/run.js.map +0 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +0 -85
- package/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme-json.js +0 -132
- package/dist/modes/interactive/theme/theme-json.js.map +0 -1
- package/dist/modes/interactive/theme/theme-schema.json +0 -361
- /package/dist/bundle/chunks/{chunk-FBU742QF.js → chunk-MOOADNVS.js} +0 -0
package/docs/themes.md
CHANGED
|
@@ -58,7 +58,7 @@ See [CLI resources](cli.md#resources) for the command-line option.
|
|
|
58
58
|
|
|
59
59
|
## Create a custom theme
|
|
60
60
|
|
|
61
|
-
Copy one of the [built-in themes](https://github.com/draht-dev/draht/tree/main/packages/coding-agent/src/modes/interactive/theme) or create a new JSON file conforming to the [schema](https://
|
|
61
|
+
Copy one of the [built-in themes](https://github.com/draht-dev/draht/tree/main/packages/coding-agent/src/modes/interactive/theme) or create a new JSON file conforming to the [schema](https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/schemas/theme.schema.json). The built-in themes use OKHSL colors, with variables for colors that several roles share, so you can adjust a hue, saturation, or lightness directly.
|
|
62
62
|
|
|
63
63
|
1. Save the file as `<agent-dir>/themes/my-theme.json`. The agent directory defaults to `~/.draht/agent`.
|
|
64
64
|
2. Set its `name` to `my-theme`.
|
|
@@ -78,6 +78,8 @@ Use the theme name as the filename. draht hot-reloads the active user theme only
|
|
|
78
78
|
| `colors` | Yes | Assigns colors to terminal UI roles. The schema identifies required and optional roles. |
|
|
79
79
|
| `export` | No | Overrides page and panel backgrounds in HTML exports. |
|
|
80
80
|
|
|
81
|
+
Theme objects are strict: only documented top-level fields and color tokens are accepted. Define reusable custom colors under `vars`; custom keys under `colors` or `export` and additional top-level metadata are rejected.
|
|
82
|
+
|
|
81
83
|
A color can be written in six forms:
|
|
82
84
|
|
|
83
85
|
| Form | Example | Meaning |
|
|
@@ -93,7 +95,7 @@ Terminal default colors render as the terminal's own colors. Where draht needs a
|
|
|
93
95
|
|
|
94
96
|
draht resolves chained variable references. A missing variable or circular reference makes the theme invalid. draht uses truecolor when available, gamut-maps OKLCH to sRGB, and approximates colors for 256-color terminals. HTML exports convert OKHSL values to hexadecimal because CSS does not support them. If colors differ from their source values, check your terminal's truecolor detection and contrast settings. See [Configure Your Terminal](terminal-setup.md#override-detected-capabilities).
|
|
95
97
|
|
|
96
|
-
Use the [theme JSON schema](https://
|
|
98
|
+
Use the [theme JSON schema](https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/schemas/theme.schema.json) for the exact properties, required colors, and accepted value types.
|
|
97
99
|
|
|
98
100
|
draht reports invalid theme files during startup and `/reload`.
|
|
99
101
|
|
package/docs/tui.md
CHANGED
|
@@ -45,7 +45,7 @@ Prefer these components over rebuilding selection, scrolling, text editing, or w
|
|
|
45
45
|
|
|
46
46
|
Use `matchesKey()` and `Key` for terminal keyboard input. The parser accounts for supported terminal protocols and key modifiers. Extension components should use the injected `KeybindingsManager` for configurable application actions.
|
|
47
47
|
|
|
48
|
-
A component that displays a text cursor should implement `Focusable` and place `CURSOR_MARKER` immediately before its visual cursor. The TUI uses
|
|
48
|
+
A component that displays a text cursor should implement `Focusable` and place `CURSOR_MARKER` immediately before its visual cursor. Wrap the cursor cell in `renderFakeCursor()` so the TUI draws it in reverse video, or hides it after `CURSOR_MARKER` when the hardware cursor is shown. The TUI uses the marker to position the hardware cursor for input method editors. Some terminals only place IME candidate windows next to a visible hardware cursor; set `DRAHT_HARDWARE_CURSOR=1` (or the `showHardwareCursor` setting) to show it. The coding agent reads `DRAHT_HARDWARE_CURSOR` and `DRAHT_CLEAR_ON_SHRINK` and passes them to the TUI; `@draht/tui` itself does not read environment variables.
|
|
49
49
|
|
|
50
50
|
Containers that wrap an `Input` or `Editor` must propagate their `focused` state to that child. Without propagation, Chinese, Japanese, Korean, and other IME candidate windows can appear at the wrong screen position.
|
|
51
51
|
|
|
@@ -65,6 +65,76 @@ Regular mode leaves mouse input to the terminal because the terminal owns scroll
|
|
|
65
65
|
|
|
66
66
|
`ctx.ui.custom()` temporarily gives one component control of the interactive area and resolves when that component calls the supplied completion callback.
|
|
67
67
|
|
|
68
|
+
### Build a minimal custom screen
|
|
69
|
+
|
|
70
|
+
This complete extension shows the custom-component lifecycle: render within the supplied width, use injected keybindings, invalidate cached output after state changes, request a render, and finish through `done()`.
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import type { ExtensionAPI } from "@draht/coding-agent";
|
|
74
|
+
import { truncateToWidth } from "@draht/tui";
|
|
75
|
+
|
|
76
|
+
export default function (pi: ExtensionAPI) {
|
|
77
|
+
pi.registerCommand("pick-target", {
|
|
78
|
+
description: "Pick a deployment target",
|
|
79
|
+
handler: async (_args, ctx) => {
|
|
80
|
+
if (ctx.mode !== "tui") {
|
|
81
|
+
ctx.ui.notify("pick-target requires interactive mode", "error");
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const choices = ["development", "staging", "production"];
|
|
86
|
+
const selected = await ctx.ui.custom<string | undefined>((tui, theme, keybindings, done) => {
|
|
87
|
+
let selectedIndex = 0;
|
|
88
|
+
let cachedWidth: number | undefined;
|
|
89
|
+
let cachedLines: string[] | undefined;
|
|
90
|
+
|
|
91
|
+
const invalidate = () => {
|
|
92
|
+
cachedWidth = undefined;
|
|
93
|
+
cachedLines = undefined;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
render(width: number): string[] {
|
|
98
|
+
if (cachedLines && cachedWidth === width) return cachedLines;
|
|
99
|
+
|
|
100
|
+
cachedWidth = width;
|
|
101
|
+
cachedLines = [
|
|
102
|
+
theme.fg("accent", "Choose a deployment target"),
|
|
103
|
+
...choices.map((choice, index) => `${index === selectedIndex ? "> " : " "}${choice}`),
|
|
104
|
+
theme.fg("dim", "up/down move, enter selects, escape cancels"),
|
|
105
|
+
].map((line) => truncateToWidth(line, width));
|
|
106
|
+
return cachedLines;
|
|
107
|
+
},
|
|
108
|
+
handleInput(data: string): void {
|
|
109
|
+
if (keybindings.matches(data, "tui.select.up")) {
|
|
110
|
+
selectedIndex = (selectedIndex - 1 + choices.length) % choices.length;
|
|
111
|
+
} else if (keybindings.matches(data, "tui.select.down")) {
|
|
112
|
+
selectedIndex = (selectedIndex + 1) % choices.length;
|
|
113
|
+
} else if (keybindings.matches(data, "tui.select.confirm")) {
|
|
114
|
+
done(choices[selectedIndex]);
|
|
115
|
+
return;
|
|
116
|
+
} else if (keybindings.matches(data, "tui.select.cancel")) {
|
|
117
|
+
done(undefined);
|
|
118
|
+
return;
|
|
119
|
+
} else {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
invalidate();
|
|
124
|
+
tui.requestRender();
|
|
125
|
+
},
|
|
126
|
+
invalidate,
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
if (selected) ctx.ui.notify(`Selected ${selected}`, "info");
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
This component does not display a text cursor, so it does not need `Focusable`. A component containing `Input` or `Editor` must implement `Focusable` and propagate its `focused` value to that child.
|
|
137
|
+
|
|
68
138
|
Pass `overlay: true` to draw above existing content. Overlay options control size, anchors, offsets, margins, and responsive visibility. An overlay handle can change focus or temporarily hide and show the overlay with `setHidden()` while the interaction remains active.
|
|
69
139
|
|
|
70
140
|
Focused overlays retain input ownership across ordinary renders. If another component should receive input while an overlay remains visible, explicitly release or redirect focus through the handle.
|
package/docs/usage.md
CHANGED
|
@@ -83,7 +83,7 @@ Use `/share` to upload the session as a private GitHub gist through the GitHub C
|
|
|
83
83
|
|
|
84
84
|
## Adjust the terminal
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Fullscreen mode, the default, keeps the editor and status area fixed while the transcript scrolls within the terminal window. Regular mode uses the terminal's normal scrollback. Choose a mode through `/settings` or `--tui-mode`.
|
|
87
87
|
|
|
88
88
|
Terminal support for mouse input, keyboard shortcuts, and inline images varies. See [Terminal Setup](terminal-setup.md) for platform-specific configuration and [Keybindings](keybindings.md) for every configurable shortcut. Run `/hotkeys` to inspect the shortcuts active in your current session.
|
|
89
89
|
|
package/docs/windows.md
CHANGED
|
@@ -19,8 +19,9 @@ For most native Windows users, installing [Git for Windows](https://git-scm.com/
|
|
|
19
19
|
draht resolves Bash in this order:
|
|
20
20
|
|
|
21
21
|
1. `shellPath` from `~/.draht/agent/settings.json`
|
|
22
|
-
2. Git Bash
|
|
23
|
-
3.
|
|
22
|
+
2. Git Bash at `%ProgramFiles%\Git\bin\bash.exe`
|
|
23
|
+
3. Git Bash at `%ProgramFiles(x86)%\Git\bin\bash.exe`
|
|
24
|
+
4. `bash.exe` on `PATH`, including Cygwin, MSYS2, or legacy WSL Bash
|
|
24
25
|
|
|
25
26
|
Start draht and enter this command to verify the shell:
|
|
26
27
|
|
|
@@ -34,6 +35,13 @@ If draht cannot find Bash, it reports the locations it checked. Install Git for
|
|
|
34
35
|
|
|
35
36
|
The optional `powershell` tool runs commands through `pwsh.exe` when available, then falls back to Windows PowerShell. It starts PowerShell with `-NoProfile -NonInteractive -ExecutionPolicy Bypass`. Administrator-enforced execution policies can still take precedence.
|
|
36
37
|
|
|
38
|
+
PowerShell discovery checks these locations in order:
|
|
39
|
+
|
|
40
|
+
1. `pwsh.exe` on `PATH`
|
|
41
|
+
2. `%ProgramFiles%\PowerShell\7\pwsh.exe`
|
|
42
|
+
3. `powershell.exe` on `PATH`
|
|
43
|
+
4. `%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe`
|
|
44
|
+
|
|
37
45
|
To replace the model-facing `bash` tool with `powershell`, add this to `~/.draht/agent/settings.json`:
|
|
38
46
|
|
|
39
47
|
```json
|
|
@@ -48,6 +56,12 @@ Restart draht, then ask it to run a harmless PowerShell command. The `!` and `!!
|
|
|
48
56
|
|
|
49
57
|
See [Settings](settings.md#tools) for other tool combinations.
|
|
50
58
|
|
|
59
|
+
## WSL
|
|
60
|
+
|
|
61
|
+
WSL path conversion on Windows and extra Git branch polling in WSL recognize `/mnt/<drive>`, not custom mount roots.
|
|
62
|
+
|
|
63
|
+
When using the legacy WSL `bash.exe` launcher from Windows, draht sends commands over stdin to avoid command-line quoting problems.
|
|
64
|
+
|
|
51
65
|
## Use a custom Bash executable
|
|
52
66
|
|
|
53
67
|
Set `shellPath` when Bash is installed somewhere draht does not discover automatically:
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type RunnerFormat = "draht-jsonl" | "json";
|
|
2
|
+
|
|
3
|
+
export interface AdapterConfig {
|
|
4
|
+
format: RunnerFormat;
|
|
5
|
+
command: string[];
|
|
6
|
+
provider: string;
|
|
7
|
+
model: string;
|
|
8
|
+
settings: Record<string, string | number | boolean>;
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface InvocationPaths {
|
|
13
|
+
workspace: string;
|
|
14
|
+
promptFile: string;
|
|
15
|
+
taskFile: string;
|
|
16
|
+
prompt: string;
|
|
17
|
+
task: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ParsedOutput {
|
|
21
|
+
finalText: string;
|
|
22
|
+
usage: {
|
|
23
|
+
inputTokens: number | null;
|
|
24
|
+
outputTokens: number | null;
|
|
25
|
+
cacheReadTokens: number | null;
|
|
26
|
+
cacheWriteTokens: number | null;
|
|
27
|
+
costUsd: number | null;
|
|
28
|
+
};
|
|
29
|
+
toolCalls: number | null;
|
|
30
|
+
telemetrySource: "draht-events" | "adapter-reported";
|
|
31
|
+
error: string | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function buildInvocation(config: AdapterConfig, paths: InvocationPaths): { command: string[]; stdin: string };
|
|
35
|
+
export function parseOutput(format: RunnerFormat, stdout: string): ParsedOutput;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
|
|
3
|
+
// Adapters describe argv and parse output; the runner owns process limits and files.
|
|
4
|
+
const THINKING_LEVELS = new Set(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
|
|
5
|
+
const OWNED_FLAGS = new Set([
|
|
6
|
+
"--", "--mode", "--print", "-p", "--provider", "--model", "--models", "--thinking", "--api-key",
|
|
7
|
+
"--system-prompt", "--append-system-prompt", "--continue", "-c", "--resume", "-r", "--session", "--session-id",
|
|
8
|
+
"--session-dir", "--no-session", "--fork", "--attach", "--attachable", "--no-attachable", "--list-sessions",
|
|
9
|
+
"--extension", "-e", "--no-extensions", "-ne", "--skill", "--no-skills", "-ns", "--prompt-template",
|
|
10
|
+
"--no-prompt-templates", "-np", "--no-context-files", "-nc", "--context-root", "--approve", "-a",
|
|
11
|
+
"--no-approve", "-na", "--tools", "-t", "--exclude-tools", "-xt", "--no-tools", "-nt", "--no-builtin-tools",
|
|
12
|
+
"-nbt", "--theme", "--use-theme", "--no-themes", "--offline", "--help", "-h", "--version", "-v", "--export", "--list-models",
|
|
13
|
+
]);
|
|
14
|
+
const METRICS = ["inputTokens", "outputTokens", "cacheReadTokens", "cacheWriteTokens", "costUsd"];
|
|
15
|
+
|
|
16
|
+
function object(value) {
|
|
17
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function text(value, label) {
|
|
21
|
+
if (typeof value !== "string" || !value.trim() || value.includes("\0")) throw new Error(`${label} must be a nonempty string`);
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function metric(value, label, integer = true) {
|
|
26
|
+
if (value === undefined || value === null) return null;
|
|
27
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0 || (integer && !Number.isSafeInteger(value))) {
|
|
28
|
+
throw new Error(`${label} must be a nonnegative ${integer ? "safe integer" : "finite number"} or null`);
|
|
29
|
+
}
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function unknownUsage() {
|
|
34
|
+
return Object.fromEntries(METRICS.map((name) => [name, null]));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function buildInvocation(config, paths) {
|
|
38
|
+
if (!Array.isArray(config.command) || !config.command.length) throw new Error("Runner command must be a nonempty argv array");
|
|
39
|
+
const command = config.command.map((arg) => text(arg, "Runner argument"));
|
|
40
|
+
text(config.provider, "Runner provider");
|
|
41
|
+
text(config.model, "Runner model");
|
|
42
|
+
if (!object(config.settings)) throw new Error("Runner settings must be an object");
|
|
43
|
+
for (const value of Object.values(config.settings)) {
|
|
44
|
+
if (!["string", "number", "boolean"].includes(typeof value) || (typeof value === "number" && !Number.isFinite(value))) {
|
|
45
|
+
throw new Error("Runner settings must contain only finite numbers, strings, or booleans");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
for (const name of ["workspace", "promptFile", "taskFile"]) text(paths[name], name);
|
|
49
|
+
if (typeof paths.prompt !== "string" || typeof paths.task !== "string") throw new Error("Prompt and task must be strings");
|
|
50
|
+
if (config.format === "json") {
|
|
51
|
+
const replacements = new Map([["{workspace}", paths.workspace], ["{prompt}", paths.promptFile], ["{task}", paths.taskFile]]);
|
|
52
|
+
return {
|
|
53
|
+
command: command.map((arg) => {
|
|
54
|
+
if (replacements.has(arg)) return replacements.get(arg);
|
|
55
|
+
if (/\{(?:workspace|prompt|task)\}/.test(arg)) throw new Error("Runner placeholders must occupy a complete argument");
|
|
56
|
+
return arg;
|
|
57
|
+
}),
|
|
58
|
+
stdin: `${JSON.stringify({ ...paths, provider: config.provider, model: config.model, settings: config.settings })}\n`,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (config.format !== "draht-jsonl") throw new Error(`Unsupported runner format: ${config.format}`);
|
|
62
|
+
for (const arg of command.slice(1)) {
|
|
63
|
+
if (OWNED_FLAGS.has(arg.split("=", 1)[0]) || arg.startsWith("@") || /\{(?:workspace|prompt|task)\}/.test(arg)) {
|
|
64
|
+
throw new Error(`Native runner argument is controlled by drahtbank: ${arg}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
for (const name of Object.keys(config.settings)) {
|
|
68
|
+
if (name !== "thinking") throw new Error(`Unsupported native runner setting: ${name}`);
|
|
69
|
+
}
|
|
70
|
+
if (config.settings.thinking !== undefined && !THINKING_LEVELS.has(config.settings.thinking)) {
|
|
71
|
+
throw new Error("Invalid native thinking setting");
|
|
72
|
+
}
|
|
73
|
+
command.push(
|
|
74
|
+
"--mode", "json", "--print", "--no-session", "--no-attachable", "--no-context-files", "--no-skills",
|
|
75
|
+
"--no-prompt-templates", "--no-extensions", "--no-themes", "--no-approve", "--offline",
|
|
76
|
+
"--no-builtin-tools", "--extension", fileURLToPath(new URL("isolated-tools.ts", import.meta.url)),
|
|
77
|
+
"--tools", `read,${process.platform === "win32" ? "powershell" : "bash"},edit,write,grep,find,ls`,
|
|
78
|
+
"--provider", config.provider, "--model", config.model,
|
|
79
|
+
);
|
|
80
|
+
if (config.settings.thinking !== undefined) command.push("--thinking", config.settings.thinking);
|
|
81
|
+
command.push("--append-system-prompt", paths.promptFile, "--", `@${paths.taskFile}`);
|
|
82
|
+
return { command, stdin: "" };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function parseJson(stdout) {
|
|
86
|
+
const value = JSON.parse(stdout);
|
|
87
|
+
if (!object(value)) throw new Error("Adapter output must be a JSON object");
|
|
88
|
+
for (const key of Object.keys(value)) {
|
|
89
|
+
if (!["finalText", "usage", "toolCalls", "error"].includes(key)) throw new Error(`Unknown adapter output field: ${key}`);
|
|
90
|
+
}
|
|
91
|
+
if (value.error !== undefined && value.error !== null) text(value.error, "Adapter error");
|
|
92
|
+
if (typeof value.finalText !== "string" || (!value.error && !value.finalText.trim())) {
|
|
93
|
+
throw new Error("Adapter output requires finalText (nonempty unless an error is reported)");
|
|
94
|
+
}
|
|
95
|
+
const usage = unknownUsage();
|
|
96
|
+
if (value.usage !== undefined && value.usage !== null) {
|
|
97
|
+
if (!object(value.usage)) throw new Error("Adapter usage must be an object or null");
|
|
98
|
+
for (const name of Object.keys(value.usage)) {
|
|
99
|
+
if (!METRICS.includes(name)) throw new Error(`Unknown adapter usage field: ${name}`);
|
|
100
|
+
usage[name] = metric(value.usage[name], name, name !== "costUsd");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return { finalText: value.finalText, usage, toolCalls: metric(value.toolCalls, "toolCalls"), error: value.error ?? null };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function nativeUsage(value) {
|
|
107
|
+
if (value === undefined || value === null) return unknownUsage();
|
|
108
|
+
if (!object(value)) throw new Error("Assistant usage must be an object");
|
|
109
|
+
if (value.cost !== undefined && value.cost !== null && !object(value.cost)) throw new Error("Assistant cost must be an object");
|
|
110
|
+
return {
|
|
111
|
+
inputTokens: metric(value.input, "usage.input"),
|
|
112
|
+
outputTokens: metric(value.output, "usage.output"),
|
|
113
|
+
cacheReadTokens: metric(value.cacheRead, "usage.cacheRead"),
|
|
114
|
+
cacheWriteTokens: metric(value.cacheWrite, "usage.cacheWrite"),
|
|
115
|
+
costUsd: metric(value.cost?.total, "usage.cost.total", false),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function parseDraht(stdout) {
|
|
120
|
+
let finalText = "";
|
|
121
|
+
let terminalMessage;
|
|
122
|
+
let completed = false;
|
|
123
|
+
let incompleteAssistant = false;
|
|
124
|
+
let assistantCount = 0;
|
|
125
|
+
let toolCalls = 0;
|
|
126
|
+
const usage = Object.fromEntries(METRICS.map((name) => [name, 0]));
|
|
127
|
+
for (const line of stdout.split(/\r?\n/)) {
|
|
128
|
+
if (!line.trim()) continue;
|
|
129
|
+
const event = JSON.parse(line);
|
|
130
|
+
if (!object(event) || typeof event.type !== "string") throw new Error("Malformed Draht JSONL event");
|
|
131
|
+
if (event.type === "agent_start") {
|
|
132
|
+
completed = false;
|
|
133
|
+
terminalMessage = undefined;
|
|
134
|
+
finalText = "";
|
|
135
|
+
}
|
|
136
|
+
if (event.type === "agent_end") completed = true;
|
|
137
|
+
if ((event.type === "message_start" && event.message?.role === "assistant") || event.type === "message_update") {
|
|
138
|
+
incompleteAssistant = true;
|
|
139
|
+
completed = false;
|
|
140
|
+
}
|
|
141
|
+
if (event.type === "tool_execution_start") {
|
|
142
|
+
text(event.toolCallId, "Tool call ID");
|
|
143
|
+
text(event.toolName, "Tool name");
|
|
144
|
+
toolCalls++;
|
|
145
|
+
completed = false;
|
|
146
|
+
}
|
|
147
|
+
if (event.type === "message_update" && event.assistantMessageEvent?.type === "error") {
|
|
148
|
+
terminalMessage = event.assistantMessageEvent.error;
|
|
149
|
+
completed = false;
|
|
150
|
+
}
|
|
151
|
+
if (event.type !== "message_end") continue;
|
|
152
|
+
if (!object(event.message) || typeof event.message.role !== "string") throw new Error("Malformed message_end event");
|
|
153
|
+
if (event.message.role !== "assistant") continue;
|
|
154
|
+
terminalMessage = event.message;
|
|
155
|
+
completed = false;
|
|
156
|
+
incompleteAssistant = false;
|
|
157
|
+
assistantCount++;
|
|
158
|
+
if (!Array.isArray(terminalMessage.content)) throw new Error("Assistant content must be an array");
|
|
159
|
+
const parts = [];
|
|
160
|
+
for (const part of terminalMessage.content) {
|
|
161
|
+
if (!object(part) || typeof part.type !== "string") throw new Error("Malformed assistant content");
|
|
162
|
+
if (part.type === "text") {
|
|
163
|
+
if (typeof part.text !== "string") throw new Error("Assistant text must be a string");
|
|
164
|
+
parts.push(part.text);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
finalText = parts.join("\n");
|
|
168
|
+
const measured = nativeUsage(terminalMessage.usage);
|
|
169
|
+
for (const name of METRICS) {
|
|
170
|
+
usage[name] = usage[name] === null || measured[name] === null ? null : metric(usage[name] + measured[name], name, name !== "costUsd");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
let error = null;
|
|
174
|
+
if (terminalMessage?.stopReason === "error" || terminalMessage?.stopReason === "aborted") {
|
|
175
|
+
error = typeof terminalMessage.errorMessage === "string" && terminalMessage.errorMessage.trim()
|
|
176
|
+
? terminalMessage.errorMessage : `Assistant ${terminalMessage.stopReason}`;
|
|
177
|
+
} else if (!completed || incompleteAssistant || !assistantCount || terminalMessage?.stopReason !== "stop" || !finalText.trim()) {
|
|
178
|
+
error = "Draht output has no completed final assistant text";
|
|
179
|
+
}
|
|
180
|
+
return { finalText, usage: assistantCount && !incompleteAssistant ? usage : unknownUsage(), toolCalls: assistantCount ? toolCalls : null, error };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function parseOutput(format, stdout) {
|
|
184
|
+
const telemetrySource = format === "draht-jsonl" ? "draht-events" : "adapter-reported";
|
|
185
|
+
try {
|
|
186
|
+
if (typeof stdout !== "string") throw new Error("Runner stdout must be a string");
|
|
187
|
+
if (format !== "draht-jsonl" && format !== "json") throw new Error(`Unsupported runner format: ${format}`);
|
|
188
|
+
return { ...(format === "draht-jsonl" ? parseDraht(stdout) : parseJson(stdout)), telemetrySource };
|
|
189
|
+
} catch (error) {
|
|
190
|
+
return { finalText: "", usage: unknownUsage(), toolCalls: null, telemetrySource, error: error instanceof Error ? error.message : String(error) };
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export type Host = "coding-agent" | "draht-claude" | "draht-codex";
|
|
2
|
+
export interface PromptVariant { id: string; ref: string | null; }
|
|
3
|
+
export interface PrepareOptions {
|
|
4
|
+
root?: string;
|
|
5
|
+
baseline?: string;
|
|
6
|
+
candidate?: string;
|
|
7
|
+
hosts?: Host[];
|
|
8
|
+
cases?: string[];
|
|
9
|
+
repeats?: number;
|
|
10
|
+
prompt?: string;
|
|
11
|
+
suite?: "1" | "2";
|
|
12
|
+
split?: "screen" | "holdout" | "all";
|
|
13
|
+
variants?: PromptVariant[];
|
|
14
|
+
orderOffset?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface Trial {
|
|
17
|
+
id: string;
|
|
18
|
+
host: Host;
|
|
19
|
+
caseId: string;
|
|
20
|
+
repetition: number;
|
|
21
|
+
variant: string;
|
|
22
|
+
promptCommit?: string | null;
|
|
23
|
+
promptSurface?: "canonical-skill" | "package-asset";
|
|
24
|
+
split?: "screen" | "holdout";
|
|
25
|
+
promptPath: string;
|
|
26
|
+
promptSha256: string;
|
|
27
|
+
promptBytes: number;
|
|
28
|
+
taskSha256: string;
|
|
29
|
+
initialWorkspaceSha256: string;
|
|
30
|
+
}
|
|
31
|
+
export interface Manifest {
|
|
32
|
+
schemaVersion: 1 | 2;
|
|
33
|
+
suiteVersion: string;
|
|
34
|
+
suiteSha256: string;
|
|
35
|
+
root: string;
|
|
36
|
+
baselineCommit: string;
|
|
37
|
+
candidateCommit: string | null;
|
|
38
|
+
hosts: Host[];
|
|
39
|
+
caseIds: string[];
|
|
40
|
+
repeats: number;
|
|
41
|
+
trials: Trial[];
|
|
42
|
+
variants?: PromptVariant[];
|
|
43
|
+
orderOffset?: number;
|
|
44
|
+
split?: "screen" | "holdout" | "all";
|
|
45
|
+
}
|
|
46
|
+
export interface Adapter {
|
|
47
|
+
format: "json" | "draht-jsonl";
|
|
48
|
+
command: string[];
|
|
49
|
+
provider: string;
|
|
50
|
+
model: string;
|
|
51
|
+
settings?: Record<string, string | number | boolean>;
|
|
52
|
+
timeoutMs?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface ProcessResult {
|
|
55
|
+
exitCode: number | null;
|
|
56
|
+
signal: string | null;
|
|
57
|
+
error: string | null;
|
|
58
|
+
timedOut: boolean;
|
|
59
|
+
elapsedMs: number;
|
|
60
|
+
stdout: string;
|
|
61
|
+
stderr: string;
|
|
62
|
+
gitEnvironment: { policy: "fixture-ceiling-v1"; ceilingDirectory: string };
|
|
63
|
+
isolation?: unknown;
|
|
64
|
+
}
|
|
65
|
+
export interface Grade extends Trial {
|
|
66
|
+
passed: boolean;
|
|
67
|
+
executionPassed: boolean;
|
|
68
|
+
evidenceIntact: boolean;
|
|
69
|
+
acceptancePassed: boolean;
|
|
70
|
+
statusPassed: boolean;
|
|
71
|
+
status: string | null;
|
|
72
|
+
scopePassed: boolean;
|
|
73
|
+
scopeViolations: string[];
|
|
74
|
+
failure: string | null;
|
|
75
|
+
acceptance: ProcessResult | null;
|
|
76
|
+
elapsedMs: number | null;
|
|
77
|
+
usage: Record<string, number | null> | null;
|
|
78
|
+
toolCalls: number | null;
|
|
79
|
+
telemetrySource: string | null;
|
|
80
|
+
adapter: Adapter | null;
|
|
81
|
+
behaviorPassed?: boolean | null;
|
|
82
|
+
evidencePassed?: boolean | null;
|
|
83
|
+
statusSyntaxPassed?: boolean;
|
|
84
|
+
statusSemanticPassed?: boolean;
|
|
85
|
+
responseFormatPassed?: boolean;
|
|
86
|
+
findingsPassed?: boolean | null;
|
|
87
|
+
auditEligible?: boolean;
|
|
88
|
+
auditReasons?: string[];
|
|
89
|
+
identity?: { passed: boolean | null; observed: number; mismatches: unknown[]; note: string };
|
|
90
|
+
isolation?: { passed: boolean | null; note: string; receipt?: unknown };
|
|
91
|
+
}
|
|
92
|
+
export interface Metric { observed: number; total: number | null; median: number | null; }
|
|
93
|
+
export interface Pair { host: Host; caseId: string; repetition: number; baselinePassed: boolean; candidatePassed: boolean; elapsedDeltaMs: number | null; }
|
|
94
|
+
export interface PairSummary {
|
|
95
|
+
total: number;
|
|
96
|
+
bothPassed: number;
|
|
97
|
+
regressions: Pair[];
|
|
98
|
+
improvements: Pair[];
|
|
99
|
+
medianElapsedDeltaMsOnPairedPasses: number | null;
|
|
100
|
+
}
|
|
101
|
+
export interface AxisComparison extends PairSummary {
|
|
102
|
+
bothFailed: number;
|
|
103
|
+
unknownOrNotApplicable: number;
|
|
104
|
+
}
|
|
105
|
+
export interface VariantComparison {
|
|
106
|
+
baselineVariant: string;
|
|
107
|
+
candidateVariant: string;
|
|
108
|
+
matchedPairs: number;
|
|
109
|
+
unpairedBaseline: number;
|
|
110
|
+
unpairedCandidate: number;
|
|
111
|
+
strict: PairSummary;
|
|
112
|
+
axes: Record<string, AxisComparison>;
|
|
113
|
+
}
|
|
114
|
+
export interface Summary {
|
|
115
|
+
variants: Record<string, { passed: number; total: number; promptBytes: number; metrics: Record<string, Metric>; axes?: Record<string, {passed: number; failed: number; unknownOrNotApplicable: number}> }>;
|
|
116
|
+
paired: PairSummary;
|
|
117
|
+
comparisons: VariantComparison[];
|
|
118
|
+
comparableRunner: boolean;
|
|
119
|
+
limits: string[];
|
|
120
|
+
}
|
|
121
|
+
export interface Report {
|
|
122
|
+
schemaVersion: 1 | 2;
|
|
123
|
+
suiteVersion: string;
|
|
124
|
+
suiteSha256: string;
|
|
125
|
+
baselineCommit: string;
|
|
126
|
+
candidateCommit: string | null;
|
|
127
|
+
gradedAt: string;
|
|
128
|
+
gradingEnvironment: {node: string; platform: string; arch: string};
|
|
129
|
+
results: Grade[];
|
|
130
|
+
summary: Summary;
|
|
131
|
+
variants?: PromptVariant[];
|
|
132
|
+
split?: "screen" | "holdout" | "all";
|
|
133
|
+
}
|
|
134
|
+
export const HOSTS: Host[];
|
|
135
|
+
export function prepareBank(output: string, options?: PrepareOptions): Manifest;
|
|
136
|
+
export function readManifest(output: string): Manifest;
|
|
137
|
+
export function validateAdapter(config: unknown): Adapter & { settings: Record<string, string | number | boolean>; timeoutMs: number };
|
|
138
|
+
export function runProcess(command: string[], options: {cwd: string; timeoutMs: number; stdin?: string; env?: Record<string,string>}): Promise<ProcessResult>;
|
|
139
|
+
export function runBank(output: string, config: Adapter, onProgress?: (progress: { index: number; total: number; trial: Trial }) => void): Promise<Report>;
|
|
140
|
+
export function gradeBank(output: string): Promise<Report>;
|
|
141
|
+
export function summarize(results: Grade[], variantIds?: string[]): Summary;
|