@draht/coding-agent 2026.10.20 → 2026.10.23

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.
Files changed (726) hide show
  1. package/CHANGELOG.md +138 -0
  2. package/agents/advisor.md +2 -2
  3. package/agents/architect.md +11 -33
  4. package/agents/debugger.md +13 -54
  5. package/agents/git-committer.md +18 -42
  6. package/agents/implementer.md +14 -36
  7. package/agents/investigator.md +12 -63
  8. package/agents/reviewer.md +16 -44
  9. package/agents/security-auditor.md +22 -56
  10. package/agents/spec-reviewer.md +13 -53
  11. package/agents/verifier.md +14 -33
  12. package/bin/drahtbank.mjs +4 -0
  13. package/dist/agents/advisor.md +2 -2
  14. package/dist/agents/architect.md +11 -33
  15. package/dist/agents/debugger.md +13 -54
  16. package/dist/agents/git-committer.md +18 -42
  17. package/dist/agents/implementer.md +14 -36
  18. package/dist/agents/investigator.md +12 -63
  19. package/dist/agents/reviewer.md +16 -44
  20. package/dist/agents/security-auditor.md +22 -56
  21. package/dist/agents/spec-reviewer.md +13 -53
  22. package/dist/agents/verifier.md +14 -33
  23. package/dist/bundle/chunks/anthropic-messages-VEMVBETR.js +6 -0
  24. package/dist/bundle/chunks/anthropic.js +1 -1
  25. package/dist/bundle/chunks/azure-openai-responses-EXUP6SLM.js +2 -0
  26. package/dist/bundle/chunks/bedrock-converse-stream.js +23 -20
  27. package/dist/bundle/chunks/chunk-2MJ6J5N2.js +6 -0
  28. package/dist/bundle/chunks/chunk-2RI4GIFP.js +166 -0
  29. package/dist/bundle/chunks/chunk-57PET6SW.js +82 -0
  30. package/dist/bundle/chunks/chunk-76YNMQ57.js +2 -0
  31. package/dist/bundle/chunks/chunk-AACPRSR2.js +9 -0
  32. package/dist/bundle/chunks/chunk-CHRFWNPF.js +1424 -0
  33. package/dist/bundle/chunks/chunk-CI37W6HM.js +2 -0
  34. package/dist/bundle/chunks/chunk-CMKX4CSI.js +6 -0
  35. package/dist/bundle/chunks/chunk-DHZBWXZK.js +16 -0
  36. package/dist/bundle/chunks/{chunk-D6TMD5Q2.js → chunk-DLVZ3EK7.js} +4 -4
  37. package/dist/bundle/chunks/chunk-DQ4G4IS4.js +20 -0
  38. package/dist/bundle/chunks/chunk-FXCTQRNN.js +2 -0
  39. package/dist/bundle/chunks/chunk-FXLM6UQV.js +2 -0
  40. package/dist/bundle/chunks/chunk-ITP6IDBA.js +20 -0
  41. package/dist/bundle/chunks/chunk-JRHPLIE5.js +11 -0
  42. package/dist/bundle/chunks/chunk-KINQOWAP.js +4 -0
  43. package/dist/bundle/chunks/{chunk-IWTUBX6V.js → chunk-LK54N67E.js} +5 -2
  44. package/dist/bundle/chunks/chunk-MBFTIGLS.js +2 -0
  45. package/dist/bundle/chunks/chunk-QG2WW2SA.js +2 -0
  46. package/dist/bundle/chunks/{chunk-KPO5375S.js → chunk-RCRGGYLW.js} +1 -1
  47. package/dist/bundle/chunks/chunk-RGI7SF5G.js +2 -0
  48. package/dist/bundle/chunks/{chunk-6ZJKIMU7.js → chunk-SYRVFGYE.js} +1 -1
  49. package/dist/bundle/chunks/chunk-UQSONZLL.js +479 -0
  50. package/dist/bundle/chunks/chunk-USCN7R2E.js +2 -0
  51. package/dist/bundle/chunks/chunk-XB4F3WGD.js +132 -0
  52. package/dist/bundle/chunks/chunk-YSIQCH4Z.js +2 -0
  53. package/dist/bundle/chunks/chunk-ZRPAOMVB.js +2 -0
  54. package/dist/bundle/chunks/{cli-PYJB6AQ3.js → cli-LGOE6EXL.js} +6 -6
  55. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-47PK45EQ.js +2 -0
  56. package/dist/bundle/chunks/codemode-worker.js +188 -21
  57. package/dist/bundle/chunks/execute-ZVQ7ITER.js +31 -0
  58. package/dist/bundle/chunks/github-copilot.js +1 -1
  59. package/dist/bundle/chunks/google-generative-ai-PBPH45HB.js +2 -0
  60. package/dist/bundle/chunks/google-vertex-ZPCFQNU6.js +2 -0
  61. package/dist/bundle/chunks/image-resize-worker.js +1 -1
  62. package/dist/bundle/chunks/{llama-cpp-classify-EJ5XMSQL.js → llama-cpp-classify-MWIQKGBR.js} +3 -3
  63. package/dist/bundle/chunks/mistral-conversations-7ODWQ37T.js +5 -0
  64. package/dist/bundle/chunks/node-BZAVEWJ3.js +16 -0
  65. package/dist/bundle/chunks/openai-chatgpt.js +1 -1
  66. package/dist/bundle/chunks/openai-codex-responses-7Y2SP2GS.js +10 -0
  67. package/dist/bundle/chunks/openai-codex.js +1 -1
  68. package/dist/bundle/chunks/openai-completions-QNWYJ4H4.js +7 -0
  69. package/dist/bundle/chunks/openai-decisions-4PKBAPR3.js +5 -0
  70. package/dist/bundle/chunks/openai-responses-73WU3TQM.js +4 -0
  71. package/dist/bundle/chunks/opencode-go.js +1 -1
  72. package/dist/bundle/chunks/openrouter-images-IMWDSQ5F.js +2 -0
  73. package/dist/bundle/chunks/pi-messages-AMNZ7HKZ.js +8 -0
  74. package/dist/bundle/chunks/runtime-7BIFTREJ.js +3 -0
  75. package/dist/bundle/chunks/runtime-MZVF4MP6.js +2 -0
  76. package/dist/bundle/chunks/settings-manager-QF6DRH5C.js +2 -0
  77. package/dist/bundle/chunks/typesafe-system-one-AXQRIVVX.js +2 -0
  78. package/dist/bundle/chunks/virtual-modules-Z4F3ZUX3.js +2 -0
  79. package/dist/bundle/cli-runtime.js +1 -1
  80. package/dist/bundle/index.js +1 -1
  81. package/dist/bundle/rpc-entry.js +1 -1
  82. package/dist/cli/args.d.ts +2 -1
  83. package/dist/cli/args.d.ts.map +1 -1
  84. package/dist/cli/args.js +30 -8
  85. package/dist/cli/args.js.map +1 -1
  86. package/dist/cli/credential-print.d.ts.map +1 -1
  87. package/dist/cli/credential-print.js +4 -4
  88. package/dist/cli/credential-print.js.map +1 -1
  89. package/dist/config.d.ts +18 -1
  90. package/dist/config.d.ts.map +1 -1
  91. package/dist/config.js +44 -6
  92. package/dist/config.js.map +1 -1
  93. package/dist/core/agent-session.d.ts +65 -8
  94. package/dist/core/agent-session.d.ts.map +1 -1
  95. package/dist/core/agent-session.js +240 -102
  96. package/dist/core/agent-session.js.map +1 -1
  97. package/dist/core/auth-storage.d.ts.map +1 -1
  98. package/dist/core/auth-storage.js +20 -13
  99. package/dist/core/auth-storage.js.map +1 -1
  100. package/dist/core/bash-executor.d.ts.map +1 -1
  101. package/dist/core/bash-executor.js +42 -52
  102. package/dist/core/bash-executor.js.map +1 -1
  103. package/dist/core/bug-report.d.ts +9 -1
  104. package/dist/core/bug-report.d.ts.map +1 -1
  105. package/dist/core/builtins/completion-checks.d.ts +3 -0
  106. package/dist/core/builtins/completion-checks.d.ts.map +1 -0
  107. package/dist/core/builtins/completion-checks.js +142 -0
  108. package/dist/core/builtins/completion-checks.js.map +1 -0
  109. package/dist/core/builtins/duet.d.ts.map +1 -1
  110. package/dist/core/builtins/duet.js +7 -5
  111. package/dist/core/builtins/duet.js.map +1 -1
  112. package/dist/core/builtins/git-safety.d.ts +3 -0
  113. package/dist/core/builtins/git-safety.d.ts.map +1 -0
  114. package/dist/core/builtins/git-safety.js +34 -0
  115. package/dist/core/builtins/git-safety.js.map +1 -0
  116. package/dist/core/builtins/index.d.ts.map +1 -1
  117. package/dist/core/builtins/index.js +4 -0
  118. package/dist/core/builtins/index.js.map +1 -1
  119. package/dist/core/client-identity.d.ts +8 -0
  120. package/dist/core/client-identity.d.ts.map +1 -0
  121. package/dist/core/client-identity.js +15 -0
  122. package/dist/core/client-identity.js.map +1 -0
  123. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  124. package/dist/core/compaction/branch-summarization.js +1 -2
  125. package/dist/core/compaction/branch-summarization.js.map +1 -1
  126. package/dist/core/compaction/compaction.d.ts +2 -2
  127. package/dist/core/compaction/compaction.d.ts.map +1 -1
  128. package/dist/core/compaction/compaction.js +20 -15
  129. package/dist/core/compaction/compaction.js.map +1 -1
  130. package/dist/core/compaction/utils.d.ts +6 -0
  131. package/dist/core/compaction/utils.d.ts.map +1 -1
  132. package/dist/core/compaction/utils.js +7 -8
  133. package/dist/core/compaction/utils.js.map +1 -1
  134. package/dist/core/export-html/index.d.ts.map +1 -1
  135. package/dist/core/export-html/index.js +2 -0
  136. package/dist/core/export-html/index.js.map +1 -1
  137. package/dist/core/export-html/template.html +1 -0
  138. package/dist/core/export-html/template.js +23 -17
  139. package/dist/core/export-html/tool-renderer.d.ts +3 -3
  140. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  141. package/dist/core/export-html/tool-renderer.js +5 -3
  142. package/dist/core/export-html/tool-renderer.js.map +1 -1
  143. package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
  144. package/dist/core/export-html/vendor/marked.min.js +30 -29
  145. package/dist/core/extensions/index.d.ts +1 -1
  146. package/dist/core/extensions/index.d.ts.map +1 -1
  147. package/dist/core/extensions/index.js.map +1 -1
  148. package/dist/core/extensions/loader.d.ts.map +1 -1
  149. package/dist/core/extensions/loader.js +7 -0
  150. package/dist/core/extensions/loader.js.map +1 -1
  151. package/dist/core/extensions/runner.d.ts +6 -2
  152. package/dist/core/extensions/runner.d.ts.map +1 -1
  153. package/dist/core/extensions/runner.js +16 -4
  154. package/dist/core/extensions/runner.js.map +1 -1
  155. package/dist/core/extensions/types.d.ts +61 -7
  156. package/dist/core/extensions/types.d.ts.map +1 -1
  157. package/dist/core/extensions/types.js.map +1 -1
  158. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  159. package/dist/core/extensions/virtual-modules.js +2 -0
  160. package/dist/core/extensions/virtual-modules.js.map +1 -1
  161. package/dist/core/key-id-schema.d.ts +6 -0
  162. package/dist/core/key-id-schema.d.ts.map +1 -0
  163. package/dist/core/key-id-schema.js +16 -0
  164. package/dist/core/key-id-schema.js.map +1 -0
  165. package/dist/core/keybindings-schema.d.ts +4 -0
  166. package/dist/core/keybindings-schema.d.ts.map +1 -0
  167. package/dist/core/keybindings-schema.js +16 -0
  168. package/dist/core/keybindings-schema.js.map +1 -0
  169. package/dist/core/keybindings.d.ts +242 -75
  170. package/dist/core/keybindings.d.ts.map +1 -1
  171. package/dist/core/keybindings.js +30 -23
  172. package/dist/core/keybindings.js.map +1 -1
  173. package/dist/core/mcp-servers.d.ts +22 -0
  174. package/dist/core/mcp-servers.d.ts.map +1 -1
  175. package/dist/core/mcp-servers.js +72 -11
  176. package/dist/core/mcp-servers.js.map +1 -1
  177. package/dist/core/model-config.d.ts +1623 -74
  178. package/dist/core/model-config.d.ts.map +1 -1
  179. package/dist/core/model-config.js +70 -184
  180. package/dist/core/model-config.js.map +1 -1
  181. package/dist/core/model-registry.d.ts +3 -1
  182. package/dist/core/model-registry.d.ts.map +1 -1
  183. package/dist/core/model-registry.js +4 -0
  184. package/dist/core/model-registry.js.map +1 -1
  185. package/dist/core/model-resolver.d.ts +56 -43
  186. package/dist/core/model-resolver.d.ts.map +1 -1
  187. package/dist/core/model-resolver.js +253 -358
  188. package/dist/core/model-resolver.js.map +1 -1
  189. package/dist/core/model-runtime.d.ts.map +1 -1
  190. package/dist/core/model-runtime.js +19 -10
  191. package/dist/core/model-runtime.js.map +1 -1
  192. package/dist/core/nested-tool-calls.d.ts +1 -0
  193. package/dist/core/nested-tool-calls.d.ts.map +1 -1
  194. package/dist/core/nested-tool-calls.js +1 -0
  195. package/dist/core/nested-tool-calls.js.map +1 -1
  196. package/dist/core/package-manager.js +3 -3
  197. package/dist/core/package-manager.js.map +1 -1
  198. package/dist/core/polyphase/keyword.js +1 -1
  199. package/dist/core/polyphase/keyword.js.map +1 -1
  200. package/dist/core/polyphase/model-selection.d.ts.map +1 -1
  201. package/dist/core/polyphase/model-selection.js +15 -7
  202. package/dist/core/polyphase/model-selection.js.map +1 -1
  203. package/dist/core/polyphase/workflow/prelude.d.ts +2 -0
  204. package/dist/core/polyphase/workflow/prelude.d.ts.map +1 -1
  205. package/dist/core/polyphase/workflow/prelude.js +12 -16
  206. package/dist/core/polyphase/workflow/prelude.js.map +1 -1
  207. package/dist/core/polyphase/workflow/runtime.d.ts.map +1 -1
  208. package/dist/core/polyphase/workflow/runtime.js +2 -1
  209. package/dist/core/polyphase/workflow/runtime.js.map +1 -1
  210. package/dist/core/project-trust.d.ts.map +1 -1
  211. package/dist/core/project-trust.js +2 -1
  212. package/dist/core/project-trust.js.map +1 -1
  213. package/dist/core/prompt-templates.d.ts.map +1 -1
  214. package/dist/core/prompt-templates.js +7 -2
  215. package/dist/core/prompt-templates.js.map +1 -1
  216. package/dist/core/provider-composer.d.ts +2 -1
  217. package/dist/core/provider-composer.d.ts.map +1 -1
  218. package/dist/core/provider-composer.js +13 -0
  219. package/dist/core/provider-composer.js.map +1 -1
  220. package/dist/core/radius.d.ts +2 -0
  221. package/dist/core/radius.d.ts.map +1 -1
  222. package/dist/core/radius.js +2 -0
  223. package/dist/core/radius.js.map +1 -1
  224. package/dist/core/remote-catalog-provider.d.ts +12 -1
  225. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  226. package/dist/core/remote-catalog-provider.js +84 -24
  227. package/dist/core/remote-catalog-provider.js.map +1 -1
  228. package/dist/core/resource-loader.d.ts +3 -0
  229. package/dist/core/resource-loader.d.ts.map +1 -1
  230. package/dist/core/resource-loader.js +7 -4
  231. package/dist/core/resource-loader.js.map +1 -1
  232. package/dist/core/sdk.d.ts +13 -4
  233. package/dist/core/sdk.d.ts.map +1 -1
  234. package/dist/core/sdk.js +27 -15
  235. package/dist/core/sdk.js.map +1 -1
  236. package/dist/core/settings-defaults.d.ts +65 -0
  237. package/dist/core/settings-defaults.d.ts.map +1 -0
  238. package/dist/core/settings-defaults.js +66 -0
  239. package/dist/core/settings-defaults.js.map +1 -0
  240. package/dist/core/settings-manager.d.ts +17 -178
  241. package/dist/core/settings-manager.d.ts.map +1 -1
  242. package/dist/core/settings-manager.js +86 -57
  243. package/dist/core/settings-manager.js.map +1 -1
  244. package/dist/core/settings-schema.d.ts +269 -0
  245. package/dist/core/settings-schema.d.ts.map +1 -0
  246. package/dist/core/settings-schema.js +318 -0
  247. package/dist/core/settings-schema.js.map +1 -0
  248. package/dist/core/skills.d.ts +4 -1
  249. package/dist/core/skills.d.ts.map +1 -1
  250. package/dist/core/skills.js +6 -1
  251. package/dist/core/skills.js.map +1 -1
  252. package/dist/core/system-prompt.d.ts +6 -0
  253. package/dist/core/system-prompt.d.ts.map +1 -1
  254. package/dist/core/system-prompt.js +10 -5
  255. package/dist/core/system-prompt.js.map +1 -1
  256. package/dist/core/tools/bash.d.ts.map +1 -1
  257. package/dist/core/tools/bash.js +3 -5
  258. package/dist/core/tools/bash.js.map +1 -1
  259. package/dist/core/tools/grep.d.ts +8 -0
  260. package/dist/core/tools/grep.d.ts.map +1 -1
  261. package/dist/core/tools/grep.js +19 -7
  262. package/dist/core/tools/grep.js.map +1 -1
  263. package/dist/core/tools/index.d.ts +2 -0
  264. package/dist/core/tools/index.d.ts.map +1 -1
  265. package/dist/core/tools/index.js +2 -0
  266. package/dist/core/tools/index.js.map +1 -1
  267. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  268. package/dist/core/tools/output-accumulator.js +4 -10
  269. package/dist/core/tools/output-accumulator.js.map +1 -1
  270. package/dist/core/tools/path-utils.d.ts +1 -1
  271. package/dist/core/tools/path-utils.d.ts.map +1 -1
  272. package/dist/core/tools/path-utils.js +6 -6
  273. package/dist/core/tools/path-utils.js.map +1 -1
  274. package/dist/core/tools/read.d.ts +13 -0
  275. package/dist/core/tools/read.d.ts.map +1 -1
  276. package/dist/core/tools/read.js +32 -2
  277. package/dist/core/tools/read.js.map +1 -1
  278. package/dist/core/tools/render-utils.d.ts +20 -0
  279. package/dist/core/tools/render-utils.d.ts.map +1 -1
  280. package/dist/core/tools/render-utils.js +67 -0
  281. package/dist/core/tools/render-utils.js.map +1 -1
  282. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  283. package/dist/core/tools/renderers/bash.js +7 -35
  284. package/dist/core/tools/renderers/bash.js.map +1 -1
  285. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  286. package/dist/core/tools/renderers/edit.js +5 -4
  287. package/dist/core/tools/renderers/edit.js.map +1 -1
  288. package/dist/core/tools/renderers/index.d.ts +2 -2
  289. package/dist/core/tools/renderers/index.d.ts.map +1 -1
  290. package/dist/core/tools/renderers/index.js.map +1 -1
  291. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  292. package/dist/core/tools/renderers/read.js +7 -11
  293. package/dist/core/tools/renderers/read.js.map +1 -1
  294. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  295. package/dist/extensions/codemode/execute.js +391 -80
  296. package/dist/extensions/codemode/execute.js.map +1 -1
  297. package/dist/extensions/codemode/index.d.ts.map +1 -1
  298. package/dist/extensions/codemode/index.js +3 -1
  299. package/dist/extensions/codemode/index.js.map +1 -1
  300. package/dist/extensions/codemode/renderer.d.ts +2 -2
  301. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  302. package/dist/extensions/codemode/renderer.js +9 -3
  303. package/dist/extensions/codemode/renderer.js.map +1 -1
  304. package/dist/extensions/codemode/tool.d.ts +22 -21
  305. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  306. package/dist/extensions/codemode/tool.js +96 -123
  307. package/dist/extensions/codemode/tool.js.map +1 -1
  308. package/dist/extensions/llama/provider.d.ts.map +1 -1
  309. package/dist/extensions/llama/provider.js +34 -11
  310. package/dist/extensions/llama/provider.js.map +1 -1
  311. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  312. package/dist/extensions/mcp/cli.js +27 -33
  313. package/dist/extensions/mcp/cli.js.map +1 -1
  314. package/dist/extensions/mcp/config.d.ts +15 -3
  315. package/dist/extensions/mcp/config.d.ts.map +1 -1
  316. package/dist/extensions/mcp/config.js +49 -12
  317. package/dist/extensions/mcp/config.js.map +1 -1
  318. package/dist/extensions/mcp/index.d.ts +4 -1
  319. package/dist/extensions/mcp/index.d.ts.map +1 -1
  320. package/dist/extensions/mcp/index.js +279 -129
  321. package/dist/extensions/mcp/index.js.map +1 -1
  322. package/dist/extensions/mcp/oauth.d.ts +21 -11
  323. package/dist/extensions/mcp/oauth.d.ts.map +1 -1
  324. package/dist/extensions/mcp/oauth.js +166 -45
  325. package/dist/extensions/mcp/oauth.js.map +1 -1
  326. package/dist/extensions/mcp/resources.d.ts +3 -10
  327. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  328. package/dist/extensions/mcp/resources.js +4 -5
  329. package/dist/extensions/mcp/resources.js.map +1 -1
  330. package/dist/extensions/mcp/runtime.d.ts +7 -7
  331. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  332. package/dist/extensions/mcp/runtime.js +31 -45
  333. package/dist/extensions/mcp/runtime.js.map +1 -1
  334. package/dist/extensions/mcp/tools.d.ts +7 -5
  335. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  336. package/dist/extensions/mcp/tools.js +87 -29
  337. package/dist/extensions/mcp/tools.js.map +1 -1
  338. package/dist/extensions/mcp/ui.d.ts +3 -3
  339. package/dist/extensions/mcp/ui.d.ts.map +1 -1
  340. package/dist/extensions/mcp/ui.js +18 -6
  341. package/dist/extensions/mcp/ui.js.map +1 -1
  342. package/dist/extensions/tool-search/tool.d.ts +0 -2
  343. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  344. package/dist/extensions/tool-search/tool.js +2 -4
  345. package/dist/extensions/tool-search/tool.js.map +1 -1
  346. package/dist/hooks/checks/checks-runtime.cjs +215 -0
  347. package/dist/hooks/checks/git-safety.cjs +198 -0
  348. package/dist/hooks/checks/git-safety.d.cts +1 -0
  349. package/dist/hooks/gsd/draht-post-task.js +78 -39
  350. package/dist/hooks/gsd/draht-quality-gate.js +210 -122
  351. package/dist/hooks/gsd/package.json +3 -0
  352. package/dist/index.d.ts +5 -4
  353. package/dist/index.d.ts.map +1 -1
  354. package/dist/index.js +3 -2
  355. package/dist/index.js.map +1 -1
  356. package/dist/main.d.ts.map +1 -1
  357. package/dist/main.js +11 -3
  358. package/dist/main.js.map +1 -1
  359. package/dist/modes/interactive/components/auth-url.d.ts +14 -0
  360. package/dist/modes/interactive/components/auth-url.d.ts.map +1 -0
  361. package/dist/modes/interactive/components/auth-url.js +37 -0
  362. package/dist/modes/interactive/components/auth-url.js.map +1 -0
  363. package/dist/modes/interactive/components/bash-execution.d.ts +5 -1
  364. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  365. package/dist/modes/interactive/components/bash-execution.js +17 -14
  366. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  367. package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
  368. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  369. package/dist/modes/interactive/components/branch-summary-message.js +5 -2
  370. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  371. package/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -1
  372. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  373. package/dist/modes/interactive/components/compaction-summary-message.js +5 -2
  374. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  375. package/dist/modes/interactive/components/custom-entry.d.ts +3 -1
  376. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  377. package/dist/modes/interactive/components/custom-entry.js +8 -2
  378. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  379. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  380. package/dist/modes/interactive/components/custom-message.js +1 -0
  381. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  382. package/dist/modes/interactive/components/login-dialog.d.ts +3 -0
  383. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  384. package/dist/modes/interactive/components/login-dialog.js +38 -10
  385. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  386. package/dist/modes/interactive/components/oauth-selector.d.ts +8 -2
  387. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  388. package/dist/modes/interactive/components/oauth-selector.js +24 -21
  389. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  390. package/dist/modes/interactive/components/radius-login-selector.d.ts +15 -0
  391. package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -0
  392. package/dist/modes/interactive/components/radius-login-selector.js +85 -0
  393. package/dist/modes/interactive/components/radius-login-selector.js.map +1 -0
  394. package/dist/modes/interactive/components/settings-selector.d.ts +3 -3
  395. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  396. package/dist/modes/interactive/components/settings-selector.js +9 -8
  397. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  398. package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
  399. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  400. package/dist/modes/interactive/components/skill-invocation-message.js +5 -2
  401. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  402. package/dist/modes/interactive/components/status-indicator.d.ts +1 -1
  403. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  404. package/dist/modes/interactive/components/status-indicator.js +2 -2
  405. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  406. package/dist/modes/interactive/components/tool-execution.d.ts +12 -13
  407. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  408. package/dist/modes/interactive/components/tool-execution.js +32 -45
  409. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  410. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  411. package/dist/modes/interactive/components/tree-selector.js +2 -9
  412. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  413. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  414. package/dist/modes/interactive/components/user-message.js +5 -4
  415. package/dist/modes/interactive/components/user-message.js.map +1 -1
  416. package/dist/modes/interactive/interactive-mode.d.ts +43 -48
  417. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  418. package/dist/modes/interactive/interactive-mode.js +362 -278
  419. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  420. package/dist/modes/interactive/program-status-reporter.d.ts +34 -0
  421. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
  422. package/dist/modes/interactive/program-status-reporter.js +110 -0
  423. package/dist/modes/interactive/program-status-reporter.js.map +1 -0
  424. package/dist/modes/interactive/theme/dark.json +1 -1
  425. package/dist/modes/interactive/theme/light.json +1 -1
  426. package/dist/modes/interactive/theme/system-theme.d.ts +2 -1
  427. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -1
  428. package/dist/modes/interactive/theme/system-theme.js +16 -5
  429. package/dist/modes/interactive/theme/system-theme.js.map +1 -1
  430. package/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
  431. package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  432. package/dist/modes/interactive/theme/theme-schema.js +105 -0
  433. package/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  434. package/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
  435. package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
  436. package/dist/modes/interactive/theme/theme-tokens.js +94 -0
  437. package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
  438. package/dist/modes/interactive/theme/theme.d.ts +13 -16
  439. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  440. package/dist/modes/interactive/theme/theme.js +22 -29
  441. package/dist/modes/interactive/theme/theme.js.map +1 -1
  442. package/dist/modes/print-mode.d.ts.map +1 -1
  443. package/dist/modes/print-mode.js +4 -0
  444. package/dist/modes/print-mode.js.map +1 -1
  445. package/dist/package-manager-cli.d.ts.map +1 -1
  446. package/dist/package-manager-cli.js +26 -1
  447. package/dist/package-manager-cli.js.map +1 -1
  448. package/dist/prompts/commands/atomic-commit.md +8 -6
  449. package/dist/prompts/commands/brainstorm.md +5 -149
  450. package/dist/prompts/commands/create-verification-skill.md +8 -48
  451. package/dist/prompts/commands/discuss-phase.md +6 -10
  452. package/dist/prompts/commands/execute-phase.md +18 -45
  453. package/dist/prompts/commands/fix.md +16 -128
  454. package/dist/prompts/commands/grill.md +6 -53
  455. package/dist/prompts/commands/init-project.md +13 -18
  456. package/dist/prompts/commands/map-codebase.md +3 -3
  457. package/dist/prompts/commands/new-project.md +12 -17
  458. package/dist/prompts/commands/next-milestone.md +4 -8
  459. package/dist/prompts/commands/orchestrate-loop.md +12 -12
  460. package/dist/prompts/commands/orchestrate.md +12 -11
  461. package/dist/prompts/commands/pause-work.md +1 -1
  462. package/dist/prompts/commands/plan-phase.md +15 -37
  463. package/dist/prompts/commands/quick.md +11 -64
  464. package/dist/prompts/commands/resolve-conflicts.md +2 -15
  465. package/dist/prompts/commands/triage.md +3 -14
  466. package/dist/prompts/commands/verify-work.md +15 -63
  467. package/dist/prompts/commands/why.md +18 -118
  468. package/dist/skills/atomic-reasoning/SKILL.md +6 -105
  469. package/dist/skills/blast-radius/SKILL.md +1 -1
  470. package/dist/skills/epistemics/SKILL.md +12 -87
  471. package/dist/skills/explainers/SKILL.md +1 -1
  472. package/dist/skills/typescript-discipline/SKILL.md +12 -42
  473. package/dist/skills/typescript-discipline/references/patterns.md +25 -266
  474. package/dist/skills/unslop/SKILL.md +14 -105
  475. package/dist/utils/ansi.d.ts +8 -0
  476. package/dist/utils/ansi.d.ts.map +1 -1
  477. package/dist/utils/ansi.js +30 -11
  478. package/dist/utils/ansi.js.map +1 -1
  479. package/dist/utils/clipboard-command.d.ts.map +1 -1
  480. package/dist/utils/clipboard-command.js +3 -0
  481. package/dist/utils/clipboard-command.js.map +1 -1
  482. package/dist/utils/clipboard.d.ts.map +1 -1
  483. package/dist/utils/clipboard.js +18 -12
  484. package/dist/utils/clipboard.js.map +1 -1
  485. package/dist/utils/draht-user-agent.d.ts +1 -0
  486. package/dist/utils/draht-user-agent.d.ts.map +1 -1
  487. package/dist/utils/draht-user-agent.js +3 -2
  488. package/dist/utils/draht-user-agent.js.map +1 -1
  489. package/dist/utils/image-convert.d.ts +12 -0
  490. package/dist/utils/image-convert.d.ts.map +1 -1
  491. package/dist/utils/image-convert.js +45 -6
  492. package/dist/utils/image-convert.js.map +1 -1
  493. package/dist/utils/image-resize-core.d.ts +12 -0
  494. package/dist/utils/image-resize-core.d.ts.map +1 -1
  495. package/dist/utils/image-resize-core.js +5 -0
  496. package/dist/utils/image-resize-core.js.map +1 -1
  497. package/dist/utils/image-resize-worker.js +3 -2
  498. package/dist/utils/image-resize-worker.js.map +1 -1
  499. package/dist/utils/image-resize.d.ts.map +1 -1
  500. package/dist/utils/image-resize.js +9 -10
  501. package/dist/utils/image-resize.js.map +1 -1
  502. package/dist/utils/output-files.d.ts +15 -0
  503. package/dist/utils/output-files.d.ts.map +1 -0
  504. package/dist/utils/output-files.js +30 -0
  505. package/dist/utils/output-files.js.map +1 -0
  506. package/dist/utils/shell.d.ts.map +1 -1
  507. package/dist/utils/shell.js +43 -13
  508. package/dist/utils/shell.js.map +1 -1
  509. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  510. package/dist/utils/syntax-highlight.js +6 -1
  511. package/dist/utils/syntax-highlight.js.map +1 -1
  512. package/dist/utils/tools-manager.d.ts.map +1 -1
  513. package/dist/utils/tools-manager.js +4 -3
  514. package/dist/utils/tools-manager.js.map +1 -1
  515. package/docs/cli-integration.md +1 -1
  516. package/docs/cli.md +30 -26
  517. package/docs/codemode.md +230 -0
  518. package/docs/compaction.md +5 -5
  519. package/docs/containerization.md +1 -1
  520. package/docs/custom-provider.md +53 -1
  521. package/docs/docs.json +17 -1
  522. package/docs/drahtbank.md +163 -0
  523. package/docs/environment-variables.md +5 -2
  524. package/docs/extensions.md +143 -13
  525. package/docs/index.md +1 -1
  526. package/docs/json.md +3 -3
  527. package/docs/keybindings.md +9 -5
  528. package/docs/llama-cpp.md +9 -2
  529. package/docs/mcp.md +59 -3
  530. package/docs/message-types.md +22 -4
  531. package/docs/models-configuration.md +187 -0
  532. package/docs/models.md +67 -4
  533. package/docs/nvidia-rtx-llama-cpp.md +96 -0
  534. package/docs/providers.md +70 -5
  535. package/docs/sdk.md +1 -1
  536. package/docs/settings.md +10 -8
  537. package/docs/terminal-setup.md +14 -0
  538. package/docs/themes.md +4 -2
  539. package/docs/tui.md +71 -1
  540. package/docs/usage.md +1 -1
  541. package/docs/windows.md +16 -2
  542. package/eval/drahtbank/adapters.d.mts +35 -0
  543. package/eval/drahtbank/adapters.mjs +192 -0
  544. package/eval/drahtbank/bank.d.mts +141 -0
  545. package/eval/drahtbank/bank.mjs +515 -0
  546. package/eval/drahtbank/cases-v2.d.mts +28 -0
  547. package/eval/drahtbank/cases-v2.mjs +164 -0
  548. package/eval/drahtbank/cases.d.mts +17 -0
  549. package/eval/drahtbank/cases.mjs +198 -0
  550. package/eval/drahtbank/cli.mjs +120 -0
  551. package/eval/drahtbank/grading-v2.d.mts +26 -0
  552. package/eval/drahtbank/grading-v2.mjs +227 -0
  553. package/eval/drahtbank/isolated-tools.ts +223 -0
  554. package/eval/drahtbank/isolation-worker.mjs +53 -0
  555. package/eval/drahtbank/isolation.d.mts +52 -0
  556. package/eval/drahtbank/isolation.mjs +345 -0
  557. package/eval/drahtbank/runtime-checks.d.mts +15 -0
  558. package/eval/drahtbank/runtime-checks.mjs +187 -0
  559. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  560. package/examples/extensions/minimal-mode.ts +4 -5
  561. package/examples/extensions/overlay-test.ts +2 -2
  562. package/examples/extensions/plan-mode/index.ts +6 -2
  563. package/examples/extensions/subagent/index.ts +4 -6
  564. package/hooks/checks/checks-runtime.cjs +215 -0
  565. package/hooks/checks/git-safety.cjs +198 -0
  566. package/hooks/checks/git-safety.d.cts +1 -0
  567. package/hooks/gsd/draht-post-task.js +78 -39
  568. package/hooks/gsd/draht-quality-gate.js +210 -122
  569. package/hooks/gsd/package.json +3 -0
  570. package/package.json +21 -16
  571. package/prompts/commands/atomic-commit.md +8 -6
  572. package/prompts/commands/brainstorm.md +5 -149
  573. package/prompts/commands/create-verification-skill.md +8 -48
  574. package/prompts/commands/discuss-phase.md +6 -10
  575. package/prompts/commands/execute-phase.md +18 -45
  576. package/prompts/commands/fix.md +16 -128
  577. package/prompts/commands/grill.md +6 -53
  578. package/prompts/commands/init-project.md +13 -18
  579. package/prompts/commands/map-codebase.md +3 -3
  580. package/prompts/commands/new-project.md +12 -17
  581. package/prompts/commands/next-milestone.md +4 -8
  582. package/prompts/commands/orchestrate-loop.md +12 -12
  583. package/prompts/commands/orchestrate.md +12 -11
  584. package/prompts/commands/pause-work.md +1 -1
  585. package/prompts/commands/plan-phase.md +15 -37
  586. package/prompts/commands/quick.md +11 -64
  587. package/prompts/commands/resolve-conflicts.md +2 -15
  588. package/prompts/commands/triage.md +3 -14
  589. package/prompts/commands/verify-work.md +15 -63
  590. package/prompts/commands/why.md +18 -118
  591. package/schemas/keybindings.schema.json +433 -0
  592. package/schemas/models.schema.json +1190 -0
  593. package/schemas/settings.schema.json +849 -0
  594. package/schemas/theme.schema.json +365 -0
  595. package/skills/atomic-reasoning/SKILL.md +6 -105
  596. package/skills/blast-radius/SKILL.md +1 -1
  597. package/skills/epistemics/SKILL.md +12 -87
  598. package/skills/explainers/SKILL.md +1 -1
  599. package/skills/typescript-discipline/SKILL.md +12 -42
  600. package/skills/typescript-discipline/references/patterns.md +25 -266
  601. package/skills/unslop/SKILL.md +14 -105
  602. package/dist/bundle/chunks/anthropic-messages-GAKYXF65.js +0 -6
  603. package/dist/bundle/chunks/azure-openai-responses-ZIXMK6JO.js +0 -2
  604. package/dist/bundle/chunks/chunk-2E5VODES.js +0 -2
  605. package/dist/bundle/chunks/chunk-2VAF4XJI.js +0 -146
  606. package/dist/bundle/chunks/chunk-4TVQYRQY.js +0 -2
  607. package/dist/bundle/chunks/chunk-7TYCZN4Z.js +0 -137
  608. package/dist/bundle/chunks/chunk-BXSHCX3G.js +0 -11
  609. package/dist/bundle/chunks/chunk-GVXA72ZA.js +0 -2
  610. package/dist/bundle/chunks/chunk-I5OKY6RH.js +0 -11
  611. package/dist/bundle/chunks/chunk-KU5HAKZL.js +0 -4
  612. package/dist/bundle/chunks/chunk-MO3SCGBN.js +0 -18
  613. package/dist/bundle/chunks/chunk-N2QZNJT6.js +0 -65
  614. package/dist/bundle/chunks/chunk-PGJAHC3R.js +0 -107
  615. package/dist/bundle/chunks/chunk-QVFELZW2.js +0 -312
  616. package/dist/bundle/chunks/chunk-RZKPFWMH.js +0 -42
  617. package/dist/bundle/chunks/chunk-SDRCE6OP.js +0 -2
  618. package/dist/bundle/chunks/chunk-SVNWI7EV.js +0 -8
  619. package/dist/bundle/chunks/chunk-TOWVIJ2O.js +0 -1623
  620. package/dist/bundle/chunks/chunk-XBUEMKIY.js +0 -2
  621. package/dist/bundle/chunks/chunk-ZA4QNPJY.js +0 -82
  622. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-MJKOAE5S.js +0 -2
  623. package/dist/bundle/chunks/execute-6N7T7VLY.js +0 -18
  624. package/dist/bundle/chunks/google-generative-ai-RPUPQ6PM.js +0 -2
  625. package/dist/bundle/chunks/google-vertex-EZES5QVQ.js +0 -2
  626. package/dist/bundle/chunks/mistral-conversations-AOYGU43Y.js +0 -5
  627. package/dist/bundle/chunks/node-LQ52KV6B.js +0 -16
  628. package/dist/bundle/chunks/openai-codex-responses-M2Y77JEQ.js +0 -10
  629. package/dist/bundle/chunks/openai-completions-A4OKYOYV.js +0 -7
  630. package/dist/bundle/chunks/openai-responses-6IXV53T3.js +0 -3
  631. package/dist/bundle/chunks/openrouter-images-LYV4NKFM.js +0 -2
  632. package/dist/bundle/chunks/pi-messages-KKMEUT3Z.js +0 -8
  633. package/dist/bundle/chunks/runtime-363BOYEO.js +0 -3
  634. package/dist/bundle/chunks/runtime-D3KV73AE.js +0 -2
  635. package/dist/bundle/chunks/settings-manager-GEOZJXFQ.js +0 -2
  636. package/dist/bundle/chunks/typesafe-system-one-YBEEY5XU.js +0 -2
  637. package/dist/bundle/chunks/virtual-modules-RLC4Y5MX.js +0 -2
  638. package/dist/core/provider-attribution.d.ts +0 -4
  639. package/dist/core/provider-attribution.d.ts.map +0 -1
  640. package/dist/core/provider-attribution.js +0 -72
  641. package/dist/core/provider-attribution.js.map +0 -1
  642. package/dist/experimental/micro/api.d.ts +0 -81
  643. package/dist/experimental/micro/api.d.ts.map +0 -1
  644. package/dist/experimental/micro/api.js +0 -2
  645. package/dist/experimental/micro/api.js.map +0 -1
  646. package/dist/experimental/micro/main.d.ts +0 -3
  647. package/dist/experimental/micro/main.d.ts.map +0 -1
  648. package/dist/experimental/micro/main.js +0 -21
  649. package/dist/experimental/micro/main.js.map +0 -1
  650. package/dist/experimental/micro/models.d.ts +0 -11
  651. package/dist/experimental/micro/models.d.ts.map +0 -1
  652. package/dist/experimental/micro/models.js +0 -95
  653. package/dist/experimental/micro/models.js.map +0 -1
  654. package/dist/experimental/micro/runtime.d.ts +0 -12
  655. package/dist/experimental/micro/runtime.d.ts.map +0 -1
  656. package/dist/experimental/micro/runtime.js +0 -465
  657. package/dist/experimental/micro/runtime.js.map +0 -1
  658. package/dist/experimental/micro/sessions.d.ts +0 -10
  659. package/dist/experimental/micro/sessions.d.ts.map +0 -1
  660. package/dist/experimental/micro/sessions.js +0 -41
  661. package/dist/experimental/micro/sessions.js.map +0 -1
  662. package/dist/experimental/micro/tools.d.ts +0 -10
  663. package/dist/experimental/micro/tools.d.ts.map +0 -1
  664. package/dist/experimental/micro/tools.js +0 -96
  665. package/dist/experimental/micro/tools.js.map +0 -1
  666. package/dist/experimental/micro/tui.d.ts +0 -3
  667. package/dist/experimental/micro/tui.d.ts.map +0 -1
  668. package/dist/experimental/micro/tui.js +0 -510
  669. package/dist/experimental/micro/tui.js.map +0 -1
  670. package/dist/experimental/mini/main.d.ts +0 -7
  671. package/dist/experimental/mini/main.d.ts.map +0 -1
  672. package/dist/experimental/mini/main.js +0 -21
  673. package/dist/experimental/mini/main.js.map +0 -1
  674. package/dist/experimental/mini/server/entry.d.ts +0 -3
  675. package/dist/experimental/mini/server/entry.d.ts.map +0 -1
  676. package/dist/experimental/mini/server/entry.js +0 -11
  677. package/dist/experimental/mini/server/entry.js.map +0 -1
  678. package/dist/experimental/mini/server/run.d.ts +0 -13
  679. package/dist/experimental/mini/server/run.d.ts.map +0 -1
  680. package/dist/experimental/mini/server/run.js +0 -150
  681. package/dist/experimental/mini/server/run.js.map +0 -1
  682. package/dist/experimental/mini/shared/protocol.d.ts +0 -127
  683. package/dist/experimental/mini/shared/protocol.d.ts.map +0 -1
  684. package/dist/experimental/mini/shared/protocol.js +0 -13
  685. package/dist/experimental/mini/shared/protocol.js.map +0 -1
  686. package/dist/experimental/mini/shared/rpc.d.ts +0 -49
  687. package/dist/experimental/mini/shared/rpc.d.ts.map +0 -1
  688. package/dist/experimental/mini/shared/rpc.js +0 -171
  689. package/dist/experimental/mini/shared/rpc.js.map +0 -1
  690. package/dist/experimental/mini/shared/transport.d.ts +0 -35
  691. package/dist/experimental/mini/shared/transport.d.ts.map +0 -1
  692. package/dist/experimental/mini/shared/transport.js +0 -94
  693. package/dist/experimental/mini/shared/transport.js.map +0 -1
  694. package/dist/experimental/mini/tui/run.d.ts +0 -9
  695. package/dist/experimental/mini/tui/run.d.ts.map +0 -1
  696. package/dist/experimental/mini/tui/run.js +0 -62
  697. package/dist/experimental/mini/tui/run.js.map +0 -1
  698. package/dist/experimental/mini/tui/session.d.ts +0 -26
  699. package/dist/experimental/mini/tui/session.d.ts.map +0 -1
  700. package/dist/experimental/mini/tui/session.js +0 -94
  701. package/dist/experimental/mini/tui/session.js.map +0 -1
  702. package/dist/experimental/mini/tui/view.d.ts +0 -10
  703. package/dist/experimental/mini/tui/view.d.ts.map +0 -1
  704. package/dist/experimental/mini/tui/view.js +0 -461
  705. package/dist/experimental/mini/tui/view.js.map +0 -1
  706. package/dist/experimental/mini/worker/entry.d.ts +0 -3
  707. package/dist/experimental/mini/worker/entry.d.ts.map +0 -1
  708. package/dist/experimental/mini/worker/entry.js +0 -10
  709. package/dist/experimental/mini/worker/entry.js.map +0 -1
  710. package/dist/experimental/mini/worker/lane-service.d.ts +0 -44
  711. package/dist/experimental/mini/worker/lane-service.d.ts.map +0 -1
  712. package/dist/experimental/mini/worker/lane-service.js +0 -97
  713. package/dist/experimental/mini/worker/lane-service.js.map +0 -1
  714. package/dist/experimental/mini/worker/models-service.d.ts +0 -19
  715. package/dist/experimental/mini/worker/models-service.d.ts.map +0 -1
  716. package/dist/experimental/mini/worker/models-service.js +0 -136
  717. package/dist/experimental/mini/worker/models-service.js.map +0 -1
  718. package/dist/experimental/mini/worker/run.d.ts +0 -14
  719. package/dist/experimental/mini/worker/run.d.ts.map +0 -1
  720. package/dist/experimental/mini/worker/run.js +0 -88
  721. package/dist/experimental/mini/worker/run.js.map +0 -1
  722. package/dist/modes/interactive/theme/theme-json.d.ts +0 -85
  723. package/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
  724. package/dist/modes/interactive/theme/theme-json.js +0 -132
  725. package/dist/modes/interactive/theme/theme-json.js.map +0 -1
  726. package/dist/modes/interactive/theme/theme-schema.json +0 -361
