@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.
Files changed (729) 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-G57VPNTF.js +6 -0
  24. package/dist/bundle/chunks/anthropic.js +1 -1
  25. package/dist/bundle/chunks/azure-openai-responses-AYUCZ5WN.js +2 -0
  26. package/dist/bundle/chunks/bedrock-converse-stream.js +23 -20
  27. package/dist/bundle/chunks/chunk-3GDEPGTR.js +16 -0
  28. package/dist/bundle/chunks/chunk-5JW3NSTV.js +2 -0
  29. package/dist/bundle/chunks/{chunk-FHX2S5IG.js → chunk-6WESOD4H.js} +1 -1
  30. package/dist/bundle/chunks/chunk-76YNMQ57.js +2 -0
  31. package/dist/bundle/chunks/chunk-AC3MSTC6.js +2 -0
  32. package/dist/bundle/chunks/chunk-ACLWH5WQ.js +2 -0
  33. package/dist/bundle/chunks/chunk-BL72B6LV.js +82 -0
  34. package/dist/bundle/chunks/{chunk-5QJFWTKA.js → chunk-CLKG6K6Z.js} +5 -2
  35. package/dist/bundle/chunks/chunk-DN7SM3LX.js +479 -0
  36. package/dist/bundle/chunks/{chunk-UTRX2VHB.js → chunk-DOUMZTXH.js} +3 -3
  37. package/dist/bundle/chunks/chunk-DQ4G4IS4.js +20 -0
  38. package/dist/bundle/chunks/chunk-E4VZJRJ2.js +9 -0
  39. package/dist/bundle/chunks/chunk-FOYIPAAD.js +6 -0
  40. package/dist/bundle/chunks/chunk-FXCTQRNN.js +2 -0
  41. package/dist/bundle/chunks/chunk-GQXRTK54.js +20 -0
  42. package/dist/bundle/chunks/chunk-IGO52ZOY.js +132 -0
  43. package/dist/bundle/chunks/{chunk-VXUJMEMO.js → chunk-IT4RIOZD.js} +1 -1
  44. package/dist/bundle/chunks/chunk-JJKPUMH2.js +1424 -0
  45. package/dist/bundle/chunks/chunk-JNWRE5F4.js +2 -0
  46. package/dist/bundle/chunks/chunk-KSGHCBHT.js +2 -0
  47. package/dist/bundle/chunks/chunk-MBFTIGLS.js +2 -0
  48. package/dist/bundle/chunks/chunk-N26RGV3K.js +11 -0
  49. package/dist/bundle/chunks/{chunk-KPO5375S.js → chunk-RCRGGYLW.js} +1 -1
  50. package/dist/bundle/chunks/chunk-UCJ7FLSO.js +166 -0
  51. package/dist/bundle/chunks/chunk-USCN7R2E.js +2 -0
  52. package/dist/bundle/chunks/chunk-WFHH5SX6.js +4 -0
  53. package/dist/bundle/chunks/chunk-WYWBXNDO.js +6 -0
  54. package/dist/bundle/chunks/chunk-ZRPAOMVB.js +2 -0
  55. package/dist/bundle/chunks/{cli-VCHSHNKT.js → cli-HTUB6WOG.js} +6 -6
  56. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-RRSO6OXX.js +2 -0
  57. package/dist/bundle/chunks/codemode-worker.js +188 -21
  58. package/dist/bundle/chunks/execute-UUPNZJJG.js +31 -0
  59. package/dist/bundle/chunks/github-copilot.js +1 -1
  60. package/dist/bundle/chunks/google-generative-ai-VJSS5EBX.js +2 -0
  61. package/dist/bundle/chunks/google-vertex-K23DBWTT.js +2 -0
  62. package/dist/bundle/chunks/image-resize-worker.js +1 -1
  63. package/dist/bundle/chunks/{llama-cpp-classify-EJ5XMSQL.js → llama-cpp-classify-3VDXTYVJ.js} +3 -3
  64. package/dist/bundle/chunks/mistral-conversations-SKVQJGFZ.js +5 -0
  65. package/dist/bundle/chunks/node-DXZFQBEO.js +16 -0
  66. package/dist/bundle/chunks/{node-6IIDYB3K.js → node-LBZLUIBE.js} +1 -1
  67. package/dist/bundle/chunks/openai-chatgpt.js +1 -1
  68. package/dist/bundle/chunks/openai-codex-responses-LV4RIZL3.js +10 -0
  69. package/dist/bundle/chunks/openai-codex.js +1 -1
  70. package/dist/bundle/chunks/openai-completions-PUIR2V25.js +7 -0
  71. package/dist/bundle/chunks/openai-decisions-2DJLSYQF.js +5 -0
  72. package/dist/bundle/chunks/openai-responses-6ESQOXAF.js +4 -0
  73. package/dist/bundle/chunks/opencode-go.js +1 -1
  74. package/dist/bundle/chunks/openrouter-images-TVXBMY3V.js +2 -0
  75. package/dist/bundle/chunks/pi-messages-XS7FDWQI.js +8 -0
  76. package/dist/bundle/chunks/runtime-IB3XQ7E3.js +2 -0
  77. package/dist/bundle/chunks/runtime-LB35PK4J.js +3 -0
  78. package/dist/bundle/chunks/settings-manager-YNY5F4RU.js +2 -0
  79. package/dist/bundle/chunks/typesafe-system-one-67GAWZXE.js +2 -0
  80. package/dist/bundle/chunks/virtual-modules-U4CBGVMI.js +2 -0
  81. package/dist/bundle/cli-runtime.js +1 -1
  82. package/dist/bundle/index.js +1 -1
  83. package/dist/bundle/rpc-entry.js +1 -1
  84. package/dist/cli/args.d.ts +2 -1
  85. package/dist/cli/args.d.ts.map +1 -1
  86. package/dist/cli/args.js +30 -8
  87. package/dist/cli/args.js.map +1 -1
  88. package/dist/cli/credential-print.d.ts.map +1 -1
  89. package/dist/cli/credential-print.js +4 -4
  90. package/dist/cli/credential-print.js.map +1 -1
  91. package/dist/config.d.ts +18 -1
  92. package/dist/config.d.ts.map +1 -1
  93. package/dist/config.js +44 -6
  94. package/dist/config.js.map +1 -1
  95. package/dist/core/agent-session.d.ts +65 -8
  96. package/dist/core/agent-session.d.ts.map +1 -1
  97. package/dist/core/agent-session.js +240 -102
  98. package/dist/core/agent-session.js.map +1 -1
  99. package/dist/core/auth-storage.d.ts.map +1 -1
  100. package/dist/core/auth-storage.js +20 -13
  101. package/dist/core/auth-storage.js.map +1 -1
  102. package/dist/core/bash-executor.d.ts.map +1 -1
  103. package/dist/core/bash-executor.js +42 -52
  104. package/dist/core/bash-executor.js.map +1 -1
  105. package/dist/core/bug-report.d.ts +9 -1
  106. package/dist/core/bug-report.d.ts.map +1 -1
  107. package/dist/core/builtins/completion-checks.d.ts +3 -0
  108. package/dist/core/builtins/completion-checks.d.ts.map +1 -0
  109. package/dist/core/builtins/completion-checks.js +142 -0
  110. package/dist/core/builtins/completion-checks.js.map +1 -0
  111. package/dist/core/builtins/duet.d.ts.map +1 -1
  112. package/dist/core/builtins/duet.js +7 -5
  113. package/dist/core/builtins/duet.js.map +1 -1
  114. package/dist/core/builtins/git-safety.d.ts +3 -0
  115. package/dist/core/builtins/git-safety.d.ts.map +1 -0
  116. package/dist/core/builtins/git-safety.js +34 -0
  117. package/dist/core/builtins/git-safety.js.map +1 -0
  118. package/dist/core/builtins/index.d.ts.map +1 -1
  119. package/dist/core/builtins/index.js +4 -0
  120. package/dist/core/builtins/index.js.map +1 -1
  121. package/dist/core/client-identity.d.ts +8 -0
  122. package/dist/core/client-identity.d.ts.map +1 -0
  123. package/dist/core/client-identity.js +15 -0
  124. package/dist/core/client-identity.js.map +1 -0
  125. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  126. package/dist/core/compaction/branch-summarization.js +1 -2
  127. package/dist/core/compaction/branch-summarization.js.map +1 -1
  128. package/dist/core/compaction/compaction.d.ts +2 -2
  129. package/dist/core/compaction/compaction.d.ts.map +1 -1
  130. package/dist/core/compaction/compaction.js +20 -15
  131. package/dist/core/compaction/compaction.js.map +1 -1
  132. package/dist/core/compaction/utils.d.ts +6 -0
  133. package/dist/core/compaction/utils.d.ts.map +1 -1
  134. package/dist/core/compaction/utils.js +7 -8
  135. package/dist/core/compaction/utils.js.map +1 -1
  136. package/dist/core/export-html/index.d.ts.map +1 -1
  137. package/dist/core/export-html/index.js +2 -0
  138. package/dist/core/export-html/index.js.map +1 -1
  139. package/dist/core/export-html/template.html +1 -0
  140. package/dist/core/export-html/template.js +23 -17
  141. package/dist/core/export-html/tool-renderer.d.ts +3 -3
  142. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  143. package/dist/core/export-html/tool-renderer.js +5 -3
  144. package/dist/core/export-html/tool-renderer.js.map +1 -1
  145. package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
  146. package/dist/core/export-html/vendor/marked.min.js +30 -29
  147. package/dist/core/extensions/index.d.ts +1 -1
  148. package/dist/core/extensions/index.d.ts.map +1 -1
  149. package/dist/core/extensions/index.js.map +1 -1
  150. package/dist/core/extensions/loader.d.ts.map +1 -1
  151. package/dist/core/extensions/loader.js +7 -0
  152. package/dist/core/extensions/loader.js.map +1 -1
  153. package/dist/core/extensions/runner.d.ts +6 -2
  154. package/dist/core/extensions/runner.d.ts.map +1 -1
  155. package/dist/core/extensions/runner.js +16 -4
  156. package/dist/core/extensions/runner.js.map +1 -1
  157. package/dist/core/extensions/types.d.ts +61 -7
  158. package/dist/core/extensions/types.d.ts.map +1 -1
  159. package/dist/core/extensions/types.js.map +1 -1
  160. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  161. package/dist/core/extensions/virtual-modules.js +2 -0
  162. package/dist/core/extensions/virtual-modules.js.map +1 -1
  163. package/dist/core/key-id-schema.d.ts +6 -0
  164. package/dist/core/key-id-schema.d.ts.map +1 -0
  165. package/dist/core/key-id-schema.js +16 -0
  166. package/dist/core/key-id-schema.js.map +1 -0
  167. package/dist/core/keybindings-schema.d.ts +4 -0
  168. package/dist/core/keybindings-schema.d.ts.map +1 -0
  169. package/dist/core/keybindings-schema.js +16 -0
  170. package/dist/core/keybindings-schema.js.map +1 -0
  171. package/dist/core/keybindings.d.ts +242 -75
  172. package/dist/core/keybindings.d.ts.map +1 -1
  173. package/dist/core/keybindings.js +30 -23
  174. package/dist/core/keybindings.js.map +1 -1
  175. package/dist/core/mcp-servers.d.ts +22 -0
  176. package/dist/core/mcp-servers.d.ts.map +1 -1
  177. package/dist/core/mcp-servers.js +72 -11
  178. package/dist/core/mcp-servers.js.map +1 -1
  179. package/dist/core/model-config.d.ts +1623 -74
  180. package/dist/core/model-config.d.ts.map +1 -1
  181. package/dist/core/model-config.js +70 -184
  182. package/dist/core/model-config.js.map +1 -1
  183. package/dist/core/model-registry.d.ts +3 -1
  184. package/dist/core/model-registry.d.ts.map +1 -1
  185. package/dist/core/model-registry.js +4 -0
  186. package/dist/core/model-registry.js.map +1 -1
  187. package/dist/core/model-resolver.d.ts +56 -43
  188. package/dist/core/model-resolver.d.ts.map +1 -1
  189. package/dist/core/model-resolver.js +253 -358
  190. package/dist/core/model-resolver.js.map +1 -1
  191. package/dist/core/model-runtime.d.ts.map +1 -1
  192. package/dist/core/model-runtime.js +19 -10
  193. package/dist/core/model-runtime.js.map +1 -1
  194. package/dist/core/nested-tool-calls.d.ts +1 -0
  195. package/dist/core/nested-tool-calls.d.ts.map +1 -1
  196. package/dist/core/nested-tool-calls.js +1 -0
  197. package/dist/core/nested-tool-calls.js.map +1 -1
  198. package/dist/core/package-manager.js +3 -3
  199. package/dist/core/package-manager.js.map +1 -1
  200. package/dist/core/polyphase/keyword.js +1 -1
  201. package/dist/core/polyphase/keyword.js.map +1 -1
  202. package/dist/core/polyphase/model-selection.d.ts.map +1 -1
  203. package/dist/core/polyphase/model-selection.js +15 -7
  204. package/dist/core/polyphase/model-selection.js.map +1 -1
  205. package/dist/core/polyphase/workflow/prelude.d.ts +2 -0
  206. package/dist/core/polyphase/workflow/prelude.d.ts.map +1 -1
  207. package/dist/core/polyphase/workflow/prelude.js +12 -16
  208. package/dist/core/polyphase/workflow/prelude.js.map +1 -1
  209. package/dist/core/polyphase/workflow/runtime.d.ts.map +1 -1
  210. package/dist/core/polyphase/workflow/runtime.js +2 -1
  211. package/dist/core/polyphase/workflow/runtime.js.map +1 -1
  212. package/dist/core/project-trust.d.ts.map +1 -1
  213. package/dist/core/project-trust.js +2 -1
  214. package/dist/core/project-trust.js.map +1 -1
  215. package/dist/core/prompt-templates.d.ts.map +1 -1
  216. package/dist/core/prompt-templates.js +7 -2
  217. package/dist/core/prompt-templates.js.map +1 -1
  218. package/dist/core/provider-composer.d.ts +2 -1
  219. package/dist/core/provider-composer.d.ts.map +1 -1
  220. package/dist/core/provider-composer.js +13 -0
  221. package/dist/core/provider-composer.js.map +1 -1
  222. package/dist/core/radius.d.ts +2 -0
  223. package/dist/core/radius.d.ts.map +1 -1
  224. package/dist/core/radius.js +2 -0
  225. package/dist/core/radius.js.map +1 -1
  226. package/dist/core/remote-catalog-provider.d.ts +12 -1
  227. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  228. package/dist/core/remote-catalog-provider.js +84 -24
  229. package/dist/core/remote-catalog-provider.js.map +1 -1
  230. package/dist/core/resource-loader.d.ts +3 -0
  231. package/dist/core/resource-loader.d.ts.map +1 -1
  232. package/dist/core/resource-loader.js +7 -4
  233. package/dist/core/resource-loader.js.map +1 -1
  234. package/dist/core/sdk.d.ts +13 -4
  235. package/dist/core/sdk.d.ts.map +1 -1
  236. package/dist/core/sdk.js +27 -15
  237. package/dist/core/sdk.js.map +1 -1
  238. package/dist/core/settings-defaults.d.ts +65 -0
  239. package/dist/core/settings-defaults.d.ts.map +1 -0
  240. package/dist/core/settings-defaults.js +66 -0
  241. package/dist/core/settings-defaults.js.map +1 -0
  242. package/dist/core/settings-manager.d.ts +17 -178
  243. package/dist/core/settings-manager.d.ts.map +1 -1
  244. package/dist/core/settings-manager.js +86 -57
  245. package/dist/core/settings-manager.js.map +1 -1
  246. package/dist/core/settings-schema.d.ts +269 -0
  247. package/dist/core/settings-schema.d.ts.map +1 -0
  248. package/dist/core/settings-schema.js +318 -0
  249. package/dist/core/settings-schema.js.map +1 -0
  250. package/dist/core/skills.d.ts +4 -1
  251. package/dist/core/skills.d.ts.map +1 -1
  252. package/dist/core/skills.js +6 -1
  253. package/dist/core/skills.js.map +1 -1
  254. package/dist/core/system-prompt.d.ts +6 -0
  255. package/dist/core/system-prompt.d.ts.map +1 -1
  256. package/dist/core/system-prompt.js +10 -5
  257. package/dist/core/system-prompt.js.map +1 -1
  258. package/dist/core/tools/bash.d.ts.map +1 -1
  259. package/dist/core/tools/bash.js +3 -5
  260. package/dist/core/tools/bash.js.map +1 -1
  261. package/dist/core/tools/grep.d.ts +8 -0
  262. package/dist/core/tools/grep.d.ts.map +1 -1
  263. package/dist/core/tools/grep.js +19 -7
  264. package/dist/core/tools/grep.js.map +1 -1
  265. package/dist/core/tools/index.d.ts +2 -0
  266. package/dist/core/tools/index.d.ts.map +1 -1
  267. package/dist/core/tools/index.js +2 -0
  268. package/dist/core/tools/index.js.map +1 -1
  269. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  270. package/dist/core/tools/output-accumulator.js +4 -10
  271. package/dist/core/tools/output-accumulator.js.map +1 -1
  272. package/dist/core/tools/path-utils.d.ts +1 -1
  273. package/dist/core/tools/path-utils.d.ts.map +1 -1
  274. package/dist/core/tools/path-utils.js +6 -6
  275. package/dist/core/tools/path-utils.js.map +1 -1
  276. package/dist/core/tools/read.d.ts +13 -0
  277. package/dist/core/tools/read.d.ts.map +1 -1
  278. package/dist/core/tools/read.js +32 -2
  279. package/dist/core/tools/read.js.map +1 -1
  280. package/dist/core/tools/render-utils.d.ts +20 -0
  281. package/dist/core/tools/render-utils.d.ts.map +1 -1
  282. package/dist/core/tools/render-utils.js +67 -0
  283. package/dist/core/tools/render-utils.js.map +1 -1
  284. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  285. package/dist/core/tools/renderers/bash.js +7 -35
  286. package/dist/core/tools/renderers/bash.js.map +1 -1
  287. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  288. package/dist/core/tools/renderers/edit.js +5 -4
  289. package/dist/core/tools/renderers/edit.js.map +1 -1
  290. package/dist/core/tools/renderers/index.d.ts +2 -2
  291. package/dist/core/tools/renderers/index.d.ts.map +1 -1
  292. package/dist/core/tools/renderers/index.js.map +1 -1
  293. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  294. package/dist/core/tools/renderers/read.js +7 -11
  295. package/dist/core/tools/renderers/read.js.map +1 -1
  296. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  297. package/dist/extensions/codemode/execute.js +391 -80
  298. package/dist/extensions/codemode/execute.js.map +1 -1
  299. package/dist/extensions/codemode/index.d.ts.map +1 -1
  300. package/dist/extensions/codemode/index.js +3 -1
  301. package/dist/extensions/codemode/index.js.map +1 -1
  302. package/dist/extensions/codemode/renderer.d.ts +2 -2
  303. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  304. package/dist/extensions/codemode/renderer.js +9 -3
  305. package/dist/extensions/codemode/renderer.js.map +1 -1
  306. package/dist/extensions/codemode/tool.d.ts +22 -21
  307. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  308. package/dist/extensions/codemode/tool.js +96 -123
  309. package/dist/extensions/codemode/tool.js.map +1 -1
  310. package/dist/extensions/llama/provider.d.ts.map +1 -1
  311. package/dist/extensions/llama/provider.js +34 -11
  312. package/dist/extensions/llama/provider.js.map +1 -1
  313. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  314. package/dist/extensions/mcp/cli.js +27 -33
  315. package/dist/extensions/mcp/cli.js.map +1 -1
  316. package/dist/extensions/mcp/config.d.ts +15 -3
  317. package/dist/extensions/mcp/config.d.ts.map +1 -1
  318. package/dist/extensions/mcp/config.js +49 -12
  319. package/dist/extensions/mcp/config.js.map +1 -1
  320. package/dist/extensions/mcp/index.d.ts +4 -1
  321. package/dist/extensions/mcp/index.d.ts.map +1 -1
  322. package/dist/extensions/mcp/index.js +279 -129
  323. package/dist/extensions/mcp/index.js.map +1 -1
  324. package/dist/extensions/mcp/oauth.d.ts +21 -11
  325. package/dist/extensions/mcp/oauth.d.ts.map +1 -1
  326. package/dist/extensions/mcp/oauth.js +166 -45
  327. package/dist/extensions/mcp/oauth.js.map +1 -1
  328. package/dist/extensions/mcp/resources.d.ts +3 -10
  329. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  330. package/dist/extensions/mcp/resources.js +4 -5
  331. package/dist/extensions/mcp/resources.js.map +1 -1
  332. package/dist/extensions/mcp/runtime.d.ts +7 -7
  333. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  334. package/dist/extensions/mcp/runtime.js +31 -45
  335. package/dist/extensions/mcp/runtime.js.map +1 -1
  336. package/dist/extensions/mcp/tools.d.ts +7 -5
  337. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  338. package/dist/extensions/mcp/tools.js +87 -29
  339. package/dist/extensions/mcp/tools.js.map +1 -1
  340. package/dist/extensions/mcp/ui.d.ts +3 -3
  341. package/dist/extensions/mcp/ui.d.ts.map +1 -1
  342. package/dist/extensions/mcp/ui.js +18 -6
  343. package/dist/extensions/mcp/ui.js.map +1 -1
  344. package/dist/extensions/tool-search/tool.d.ts +0 -2
  345. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  346. package/dist/extensions/tool-search/tool.js +2 -4
  347. package/dist/extensions/tool-search/tool.js.map +1 -1
  348. package/dist/hooks/checks/checks-runtime.cjs +215 -0
  349. package/dist/hooks/checks/git-safety.cjs +198 -0
  350. package/dist/hooks/checks/git-safety.d.cts +1 -0
  351. package/dist/hooks/gsd/draht-post-task.js +78 -39
  352. package/dist/hooks/gsd/draht-quality-gate.js +210 -122
  353. package/dist/hooks/gsd/package.json +3 -0
  354. package/dist/index.d.ts +5 -4
  355. package/dist/index.d.ts.map +1 -1
  356. package/dist/index.js +3 -2
  357. package/dist/index.js.map +1 -1
  358. package/dist/main.d.ts.map +1 -1
  359. package/dist/main.js +11 -3
  360. package/dist/main.js.map +1 -1
  361. package/dist/modes/interactive/components/auth-url.d.ts +14 -0
  362. package/dist/modes/interactive/components/auth-url.d.ts.map +1 -0
  363. package/dist/modes/interactive/components/auth-url.js +37 -0
  364. package/dist/modes/interactive/components/auth-url.js.map +1 -0
  365. package/dist/modes/interactive/components/bash-execution.d.ts +5 -1
  366. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  367. package/dist/modes/interactive/components/bash-execution.js +17 -14
  368. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  369. package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
  370. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  371. package/dist/modes/interactive/components/branch-summary-message.js +5 -2
  372. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  373. package/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -1
  374. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  375. package/dist/modes/interactive/components/compaction-summary-message.js +5 -2
  376. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  377. package/dist/modes/interactive/components/custom-entry.d.ts +3 -1
  378. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  379. package/dist/modes/interactive/components/custom-entry.js +8 -2
  380. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  381. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  382. package/dist/modes/interactive/components/custom-message.js +1 -0
  383. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  384. package/dist/modes/interactive/components/login-dialog.d.ts +3 -0
  385. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  386. package/dist/modes/interactive/components/login-dialog.js +38 -10
  387. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  388. package/dist/modes/interactive/components/oauth-selector.d.ts +8 -2
  389. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  390. package/dist/modes/interactive/components/oauth-selector.js +24 -21
  391. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  392. package/dist/modes/interactive/components/radius-login-selector.d.ts +15 -0
  393. package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -0
  394. package/dist/modes/interactive/components/radius-login-selector.js +85 -0
  395. package/dist/modes/interactive/components/radius-login-selector.js.map +1 -0
  396. package/dist/modes/interactive/components/settings-selector.d.ts +3 -3
  397. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  398. package/dist/modes/interactive/components/settings-selector.js +9 -8
  399. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  400. package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
  401. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  402. package/dist/modes/interactive/components/skill-invocation-message.js +5 -2
  403. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  404. package/dist/modes/interactive/components/status-indicator.d.ts +1 -1
  405. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  406. package/dist/modes/interactive/components/status-indicator.js +2 -2
  407. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  408. package/dist/modes/interactive/components/tool-execution.d.ts +12 -13
  409. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  410. package/dist/modes/interactive/components/tool-execution.js +32 -45
  411. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  412. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  413. package/dist/modes/interactive/components/tree-selector.js +2 -9
  414. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  415. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  416. package/dist/modes/interactive/components/user-message.js +5 -4
  417. package/dist/modes/interactive/components/user-message.js.map +1 -1
  418. package/dist/modes/interactive/interactive-mode.d.ts +43 -48
  419. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  420. package/dist/modes/interactive/interactive-mode.js +362 -278
  421. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  422. package/dist/modes/interactive/program-status-reporter.d.ts +34 -0
  423. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
  424. package/dist/modes/interactive/program-status-reporter.js +110 -0
  425. package/dist/modes/interactive/program-status-reporter.js.map +1 -0
  426. package/dist/modes/interactive/theme/dark.json +1 -1
  427. package/dist/modes/interactive/theme/light.json +1 -1
  428. package/dist/modes/interactive/theme/system-theme.d.ts +2 -1
  429. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -1
  430. package/dist/modes/interactive/theme/system-theme.js +16 -5
  431. package/dist/modes/interactive/theme/system-theme.js.map +1 -1
  432. package/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
  433. package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  434. package/dist/modes/interactive/theme/theme-schema.js +105 -0
  435. package/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  436. package/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
  437. package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
  438. package/dist/modes/interactive/theme/theme-tokens.js +94 -0
  439. package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
  440. package/dist/modes/interactive/theme/theme.d.ts +13 -16
  441. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  442. package/dist/modes/interactive/theme/theme.js +22 -29
  443. package/dist/modes/interactive/theme/theme.js.map +1 -1
  444. package/dist/modes/print-mode.d.ts.map +1 -1
  445. package/dist/modes/print-mode.js +4 -0
  446. package/dist/modes/print-mode.js.map +1 -1
  447. package/dist/package-manager-cli.d.ts.map +1 -1
  448. package/dist/package-manager-cli.js +26 -1
  449. package/dist/package-manager-cli.js.map +1 -1
  450. package/dist/prompts/commands/atomic-commit.md +8 -6
  451. package/dist/prompts/commands/brainstorm.md +5 -149
  452. package/dist/prompts/commands/create-verification-skill.md +8 -48
  453. package/dist/prompts/commands/discuss-phase.md +6 -10
  454. package/dist/prompts/commands/execute-phase.md +18 -45
  455. package/dist/prompts/commands/fix.md +16 -128
  456. package/dist/prompts/commands/grill.md +6 -53
  457. package/dist/prompts/commands/init-project.md +13 -18
  458. package/dist/prompts/commands/map-codebase.md +3 -3
  459. package/dist/prompts/commands/new-project.md +12 -17
  460. package/dist/prompts/commands/next-milestone.md +4 -8
  461. package/dist/prompts/commands/orchestrate-loop.md +12 -12
  462. package/dist/prompts/commands/orchestrate.md +12 -11
  463. package/dist/prompts/commands/pause-work.md +1 -1
  464. package/dist/prompts/commands/plan-phase.md +15 -37
  465. package/dist/prompts/commands/quick.md +11 -64
  466. package/dist/prompts/commands/resolve-conflicts.md +2 -15
  467. package/dist/prompts/commands/triage.md +3 -14
  468. package/dist/prompts/commands/verify-work.md +15 -63
  469. package/dist/prompts/commands/why.md +18 -118
  470. package/dist/skills/atomic-reasoning/SKILL.md +6 -105
  471. package/dist/skills/blast-radius/SKILL.md +1 -1
  472. package/dist/skills/epistemics/SKILL.md +12 -87
  473. package/dist/skills/explainers/SKILL.md +1 -1
  474. package/dist/skills/typescript-discipline/SKILL.md +12 -42
  475. package/dist/skills/typescript-discipline/references/patterns.md +25 -266
  476. package/dist/skills/unslop/SKILL.md +14 -105
  477. package/dist/utils/ansi.d.ts +8 -0
  478. package/dist/utils/ansi.d.ts.map +1 -1
  479. package/dist/utils/ansi.js +30 -11
  480. package/dist/utils/ansi.js.map +1 -1
  481. package/dist/utils/clipboard-command.d.ts.map +1 -1
  482. package/dist/utils/clipboard-command.js +3 -0
  483. package/dist/utils/clipboard-command.js.map +1 -1
  484. package/dist/utils/clipboard.d.ts.map +1 -1
  485. package/dist/utils/clipboard.js +18 -12
  486. package/dist/utils/clipboard.js.map +1 -1
  487. package/dist/utils/draht-user-agent.d.ts +1 -0
  488. package/dist/utils/draht-user-agent.d.ts.map +1 -1
  489. package/dist/utils/draht-user-agent.js +3 -2
  490. package/dist/utils/draht-user-agent.js.map +1 -1
  491. package/dist/utils/image-convert.d.ts +12 -0
  492. package/dist/utils/image-convert.d.ts.map +1 -1
  493. package/dist/utils/image-convert.js +45 -6
  494. package/dist/utils/image-convert.js.map +1 -1
  495. package/dist/utils/image-resize-core.d.ts +12 -0
  496. package/dist/utils/image-resize-core.d.ts.map +1 -1
  497. package/dist/utils/image-resize-core.js +5 -0
  498. package/dist/utils/image-resize-core.js.map +1 -1
  499. package/dist/utils/image-resize-worker.js +3 -2
  500. package/dist/utils/image-resize-worker.js.map +1 -1
  501. package/dist/utils/image-resize.d.ts.map +1 -1
  502. package/dist/utils/image-resize.js +9 -10
  503. package/dist/utils/image-resize.js.map +1 -1
  504. package/dist/utils/output-files.d.ts +15 -0
  505. package/dist/utils/output-files.d.ts.map +1 -0
  506. package/dist/utils/output-files.js +30 -0
  507. package/dist/utils/output-files.js.map +1 -0
  508. package/dist/utils/shell.d.ts.map +1 -1
  509. package/dist/utils/shell.js +43 -13
  510. package/dist/utils/shell.js.map +1 -1
  511. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  512. package/dist/utils/syntax-highlight.js +6 -1
  513. package/dist/utils/syntax-highlight.js.map +1 -1
  514. package/dist/utils/tools-manager.d.ts.map +1 -1
  515. package/dist/utils/tools-manager.js +4 -3
  516. package/dist/utils/tools-manager.js.map +1 -1
  517. package/docs/cli-integration.md +1 -1
  518. package/docs/cli.md +30 -26
  519. package/docs/codemode.md +230 -0
  520. package/docs/compaction.md +5 -5
  521. package/docs/containerization.md +1 -1
  522. package/docs/custom-provider.md +53 -1
  523. package/docs/docs.json +17 -1
  524. package/docs/drahtbank.md +163 -0
  525. package/docs/environment-variables.md +5 -2
  526. package/docs/extensions.md +143 -13
  527. package/docs/index.md +1 -1
  528. package/docs/json.md +3 -3
  529. package/docs/keybindings.md +9 -5
  530. package/docs/llama-cpp.md +9 -2
  531. package/docs/mcp.md +59 -3
  532. package/docs/message-types.md +22 -4
  533. package/docs/models-configuration.md +187 -0
  534. package/docs/models.md +67 -4
  535. package/docs/nvidia-rtx-llama-cpp.md +96 -0
  536. package/docs/providers.md +70 -5
  537. package/docs/sdk.md +1 -1
  538. package/docs/settings.md +10 -8
  539. package/docs/terminal-setup.md +14 -0
  540. package/docs/themes.md +4 -2
  541. package/docs/tui.md +71 -1
  542. package/docs/usage.md +1 -1
  543. package/docs/windows.md +16 -2
  544. package/eval/drahtbank/adapters.d.mts +35 -0
  545. package/eval/drahtbank/adapters.mjs +192 -0
  546. package/eval/drahtbank/bank.d.mts +141 -0
  547. package/eval/drahtbank/bank.mjs +515 -0
  548. package/eval/drahtbank/cases-v2.d.mts +28 -0
  549. package/eval/drahtbank/cases-v2.mjs +164 -0
  550. package/eval/drahtbank/cases.d.mts +17 -0
  551. package/eval/drahtbank/cases.mjs +198 -0
  552. package/eval/drahtbank/cli.mjs +120 -0
  553. package/eval/drahtbank/grading-v2.d.mts +26 -0
  554. package/eval/drahtbank/grading-v2.mjs +227 -0
  555. package/eval/drahtbank/isolated-tools.ts +223 -0
  556. package/eval/drahtbank/isolation-worker.mjs +53 -0
  557. package/eval/drahtbank/isolation.d.mts +52 -0
  558. package/eval/drahtbank/isolation.mjs +345 -0
  559. package/eval/drahtbank/runtime-checks.d.mts +15 -0
  560. package/eval/drahtbank/runtime-checks.mjs +187 -0
  561. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  562. package/examples/extensions/minimal-mode.ts +4 -5
  563. package/examples/extensions/overlay-test.ts +2 -2
  564. package/examples/extensions/plan-mode/index.ts +6 -2
  565. package/examples/extensions/subagent/index.ts +4 -6
  566. package/hooks/checks/checks-runtime.cjs +215 -0
  567. package/hooks/checks/git-safety.cjs +198 -0
  568. package/hooks/checks/git-safety.d.cts +1 -0
  569. package/hooks/gsd/draht-post-task.js +78 -39
  570. package/hooks/gsd/draht-quality-gate.js +210 -122
  571. package/hooks/gsd/package.json +3 -0
  572. package/package.json +21 -16
  573. package/prompts/commands/atomic-commit.md +8 -6
  574. package/prompts/commands/brainstorm.md +5 -149
  575. package/prompts/commands/create-verification-skill.md +8 -48
  576. package/prompts/commands/discuss-phase.md +6 -10
  577. package/prompts/commands/execute-phase.md +18 -45
  578. package/prompts/commands/fix.md +16 -128
  579. package/prompts/commands/grill.md +6 -53
  580. package/prompts/commands/init-project.md +13 -18
  581. package/prompts/commands/map-codebase.md +3 -3
  582. package/prompts/commands/new-project.md +12 -17
  583. package/prompts/commands/next-milestone.md +4 -8
  584. package/prompts/commands/orchestrate-loop.md +12 -12
  585. package/prompts/commands/orchestrate.md +12 -11
  586. package/prompts/commands/pause-work.md +1 -1
  587. package/prompts/commands/plan-phase.md +15 -37
  588. package/prompts/commands/quick.md +11 -64
  589. package/prompts/commands/resolve-conflicts.md +2 -15
  590. package/prompts/commands/triage.md +3 -14
  591. package/prompts/commands/verify-work.md +15 -63
  592. package/prompts/commands/why.md +18 -118
  593. package/schemas/keybindings.schema.json +433 -0
  594. package/schemas/models.schema.json +1190 -0
  595. package/schemas/settings.schema.json +849 -0
  596. package/schemas/theme.schema.json +365 -0
  597. package/skills/atomic-reasoning/SKILL.md +6 -105
  598. package/skills/blast-radius/SKILL.md +1 -1
  599. package/skills/epistemics/SKILL.md +12 -87
  600. package/skills/explainers/SKILL.md +1 -1
  601. package/skills/typescript-discipline/SKILL.md +12 -42
  602. package/skills/typescript-discipline/references/patterns.md +25 -266
  603. package/skills/unslop/SKILL.md +14 -105
  604. package/dist/bundle/chunks/anthropic-messages-E2P6C3P7.js +0 -6
  605. package/dist/bundle/chunks/azure-openai-responses-JZMSTDIM.js +0 -2
  606. package/dist/bundle/chunks/chunk-2E5VODES.js +0 -2
  607. package/dist/bundle/chunks/chunk-3DQNSI5W.js +0 -137
  608. package/dist/bundle/chunks/chunk-4COXSQRQ.js +0 -18
  609. package/dist/bundle/chunks/chunk-D3HO453P.js +0 -42
  610. package/dist/bundle/chunks/chunk-GVXA72ZA.js +0 -2
  611. package/dist/bundle/chunks/chunk-I2SOJ4JN.js +0 -65
  612. package/dist/bundle/chunks/chunk-I5OKY6RH.js +0 -11
  613. package/dist/bundle/chunks/chunk-ILSPVHVH.js +0 -1623
  614. package/dist/bundle/chunks/chunk-KY2BG6BC.js +0 -11
  615. package/dist/bundle/chunks/chunk-PGJAHC3R.js +0 -107
  616. package/dist/bundle/chunks/chunk-QVFELZW2.js +0 -312
  617. package/dist/bundle/chunks/chunk-QVTLBSTH.js +0 -4
  618. package/dist/bundle/chunks/chunk-SDRCE6OP.js +0 -2
  619. package/dist/bundle/chunks/chunk-U6LDZZGM.js +0 -146
  620. package/dist/bundle/chunks/chunk-X3YFUSCK.js +0 -82
  621. package/dist/bundle/chunks/chunk-XBUEMKIY.js +0 -2
  622. package/dist/bundle/chunks/chunk-XHCO4PPH.js +0 -8
  623. package/dist/bundle/chunks/chunk-YH7HNI7D.js +0 -2
  624. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-MJKOAE5S.js +0 -2
  625. package/dist/bundle/chunks/execute-AGEWJLIO.js +0 -18
  626. package/dist/bundle/chunks/google-generative-ai-HPNDIAZD.js +0 -2
  627. package/dist/bundle/chunks/google-vertex-KPAWJ4SP.js +0 -2
  628. package/dist/bundle/chunks/mistral-conversations-FMSPWQ7A.js +0 -5
  629. package/dist/bundle/chunks/node-4JNG6XQO.js +0 -16
  630. package/dist/bundle/chunks/openai-codex-responses-TU7NGPXE.js +0 -10
  631. package/dist/bundle/chunks/openai-completions-GANCQQO5.js +0 -7
  632. package/dist/bundle/chunks/openai-responses-ASDPAX3E.js +0 -3
  633. package/dist/bundle/chunks/openrouter-images-NROSQXMZ.js +0 -2
  634. package/dist/bundle/chunks/pi-messages-2QEJYOAO.js +0 -8
  635. package/dist/bundle/chunks/runtime-2B56SZM6.js +0 -2
  636. package/dist/bundle/chunks/runtime-TJ3EAMJK.js +0 -3
  637. package/dist/bundle/chunks/settings-manager-HC5RR36T.js +0 -2
  638. package/dist/bundle/chunks/typesafe-system-one-YBEEY5XU.js +0 -2
  639. package/dist/bundle/chunks/virtual-modules-XKLDADFR.js +0 -2
  640. package/dist/core/provider-attribution.d.ts +0 -4
  641. package/dist/core/provider-attribution.d.ts.map +0 -1
  642. package/dist/core/provider-attribution.js +0 -72
  643. package/dist/core/provider-attribution.js.map +0 -1
  644. package/dist/experimental/micro/api.d.ts +0 -81
  645. package/dist/experimental/micro/api.d.ts.map +0 -1
  646. package/dist/experimental/micro/api.js +0 -2
  647. package/dist/experimental/micro/api.js.map +0 -1
  648. package/dist/experimental/micro/main.d.ts +0 -3
  649. package/dist/experimental/micro/main.d.ts.map +0 -1
  650. package/dist/experimental/micro/main.js +0 -21
  651. package/dist/experimental/micro/main.js.map +0 -1
  652. package/dist/experimental/micro/models.d.ts +0 -11
  653. package/dist/experimental/micro/models.d.ts.map +0 -1
  654. package/dist/experimental/micro/models.js +0 -95
  655. package/dist/experimental/micro/models.js.map +0 -1
  656. package/dist/experimental/micro/runtime.d.ts +0 -12
  657. package/dist/experimental/micro/runtime.d.ts.map +0 -1
  658. package/dist/experimental/micro/runtime.js +0 -465
  659. package/dist/experimental/micro/runtime.js.map +0 -1
  660. package/dist/experimental/micro/sessions.d.ts +0 -10
  661. package/dist/experimental/micro/sessions.d.ts.map +0 -1
  662. package/dist/experimental/micro/sessions.js +0 -41
  663. package/dist/experimental/micro/sessions.js.map +0 -1
  664. package/dist/experimental/micro/tools.d.ts +0 -10
  665. package/dist/experimental/micro/tools.d.ts.map +0 -1
  666. package/dist/experimental/micro/tools.js +0 -96
  667. package/dist/experimental/micro/tools.js.map +0 -1
  668. package/dist/experimental/micro/tui.d.ts +0 -3
  669. package/dist/experimental/micro/tui.d.ts.map +0 -1
  670. package/dist/experimental/micro/tui.js +0 -510
  671. package/dist/experimental/micro/tui.js.map +0 -1
  672. package/dist/experimental/mini/main.d.ts +0 -7
  673. package/dist/experimental/mini/main.d.ts.map +0 -1
  674. package/dist/experimental/mini/main.js +0 -21
  675. package/dist/experimental/mini/main.js.map +0 -1
  676. package/dist/experimental/mini/server/entry.d.ts +0 -3
  677. package/dist/experimental/mini/server/entry.d.ts.map +0 -1
  678. package/dist/experimental/mini/server/entry.js +0 -11
  679. package/dist/experimental/mini/server/entry.js.map +0 -1
  680. package/dist/experimental/mini/server/run.d.ts +0 -13
  681. package/dist/experimental/mini/server/run.d.ts.map +0 -1
  682. package/dist/experimental/mini/server/run.js +0 -150
  683. package/dist/experimental/mini/server/run.js.map +0 -1
  684. package/dist/experimental/mini/shared/protocol.d.ts +0 -127
  685. package/dist/experimental/mini/shared/protocol.d.ts.map +0 -1
  686. package/dist/experimental/mini/shared/protocol.js +0 -13
  687. package/dist/experimental/mini/shared/protocol.js.map +0 -1
  688. package/dist/experimental/mini/shared/rpc.d.ts +0 -49
  689. package/dist/experimental/mini/shared/rpc.d.ts.map +0 -1
  690. package/dist/experimental/mini/shared/rpc.js +0 -171
  691. package/dist/experimental/mini/shared/rpc.js.map +0 -1
  692. package/dist/experimental/mini/shared/transport.d.ts +0 -35
  693. package/dist/experimental/mini/shared/transport.d.ts.map +0 -1
  694. package/dist/experimental/mini/shared/transport.js +0 -94
  695. package/dist/experimental/mini/shared/transport.js.map +0 -1
  696. package/dist/experimental/mini/tui/run.d.ts +0 -9
  697. package/dist/experimental/mini/tui/run.d.ts.map +0 -1
  698. package/dist/experimental/mini/tui/run.js +0 -62
  699. package/dist/experimental/mini/tui/run.js.map +0 -1
  700. package/dist/experimental/mini/tui/session.d.ts +0 -26
  701. package/dist/experimental/mini/tui/session.d.ts.map +0 -1
  702. package/dist/experimental/mini/tui/session.js +0 -94
  703. package/dist/experimental/mini/tui/session.js.map +0 -1
  704. package/dist/experimental/mini/tui/view.d.ts +0 -10
  705. package/dist/experimental/mini/tui/view.d.ts.map +0 -1
  706. package/dist/experimental/mini/tui/view.js +0 -461
  707. package/dist/experimental/mini/tui/view.js.map +0 -1
  708. package/dist/experimental/mini/worker/entry.d.ts +0 -3
  709. package/dist/experimental/mini/worker/entry.d.ts.map +0 -1
  710. package/dist/experimental/mini/worker/entry.js +0 -10
  711. package/dist/experimental/mini/worker/entry.js.map +0 -1
  712. package/dist/experimental/mini/worker/lane-service.d.ts +0 -44
  713. package/dist/experimental/mini/worker/lane-service.d.ts.map +0 -1
  714. package/dist/experimental/mini/worker/lane-service.js +0 -97
  715. package/dist/experimental/mini/worker/lane-service.js.map +0 -1
  716. package/dist/experimental/mini/worker/models-service.d.ts +0 -19
  717. package/dist/experimental/mini/worker/models-service.d.ts.map +0 -1
  718. package/dist/experimental/mini/worker/models-service.js +0 -136
  719. package/dist/experimental/mini/worker/models-service.js.map +0 -1
  720. package/dist/experimental/mini/worker/run.d.ts +0 -14
  721. package/dist/experimental/mini/worker/run.d.ts.map +0 -1
  722. package/dist/experimental/mini/worker/run.js +0 -88
  723. package/dist/experimental/mini/worker/run.js.map +0 -1
  724. package/dist/modes/interactive/theme/theme-json.d.ts +0 -85
  725. package/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
  726. package/dist/modes/interactive/theme/theme-json.js +0 -132
  727. package/dist/modes/interactive/theme/theme-json.js.map +0 -1
  728. package/dist/modes/interactive/theme/theme-schema.json +0 -361
  729. /package/dist/bundle/chunks/{chunk-FBU742QF.js → chunk-MOOADNVS.js} +0 -0
