@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
package/docs/themes.md CHANGED
@@ -58,7 +58,7 @@ See [CLI resources](cli.md#resources) for the command-line option.
58
58
 
59
59
  ## Create a custom theme
60
60
 
61
- Copy one of the [built-in themes](https://github.com/draht-dev/draht/tree/main/packages/coding-agent/src/modes/interactive/theme) or create a new JSON file conforming to the [schema](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json). The built-in themes use OKHSL colors, with variables for colors that several roles share, so you can adjust a hue, saturation, or lightness directly.
61
+ Copy one of the [built-in themes](https://github.com/draht-dev/draht/tree/main/packages/coding-agent/src/modes/interactive/theme) or create a new JSON file conforming to the [schema](https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/schemas/theme.schema.json). The built-in themes use OKHSL colors, with variables for colors that several roles share, so you can adjust a hue, saturation, or lightness directly.
62
62
 
63
63
  1. Save the file as `<agent-dir>/themes/my-theme.json`. The agent directory defaults to `~/.draht/agent`.
64
64
  2. Set its `name` to `my-theme`.
@@ -78,6 +78,8 @@ Use the theme name as the filename. draht hot-reloads the active user theme only
78
78
  | `colors` | Yes | Assigns colors to terminal UI roles. The schema identifies required and optional roles. |
79
79
  | `export` | No | Overrides page and panel backgrounds in HTML exports. |
80
80
 
81
+ Theme objects are strict: only documented top-level fields and color tokens are accepted. Define reusable custom colors under `vars`; custom keys under `colors` or `export` and additional top-level metadata are rejected.
82
+
81
83
  A color can be written in six forms:
82
84
 
83
85
  | Form | Example | Meaning |
@@ -93,7 +95,7 @@ Terminal default colors render as the terminal's own colors. Where draht needs a
93
95
 
94
96
  draht resolves chained variable references. A missing variable or circular reference makes the theme invalid. draht uses truecolor when available, gamut-maps OKLCH to sRGB, and approximates colors for 256-color terminals. HTML exports convert OKHSL values to hexadecimal because CSS does not support them. If colors differ from their source values, check your terminal's truecolor detection and contrast settings. See [Configure Your Terminal](terminal-setup.md#override-detected-capabilities).
95
97
 
96
- Use the [theme JSON schema](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json) for the exact properties, required colors, and accepted value types.
98
+ Use the [theme JSON schema](https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/schemas/theme.schema.json) for the exact properties, required colors, and accepted value types.
97
99
 
98
100
  draht reports invalid theme files during startup and `/reload`.
99
101
 
package/docs/tui.md CHANGED
@@ -45,7 +45,7 @@ Prefer these components over rebuilding selection, scrolling, text editing, or w
45
45
 
46
46
  Use `matchesKey()` and `Key` for terminal keyboard input. The parser accounts for supported terminal protocols and key modifiers. Extension components should use the injected `KeybindingsManager` for configurable application actions.
47
47
 
48
- A component that displays a text cursor should implement `Focusable` and place `CURSOR_MARKER` immediately before its visual cursor. The TUI uses that marker to position the hardware cursor for input method editors. Some terminals only place IME candidate windows next to a visible hardware cursor; set `DRAHT_HARDWARE_CURSOR=1` (or the `showHardwareCursor` setting) to show it. The coding agent reads `DRAHT_HARDWARE_CURSOR` and `DRAHT_CLEAR_ON_SHRINK` and passes them to the TUI; `@draht/tui` itself does not read environment variables.
48
+ A component that displays a text cursor should implement `Focusable` and place `CURSOR_MARKER` immediately before its visual cursor. Wrap the cursor cell in `renderFakeCursor()` so the TUI draws it in reverse video, or hides it after `CURSOR_MARKER` when the hardware cursor is shown. The TUI uses the marker to position the hardware cursor for input method editors. Some terminals only place IME candidate windows next to a visible hardware cursor; set `DRAHT_HARDWARE_CURSOR=1` (or the `showHardwareCursor` setting) to show it. The coding agent reads `DRAHT_HARDWARE_CURSOR` and `DRAHT_CLEAR_ON_SHRINK` and passes them to the TUI; `@draht/tui` itself does not read environment variables.
49
49
 
50
50
  Containers that wrap an `Input` or `Editor` must propagate their `focused` state to that child. Without propagation, Chinese, Japanese, Korean, and other IME candidate windows can appear at the wrong screen position.
51
51
 
@@ -65,6 +65,76 @@ Regular mode leaves mouse input to the terminal because the terminal owns scroll
65
65
 
66
66
  `ctx.ui.custom()` temporarily gives one component control of the interactive area and resolves when that component calls the supplied completion callback.
67
67
 
68
+ ### Build a minimal custom screen
69
+
70
+ This complete extension shows the custom-component lifecycle: render within the supplied width, use injected keybindings, invalidate cached output after state changes, request a render, and finish through `done()`.
71
+
72
+ ```typescript
73
+ import type { ExtensionAPI } from "@draht/coding-agent";
74
+ import { truncateToWidth } from "@draht/tui";
75
+
76
+ export default function (pi: ExtensionAPI) {
77
+ pi.registerCommand("pick-target", {
78
+ description: "Pick a deployment target",
79
+ handler: async (_args, ctx) => {
80
+ if (ctx.mode !== "tui") {
81
+ ctx.ui.notify("pick-target requires interactive mode", "error");
82
+ return;
83
+ }
84
+
85
+ const choices = ["development", "staging", "production"];
86
+ const selected = await ctx.ui.custom<string | undefined>((tui, theme, keybindings, done) => {
87
+ let selectedIndex = 0;
88
+ let cachedWidth: number | undefined;
89
+ let cachedLines: string[] | undefined;
90
+
91
+ const invalidate = () => {
92
+ cachedWidth = undefined;
93
+ cachedLines = undefined;
94
+ };
95
+
96
+ return {
97
+ render(width: number): string[] {
98
+ if (cachedLines && cachedWidth === width) return cachedLines;
99
+
100
+ cachedWidth = width;
101
+ cachedLines = [
102
+ theme.fg("accent", "Choose a deployment target"),
103
+ ...choices.map((choice, index) => `${index === selectedIndex ? "> " : " "}${choice}`),
104
+ theme.fg("dim", "up/down move, enter selects, escape cancels"),
105
+ ].map((line) => truncateToWidth(line, width));
106
+ return cachedLines;
107
+ },
108
+ handleInput(data: string): void {
109
+ if (keybindings.matches(data, "tui.select.up")) {
110
+ selectedIndex = (selectedIndex - 1 + choices.length) % choices.length;
111
+ } else if (keybindings.matches(data, "tui.select.down")) {
112
+ selectedIndex = (selectedIndex + 1) % choices.length;
113
+ } else if (keybindings.matches(data, "tui.select.confirm")) {
114
+ done(choices[selectedIndex]);
115
+ return;
116
+ } else if (keybindings.matches(data, "tui.select.cancel")) {
117
+ done(undefined);
118
+ return;
119
+ } else {
120
+ return;
121
+ }
122
+
123
+ invalidate();
124
+ tui.requestRender();
125
+ },
126
+ invalidate,
127
+ };
128
+ });
129
+
130
+ if (selected) ctx.ui.notify(`Selected ${selected}`, "info");
131
+ },
132
+ });
133
+ }
134
+ ```
135
+
136
+ This component does not display a text cursor, so it does not need `Focusable`. A component containing `Input` or `Editor` must implement `Focusable` and propagate its `focused` value to that child.
137
+
68
138
  Pass `overlay: true` to draw above existing content. Overlay options control size, anchors, offsets, margins, and responsive visibility. An overlay handle can change focus or temporarily hide and show the overlay with `setHidden()` while the interaction remains active.
69
139
 
70
140
  Focused overlays retain input ownership across ordinary renders. If another component should receive input while an overlay remains visible, explicitly release or redirect focus through the handle.
package/docs/usage.md CHANGED
@@ -83,7 +83,7 @@ Use `/share` to upload the session as a private GitHub gist through the GitHub C
83
83
 
84
84
  ## Adjust the terminal
85
85
 
86
- Regular mode uses the terminal's normal scrollback. Fullscreen mode keeps the editor and status area fixed while the transcript scrolls within the terminal window. Choose a mode through `/settings` or `--tui-mode`.
86
+ Fullscreen mode, the default, keeps the editor and status area fixed while the transcript scrolls within the terminal window. Regular mode uses the terminal's normal scrollback. Choose a mode through `/settings` or `--tui-mode`.
87
87
 
88
88
  Terminal support for mouse input, keyboard shortcuts, and inline images varies. See [Terminal Setup](terminal-setup.md) for platform-specific configuration and [Keybindings](keybindings.md) for every configurable shortcut. Run `/hotkeys` to inspect the shortcuts active in your current session.
89
89
 
package/docs/windows.md CHANGED
@@ -19,8 +19,9 @@ For most native Windows users, installing [Git for Windows](https://git-scm.com/
19
19
  draht resolves Bash in this order:
20
20
 
21
21
  1. `shellPath` from `~/.draht/agent/settings.json`
22
- 2. Git Bash under `Program Files` or `Program Files (x86)`
23
- 3. `bash.exe` on `PATH`, including Cygwin, MSYS2, or legacy WSL Bash
22
+ 2. Git Bash at `%ProgramFiles%\Git\bin\bash.exe`
23
+ 3. Git Bash at `%ProgramFiles(x86)%\Git\bin\bash.exe`
24
+ 4. `bash.exe` on `PATH`, including Cygwin, MSYS2, or legacy WSL Bash
24
25
 
25
26
  Start draht and enter this command to verify the shell:
26
27
 
@@ -34,6 +35,13 @@ If draht cannot find Bash, it reports the locations it checked. Install Git for
34
35
 
35
36
  The optional `powershell` tool runs commands through `pwsh.exe` when available, then falls back to Windows PowerShell. It starts PowerShell with `-NoProfile -NonInteractive -ExecutionPolicy Bypass`. Administrator-enforced execution policies can still take precedence.
36
37
 
38
+ PowerShell discovery checks these locations in order:
39
+
40
+ 1. `pwsh.exe` on `PATH`
41
+ 2. `%ProgramFiles%\PowerShell\7\pwsh.exe`
42
+ 3. `powershell.exe` on `PATH`
43
+ 4. `%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe`
44
+
37
45
  To replace the model-facing `bash` tool with `powershell`, add this to `~/.draht/agent/settings.json`:
38
46
 
39
47
  ```json
@@ -48,6 +56,12 @@ Restart draht, then ask it to run a harmless PowerShell command. The `!` and `!!
48
56
 
49
57
  See [Settings](settings.md#tools) for other tool combinations.
50
58
 
59
+ ## WSL
60
+
61
+ WSL path conversion on Windows and extra Git branch polling in WSL recognize `/mnt/<drive>`, not custom mount roots.
62
+
63
+ When using the legacy WSL `bash.exe` launcher from Windows, draht sends commands over stdin to avoid command-line quoting problems.
64
+
51
65
  ## Use a custom Bash executable
52
66
 
53
67
  Set `shellPath` when Bash is installed somewhere draht does not discover automatically:
@@ -0,0 +1,35 @@
1
+ export type RunnerFormat = "draht-jsonl" | "json";
2
+
3
+ export interface AdapterConfig {
4
+ format: RunnerFormat;
5
+ command: string[];
6
+ provider: string;
7
+ model: string;
8
+ settings: Record<string, string | number | boolean>;
9
+ timeoutMs?: number;
10
+ }
11
+
12
+ export interface InvocationPaths {
13
+ workspace: string;
14
+ promptFile: string;
15
+ taskFile: string;
16
+ prompt: string;
17
+ task: string;
18
+ }
19
+
20
+ export interface ParsedOutput {
21
+ finalText: string;
22
+ usage: {
23
+ inputTokens: number | null;
24
+ outputTokens: number | null;
25
+ cacheReadTokens: number | null;
26
+ cacheWriteTokens: number | null;
27
+ costUsd: number | null;
28
+ };
29
+ toolCalls: number | null;
30
+ telemetrySource: "draht-events" | "adapter-reported";
31
+ error: string | null;
32
+ }
33
+
34
+ export function buildInvocation(config: AdapterConfig, paths: InvocationPaths): { command: string[]; stdin: string };
35
+ export function parseOutput(format: RunnerFormat, stdout: string): ParsedOutput;
@@ -0,0 +1,192 @@
1
+ import { fileURLToPath } from "node:url";
2
+
3
+ // Adapters describe argv and parse output; the runner owns process limits and files.
4
+ const THINKING_LEVELS = new Set(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
5
+ const OWNED_FLAGS = new Set([
6
+ "--", "--mode", "--print", "-p", "--provider", "--model", "--models", "--thinking", "--api-key",
7
+ "--system-prompt", "--append-system-prompt", "--continue", "-c", "--resume", "-r", "--session", "--session-id",
8
+ "--session-dir", "--no-session", "--fork", "--attach", "--attachable", "--no-attachable", "--list-sessions",
9
+ "--extension", "-e", "--no-extensions", "-ne", "--skill", "--no-skills", "-ns", "--prompt-template",
10
+ "--no-prompt-templates", "-np", "--no-context-files", "-nc", "--context-root", "--approve", "-a",
11
+ "--no-approve", "-na", "--tools", "-t", "--exclude-tools", "-xt", "--no-tools", "-nt", "--no-builtin-tools",
12
+ "-nbt", "--theme", "--use-theme", "--no-themes", "--offline", "--help", "-h", "--version", "-v", "--export", "--list-models",
13
+ ]);
14
+ const METRICS = ["inputTokens", "outputTokens", "cacheReadTokens", "cacheWriteTokens", "costUsd"];
15
+
16
+ function object(value) {
17
+ return value !== null && typeof value === "object" && !Array.isArray(value);
18
+ }
19
+
20
+ function text(value, label) {
21
+ if (typeof value !== "string" || !value.trim() || value.includes("\0")) throw new Error(`${label} must be a nonempty string`);
22
+ return value;
23
+ }
24
+
25
+ function metric(value, label, integer = true) {
26
+ if (value === undefined || value === null) return null;
27
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0 || (integer && !Number.isSafeInteger(value))) {
28
+ throw new Error(`${label} must be a nonnegative ${integer ? "safe integer" : "finite number"} or null`);
29
+ }
30
+ return value;
31
+ }
32
+
33
+ function unknownUsage() {
34
+ return Object.fromEntries(METRICS.map((name) => [name, null]));
35
+ }
36
+
37
+ export function buildInvocation(config, paths) {
38
+ if (!Array.isArray(config.command) || !config.command.length) throw new Error("Runner command must be a nonempty argv array");
39
+ const command = config.command.map((arg) => text(arg, "Runner argument"));
40
+ text(config.provider, "Runner provider");
41
+ text(config.model, "Runner model");
42
+ if (!object(config.settings)) throw new Error("Runner settings must be an object");
43
+ for (const value of Object.values(config.settings)) {
44
+ if (!["string", "number", "boolean"].includes(typeof value) || (typeof value === "number" && !Number.isFinite(value))) {
45
+ throw new Error("Runner settings must contain only finite numbers, strings, or booleans");
46
+ }
47
+ }
48
+ for (const name of ["workspace", "promptFile", "taskFile"]) text(paths[name], name);
49
+ if (typeof paths.prompt !== "string" || typeof paths.task !== "string") throw new Error("Prompt and task must be strings");
50
+ if (config.format === "json") {
51
+ const replacements = new Map([["{workspace}", paths.workspace], ["{prompt}", paths.promptFile], ["{task}", paths.taskFile]]);
52
+ return {
53
+ command: command.map((arg) => {
54
+ if (replacements.has(arg)) return replacements.get(arg);
55
+ if (/\{(?:workspace|prompt|task)\}/.test(arg)) throw new Error("Runner placeholders must occupy a complete argument");
56
+ return arg;
57
+ }),
58
+ stdin: `${JSON.stringify({ ...paths, provider: config.provider, model: config.model, settings: config.settings })}\n`,
59
+ };
60
+ }
61
+ if (config.format !== "draht-jsonl") throw new Error(`Unsupported runner format: ${config.format}`);
62
+ for (const arg of command.slice(1)) {
63
+ if (OWNED_FLAGS.has(arg.split("=", 1)[0]) || arg.startsWith("@") || /\{(?:workspace|prompt|task)\}/.test(arg)) {
64
+ throw new Error(`Native runner argument is controlled by drahtbank: ${arg}`);
65
+ }
66
+ }
67
+ for (const name of Object.keys(config.settings)) {
68
+ if (name !== "thinking") throw new Error(`Unsupported native runner setting: ${name}`);
69
+ }
70
+ if (config.settings.thinking !== undefined && !THINKING_LEVELS.has(config.settings.thinking)) {
71
+ throw new Error("Invalid native thinking setting");
72
+ }
73
+ command.push(
74
+ "--mode", "json", "--print", "--no-session", "--no-attachable", "--no-context-files", "--no-skills",
75
+ "--no-prompt-templates", "--no-extensions", "--no-themes", "--no-approve", "--offline",
76
+ "--no-builtin-tools", "--extension", fileURLToPath(new URL("isolated-tools.ts", import.meta.url)),
77
+ "--tools", `read,${process.platform === "win32" ? "powershell" : "bash"},edit,write,grep,find,ls`,
78
+ "--provider", config.provider, "--model", config.model,
79
+ );
80
+ if (config.settings.thinking !== undefined) command.push("--thinking", config.settings.thinking);
81
+ command.push("--append-system-prompt", paths.promptFile, "--", `@${paths.taskFile}`);
82
+ return { command, stdin: "" };
83
+ }
84
+
85
+ function parseJson(stdout) {
86
+ const value = JSON.parse(stdout);
87
+ if (!object(value)) throw new Error("Adapter output must be a JSON object");
88
+ for (const key of Object.keys(value)) {
89
+ if (!["finalText", "usage", "toolCalls", "error"].includes(key)) throw new Error(`Unknown adapter output field: ${key}`);
90
+ }
91
+ if (value.error !== undefined && value.error !== null) text(value.error, "Adapter error");
92
+ if (typeof value.finalText !== "string" || (!value.error && !value.finalText.trim())) {
93
+ throw new Error("Adapter output requires finalText (nonempty unless an error is reported)");
94
+ }
95
+ const usage = unknownUsage();
96
+ if (value.usage !== undefined && value.usage !== null) {
97
+ if (!object(value.usage)) throw new Error("Adapter usage must be an object or null");
98
+ for (const name of Object.keys(value.usage)) {
99
+ if (!METRICS.includes(name)) throw new Error(`Unknown adapter usage field: ${name}`);
100
+ usage[name] = metric(value.usage[name], name, name !== "costUsd");
101
+ }
102
+ }
103
+ return { finalText: value.finalText, usage, toolCalls: metric(value.toolCalls, "toolCalls"), error: value.error ?? null };
104
+ }
105
+
106
+ function nativeUsage(value) {
107
+ if (value === undefined || value === null) return unknownUsage();
108
+ if (!object(value)) throw new Error("Assistant usage must be an object");
109
+ if (value.cost !== undefined && value.cost !== null && !object(value.cost)) throw new Error("Assistant cost must be an object");
110
+ return {
111
+ inputTokens: metric(value.input, "usage.input"),
112
+ outputTokens: metric(value.output, "usage.output"),
113
+ cacheReadTokens: metric(value.cacheRead, "usage.cacheRead"),
114
+ cacheWriteTokens: metric(value.cacheWrite, "usage.cacheWrite"),
115
+ costUsd: metric(value.cost?.total, "usage.cost.total", false),
116
+ };
117
+ }
118
+
119
+ function parseDraht(stdout) {
120
+ let finalText = "";
121
+ let terminalMessage;
122
+ let completed = false;
123
+ let incompleteAssistant = false;
124
+ let assistantCount = 0;
125
+ let toolCalls = 0;
126
+ const usage = Object.fromEntries(METRICS.map((name) => [name, 0]));
127
+ for (const line of stdout.split(/\r?\n/)) {
128
+ if (!line.trim()) continue;
129
+ const event = JSON.parse(line);
130
+ if (!object(event) || typeof event.type !== "string") throw new Error("Malformed Draht JSONL event");
131
+ if (event.type === "agent_start") {
132
+ completed = false;
133
+ terminalMessage = undefined;
134
+ finalText = "";
135
+ }
136
+ if (event.type === "agent_end") completed = true;
137
+ if ((event.type === "message_start" && event.message?.role === "assistant") || event.type === "message_update") {
138
+ incompleteAssistant = true;
139
+ completed = false;
140
+ }
141
+ if (event.type === "tool_execution_start") {
142
+ text(event.toolCallId, "Tool call ID");
143
+ text(event.toolName, "Tool name");
144
+ toolCalls++;
145
+ completed = false;
146
+ }
147
+ if (event.type === "message_update" && event.assistantMessageEvent?.type === "error") {
148
+ terminalMessage = event.assistantMessageEvent.error;
149
+ completed = false;
150
+ }
151
+ if (event.type !== "message_end") continue;
152
+ if (!object(event.message) || typeof event.message.role !== "string") throw new Error("Malformed message_end event");
153
+ if (event.message.role !== "assistant") continue;
154
+ terminalMessage = event.message;
155
+ completed = false;
156
+ incompleteAssistant = false;
157
+ assistantCount++;
158
+ if (!Array.isArray(terminalMessage.content)) throw new Error("Assistant content must be an array");
159
+ const parts = [];
160
+ for (const part of terminalMessage.content) {
161
+ if (!object(part) || typeof part.type !== "string") throw new Error("Malformed assistant content");
162
+ if (part.type === "text") {
163
+ if (typeof part.text !== "string") throw new Error("Assistant text must be a string");
164
+ parts.push(part.text);
165
+ }
166
+ }
167
+ finalText = parts.join("\n");
168
+ const measured = nativeUsage(terminalMessage.usage);
169
+ for (const name of METRICS) {
170
+ usage[name] = usage[name] === null || measured[name] === null ? null : metric(usage[name] + measured[name], name, name !== "costUsd");
171
+ }
172
+ }
173
+ let error = null;
174
+ if (terminalMessage?.stopReason === "error" || terminalMessage?.stopReason === "aborted") {
175
+ error = typeof terminalMessage.errorMessage === "string" && terminalMessage.errorMessage.trim()
176
+ ? terminalMessage.errorMessage : `Assistant ${terminalMessage.stopReason}`;
177
+ } else if (!completed || incompleteAssistant || !assistantCount || terminalMessage?.stopReason !== "stop" || !finalText.trim()) {
178
+ error = "Draht output has no completed final assistant text";
179
+ }
180
+ return { finalText, usage: assistantCount && !incompleteAssistant ? usage : unknownUsage(), toolCalls: assistantCount ? toolCalls : null, error };
181
+ }
182
+
183
+ export function parseOutput(format, stdout) {
184
+ const telemetrySource = format === "draht-jsonl" ? "draht-events" : "adapter-reported";
185
+ try {
186
+ if (typeof stdout !== "string") throw new Error("Runner stdout must be a string");
187
+ if (format !== "draht-jsonl" && format !== "json") throw new Error(`Unsupported runner format: ${format}`);
188
+ return { ...(format === "draht-jsonl" ? parseDraht(stdout) : parseJson(stdout)), telemetrySource };
189
+ } catch (error) {
190
+ return { finalText: "", usage: unknownUsage(), toolCalls: null, telemetrySource, error: error instanceof Error ? error.message : String(error) };
191
+ }
192
+ }
@@ -0,0 +1,141 @@
1
+ export type Host = "coding-agent" | "draht-claude" | "draht-codex";
2
+ export interface PromptVariant { id: string; ref: string | null; }
3
+ export interface PrepareOptions {
4
+ root?: string;
5
+ baseline?: string;
6
+ candidate?: string;
7
+ hosts?: Host[];
8
+ cases?: string[];
9
+ repeats?: number;
10
+ prompt?: string;
11
+ suite?: "1" | "2";
12
+ split?: "screen" | "holdout" | "all";
13
+ variants?: PromptVariant[];
14
+ orderOffset?: number;
15
+ }
16
+ export interface Trial {
17
+ id: string;
18
+ host: Host;
19
+ caseId: string;
20
+ repetition: number;
21
+ variant: string;
22
+ promptCommit?: string | null;
23
+ promptSurface?: "canonical-skill" | "package-asset";
24
+ split?: "screen" | "holdout";
25
+ promptPath: string;
26
+ promptSha256: string;
27
+ promptBytes: number;
28
+ taskSha256: string;
29
+ initialWorkspaceSha256: string;
30
+ }
31
+ export interface Manifest {
32
+ schemaVersion: 1 | 2;
33
+ suiteVersion: string;
34
+ suiteSha256: string;
35
+ root: string;
36
+ baselineCommit: string;
37
+ candidateCommit: string | null;
38
+ hosts: Host[];
39
+ caseIds: string[];
40
+ repeats: number;
41
+ trials: Trial[];
42
+ variants?: PromptVariant[];
43
+ orderOffset?: number;
44
+ split?: "screen" | "holdout" | "all";
45
+ }
46
+ export interface Adapter {
47
+ format: "json" | "draht-jsonl";
48
+ command: string[];
49
+ provider: string;
50
+ model: string;
51
+ settings?: Record<string, string | number | boolean>;
52
+ timeoutMs?: number;
53
+ }
54
+ export interface ProcessResult {
55
+ exitCode: number | null;
56
+ signal: string | null;
57
+ error: string | null;
58
+ timedOut: boolean;
59
+ elapsedMs: number;
60
+ stdout: string;
61
+ stderr: string;
62
+ gitEnvironment: { policy: "fixture-ceiling-v1"; ceilingDirectory: string };
63
+ isolation?: unknown;
64
+ }
65
+ export interface Grade extends Trial {
66
+ passed: boolean;
67
+ executionPassed: boolean;
68
+ evidenceIntact: boolean;
69
+ acceptancePassed: boolean;
70
+ statusPassed: boolean;
71
+ status: string | null;
72
+ scopePassed: boolean;
73
+ scopeViolations: string[];
74
+ failure: string | null;
75
+ acceptance: ProcessResult | null;
76
+ elapsedMs: number | null;
77
+ usage: Record<string, number | null> | null;
78
+ toolCalls: number | null;
79
+ telemetrySource: string | null;
80
+ adapter: Adapter | null;
81
+ behaviorPassed?: boolean | null;
82
+ evidencePassed?: boolean | null;
83
+ statusSyntaxPassed?: boolean;
84
+ statusSemanticPassed?: boolean;
85
+ responseFormatPassed?: boolean;
86
+ findingsPassed?: boolean | null;
87
+ auditEligible?: boolean;
88
+ auditReasons?: string[];
89
+ identity?: { passed: boolean | null; observed: number; mismatches: unknown[]; note: string };
90
+ isolation?: { passed: boolean | null; note: string; receipt?: unknown };
91
+ }
92
+ export interface Metric { observed: number; total: number | null; median: number | null; }
93
+ export interface Pair { host: Host; caseId: string; repetition: number; baselinePassed: boolean; candidatePassed: boolean; elapsedDeltaMs: number | null; }
94
+ export interface PairSummary {
95
+ total: number;
96
+ bothPassed: number;
97
+ regressions: Pair[];
98
+ improvements: Pair[];
99
+ medianElapsedDeltaMsOnPairedPasses: number | null;
100
+ }
101
+ export interface AxisComparison extends PairSummary {
102
+ bothFailed: number;
103
+ unknownOrNotApplicable: number;
104
+ }
105
+ export interface VariantComparison {
106
+ baselineVariant: string;
107
+ candidateVariant: string;
108
+ matchedPairs: number;
109
+ unpairedBaseline: number;
110
+ unpairedCandidate: number;
111
+ strict: PairSummary;
112
+ axes: Record<string, AxisComparison>;
113
+ }
114
+ export interface Summary {
115
+ variants: Record<string, { passed: number; total: number; promptBytes: number; metrics: Record<string, Metric>; axes?: Record<string, {passed: number; failed: number; unknownOrNotApplicable: number}> }>;
116
+ paired: PairSummary;
117
+ comparisons: VariantComparison[];
118
+ comparableRunner: boolean;
119
+ limits: string[];
120
+ }
121
+ export interface Report {
122
+ schemaVersion: 1 | 2;
123
+ suiteVersion: string;
124
+ suiteSha256: string;
125
+ baselineCommit: string;
126
+ candidateCommit: string | null;
127
+ gradedAt: string;
128
+ gradingEnvironment: {node: string; platform: string; arch: string};
129
+ results: Grade[];
130
+ summary: Summary;
131
+ variants?: PromptVariant[];
132
+ split?: "screen" | "holdout" | "all";
133
+ }
134
+ export const HOSTS: Host[];
135
+ export function prepareBank(output: string, options?: PrepareOptions): Manifest;
136
+ export function readManifest(output: string): Manifest;
137
+ export function validateAdapter(config: unknown): Adapter & { settings: Record<string, string | number | boolean>; timeoutMs: number };
138
+ export function runProcess(command: string[], options: {cwd: string; timeoutMs: number; stdin?: string; env?: Record<string,string>}): Promise<ProcessResult>;
139
+ export function runBank(output: string, config: Adapter, onProgress?: (progress: { index: number; total: number; trial: Trial }) => void): Promise<Report>;
140
+ export function gradeBank(output: string): Promise<Report>;
141
+ export function summarize(results: Grade[], variantIds?: string[]): Summary;