@@ -51,7 +51,7 @@ Reload replaces the extension runtime, so code after `await ctx.reload()` must n
51
51
 
52
52
  <a id="understand-the-lifecycle"></a>
53
53
 
54
- ## Respect the runtime lifecycle
54
+ ## Understand the runtime lifecycle
55
55
 
56
56
  The factory can be synchronous or asynchronous. draht waits for an asynchronous factory before startup continues, allowing it to fetch configuration or register providers needed during startup.
57
57
 
@@ -59,12 +59,112 @@ Do not start processes, sockets, watchers, or timers in the factory because some
59
59
  Start long-lived resources from `session_start` or from the command or tool that needs them.
60
60
  Close session-scoped resources from an idempotent `session_shutdown` handler.
61
61
 
62
- A run proceeds from input and `before_agent_start`, through model, message, and tool events, to `agent_end`.
63
- Automatic retries, recovery, compaction, or queued work can continue afterward.
62
+ A normal prompt starts a run. The run repeats turns, then checks whether more work starts another low-level agent run:
63
+
64
+ ```mermaid
65
+ flowchart TD
66
+ Input["input"] --> Before["before_agent_start"]
67
+ Before --> AgentStart["agent_start"]
68
+ AgentStart --> Turns[["turns"]]
69
+ Turns --> AgentEnd["agent_end"]
70
+ AgentEnd --> MoreRuns{"More work?"}
71
+ MoreRuns -->|yes| AgentStart
72
+ MoreRuns -->|no| BeforeSettle["agent_before_settle"]
73
+ BeforeSettle --> Continue{"Continuation requested?"}
74
+ Continue -->|yes| AgentStart
75
+ Continue -->|no| Settled["agent_settled"]
76
+ ```
77
+
78
+ More work means a retry, recovery, compaction retry, or queued work.
79
+
80
+ Each turn sends one model request and executes the tool calls in the assistant response:
81
+
82
+ ```mermaid
83
+ flowchart TD
84
+ TurnStart["turn_start"] --> Request[["model request"]]
85
+ Request --> ToolDecision{"Tool calls?"}
86
+ ToolDecision -->|yes| Tools[["tool execution"]]
87
+ Tools --> TurnEnd["turn_end"]
88
+ ToolDecision -->|no| TurnEnd
89
+ TurnEnd --> MoreTurns{"Another turn?"}
90
+ MoreTurns -->|yes| TurnStart
91
+ MoreTurns -->|no| AgentEnd(["agent_end"])
92
+ ```
93
+
94
+ The model request runs these hooks in order:
95
+
96
+ 1. `context`
97
+ 2. `context_with_system`
98
+ 3. `before_provider_headers`
99
+ 4. `before_provider_request`
100
+ 5. `after_provider_response`
101
+ 6. `provider_stream_event` and assistant message events
102
+
103
+ Tool execution runs these hooks in order for each tool call:
104
+
105
+ 1. `tool_execution_start`
106
+ 2. `tool_call`
107
+ 3. `tool_execution_update` while the tool executes
108
+ 4. `tool_result`
109
+ 5. `tool_execution_end`
110
+
111
+ The lifecycle involves these event groups:
112
+
113
+ | Area | Events |
114
+ |---|---|
115
+ | Input preparation | `input`, `before_agent_start` |
116
+ | Agent run | `agent_start`, `agent_end` |
117
+ | Model turn | `turn_start`, `context`, `context_with_system`, `turn_end` |
118
+ | Provider call | `before_provider_headers`, `before_provider_request`, `after_provider_response`, `provider_stream_event` |
119
+ | Message lifecycle | `message_start`, `message_update`, `message_end` |
120
+ | Tool execution | `tool_execution_start`, `tool_call`, `tool_execution_update`, `tool_result`, `tool_execution_end` |
121
+ | Settlement | `agent_before_settle`, `agent_settled` |
122
+
123
+ Draht counts as busy while a run starts, including the compaction check and `before_agent_start`, so messages sent meanwhile go into the starting run. Message lifecycle events also cover user and tool-result messages; the model request list places only the assistant stream where it occurs in each turn.
124
+
125
+ Tool hooks run for each tool call, and one assistant response can start another turn by returning tool calls. Provider hooks run only when that transport exposes the corresponding stage. See the exported declarations in [`extensions/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/extensions/types.ts) for exact event payloads and result types.
126
+
127
+ Session startup and replacement follow a separate lifecycle:
128
+
129
+ ```mermaid
130
+ flowchart TD
131
+ Startup["Process startup"] --> Trust["project_trust when needed"]
132
+ Trust --> SessionStart["session_start"]
133
+ Switch["/new or /resume"] --> BeforeSwitch["session_before_switch"]
134
+ Fork["/fork or /clone"] --> BeforeFork["session_before_fork"]
135
+ BeforeSwitch --> Shutdown["session_shutdown"]
136
+ BeforeFork --> Shutdown
137
+ Reload["reload"] --> Shutdown
138
+ Shutdown --> Replacing{"Replacing the runtime?"}
139
+ Replacing -->|yes| Replacement["load replacement extension runtime"]
140
+ Replacement --> SessionStart
141
+ Replacing -->|no| Stop["process exits"]
142
+ SessionStart --> Discover["resources_discover"]
143
+ ```
144
+
145
+ `project_trust` runs before trusted project resources load and can run again when session replacement enters a new working directory. Retries, recovery, compaction, and queued messages can start another agent run after `agent_end`, so `agent_end` is not a final-idle signal. Reload and session replacement invalidate the old runtime. Code after `await ctx.reload()` still belongs to the old runtime and must not reuse its session-bound state.
146
+
147
+ ### Choose an event by intent
148
+
149
+ | Goal | Event |
150
+ |---|---|
151
+ | Inspect, transform, or consume raw user input | `input` |
152
+ | Change prompt sections, active tools, or add context before a run | `before_agent_start` |
153
+ | Observe one low-level agent run | `agent_start`, `agent_end` |
154
+ | Act after one model response and its tool calls | `turn_end` |
155
+ | Filter conversation messages for one provider request | `context` |
156
+ | Transform the complete transcript, including system messages | `context_with_system` |
157
+ | Change request headers or the serialized provider payload | `before_provider_headers`, `before_provider_request` |
158
+ | Observe provider response metadata or parsed stream events | `after_provider_response`, `provider_stream_event` |
159
+ | Authorize or modify a tool call | `tool_call` |
160
+ | Redact, annotate, or replace a tool result | `tool_result` |
161
+ | Append final entries or request one last continuation | `agent_before_settle` |
162
+ | Run notification work after automatic processing has stopped | `agent_settled` |
163
+ | Initialize or release session-scoped resources | `session_start`, `session_shutdown` |
164
+
64
165
  <a id="agent_start--agent_end--agent_before_settle--agent_settled"></a>
65
166
 
66
- `agent_before_settle` is the final actionable boundary: it can append entries and request one continuation.
67
- `agent_settled` is final and notification-only; use it when an integration needs to know draht will not continue automatically.
167
+ Use `agent_before_settle` when an extension must append entries or request one final continuation. Use `agent_settled` for notification-only work that should run after draht has no automatic continuation remaining.
68
168
 
69
169
  <a id="extensionapi-methods"></a>
70
170
 
@@ -104,7 +204,20 @@ Use each event’s declared result type rather than assuming every return value
104
204
 
105
205
  Events cover resource discovery, sessions, agent and message lifecycle, providers, tools, and raw input.
106
206
 
107
- `before_agent_start` exposes both the current prompt and its structured `systemPromptOptions`. Prefer changing prompt sections, selected tools, or guidelines so draht can append a transcript delta. Returning `systemPrompt`, or setting `forceSystemPrompt`, replaces the whole prompt for that run while the transcript continues recording the structured sections. Providers receive the forced text as their leading system prompt.
207
+ #### Understand handler composition
208
+
209
+ | Pattern | Behavior |
210
+ |---|---|
211
+ | Notification | Return values are ignored. Use the event for observation only. |
212
+ | In-place mutation | Later handlers see changes to values such as `before_provider_headers.headers`, `before_agent_start.systemPromptOptions`, and `tool_call.input`. |
213
+ | Chained transformation | Later handlers receive the value returned by earlier `input`, `context`, `context_with_system`, `message_end`, `tool_result`, and `before_provider_request` handlers. |
214
+ | Gate | A handled input, blocked tool call, cancelled session operation, or handled `user_bash` command stops that operation's normal fallback path. |
215
+ | Actionable boundary | Each `turn_end` or `agent_before_settle` handler sees the entries and continuation decision proposed so far. |
216
+ | Last override | The last `cache_warming_decision` handler that returns an action wins. |
217
+
218
+ Notification handlers should not perform slow work on a streaming event. Transform handlers should preserve fields they do not intentionally own, and gate handlers should fail closed when their safety decision cannot be made.
219
+
220
+ `before_agent_start` exposes both the current prompt and its structured `systemPromptOptions`. `event.messageType` says what started the run: `"user"` for a prompt or `pi.sendUserMessage()`, with `prompt` and `images`; `"custom"` for `pi.sendMessage(..., { triggerTurn: true })`, with the starting `message` and no `prompt`. A returned `message` is added to either kind of run; check `messageType` to skip runs started by custom messages. Prefer changing prompt sections, selected tools, or guidelines so draht can append a transcript delta. Returning `systemPrompt`, or setting `forceSystemPrompt`, replaces the whole prompt for that run while the transcript continues recording the structured sections. Providers receive the forced text as their leading system prompt.
108
221
 
109
222
  `message_end` can replace a finalized message while preserving its role. `tool_call` can mutate input or block execution. `tool_result` handlers compose, with each handler seeing prior changes.
110
223
 
@@ -163,9 +276,9 @@ See [`hello.ts`](../examples/extensions/hello.ts), [`todo.ts`](../examples/exten
163
276
  - `deferred`: like `codemode`, but codemode tools do not list it; `tool_search` can find and activate it.
164
277
  - `hidden`: registered but unreachable. Re-register a tool with `exposure: "hidden"` to withdraw it, since tools cannot be unregistered.
165
278
 
166
- `namespace: { name, description, instructions }` groups related tools, as MCP servers do. Codemode tools list a namespace under one heading with its `description`. `instructions` holds longer usage guidance; it is not listed, and codemode scripts read it with `describeNamespace(name)`.
279
+ `namespace: { name, aliases, description, instructions }` groups related tools, as MCP servers do. Codemode tools list a namespace under one heading with its `description`. `instructions` holds longer usage guidance; it is not listed, and codemode scripts read it with `describeNamespace(name)`. `aliases` are other names scripts may look the namespace up by, for example the server name `docs` for `mcp__docs`; a name and the same name as a script identifier (`my-docs`, `my_docs`) match alike.
167
280
 
168
- Registering a `direct` or `model-only` tool activates it; the other exposures are not activated on registration. The active set (`pi.getActiveTools()`, `pi.setActiveTools()`) is the set of tools declared to the model. `pi.getAllTools()` reports each tool's `exposure`, `namespace`, and `annotations`.
281
+ Registering a `direct` or `model-only` tool activates it; the other exposures are not activated on registration. The active set (`pi.getActiveTools()`, `pi.setActiveTools()`) is the set of tools declared to the model. `pi.getAllTools()` reports each tool's `exposure`, `namespace`, `annotations`, and `reachesTools`.
169
282
 
170
283
  `annotations` are hints about what a tool does, with the meaning of MCP tool annotations: `readOnlyHint`, `destructiveHint`, `idempotentHint`, and `openWorldHint`. MCP tools carry the hints their server declares. Missing hints take the MCP defaults: a tool is not read-only, and may be destructive and reach an open world. The hints are not verified, but a permission extension can use them to decide which calls to confirm. This confirms the calls Codex asks approval for:
171
284
 
@@ -181,7 +294,9 @@ pi.on("tool_call", async (event, ctx) => {
181
294
  });
182
295
  ```
183
296
 
184
- A tool that orchestrates other tools can adjust what the model sees while it is active with `prepareLoadout(loadout)`. It runs whenever the active tools change and receives the declared tools, the callable tools, and every registered tool with its exposure and namespace. It returns replacement `descriptions` for declared tools (including its own) and `hiddenDeclarations`: active tools whose declarations requests leave out while they stay active and callable. `codemode` uses only this hook, `exposure`, and `ctx.executeTool()`, so another tool can implement the same behavior under a different name.
297
+ A tool that orchestrates other tools can adjust what the model sees while it is active with `prepareLoadout(loadout)`. It runs whenever the active tools change and receives the declared tools, the callable tools, and every registered tool with its exposure, namespace, and prompt guidelines. It returns replacement `descriptions` for declared tools (including its own) and `hiddenDeclarations`: active tools whose declarations requests leave out while they stay active and callable. The default system prompt leaves hidden tools out of its tool list and rules, and names no tool in the skills hint when the file reader is hidden, so the orchestrating tool should present their guidelines itself. `codemode` uses only this hook, `exposure`, `reachesTools`, and `ctx.executeTool()`, so another tool can implement the same behavior under a different name.
298
+
299
+ A tool that reaches other tools declares which ones a call may reach with `reachesTools(input)`: `"all"`, or the words of the input that may name them, where a word refers to every tool or namespace whose name it contains. `codemode` returns `"all"` for scripts that search or list tools and the words of the script otherwise; `tool_search` always returns `"all"`. Extensions that register tools late use it from their `tool_call` handler to finish registering the tools a call needs before it runs, as the MCP extension does for servers that are still connecting. The MCP extension also activates `codemode` or `tool_search` for MCP tools only when the tool of that name declares `reachesTools`.
185
300
 
186
301
  ### Activate tools dynamically
187
302
 
@@ -195,6 +310,10 @@ draht snapshots the working tree per session so `/rewind` can restore conversati
195
310
 
196
311
  `checkpoint_created` fires after every capture. `session_before_rewind` reports the target entry and scope (`conversation-and-files`, `conversation-only`, or `files-only`) and can return `{ cancel: true }`. Retention is configured in [Settings](settings.md).
197
312
 
313
+ ### Tool rendering
314
+
315
+ A tool's `renderCall` and `renderResult` draw its calls in the interactive transcript and in HTML exports. `draht.registerToolRenderer((toolName, next) => renderers)` chooses renderers for calls to any tool, including tools that are not registered yet, such as MCP tools in a resumed session before their server connected. `next()` returns what the remaining resolvers (in extension load order), then the registered tool, would use, so `next() ?? mine` only fills in.
316
+
198
317
  ### MCP servers
199
318
 
200
319
  `pi.registerMcpServer(name, config)` adds an MCP server for the current session. `config` has the shape of an `mcpServers` entry in [`mcp.json`](mcp.md): `command`, `args`, `env`, and `cwd` for stdio servers, `url`, `headers`, and `oauth` for HTTP servers, plus `exposure`, `toolExposure`, `description`, `enabled`, and `timeout`.
@@ -274,7 +393,18 @@ Use `ctx.shutdown()` to request an orderly process shutdown.
274
393
 
275
394
  ## Examples and reference
276
395
 
277
- The checked [extension examples](../examples/extensions/) cover tools, lifecycle events, commands, flags, shortcuts, state, rendering, providers, OAuth, remote execution, and terminal components.
278
- Start with the smallest example matching your integration point.
279
-
280
- Use [Custom Providers](custom-provider.md) for model-service integrations, [Terminal UI](tui.md) for custom components, and [draht Packages](packages.md) to install or distribute extensions with other resources.
396
+ The checked [extension examples](../examples/extensions/) are the implementation reference. Start with the smallest example matching the behavior you need:
397
+
398
+ | Goal | Start with | Why |
399
+ |---|---|---|
400
+ | Confirm or block tool calls | [`permission-gate.ts`](../examples/extensions/permission-gate.ts) | Combines `tool_call`, mode-aware UI, and fail-closed behavior. |
401
+ | Modify prompt sections for a run | [`prompt-customizer.ts`](../examples/extensions/prompt-customizer.ts) | Uses structured prompt options instead of replacing the complete prompt. |
402
+ | Keep branch-aware tool state | [`todo.ts`](../examples/extensions/todo.ts) | Reconstructs state from persisted entries and renders it in the TUI. |
403
+ | Register tools after startup | [`dynamic-tools.ts`](../examples/extensions/dynamic-tools.ts) | Shares registration logic between lifecycle and command handlers. |
404
+ | Run cancellable model work from a command | [`qna.ts`](../examples/extensions/qna.ts) | Combines nested model calls, cancellation, and custom UI. |
405
+ | Replace the main editor | [`modal-editor.ts`](../examples/extensions/modal-editor.ts) | Extends `CustomEditor` while preserving application controls. |
406
+ | Run finalization at shutdown | [`auto-commit-on-exit.ts`](../examples/extensions/auto-commit-on-exit.ts) | Uses the session shutdown hook for finalization work. |
407
+ | Route built-in tools to another machine | [`ssh.ts`](../examples/extensions/ssh.ts) | Reuses tool operation interfaces instead of recreating tool contracts. |
408
+ | Add OAuth and provider-specific streaming | [`custom-provider-gitlab-duo/`](../examples/extensions/custom-provider-gitlab-duo/) | Shows a complete provider integration while delegating supported protocols. |
409
+
410
+ Use [Custom Providers](custom-provider.md) for model-service integrations, [Terminal UI](tui.md) for custom components, and [draht Packages](packages.md) to install or distribute extensions with other resources. Use the exported declarations for exact signatures, payloads, and result schemas; this guide focuses on lifecycle choices, composition, and durable implementation patterns.
package/docs/index.md CHANGED
@@ -31,7 +31,7 @@ Use the [Quickstart customization chooser](quickstart.md#choose-how-to-customize
31
31
 
32
32
  ## Find reference and setup information
33
33
 
34
- Use the reference pages to look up [CLI options](cli.md), [settings](settings.md), [provider authentication](providers.md), [keybindings](keybindings.md), and [environment variables](environment-variables.md).
34
+ Use the reference pages to look up [CLI options](cli.md), [settings](settings.md), [providers](providers.md), [keybindings](keybindings.md), and [environment variables](environment-variables.md).
35
35
 
36
36
  For platform-specific help, see [Terminal Setup](terminal-setup.md), [Windows](windows.md), [tmux](tmux.md), [Termux on Android](termux.md), or [Containerization](containerization.md).
37
37
 
package/docs/json.md CHANGED
@@ -42,7 +42,7 @@ A basic run produces records like these:
42
42
  {"type":"message_end","message":{"role":"assistant","...":"..."}}
43
43
  {"type":"turn_end","message":{"role":"assistant","...":"..."},"toolResults":[]}
44
44
  {"type":"agent_end","messages":[{"...":"..."}],"willRetry":false}
45
- {"type":"agent_settled"}
45
+ {"type":"agent_settled","aborted":false}
46
46
  ```
47
47
 
48
48
  `agent_end` closes one low-level agent run. Automatic retry, overflow recovery, compaction retry, steering, or follow-up work can still continue. `agent_settled` means draht has no remaining automatic work for that session-level run.
@@ -53,7 +53,7 @@ A basic run produces records like these:
53
53
  |---|---|---|
54
54
  | `agent_start` | None | A low-level agent run started. |
55
55
  | `agent_end` | `messages`, `willRetry` | That low-level run ended. `messages` contains messages generated by the run. |
56
- | `agent_settled` | None | draht will not continue automatically through retries, compaction recovery, or queued messages. |
56
+ | `agent_settled` | `aborted` | draht will not continue automatically through retries, compaction recovery, or queued messages. `aborted` is `true` when the run ended because it was aborted. |
57
57
  | `turn_start` | None | One assistant turn started. |
58
58
  | `turn_end` | `message`, `toolResults` | One assistant response and its resulting tool calls finished. |
59
59
 
@@ -104,7 +104,7 @@ The top-level `usage` is the latest cumulative provider-reported usage for the a
104
104
  |---|---|---|
105
105
  | `tool_execution_start` | `toolCallId`, `toolName`, `args` | Tool execution started. |
106
106
  | `tool_execution_update` | `toolCallId`, `toolName`, `args`, `partialResult` | The tool reported a partial result. |
107
- | `tool_execution_end` | `toolCallId`, `toolName`, `result`, `isError` | Tool execution finished. |
107
+ | `tool_execution_end` | `toolCallId`, `toolName`, `result`, `isError`, `durationMs` | Tool execution finished. `durationMs` is how long the tool's `execute()` took, measured with a monotonic clock; absent when the tool did not run. |
108
108
 
109
109
  Use `toolCallId` to correlate the lifecycle. `partialResult` is the latest partial result supplied by the tool. Whether it replaces or extends an earlier update depends on that tool's result contract.
110
110
 
@@ -12,6 +12,7 @@ Map each action identifier to one key or a list of keys:
12
12
 
13
13
  ```json
14
14
  {
15
+ "$schema": "https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/schemas/keybindings.schema.json",
15
16
  "app.session.new": "ctrl+shift+n",
16
17
  "app.session.tree": ["ctrl+shift+t", "alt+shift+t"]
17
18
  }
@@ -59,8 +60,8 @@ On macOS, `alt` with a letter, such as `alt+m`, requires a terminal that sends O
59
60
  | `tui.editor.cursorRight` | `right`, `ctrl+f` | Move cursor right |
60
61
  | `tui.editor.cursorWordLeft` | `alt+left`, `ctrl+left`, `alt+b` | Move cursor word left |
61
62
  | `tui.editor.cursorWordRight` | `alt+right`, `ctrl+right`, `alt+f` | Move cursor word right |
62
- | `tui.editor.cursorLineStart` | `home`, `ctrl+home`, `ctrl+a` | Move to line start |
63
- | `tui.editor.cursorLineEnd` | `end`, `ctrl+end`, `ctrl+e` | Move to line end |
63
+ | `tui.editor.cursorLineStart` | `home`, `ctrl+a` | Move to line start |
64
+ | `tui.editor.cursorLineEnd` | `end`, `ctrl+e` | Move to line end |
64
65
  | `tui.editor.jumpForward` | `ctrl+]` | Jump forward to character |
65
66
  | `tui.editor.jumpBackward` | `ctrl+alt+]` | Jump backward to character |
66
67
  | `tui.editor.pageUp` | `pageUp`, `ctrl+pageUp` | Scroll up by page |
@@ -115,8 +116,8 @@ In fullscreen mode, these actions control the transcript and take precedence ove
115
116
  | `tui.altScreen.searchNext` | `enter`, `ctrl+g` | Select the next search match while searching |
116
117
  | `tui.altScreen.searchPrevious` | `shift+enter`, `ctrl+shift+g` | Select the previous search match while searching |
117
118
  | `tui.altScreen.searchClose` | `escape` | Close transcript search |
118
- | `tui.altScreen.top` | `home` | Scroll to the beginning of the transcript |
119
- | `tui.altScreen.bottom` | `end` | Scroll to the transcript end and follow new output |
119
+ | `tui.altScreen.top` | `ctrl+home` | Scroll to the beginning of the transcript |
120
+ | `tui.altScreen.bottom` | `ctrl+end` | Scroll to the transcript end and follow new output |
120
121
 
121
122
  ### Application
122
123
 
@@ -128,9 +129,12 @@ In fullscreen mode, these actions control the transcript and take precedence ove
128
129
  | `app.suspend` | `ctrl+z` (None on Windows) | Suspend to background |
129
130
  | `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
130
131
  | `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows and WSL) | Paste files on macOS, images, or text from clipboard |
132
+ | `app.login.copyUrl` | `ctrl+x` | Copy the complete login URL while `/login` is open |
131
133
 
132
134
  On native Windows, `app.suspend` has no default because Windows terminals do not support Unix job control. If you assign it manually, draht shows a status message instead of suspending. WSL uses the normal `ctrl+z` and `fg` behavior.
133
135
 
136
+ During `/login`, `app.login.copyUrl` copies the original URL without the line breaks shown on screen. Over SSH, this requires a local terminal that allows OSC 52 clipboard writes.
137
+
134
138
  ### Sessions
135
139
 
136
140
  | Keybinding id | Default | Description |
@@ -166,7 +170,7 @@ On native Windows, `app.suspend` has no default because Windows terminals do not
166
170
  | Keybinding id | Default | Description |
167
171
  |--------|---------|-------------|
168
172
  | `app.tools.expand` | `ctrl+o` | Collapse or expand tool output |
169
- | `app.message.copy` | `ctrl+x` | Copy the selected message in `/tree`; in fullscreen mode, copy the active selection when `fullscreenCopyOnSelect` is `false`; otherwise copy the last assistant message |
173
+ | `app.message.copy` | `ctrl+x` | Copy the selected message in `/tree`; in fullscreen mode, copy the active selection when `fullscreenCopyOnSelect` is `false`; otherwise copy the last assistant message. On OAuth sign-in screens, copy the sign-in URL |
170
174
  | `app.message.followUp` | `alt+enter` (`ctrl+q` on Windows and WSL) | Queue follow-up message |
171
175
  | `app.message.dequeue` | `alt+up` (`alt+q` on Windows and WSL) | Restore queued messages to editor |
172
176
  | `app.polyphase.inspector` | `alt+a` | Open or close the agent inspector |
package/docs/llama-cpp.md CHANGED
@@ -41,7 +41,7 @@ A single-file model can sit directly in the model directory. Put multimodal and
41
41
  └── large-model-Q4_K_M-00003-of-00003.gguf
42
42
  ```
43
43
 
44
- Restart the router after manually adding files. For per-model context sizes and other options, use [llama.cpp model presets](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md#model-presets).
44
+ Restart the router after manually adding files. For per-model context sizes and other options, use [llama.cpp model presets](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md#model-presets). For settings tuned to a specific NVIDIA GPU and model, see [Run draht with NVIDIA RTX and llama.cpp](nvidia-rtx-llama-cpp.md).
45
45
 
46
46
  ## Configure draht
47
47
 
@@ -88,7 +88,14 @@ If the router disconnects, `/llama` shows **Retry** and **Close**. Retry reconne
88
88
 
89
89
  ## Classification
90
90
 
91
- Every model listed for chat is also listed as a classifier model with the same ID and the `llama-cpp-classify` API. Classifier models answer typed `choice`, `bool`, and `score` questions about JSON state, like TypeSafe's Jev models. The model reaches them from [`codemode`](cli.md#enable-codemode) scripts, and extensions through `ctx.modelRegistry.classify()`; see [Classifier models](models.md#use-classifier-models).
91
+ Classifier models answer typed `choice`, `bool`, and `score` questions about JSON state, like TypeSafe's Jev models. The model reaches them from [`codemode`](cli.md#enable-codemode) scripts, and extensions through `ctx.modelRegistry.classify()`; see [Classifier models](models.md#use-classifier-models). draht lists llama.cpp models as classifiers in two ways:
92
+
93
+ - **Decision models** such as [Julia-1, Laya, Kev, lev, and OpenJev](https://huggingface.co/collections/ggml-org/decision-models-6abf80cca3c83f127060a769) answer natively through llama.cpp's `/v1/systemone` endpoint. They appear only as classifiers, with the `typesafe-system-one` API, and not in `/model`.
94
+ - **Chat models** are also listed as classifiers with the same ID and the `llama-cpp-classify` API, which reads answers from next-token probabilities as described below.
95
+
96
+ llama.cpp 0.6.0 and later report decision models in the router's model list: their `architecture.output_modalities` contains `decisions`. The router reads this from the GGUF metadata without loading the model, so draht recognizes unloaded and sleeping decision models too. Older llama.cpp builds do not report it, and draht lists their decision models as chat models.
97
+
98
+ ### Chat models as classifiers
92
99
 
93
100
  The model does not generate an answer. Each question becomes one chat prompt: the state, every question of the request, the state again, and then the question with its answers under single-token labels. Labels are letters for a choice (up to 62 options), `Yes`/`No` for a bool, and digits for a score (up to 10 levels). The second copy of the state is read with the questions in view, which improved accuracy on JevBench with small models. draht reads the probabilities of the labels as the next token and normalizes them. A choice returns every option's probability and a confidence of `(n * peak - 1) / (n - 1)`; a score returns the expected level.
94
101
 
package/docs/mcp.md CHANGED
@@ -31,6 +31,16 @@ Use `/mcp` inside an interactive session to inspect connections, sign in, reconn
31
31
 
32
32
  draht reads user-level servers from `~/.draht/agent/mcp.json` and project servers from `.draht/mcp.json`. Project configuration is read only after [project trust](security.md#understand-project-trust) is granted. A project entry replaces a user-level entry with the same name.
33
33
 
34
+ A project entry without `command`, `url`, or `type` overrides only `enabled`, `exposure`, and `toolExposure` of the user-level server with the same name and keeps the rest, including `env`, `headers`, and `auth`. For example, this turns off a user-level server in one project:
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "internal-tools": { "enabled": false }
40
+ }
41
+ }
42
+ ```
43
+
34
44
  The format matches other MCP clients:
35
45
 
36
46
  ```json
@@ -77,7 +87,7 @@ Keep personal servers and servers with credentials in the user-level file. Use t
77
87
 
78
88
  `/mcp` lists configured servers with their state, tool count, exposure, and configuration source. Servers that need attention appear first. Select a server to inspect its tools and connection details, reconnect, sign in or out, change exposure, or enable and disable it.
79
89
 
80
- Exposure and enabled-state changes are saved to the file that defines the server without replacing unrelated content. Disabled servers remain listed. Outside the interactive TUI, `/mcp` prints server status; `/mcp login <server>`, `/mcp logout <server>`, and `/mcp reconnect <server>` perform those actions directly.
90
+ Exposure and enabled-state changes are saved to the file that defines the server without replacing unrelated content. In a trusted project, "Enable in this project" and "Disable in this project" add a project override for a user-level server; later changes to that server are saved to the override. Disabled servers remain listed. Outside the interactive TUI, `/mcp` prints server status; `/mcp login <server>`, `/mcp logout <server>`, and `/mcp reconnect <server>` perform those actions directly.
81
91
 
82
92
  Shell commands work without a session: `draht mcp add`, `draht mcp remove`, `draht mcp list`, `draht mcp login`, and `draht mcp logout`. Shell commands do not load extensions.
83
93
 
@@ -118,6 +128,8 @@ When the server rejects an unauthenticated connection, `/mcp` shows that it need
118
128
 
119
129
  draht registers itself with the authorization server, stores tokens in `~/.draht/agent/mcp-auth.json`, and refreshes access tokens when they expire or the server rejects them. If a server later requests additional scope, draht asks for sign-in again. Signing out deletes the stored credentials.
120
130
 
131
+ Credentials belong to a server name and URL. Servers with the same URL under different names, such as one per account, sign in separately; servers with the same name and URL in different `mcp.json` files share one sign-in.
132
+
121
133
  OAuth applies to HTTP servers without an `Authorization` header. For a server that does not support dynamic client registration, configure a registered client:
122
134
 
123
135
  ```json
@@ -147,6 +159,48 @@ draht registers as `draht`. Some servers only accept registrations from known cl
147
159
 
148
160
  The name is only sent when draht registers a client. To register again under a new name, sign out first.
149
161
 
162
+ Some authorization servers accept a Client ID Metadata Document URL instead of dynamic registration. To opt in, set `clientRegistration` to `cimd` and supply `clientMetadataBaseUrl`. There is no default metadata service. The following URL is illustrative; replace it with an HTTPS service you operate:
163
+
164
+ ```json
165
+ {
166
+ "mcpServers": {
167
+ "example": {
168
+ "url": "https://mcp.example.com/mcp",
169
+ "oauth": {
170
+ "clientRegistration": "cimd",
171
+ "clientMetadataBaseUrl": "https://example.com/team/oauth/"
172
+ }
173
+ }
174
+ }
175
+ }
176
+ ```
177
+
178
+ The base must be an absolute HTTPS URL without userinfo, query, or fragment. A trailing slash is normalized; the path prefix is preserved. The operator must actually host JSON metadata under that base:
179
+
180
+ - `client.json`, whose `client_id` is its complete URL and whose `redirect_uris` includes `http://127.0.0.1/callback` (or `http://localhost/callback` when configured).
181
+ - `<id>/client.json`, whose `client_id` is its complete URL and whose `redirect_uris` uses the matching `/callback/<id>` path. The ID is the first 9 bytes of SHA-256 of the normalized MCP server URL with its fragment removed, encoded as unpadded base64url. A service can generate these documents for each requested ID.
182
+
183
+ The documents must describe a public client (`token_endpoint_auth_method: "none"`) with authorization-code and refresh-token grants and the `code` response type. Authorization servers must accept the dynamically chosen loopback port as specified by RFC 8252, or the documents must list the exact configured port. Each document's identity and redirect paths must match the URLs draht sends; draht does not publish these documents for you.
184
+
185
+ When the authorization server supports the `iss` parameter (RFC 9207), draht uses `client.json` and checks the returned issuer. Otherwise it uses the server-specific document and callback path to prevent authorization-server mix-ups. Browser callbacks and pasted redirect URLs must match the chosen callback origin and path. The server must advertise metadata-document support and public-client authentication, or sign-in fails. CIMD cannot be combined with `clientId`, `clientName`, or `clientSecret`; `callbackUrl` must use `localhost` or `127.0.0.1` with path `/callback`.
186
+
187
+ Without `clientRegistration`, or with `"dcr"`, dynamic registration remains the default. `clientMetadataBaseUrl` is rejected outside CIMD mode. Switching between DCR and CIMD or changing the metadata base requires a new sign-in: cached tokens are bound to the issuing client document and are never sent or refreshed under another client. Existing DCR credentials remain valid.
188
+
189
+ draht finds the authorization server through the server's protected resource metadata (RFC 9728) and checks that the authorization server's metadata names the expected issuer (RFC 8414). Some servers advertise the wrong authorization server or none, so sign-in opens a page that does not exist. Set `authServerMetadataUrl` to the metadata document of the right authorization server:
190
+
191
+ ```json
192
+ {
193
+ "mcpServers": {
194
+ "example": {
195
+ "url": "https://mcp.example.com/mcp",
196
+ "oauth": { "authServerMetadataUrl": "https://example.okta.com/.well-known/openid-configuration" }
197
+ }
198
+ }
199
+ }
200
+ ```
201
+
202
+ draht uses that document instead of discovery and trusts it as configured, so only point it at a document you trust. The URL must use HTTPS, except on `localhost`, `127.0.0.1`, or `[::1]`.
203
+
150
204
  ## Control tool exposure
151
205
 
152
206
  Each server tool is registered as `mcp__<server>__<tool>`. The server's `exposure` determines how the model reaches it:
@@ -186,6 +240,8 @@ draht activates `codemode` when a server with `codemode` exposure connects. It a
186
240
 
187
241
  Tools with `codemode` or `deferred` exposure can be reached through either indirect mechanism: codemode scripts can call them, and `tool_search` can load them. Codemode calls do not depend on the active tool set, so they remain available after `/tree`, resume, and fork. Tools loaded by `tool_search` are recorded in the transcript and remain declared on that branch.
188
242
 
243
+ `--tools` does not remove MCP tools unless one of its entries starts with `mcp__`; `draht --tools read,codemode,'mcp__radius__*'` keeps only the tools of `radius`. `--exclude-tools` accepts the same patterns, and `--no-mcp` disables MCP for one run (see [Tools](cli.md#mcp-tools)).
244
+
189
245
  To keep `codemode` active without MCP servers, add `"defaultTools": ["+codemode"]` to [settings](settings.md#tools). To prevent automatic codemode activation, set `"autoEnableCodemode": false` beside `mcpServers`. A project value overrides the user-level value. draht warns once when neither `codemode` nor `tool_search` is active and non-direct tools cannot be called.
190
246
 
191
247
  Text results over 20 KB reach the model with their middle removed around a `…N chars truncated…` marker. The full text is saved to a temporary file named in the result. Codemode scripts receive the complete result and can reduce it before returning output to the model.
@@ -222,9 +278,9 @@ Changes to enabled state or exposure apply only to the current session. A file-c
222
278
 
223
279
  ### Replace the built-in MCP support
224
280
 
225
- An installed extension that registers `/mcp`, such as `pi-mcp-adapter`, replaces the built-in MCP support for sessions. draht then does not read `mcp.json` or connect its servers in a session, and `/mcp` belongs to the extension. Remove the extension to restore the built-in behavior. To disable built-in MCP support without a replacement, disable `mcp` under Built-in in `draht config`, or set `"extensions": ["-builtin:mcp"]` in [settings](settings.md#resources).
281
+ An installed extension that registers `/mcp`, such as `pi-mcp-adapter`, replaces the built-in MCP support for sessions. draht then does not read `mcp.json` or connect its servers in a session, and `/mcp` belongs to the extension. Remove the extension to restore the built-in behavior. To disable built-in MCP support without a replacement, disable `mcp` under Built-in in `draht config`, or set `"extensions": ["-builtin:mcp"]` in [settings](settings.md#resources). `--no-mcp` disables it for one run.
226
282
 
227
- An extension that registers `codemode` or `tool_search` similarly replaces the built-in tool with that name. Shell-level `draht mcp` commands always use the built-in implementation.
283
+ An extension that registers `codemode` or `tool_search` similarly replaces the built-in tool with that name. draht activates the replacement for MCP servers and waits for the servers its calls need only when it declares [`reachesTools`](extensions.md#tool-exposure). Shell-level `draht mcp` commands always use the built-in implementation.
228
284
 
229
285
  ### Use MCP from the SDK
230
286
 
@@ -100,12 +100,11 @@ interface SystemMessage {
100
100
  sections?: Record<string, string | null>;
101
101
  toolsAdded?: Tool[];
102
102
  toolsRemoved?: ToolReference[];
103
- replace?: boolean;
104
103
  timestamp: number;
105
104
  }
106
105
  ```
107
106
 
108
- The leading system message declares the initial prompt and tools. Later system messages can append instructions, replace or remove named prompt sections, and add or remove tools. Replaying them in order yields the current state. A message with `replace: true` discards the earlier state and establishes a complete new baseline.
107
+ The leading system message declares the initial prompt and tools. Later system messages can append instructions, replace or remove named prompt sections, and add or remove tools. Replaying them in order yields the current state.
109
108
 
110
109
  ### UserMessage
111
110
 
@@ -129,6 +128,7 @@ interface AssistantMessage {
129
128
  responseModel?: string;
130
129
  responseId?: string;
131
130
  providerThinkingLevel?: string;
131
+ thinkingLevel?: ModelThinkingLevel;
132
132
  diagnostics?: AssistantMessageDiagnostic[];
133
133
  usage: Usage;
134
134
  stopReason: "pending" | "stop" | "length" | "toolUse" | "error" | "aborted" | "deferred";
@@ -140,7 +140,7 @@ interface AssistantMessage {
140
140
  }
141
141
  ```
142
142
 
143
- `responseModel` records a concrete provider response model when it differs from the requested model. `responseId`, `providerThinkingLevel`, `diagnostics`, and `rawStopReason` preserve provider or runtime details.
143
+ `responseModel` records a concrete provider response model when it differs from the requested model. `responseId`, `providerThinkingLevel`, `thinkingLevel`, `diagnostics`, and `rawStopReason` preserve provider or runtime details.
144
144
 
145
145
  `"pending"` is used for a partial assistant message while it streams. The completed message in `message_end` has a terminal stop reason, and draht does not persist `"pending"` assistant messages in session JSONL.
146
146
 
@@ -168,12 +168,30 @@ interface ToolResultMessage<TDetails = any> {
168
168
  content: (TextContent | ImageContent)[];
169
169
  details?: TDetails;
170
170
  usage?: Usage;
171
+ nestedCalls?: NestedToolCalls;
171
172
  isError: boolean;
172
173
  timestamp: number;
173
174
  }
174
175
  ```
175
176
 
176
- `details` is tool-specific. Optional `usage` reports nested model work performed by the tool and contributes to full-session statistics, but it is not part of the main model-call usage.
177
+ `details` is tool-specific. Optional `usage` reports nested model work performed by the tool and contributes to full-session statistics, but it is not part of the main model-call usage. `nestedCalls` records bounded metadata about calls this tool made to other tools:
178
+
179
+ ```typescript
180
+ interface NestedToolCalls {
181
+ calls: NestedToolCallRecord[];
182
+ complete: boolean;
183
+ }
184
+
185
+ interface NestedToolCallRecord {
186
+ id: string;
187
+ name: string;
188
+ arguments?: JsonObject;
189
+ argumentsBytes?: number;
190
+ status: "ok" | "error" | "unfinished";
191
+ durationMs?: number;
192
+ error?: string;
193
+ }
194
+ ```
177
195
 
178
196
  ## Coding-agent messages
179
197