@@ -0,0 +1,230 @@
1
+ # Codemode
2
+
3
+ The `codemode` tool lets the model write a JavaScript script that calls draht's other tools and runs non-LLM models, such as classifiers and image models. Only the script's output reaches the model, so a script can run calls in parallel and filter large results before the model sees them. To turn it on, see [Enable codemode](cli.md#enable-codemode).
4
+
5
+ ## Scripts
6
+
7
+ The tool input is raw JavaScript source, not JSON and not a markdown code fence. It runs as the body of an async function in a QuickJS sandbox, so top-level `await` and `return` work. The sandbox has no Node APIs, file system, network, or timers; scripts reach the outside world only through tools and `models`.
8
+
9
+ A script may start with an options line. It must be the first line; an options line anywhere else fails the call before the script runs:
10
+
11
+ ```js
12
+ // @options: {"max_output_tokens": 2000, "timeout_ms": 60000}
13
+ ```
14
+
15
+ - `max_output_tokens` (default 10000) limits the output. Longer output keeps its start and end, and the full text is written to a temp file whose path is included in the result. A script fails when its output passes 16777216 characters of text and base64 image data or 100000 `text()`, `image()`, and `console` calls; write large data to a file with a tool instead.
16
+ - `timeout_ms` is a hard deadline for the whole script, including any wait for a free worker. It is unset by default. Image generation can take minutes, so do not set a short deadline for scripts that generate images.
17
+
18
+ The result starts with `Script completed` or `Script failed`, the wall time, and the output. Text and image items appear in order, each on its own line. When the output has more than one text item (from `text()` or `return`), each starts with a `==> text N/M <==` line. `console` calls follow in one `<console_output>` block with one line per call. A failed script keeps its partial output, followed by `Script error:` and the error. Tool calls are real: calls made before a failure are not undone. Calls still running when the script ends are cancelled, and unawaited promises are discarded.
19
+
20
+ ## Globals
21
+
22
+ | Global | Purpose |
23
+ |---|---|
24
+ | `tools.<name>(args)` | Call a tool. See [Call tools](#call-tools). |
25
+ | `text(value)` | Add a text item to the output. Strings are added as is, other values as JSON. |
26
+ | `image(value)` | Add an image to the output: a base64 `data:` URL, an `{ image_url }` object, or an image block `{ type: "image", data, mimeType }` such as those returned by MCP tools and `models.generateImages()`. Remote URLs are not supported. PNG, JPEG, GIF, and WebP are accepted. Each image is also saved to a temp file, and the result names the path before the image. |
27
+ | `console.log(...)` | Add a line to the `<console_output>` block after the other output. Arguments are joined with spaces; `info`, `warn`, `error`, and `debug` do the same. |
28
+ | `return value` | A top-level `return` adds the value like `text()`. |
29
+ | `exit()` | End the script successfully. |
30
+ | `store(key, value)` / `load(key)` | Keep small JSON values across `codemode` calls. See [Store values](#store-values). |
31
+ | `ALL_TOOLS` | Every callable tool as `{ name, description }`, including tools the description does not list. |
32
+ | `searchTools(query, { limit?, namespace? })` | Rank callable tools by relevance (BM25, default limit 8). Resolves to `{ name, description }[]`. |
33
+ | `describeTool(name)` | Resolves to a tool's description and TypeScript declaration, or `undefined`. |
34
+ | `describeNamespace(name)` | Resolves to `{ name, description?, instructions?, tools }` for a namespace such as an MCP server, or `undefined`. |
35
+ | `models` | List and run non-LLM models. See [Models](#models). |
36
+
37
+ ## Call tools
38
+
39
+ Every tool the session can call is a method of `tools`, named by its identifier: characters that are not valid in a JavaScript identifier become `_`, so the MCP tool `mcp__dev-radius__search` is `tools.mcp__dev_radius__search`. Each method takes one object with the tool's arguments.
40
+
41
+ What a call resolves to depends on the tool:
42
+
43
+ - Tools with an output schema resolve to a structured value. `bash` resolves to `{ output, truncated, full_output_path?, exit_code, wall_time_seconds }`, also for non-zero exit codes. Its `output` is not limited to the 2000 lines or 50KB the model sees: it holds up to 1 MiB, and longer output keeps its first and last 512 KiB around an omission marker, with `truncated` set and the full output in `full_output_path`.
44
+ - MCP tools resolve to their `CallToolResult`, including `isError` and `structuredContent`.
45
+ - `read` resolves to the file's text, or for an image to an image block `{ type: "image", data, mimeType, note }` that `image()` shows. `data` is the base64 image the model would see and `note` the text that goes with it, such as resize hints.
46
+ - Other tools, such as `edit` and `write`, resolve to their text output.
47
+
48
+ A call that fails, is blocked, or gets invalid arguments rejects with an `Error` that carries the tool's error text. Use `Promise.allSettled()` to keep the results of the calls that succeed.
49
+
50
+ The `codemode` description lists tools with their TypeScript declarations, grouped by namespace (for example one MCP server). Tools with `deferred` exposure, which includes MCP tools with the default `codemode` exposure, are not listed, so the description stays the same while MCP servers connect. Listed declarations share a budget of 3000 estimated tokens (`codemode.inlineBudget` in [settings](settings.md#tools)). Scripts find the other tools with `searchTools()`, `describeTool()`, `describeNamespace()`, or by filtering `ALL_TOOLS`.
51
+
52
+ While `codemode` is active, `codemode.mode` in [settings](settings.md#tools) decides how the other tools are presented. With `on` (default) declared tools stay declared, and their descriptions say how to call them from scripts. With `only` they are hidden from the model and listed in the `codemode` description instead, so the model calls them through scripts. Tool declarations in the `codemode` description, `describeTool()`, and `ALL_TOOLS` carry the tools' prompt guidelines, since the system prompt rules only cover declared tools.
53
+
54
+ ## Store values
55
+
56
+ `store(key, value)` keeps a JSON value under a string key for later `codemode` calls; storing `undefined` deletes the key. `load(key)` returns the value, or `undefined`. Writes are kept only when the script succeeds: each successful script that stores values appends a `codemode-store` custom entry to the session, so resumed sessions keep the values and each branch sees only the values written on its path.
57
+
58
+ The store is for small state such as IDs, cursors, or summaries. One value may have at most 262144 characters of JSON and all values together at most 1048576. Do not store image data; show images with `image()`, which also saves them to a temp file.
59
+
60
+ ## Models
61
+
62
+ `models` reaches the model catalog and runs non-LLM models with the session's credentials: classifiers, which answer typed questions about JSON state and, for some models, images, and image models, which generate images. Chat models are listed but cannot be run from scripts. Which classifier and image models exist is described in [Use classifier models](models.md#use-classifier-models) and [Use image models](models.md#use-image-models).
63
+
64
+ ```ts
65
+ type ModelType = "chat" | "image" | "classifier";
66
+
67
+ /** A catalog entry. `provider` and `id` identify it; other fields depend on the type. */
68
+ interface ModelInfo {
69
+ type?: ModelType;
70
+ provider: string;
71
+ id: string;
72
+ name: string;
73
+ api: string;
74
+ input: ("text" | "image")[];
75
+ contextWindow?: number;
76
+ [key: string]: unknown;
77
+ }
78
+
79
+ declare const models: {
80
+ /** Every known model of a type, optionally for one provider. */
81
+ getModelsOfType(type: ModelType, provider?: string): Promise<ModelInfo[]>;
82
+ /** Models of a type whose provider has working credentials. */
83
+ getAvailableOfType(type: ModelType, provider?: string): Promise<ModelInfo[]>;
84
+ /** One catalog entry, or undefined. */
85
+ getModelOfType(type: ModelType, provider: string, id: string): Promise<ModelInfo | undefined>;
86
+ /** Answer `context.questions` about `context.state`; answers are in `result.answers` by question ID. */
87
+ classify(model: ModelInfo, context: ClassifierContext): Promise<ClassifierResult>;
88
+ /** Generate images from `context.input` text and image blocks; show `result.output` blocks with image(). Can take minutes. */
89
+ generateImages(model: ModelInfo, context: ImagesContext): Promise<ImagesResult>;
90
+ };
91
+ ```
92
+
93
+ `classify()` and `generateImages()` use only the `provider` and `id` of `model`, so `{ provider, id }` works as well. They do not throw on provider errors: check `stopReason` and `errorMessage`. At most four such calls run at once per script; more calls wait for a free slot, so `Promise.all()` over many items is fine. Their usage is added to the `codemode` tool result and counts toward the session cost.
94
+
95
+ Model IDs differ between providers, for example `typesafe/jev-latest` and `openrouter/typesafe/jev-1.13`. Use `models.getAvailableOfType(type)` to find the IDs that work with the current credentials.
96
+
97
+ ### Classify
98
+
99
+ ```ts
100
+ interface ClassifierContext {
101
+ /** The data to classify. */
102
+ state: Record<string, unknown>;
103
+ /** Images judged together with `state`. Only models whose `input` includes "image" accept them. */
104
+ images?: { type: "image"; data: string; mimeType: string }[];
105
+ /** Questions by ID. One call answers all of them. */
106
+ questions: Record<string, ClassifierQuestion>;
107
+ }
108
+
109
+ type ClassifierQuestion =
110
+ /** Pick one label. `criteria` maps each label to what it means. */
111
+ | { type: "choice"; instructions: string; criteria: Record<string, string> }
112
+ /** Score on an ordered scale. `criteria` describes each level, lowest first. */
113
+ | { type: "score"; instructions: string; criteria: string[] }
114
+ /** Yes or no. */
115
+ | { type: "bool"; instructions: string; criteria: { true: string; false: string } };
116
+
117
+ interface ClassifierResult {
118
+ provider: string;
119
+ model: string;
120
+ /** Answers by question ID. */
121
+ answers: Record<string, ClassifierAnswer>;
122
+ usage?: ModelUsage;
123
+ stopReason: "stop" | "error" | "aborted";
124
+ errorMessage?: string;
125
+ }
126
+
127
+ type ClassifierAnswer =
128
+ | { type: "choice"; choice: string; probabilities: Record<string, number>; confidence: number }
129
+ /** `score` is the expected level index, from 0 to `criteria.length - 1`. */
130
+ | { type: "score"; score: number; confidence: number }
131
+ /** Probability of `true`. */
132
+ | { type: "bool"; probability: number };
133
+
134
+ /** Token counts and cost in USD, when the service reports them. */
135
+ type ModelUsage = { input: number; output: number; totalTokens: number; cost: { total: number } };
136
+ ```
137
+
138
+ Classify several items by calling `classify()` once per item. This script sorts feedback messages, for example ones a tool returned earlier in the script:
139
+
140
+ ```js
141
+ const jev = await models.getModelOfType("classifier", "typesafe", "jev-latest");
142
+ const results = await Promise.all(
143
+ messages.map((message) =>
144
+ models.classify(jev, {
145
+ state: { message },
146
+ questions: {
147
+ sentiment: {
148
+ type: "choice",
149
+ instructions: "How does the user feel about the product?",
150
+ criteria: { positive: "Satisfied or happy", negative: "Unhappy or frustrated", neutral: "Neither" },
151
+ },
152
+ urgency: {
153
+ type: "score",
154
+ instructions: "How urgently does this need a reply?",
155
+ criteria: ["no reply needed", "reply this week", "reply today"],
156
+ },
157
+ },
158
+ }),
159
+ ),
160
+ );
161
+ return results.map((result, i) =>
162
+ result.stopReason === "stop"
163
+ ? { message: messages[i], sentiment: result.answers.sentiment.choice, urgency: result.answers.urgency.score }
164
+ : { message: messages[i], error: result.errorMessage },
165
+ );
166
+ ```
167
+
168
+ Classifiers whose `input` includes `"image"` also judge images. `tools.read()` returns an image file as an image block that `images` accepts. Other classifiers return an error result when `images` is not empty.
169
+
170
+ ```js
171
+ const luna = await models.getModelOfType("classifier", "openai", "gpt-6-luna");
172
+ const photo = await tools.read({ path: "screenshot.png" });
173
+ const result = await models.classify(luna, {
174
+ state: { task: "Settings page redesign" },
175
+ images: [photo],
176
+ questions: {
177
+ broken: {
178
+ type: "bool",
179
+ instructions: "Does the screenshot show a broken layout?",
180
+ criteria: { true: "Overlapping, cut-off, or misaligned elements", false: "Clean layout" },
181
+ },
182
+ },
183
+ });
184
+ ```
185
+
186
+ ### Generate images
187
+
188
+ ```ts
189
+ interface ImagesContext {
190
+ /** The prompt as text blocks, plus image blocks to edit or use as references. */
191
+ input: (TextBlock | ImageBlock)[];
192
+ }
193
+
194
+ interface ImagesResult {
195
+ provider: string;
196
+ model: string;
197
+ /** Generated images, and text blocks for models that also return text. */
198
+ output: (TextBlock | ImageBlock)[];
199
+ usage?: ModelUsage;
200
+ stopReason: "stop" | "error" | "aborted";
201
+ errorMessage?: string;
202
+ }
203
+
204
+ type TextBlock = { type: "text"; text: string };
205
+ /** `data` is base64. */
206
+ type ImageBlock = { type: "image"; data: string; mimeType: string };
207
+ ```
208
+
209
+ Show generated images with `image(block)`. Do not print `data` with `text()`, `console`, or `return`: it is large and the model cannot read it as text. `image()` also saves each image to a temp file and puts its path in the result, so a later turn can copy or move the file.
210
+
211
+ ```js
212
+ // @options: {"timeout_ms": 300000}
213
+ const painter = await models.getModelOfType("image", "openrouter", "google/gemini-2.5-flash-image");
214
+ const result = await models.generateImages(painter, {
215
+ input: [{ type: "text", text: "A red fox in the snow, watercolor" }],
216
+ });
217
+ if (result.stopReason !== "stop") return result.errorMessage;
218
+ for (const block of result.output) {
219
+ if (block.type === "image") image(block);
220
+ else text(block.text);
221
+ }
222
+ ```
223
+
224
+ ## Limits
225
+
226
+ - A script's VM has 256 MB of memory. Running out throws `InternalError: out of memory`; filter or aggregate large data instead of accumulating it.
227
+ - On Bun, stopping a script or reaching its deadline ends the call promptly, but a built-in that does not poll QuickJS's interrupt handler can keep computing in its worker until it returns.
228
+ - At most two codemode workers may be alive across all sessions in one draht process; `DRAHT_CODEMODE_MAX_WORKERS` changes the limit. A cancelled worker occupies its slot until it exits. At capacity, new scripts wait for a free worker in arrival order. A script that gets no worker within 60 seconds, or before its `timeout_ms`, fails without running.
229
+ - A script that waits on a promise that can never settle (no tool call pending) fails immediately, since there are no timers.
230
+ - Scripts cannot start other `codemode` scripts.
@@ -32,7 +32,7 @@ Auto-compaction triggers when:
32
32
  contextTokens > contextWindow - reserveTokens
33
33
  ```
34
34
 
35
- By default, `reserveTokens` is 16384 tokens (configurable in `~/.draht/agent/settings.json` or `<project-dir>/.draht/settings.json`). This leaves room for the LLM's response.
35
+ By default, `reserveTokens` is 16384 tokens (configurable in `~/.draht/agent/settings.json` or `<project-dir>/.draht/settings.json`). It only decides when compaction starts. Summary requests use the model's output limit, reduced when needed so input and output fit the context window.
36
36
 
37
37
  During a multi-turn agent run, draht checks the canonical projected context after tools finish and their results are appended, before starting the next assistant response. If the threshold is crossed, draht compacts during `prepareNextTurn`, then performs the existing catch-up steering poll before `turn_start`. It skips this between-turn check when the completed tool batch terminates the run and no queued message requires another response. draht also checks before a new user prompt and performs final-attempt overflow recovery after the low-level run ends.
38
38
 
@@ -279,7 +279,6 @@ Before summarization, messages are serialized to text via [`serializeConversatio
279
279
 
280
280
  ```
281
281
  [User]: What they said
282
- [Assistant thinking]: Internal reasoning
283
282
  [Assistant]: Response text
284
283
  [Assistant tool calls]: read(path="foo.ts"); edit(path="bar.ts", ...)
285
284
  [Tool result]: Output from tool
@@ -287,6 +286,8 @@ Before summarization, messages are serialized to text via [`serializeConversatio
287
286
 
288
287
  This prevents the model from treating it as a conversation to continue.
289
288
 
289
+ Thinking blocks are omitted. Providers return summaries of the real reasoning, and replayed thinking is often not part of the model's live context, so including it could make the summarization request larger than the context it summarizes.
290
+
290
291
  Tool results are truncated to 2000 characters during serialization. Content beyond that limit is replaced with a marker indicating how many characters were truncated. This keeps summarization requests within reasonable token budgets, since tool results (especially from `read` and `bash`) are typically the largest contributors to context size.
291
292
 
292
293
  ## Custom Summarization via Extensions
@@ -344,7 +345,6 @@ pi.on("session_before_compact", async (event, ctx) => {
344
345
  );
345
346
  // Returns:
346
347
  // [User]: message text
347
- // [Assistant thinking]: thinking content
348
348
  // [Assistant]: response text
349
349
  // [Assistant tool calls]: read(path="..."); bash(command="...")
350
350
  // [Tool result]: output text
@@ -429,7 +429,7 @@ Configure compaction in `~/.draht/agent/settings.json` or `<project-dir>/.draht/
429
429
  | Setting | Default | Description |
430
430
  |---------|---------|-------------|
431
431
  | `enabled` | `true` | Enable auto-compaction |
432
- | `reserveTokens` | `16384` | Tokens to reserve for LLM response |
432
+ | `reserveTokens` | `16384` | Free context tokens below which auto-compaction starts |
433
433
  | `keepRecentTokens` | `20000` | Recent tokens to keep (not summarized) |
434
434
 
435
435
  Disable auto-compaction with `"enabled": false`. You can still compact manually with `/compact`.
@@ -452,7 +452,7 @@ Use `compaction.modelOverrides` to tune token budgets for different models:
452
452
  }
453
453
  ```
454
454
 
455
- For a model with a 1M context window, this override triggers compaction above 600K tokens and keeps the ordinary 20000 recent tokens. Other models retain the ordinary 16384-token reserve. `reserveTokens` also influences summarization output limits, capped by the model's maximum output tokens; it is not solely a trigger threshold.
455
+ For a model with a 1M context window, this override triggers compaction above 600K tokens and keeps the ordinary 20000 recent tokens. Other models retain the ordinary 16384-token reserve.
456
456
 
457
457
  Keys are exact, case-sensitive `provider/modelId` values, including any slashes within the model ID. Each `reserveTokens` and `keepRecentTokens` value falls back independently from the model override to the ordinary setting to the built-in default. Values must be non-negative safe integers. Invalid values in the matching model override produce an error when read; only omitted fields fall back to the ordinary setting. Model override entries must be objects. Invalid ordinary token settings produce an error when read, even if the active model has a valid override. Only omitted ordinary values use built-in defaults. `enabled` remains global, not model-specific.
458
458
 
@@ -35,7 +35,7 @@ Plain Docker provides the simplest whole-process container boundary.
35
35
  Create `Dockerfile.draht`:
36
36
 
37
37
  ```dockerfile
38
- FROM node:24-bookworm-slim
38
+ FROM node:24.22.1-bookworm-slim
39
39
 
40
40
  RUN apt-get update \
41
41
  && apt-get install -y --no-install-recommends bash ca-certificates git ripgrep \
@@ -29,7 +29,59 @@ Prefer a complete provider for new integrations that own more than static endpoi
29
29
 
30
30
  Registering only `baseUrl` or `headers` for an existing provider preserves its built-in models. Supplying `models` in the legacy form replaces that provider's models across chat, image, and classifier operations. An omitted `type` means `"chat"`; image and classifier models require explicit discriminants and implementations keyed by their `api` values through the `images` and `classifiers` fields.
31
31
 
32
- For example, a mixed-operation provider can register non-chat models and their implementations together:
32
+ ### Redirect an existing provider
33
+
34
+ Register only the fields that should change. This keeps the provider's built-in catalog, authentication, API implementation, and compatibility settings:
35
+
36
+ ```typescript
37
+ import type { ExtensionAPI } from "@draht/coding-agent";
38
+
39
+ export default function (pi: ExtensionAPI) {
40
+ pi.registerProvider("anthropic", {
41
+ baseUrl: "https://gateway.example.com/anthropic",
42
+ headers: {
43
+ "X-Gateway-Key": "$GATEWAY_API_KEY",
44
+ },
45
+ });
46
+ }
47
+ ```
48
+
49
+ Use this form for a proxy or gateway that preserves the upstream protocol. Do not copy the built-in model list into the extension because doing so turns a small endpoint override into a catalog replacement that can drift.
50
+
51
+ ### Register a compatible endpoint
52
+
53
+ When a service implements a supported protocol but has its own model catalog, register the endpoint and only the models the service actually exposes:
54
+
55
+ ```typescript
56
+ import type { ExtensionAPI } from "@draht/coding-agent";
57
+
58
+ export default function (pi: ExtensionAPI) {
59
+ pi.registerProvider("acme", {
60
+ name: "Acme AI",
61
+ baseUrl: "https://api.acme.example/v1",
62
+ apiKey: "$ACME_API_KEY",
63
+ api: "openai-completions",
64
+ models: [
65
+ {
66
+ type: "chat",
67
+ id: "acme-chat",
68
+ name: "Acme Chat",
69
+ reasoning: false,
70
+ input: ["text"],
71
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
72
+ contextWindow: 128000,
73
+ maxTokens: 8192,
74
+ },
75
+ ],
76
+ });
77
+ }
78
+ ```
79
+
80
+ Prefer `models.json` for this case when no executable extension behavior is needed. Use an extension when registration depends on runtime discovery, custom authentication, or code shared with other extension features.
81
+
82
+ ### Register mixed-operation models
83
+
84
+ A mixed-operation provider can register non-chat models and their implementations together:
33
85
 
34
86
  ```typescript
35
87
  pi.registerProvider("media-tools", {
package/docs/docs.json CHANGED
@@ -59,6 +59,10 @@
59
59
  "title": "Run Local Models",
60
60
  "path": "llama-cpp.md"
61
61
  },
62
+ {
63
+ "title": "Run Local Models on NVIDIA RTX",
64
+ "path": "nvidia-rtx-llama-cpp.md"
65
+ },
62
66
  {
63
67
  "title": "Configure Your Terminal",
64
68
  "path": "terminal-setup.md"
@@ -136,6 +140,10 @@
136
140
  {
137
141
  "title": "Use the SDK",
138
142
  "path": "sdk.md"
143
+ },
144
+ {
145
+ "title": "Benchmark Prompts with Drahtbank",
146
+ "path": "drahtbank.md"
139
147
  }
140
148
  ]
141
149
  }
@@ -148,6 +156,10 @@
148
156
  "title": "CLI",
149
157
  "path": "cli.md"
150
158
  },
159
+ {
160
+ "title": "Codemode",
161
+ "path": "codemode.md"
162
+ },
151
163
  {
152
164
  "title": "Slash Commands",
153
165
  "path": "slash-commands.md"
@@ -156,6 +168,10 @@
156
168
  "title": "Settings",
157
169
  "path": "settings.md"
158
170
  },
171
+ {
172
+ "title": "Models Configuration",
173
+ "path": "models-configuration.md"
174
+ },
159
175
  {
160
176
  "title": "Environment Variables",
161
177
  "path": "environment-variables.md"
@@ -165,7 +181,7 @@
165
181
  "path": "keybindings.md"
166
182
  },
167
183
  {
168
- "title": "Provider Authentication",
184
+ "title": "Providers",
169
185
  "path": "providers.md"
170
186
  },
171
187
  {
@@ -0,0 +1,163 @@
1
+ # Drahtbank
2
+
3
+ Drahtbank compares Draht prompt snapshots on small, repeatable tasks. It runs baseline and candidate prompts against the same cases, grades their results independently, and records quality and resource use separately.
4
+
5
+ The first suite covers ten cases: a feature, a regression with a meaningful test, a multi-file CLI change, documentation-only work, an unavailable required check, read-only diagnosis, defective and clean code reviews, and vulnerable and protected security reviews. The default prompts are the implementer, debugger, reviewer, and security-auditor agents in `coding-agent`. Select the Claude or Codex package to compare their prompt assets on the same runner.
6
+
7
+ ## Run a comparison
8
+
9
+ From a Draht source checkout:
10
+
11
+ ```sh
12
+ npm run drahtbank -- list
13
+ npm run drahtbank -- prepare /tmp/drahtbank-run \
14
+ --baseline HEAD \
15
+ --hosts coding-agent,draht-claude,draht-codex \
16
+ --repeats 3
17
+ ```
18
+
19
+ This prepares 180 trials: ten cases, three prompt packages, two variants, and three repetitions. The baseline comes from the resolved Git commit; the candidate comes from the current worktree, including uncommitted prompt edits. `--candidate <ref>` selects a committed candidate instead. Preparation snapshots the exact prompts, UTF-8 byte sizes, SHA-256 digests, task briefs, and suite identity. Execution does not reread the working-tree prompts.
20
+
21
+ Use `--cases feature,regression` for a smaller run. `--repo <path>` selects the Draht source checkout. `--prompt <repository-relative-file>` applies a chosen agent, command, or skill file to all selected cases; choose cases whose tasks suit that prompt. This loads the file's text, not its referenced resources or a complete command chain.
22
+
23
+ Create an adapter configuration outside the trial workspaces:
24
+
25
+ ```json
26
+ {
27
+ "format": "draht-jsonl",
28
+ "command": ["draht"],
29
+ "provider": "<provider-id>",
30
+ "model": "<model-id>",
31
+ "settings": { "thinking": "high" },
32
+ "timeoutMs": 300000
33
+ }
34
+ ```
35
+
36
+ Replace the provider and model placeholders with IDs available in your Draht installation. Use an absolute executable path, or an argv array such as `["node", "/absolute/path/to/cli.js"]`, when the executable is not on `PATH`. Relative script arguments resolve inside each fixture. `thinking` is the only native adapter setting; unsupported settings fail before execution. The native runtime must expose Drahtbank's tool-operations compatibility marker, covering confined grep execution and read-path resolution; the shipped extension rejects older runtimes at startup.
37
+
38
+ Execution and acceptance grading now require Linux user, mount, PID, network and IPC namespaces, plus the local `unshare`, `mount`, `chroot`, `setpriv`, `bash`, Node, ripgrep and fd executables. A real filesystem preflight runs before the adapter starts. Missing tools or unavailable confinement stop execution; there is no unconfined fallback. Fixtures must use fresh files: hardlinked inputs and preexisting sockets or devices are rejected. Preparation and report inspection remain available without these prerequisites.
39
+
40
+ ```sh
41
+ npm run drahtbank -- run /tmp/drahtbank-run --adapter /tmp/drahtbank-adapter.json
42
+ npm run drahtbank -- report /tmp/drahtbank-run
43
+ npm run drahtbank -- grade /tmp/drahtbank-run --json
44
+ ```
45
+
46
+ An installed `@draht/coding-agent` also exposes the `drahtbank` binary. Preparation still requires a source checkout containing the chosen prompt assets and baseline history.
47
+
48
+ `run` invokes the configured model and can incur its usual usage charges. Preparation, grading, reporting, and the benchmark's fixture tests make no model API calls. There is no automatic model fallback. Each trial starts a fresh process; baseline/candidate order alternates across cases and repetitions. Run and grade exit nonzero if any trial fails. A correct blocked outcome on the deliberately failed verification case counts as a passed benchmark case.
49
+
50
+ ## What is measured
51
+
52
+ A trial passes only when all four conditions hold:
53
+
54
+ - The runner finishes without a process, timeout, stream, or adapter error.
55
+ - Independent assertions pass for the resulting behavior or the case's explicit review rubric.
56
+ - The response ends with one appropriate `STATUS:` line.
57
+ - Changes stay within the declared scope and leave protected files intact.
58
+
59
+ Cases disclose allowed edits, new files, and the common STATUS output format in their task briefs. The common format keeps older prompts without a STATUS section comparable; it does not specify the expected outcome for a case. The grader checks actual CLI execution, protected-file contents, and required artifacts. The regression case runs the added test against the corrected implementation and against two broken implementations, so a test that always passes fails grading. Review and documentation cases use narrow text assertions with clean controls. These are useful regression signals, not general semantic judges; inspect individual failures for phrasing-related false negatives.
60
+
61
+ Every workspace must still equal its original fixture before execution. Finished executions record a workspace digest and raw-output hashes, so later edits or background writes cannot earn credit using the original run's telemetry. Existing execution records cannot be overwritten; use a new output directory for another run. Snapshot changes, missing files, unsupported file types, early process exits before grading completes, invalid runner output, and timeouts fail closed. Grading has a ten-second process limit; runners default to five minutes per trial, configurable up to one hour. Runner and command output are bounded at 10 MiB; the private filesystem transport allows the additional base64 encoding overhead.
62
+
63
+ Reports include pass counts, paired regressions and improvements, prompt bytes, elapsed time, token usage, tool calls, and cost where available. Missing telemetry is `null`, never an inferred zero. Metric summaries show how many observations contributed. Elapsed time includes process startup and tool execution. Prompt bytes count UTF-8 assets across trials and are not tokenizer counts. Native `costUsd` comes from Draht's usage cost estimate, not a billing record.
64
+
65
+ The native adapter reads completed assistant messages and tool events from Draht JSONL output. It excludes repeated message snapshots and rejects truncated streams or a final assistant error even if the CLI exits zero. Reported reproduction commands in final text are rubric evidence, not proof that the agent executed them; raw traces remain available for inspection.
66
+
67
+ ## Other runners
68
+
69
+ A provider-neutral adapter can wrap another agent CLI or evaluation harness:
70
+
71
+ ```json
72
+ {
73
+ "format": "json",
74
+ "command": ["node", "/absolute/path/to/my-adapter.mjs"],
75
+ "provider": "my-provider",
76
+ "model": "my-model",
77
+ "settings": {},
78
+ "timeoutMs": 300000
79
+ }
80
+ ```
81
+
82
+ Drahtbank executes argv directly without an implicit shell, sets the fixture as the working directory, and sends one JSON object on stdin containing `workspace`, `promptFile`, `taskFile`, `prompt`, `task`, `provider`, and `model`/`settings`. Standalone argv placeholders `{workspace}`, `{prompt}`, and `{task}` expand to their paths. The adapter must apply the supplied prompt and task to a fresh session and respect the requested model/settings.
83
+
84
+ Write a single JSON object to stdout; send diagnostics to stderr:
85
+
86
+ ```json
87
+ {
88
+ "finalText": "Implemented and checked the requested change.\nSTATUS: DONE",
89
+ "usage": {
90
+ "inputTokens": 1200,
91
+ "outputTokens": 300,
92
+ "cacheReadTokens": 0,
93
+ "cacheWriteTokens": 0,
94
+ "costUsd": 0.01
95
+ },
96
+ "toolCalls": 4
97
+ }
98
+ ```
99
+
100
+ The numbers above only illustrate the protocol. Omit unavailable metrics or set them to `null`. An optional `error` string records an adapter/model failure. Generic telemetry is labeled `adapter-reported`; the runner cannot independently verify that adapter's usage or model selection. Do not derive token totals from prompt bytes or final-response word counts.
101
+
102
+ ## Artifacts and limits
103
+
104
+ Each bank contains `manifest.json`, isolated `workspaces/<trial-id>/`, `control/<trial-id>/` with prompt/task snapshots, stdout/stderr, and execution records, plus `report.json`. Control files stay outside the model's assigned workspace. The recorded suite hash prevents grading old fixtures with changed case definitions. Keep the bank directory and matching benchmark source when retaining evidence.
105
+
106
+ This benchmarks supplied prompt text on one selected runner. It does not validate installed Claude/Codex skill activation, plugin hooks, delegation chains, or provider parity. The native adapter disables context-file, skill, prompt-template, and extension discovery and disables builtin tools. It explicitly loads only Drahtbank's tool extension, which registers the same seven native tool definitions with confined operations. Global native configuration and the host's base system prompt can still affect both variants; use a controlled installation and record its CLI version and configuration with published results. Authentication remains the runner's responsibility.
107
+
108
+ Runner processes clear inherited Git repository-path overrides and Git configuration injection variables, then set `GIT_CEILING_DIRECTORIES` to the fixture's physical parent. Git stops before entering that parent; a ceiling equal to the initial working directory would be ignored. Execution evidence records this policy without saving inherited environment values. Generic runner commands still use the current user's permissions and must provide their own tool isolation.
109
+
110
+ Native tool operations execute in a fresh filesystem root containing the fixture at its original absolute path, declared readonly runtime directories, and minimal device files. The fixture is the only writable data directory. Host home, temporary directories, credentials, bank manifests, control files, other trials, host processes and host Unix sockets are not mounted. Child commands receive a fixed environment, empty network and IPC namespaces, no capabilities, and `no_new_privs`. Symlink targets outside this root cannot expose or modify host files. Every worker gets its own PID namespace; its descendants die with its namespace leader. Shell commands can read the declared runtime files. Direct filesystem operations require fixture paths, except for reading explicitly retained shell-output captures. This minimal runtime has no `/dev/fd`, so shell process substitution is unavailable.
111
+
112
+ The provider process remains outside this boundary so authentication and inference can work. Its trusted implementation, extension loading and output capture are part of the harness, not model tools. Truncated shell output is copied into a harness-owned readonly mount at `/.drahtbank/artifacts`; returned paths point there so the native read tool can retrieve the full capture without exposing host temporary files. Native grades require an isolation readiness event before agent execution, including the runtime compatibility marker and worker digest. This records the trusted extension's startup checks, not independent attestation of an arbitrary adapter executable. The independent acceptance process uses the same confinement because importing model-produced code can itself execute filesystem operations. Temporary grader files use the fixture and must be removed before the final snapshot check.
113
+
114
+ This enforces the filesystem and process boundary, not per-file task permissions inside the fixture. Final-file checks and trace review still detect protected-file changes and unauthorized new files; temporary in-fixture changes can require audit. CPU, memory and disk quotas are not implemented. The outer provider process retains the existing timeout and output bounds. Unsupported operating systems fail closed for execution and acceptance grading.
115
+
116
+ Use repeated paired runs with fixed model/settings and inspect both quality and resource use. External model nondeterminism, shared machine load, and provider cache state are not controlled. A smaller prompt or a few passing fixtures does not establish improved model quality, statistically meaningful equivalence, or lower latency. The earlier five-case pilot remains separate historical evidence in `docs/frontier-prompt-evaluation.json`; it is not imported as a Drahtbank run.
117
+
118
+ ## Suite 2: multiple variants and separate outcomes
119
+
120
+ Suite 1 remains available with its original case digest. Suite 2 adds ten screening cases and six separate holdout cases. Its digest includes the case definitions, response grader, bank implementation, adapter parser, isolation helper, worker and tool extension. Prepare a fresh bank after changing those sources. Keep the matching original runner and grader when reproducing earlier results: confinement changes the execution environment even when a case's task is unchanged.
121
+
122
+ Create a variants JSON file outside the fixtures:
123
+
124
+ ```json
125
+ [
126
+ { "id": "verbose", "ref": "<original-commit>" },
127
+ { "id": "pruning", "ref": "<pruning-commit>" },
128
+ { "id": "frontier", "ref": "<frontier-commit>" },
129
+ { "id": "hybrid", "ref": null }
130
+ ]
131
+ ```
132
+
133
+ References resolve to commits at preparation; `null` snapshots the current worktree. Each trial records its prompt source, bytes, and hash. Variant order rotates across cases and repetitions; `--order-offset` rotates the starting position across model banks. Four repetitions balance each position for a four-variant case.
134
+
135
+ ```sh
136
+ npm run drahtbank -- list --suite 2 --json
137
+ npm run drahtbank -- prepare /tmp/drahtbank-screen \
138
+ --suite 2 --split screen --variants /tmp/variants.json \
139
+ --hosts coding-agent --repeats 1
140
+ npm run drahtbank -- run /tmp/drahtbank-screen --adapter /tmp/go-adapter.json
141
+ ```
142
+
143
+ The existing native adapter accepts `provider: "opencode-go"` and any registered model ID. Check access, tool calling, and supported thinking settings before a broad run. Use the same runtime and permissions across variants. Provider or quota failures are execution outcomes, not evidence of poor prompt quality; retain them and never silently switch models.
144
+
145
+ Suite 2 reports these axes independently:
146
+
147
+ - Behavioral acceptance from executable assertions. It is unknown when scope violations or unavailable isolation prevent the grader from running. Isolation startup failures are infrastructure errors, not invented scope violations. For read-only cases, these assertions also check that the original fixture remains intact; they do not establish a correct diagnosis or review by themselves.
148
+ - Actual verification from the latest completed recognized invocation of each required command, using native tool-start/tool-end records, exit codes and outputs after the final observed direct edit. Literal quoting, escaping and whitespace, equivalent script paths within the fixture, and a literal `cd <workspace> && <check>` prefix are supported. Environment expansion, pipelines, redirects, arbitrary wrappers, extra commands and exit-masking chains remain unverified. An earlier success cannot hide a later failure or missing output. Overlapping attempts of the same command require audit; denied commands do not count as execution. Final prose does not prove execution. Generic adapters have unknown verification evidence.
149
+ - Output format, terminal-marker syntax, and case-specific status outcomes. `DONE` means a requested read-only review or diagnosis is complete with required evidence, including when it finds defects. `DONE_WITH_CONCERNS` permits nonblocking concerns or optional verification gaps. An observed failed required check requires `BLOCKED` until a later successful recognized rerun after the final edit; editing alone does not resolve the failure. Triage retains its separate marker contract.
150
+ - Structured verdicts, observable facts, and valid source citations. The response instructions define conditional mappings: reviews use `findings` or `clear`, diagnoses use `diagnosis`, and triage uses its specified classification mapping. These replace keyword searches in prose without disclosing which review outcome is correct. Supplied probes and explicitly supplied classifications measure fixture compliance, not autonomous discovery. Explanations and additional claims still need blinded semantic review.
151
+ - Final-file scope and observed direct write/edit violations. Opaque shell effects inside the fixture can still require audit. Native filesystem confinement prevents outside operations rather than inferring their absence from final files. Generic runner tools have no such guarantee.
152
+
153
+ Strict pass combines these checks for regression use. Use the separate axes when interpreting model quality. The unavailable-check case explicitly asks every variant to preserve completed work and report verification as blocked, so it no longer silently grades one branch's rollback policy against another.
154
+
155
+ The UTF-8 case explicitly requires preserving a leading U+FEFF, matching the original Buffer decoding behavior. Both its public check and independent assertions cover a byte-order mark split across chunks. Earlier frozen Suite 2 runs did not include this compatibility requirement: any later BOM probe is supplementary evidence, not a correction to their raw score.
156
+
157
+ These clarified verdict/status contracts, latest-check handling, and BOM assertions change the suite hash. Retain the matching source and original grades for earlier runs; prepare a new bank for this revision. The triage terminal parser rejects trailing content and competing markers, but does not inspect the preceding prose for tracker links or unsupported posting claims. Those claims remain part of semantic audit, not a demonstrated posting safeguard.
158
+
159
+ The advisor and triage cases load their corresponding skill/command text. The native advisor case uses canonical `skills/model-tiering/SKILL.md`, which is not shipped as a native package skill; its trial is labeled `canonical-skill`. This is a text comparison, not evidence of native activation. Shorter discovery descriptions are measured separately; their activation behavior is not exercised with discovery disabled.
160
+
161
+ Freeze prompt variants and both case splits before screening. Use `--split holdout` for subsequent repetitions, and retain weaker models as well as stronger ones. A case is held out from model-driven tuning, not hidden from the repository. Do not tune prompts after seeing holdout results and report the same cases as unseen evidence.
162
+
163
+ Configured completion checks have a separate offline runtime evaluation in `eval/drahtbank/runtime-checks.mjs`. It replays existing native faux-provider lifecycle tests, the shared configured-check runner tests, and both plugin Stop script tests, recording raw output, named proofs, source hashes and runtime identity. It measures enforcement behavior independently from paid model trials; installed host hook delivery and live-model repair ability remain outside that lane.
@@ -6,7 +6,7 @@ draht uses environment variables in three ways:
6
6
  - draht sets process markers so child processes can identify draht as the launching agent.
7
7
  - Commands run by the LLM-callable shell tools receive `DRAHT_*` variables describing the current session.
8
8
 
9
- Provider API-key variables are documented separately in [Provider Authentication](providers.md#use-an-api-key-from-the-environment).
9
+ Provider API-key variables are documented separately in [Providers](providers.md#use-an-api-key-from-the-environment).
10
10
 
11
11
  ## Process Marker
12
12
 
@@ -97,6 +97,7 @@ These variables are read by draht itself:
97
97
  | `DRAHT_SKIP_VERSION_CHECK` | Disable the latest-version request to the npm registry entry for `@draht/coding-agent` |
98
98
  | `DRAHT_MODEL_CATALOG_BASE_URL` | Enable the remote model catalog overlay from a self-hosted endpoint; the overlay is off when unset |
99
99
  | `DRAHT_TELEMETRY` | Override provider attribution headers (OpenRouter, NVIDIA NIM, Cloudflare): `1`/`true`/`yes` or `0`/`false`/`no` |
100
+ | `DRAHT_CODEMODE_MAX_WORKERS` | Maximum codemode workers alive at once across all sessions in the process; default `2`. Each worker's script may use up to 256 MB. Raise it when one process runs several sessions, such as in-process subagents. Further scripts wait for a free worker. See [Codemode](codemode.md) |
100
101
  | `DRAHT_CACHE_RETENTION` | Set to `long` for extended provider prompt caching where supported |
101
102
  | `DRAHT_SHARE_VIEWER_URL` | Base URL of a share viewer for `/share`; when unset, `/share` prints the gist URL |
102
103
  | `DRAHT_RADIUS_GATEWAY` | Not consulted by the builtin Radius model provider (which always uses `https://radius.pi.dev`, or a per-provider `baseUrl` from provider config) or by `/bug`; currently has no effect on behavior |
@@ -104,11 +105,13 @@ These variables are read by draht itself:
104
105
  | `DRAHT_PERMISSION_MODE` | Initial permission mode of the session: `ask`, `auto` (when unset or blank), or `yolo`, in any letter case; any other value, the old name `default` included, starts the session in `ask` with a warning. `/permissions`, `/yolo`, and [`app.permissions.cycle`](keybindings.md#models-and-thinking) change it afterwards; a mode chosen that way outlasts `/new`, `/resume`, `/fork`, and `/reload` when it asks more than the starting mode. A session the gateway starts or resumes receives the gateway daemon's value, except `yolo`, which crosses only when the daemon's `DRAHT_RESUME_ENV_ALLOW` lists the variable. Polyphase children receive the session's current mode in this variable; see [Orchestrate Agents with Polyphase](polyphase.md#permissions) |
105
106
  | `DRAHT_NO_ATTACHABLE` | Set to `1`/`true`/`yes` to stop sessions from registering an attach socket; overridden by `--attachable` |
106
107
  | `DRAHT_HARDWARE_CURSOR` | Set to `1` to show the hardware cursor; see [Terminal setup](terminal-setup.md) |
108
+ | `DRAHT_CLIPBOARD_OSC52` | Set to `1` to also send copied text to the terminal with OSC 52 after the local clipboard write, as draht does over SSH. Use it when a remote client reaches draht without SSH variables, such as a multiplexer attached from another machine or a remote IDE daemon |
107
109
  | `DRAHT_HYPERLINKS` | Override OSC 8 hyperlink detection with `1`, `0`, or `auto` |
110
+ | `DRAHT_PROGRAM_STATUS` | Override OSC 7501 program status detection: `1` always reports, `0` never reports; otherwise draht reports only after the terminal confirms support. See [Terminal setup](terminal-setup.md#program-status) |
108
111
  | `DRAHT_IMAGE_PROTOCOL` | Override inline image detection with `kitty`, `iterm2`, `none`, or `auto` |
109
112
  | `DRAHT_TRUE_COLOR` | Override truecolor detection with `1`, `0`, or `auto` |
110
113
  | `DRAHT_TUI_ESC_TIMEOUT` | How long to wait after a lone ESC before treating it as Escape, in milliseconds; defaults to `100` over SSH and `10` otherwise. Increase if Alt-key input is misread as Escape |
111
114
  | `VISUAL`, `EDITOR` | External editor fallback when `externalEditor` is unset |
112
115
  | `HTTP_PROXY`, `HTTPS_PROXY` | Proxy outbound HTTP requests |
113
116
 
114
- Provider credentials such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and cloud-provider configuration are listed in [Provider Authentication](providers.md#use-an-api-key-from-the-environment).
117
+ Provider credentials such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and provider-specific configuration are listed in [Providers](providers.md#use-an-api-key-from-the-environment).