@draht/coding-agent 2026.7.13 → 2026.9.5-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (614) hide show
  1. package/CHANGELOG.md +241 -0
  2. package/README.md +47 -2
  3. package/agents/debugger.md +12 -1
  4. package/agents/git-committer.md +1 -0
  5. package/agents/implementer.md +20 -0
  6. package/agents/investigator.md +75 -0
  7. package/agents/reviewer.md +7 -0
  8. package/agents/spec-reviewer.md +66 -0
  9. package/agents/verifier.md +4 -3
  10. package/bin/draht-tools.cjs +472 -41
  11. package/dist/agents/debugger.md +12 -1
  12. package/dist/agents/git-committer.md +1 -0
  13. package/dist/agents/implementer.md +20 -0
  14. package/dist/agents/investigator.md +75 -0
  15. package/dist/agents/reviewer.md +7 -0
  16. package/dist/agents/spec-reviewer.md +66 -0
  17. package/dist/agents/verifier.md +4 -3
  18. package/dist/bun/cli.js +2 -0
  19. package/dist/bun/cli.js.map +1 -1
  20. package/dist/cli/args.d.ts +10 -0
  21. package/dist/cli/args.d.ts.map +1 -1
  22. package/dist/cli/args.js +80 -3
  23. package/dist/cli/args.js.map +1 -1
  24. package/dist/cli/attach-mode.d.ts +61 -0
  25. package/dist/cli/attach-mode.d.ts.map +1 -1
  26. package/dist/cli/attach-mode.js +243 -5
  27. package/dist/cli/attach-mode.js.map +1 -1
  28. package/dist/cli/config-selector.js +1 -1
  29. package/dist/cli/config-selector.js.map +1 -1
  30. package/dist/cli/credential-print.d.ts +23 -0
  31. package/dist/cli/credential-print.d.ts.map +1 -0
  32. package/dist/cli/credential-print.js +117 -0
  33. package/dist/cli/credential-print.js.map +1 -0
  34. package/dist/cli/list-models.d.ts +2 -2
  35. package/dist/cli/list-models.d.ts.map +1 -1
  36. package/dist/cli/list-models.js +3 -3
  37. package/dist/cli/list-models.js.map +1 -1
  38. package/dist/cli/startup-ui.js +1 -1
  39. package/dist/cli/startup-ui.js.map +1 -1
  40. package/dist/config.d.ts +9 -0
  41. package/dist/config.d.ts.map +1 -1
  42. package/dist/config.js +31 -4
  43. package/dist/config.js.map +1 -1
  44. package/dist/core/agent-session-runtime.d.ts +17 -1
  45. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  46. package/dist/core/agent-session-runtime.js +90 -30
  47. package/dist/core/agent-session-runtime.js.map +1 -1
  48. package/dist/core/agent-session-services.d.ts +4 -7
  49. package/dist/core/agent-session-services.d.ts.map +1 -1
  50. package/dist/core/agent-session-services.js +24 -9
  51. package/dist/core/agent-session-services.js.map +1 -1
  52. package/dist/core/agent-session.d.ts +87 -27
  53. package/dist/core/agent-session.d.ts.map +1 -1
  54. package/dist/core/agent-session.js +337 -154
  55. package/dist/core/agent-session.js.map +1 -1
  56. package/dist/core/auth-storage.d.ts +20 -104
  57. package/dist/core/auth-storage.d.ts.map +1 -1
  58. package/dist/core/auth-storage.js +104 -260
  59. package/dist/core/auth-storage.js.map +1 -1
  60. package/dist/core/builtins/checkpoints.d.ts +20 -0
  61. package/dist/core/builtins/checkpoints.d.ts.map +1 -0
  62. package/dist/core/builtins/checkpoints.js +161 -0
  63. package/dist/core/builtins/checkpoints.js.map +1 -0
  64. package/dist/core/builtins/duet.d.ts +26 -0
  65. package/dist/core/builtins/duet.d.ts.map +1 -0
  66. package/dist/core/builtins/duet.js +660 -0
  67. package/dist/core/builtins/duet.js.map +1 -0
  68. package/dist/core/builtins/index.d.ts.map +1 -1
  69. package/dist/core/builtins/index.js +7 -1
  70. package/dist/core/builtins/index.js.map +1 -1
  71. package/dist/core/builtins/subagent.d.ts +24 -4
  72. package/dist/core/builtins/subagent.d.ts.map +1 -1
  73. package/dist/core/builtins/subagent.js +278 -35
  74. package/dist/core/builtins/subagent.js.map +1 -1
  75. package/dist/core/cache-stats.d.ts +2 -2
  76. package/dist/core/cache-stats.d.ts.map +1 -1
  77. package/dist/core/cache-stats.js +1 -1
  78. package/dist/core/cache-stats.js.map +1 -1
  79. package/dist/core/checkpoints/checkpoint-cli.d.ts +17 -0
  80. package/dist/core/checkpoints/checkpoint-cli.d.ts.map +1 -0
  81. package/dist/core/checkpoints/checkpoint-cli.js +78 -0
  82. package/dist/core/checkpoints/checkpoint-cli.js.map +1 -0
  83. package/dist/core/checkpoints/checkpoint-manager.d.ts +294 -0
  84. package/dist/core/checkpoints/checkpoint-manager.d.ts.map +1 -0
  85. package/dist/core/checkpoints/checkpoint-manager.js +865 -0
  86. package/dist/core/checkpoints/checkpoint-manager.js.map +1 -0
  87. package/dist/core/checkpoints/rewind.d.ts +141 -0
  88. package/dist/core/checkpoints/rewind.d.ts.map +1 -0
  89. package/dist/core/checkpoints/rewind.js +246 -0
  90. package/dist/core/checkpoints/rewind.js.map +1 -0
  91. package/dist/core/compaction/branch-summarization.d.ts +9 -3
  92. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  93. package/dist/core/compaction/branch-summarization.js +16 -14
  94. package/dist/core/compaction/branch-summarization.js.map +1 -1
  95. package/dist/core/compaction/compaction.d.ts +24 -3
  96. package/dist/core/compaction/compaction.d.ts.map +1 -1
  97. package/dist/core/compaction/compaction.js +96 -30
  98. package/dist/core/compaction/compaction.js.map +1 -1
  99. package/dist/core/compaction/utils.d.ts +1 -1
  100. package/dist/core/compaction/utils.d.ts.map +1 -1
  101. package/dist/core/compaction/utils.js +6 -17
  102. package/dist/core/compaction/utils.js.map +1 -1
  103. package/dist/core/context-windows.d.ts +7 -0
  104. package/dist/core/context-windows.d.ts.map +1 -0
  105. package/dist/core/context-windows.js +35 -0
  106. package/dist/core/context-windows.js.map +1 -0
  107. package/dist/core/extensions/index.d.ts +1 -1
  108. package/dist/core/extensions/index.d.ts.map +1 -1
  109. package/dist/core/extensions/index.js.map +1 -1
  110. package/dist/core/extensions/loader.d.ts.map +1 -1
  111. package/dist/core/extensions/loader.js +101 -23
  112. package/dist/core/extensions/loader.js.map +1 -1
  113. package/dist/core/extensions/runner.d.ts +19 -3
  114. package/dist/core/extensions/runner.d.ts.map +1 -1
  115. package/dist/core/extensions/runner.js +117 -2
  116. package/dist/core/extensions/runner.js.map +1 -1
  117. package/dist/core/extensions/types.d.ts +236 -9
  118. package/dist/core/extensions/types.d.ts.map +1 -1
  119. package/dist/core/extensions/types.js.map +1 -1
  120. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  121. package/dist/core/extensions/wrapper.js +22 -3
  122. package/dist/core/extensions/wrapper.js.map +1 -1
  123. package/dist/core/footer-data-provider.d.ts +10 -0
  124. package/dist/core/footer-data-provider.d.ts.map +1 -1
  125. package/dist/core/footer-data-provider.js +1 -1
  126. package/dist/core/footer-data-provider.js.map +1 -1
  127. package/dist/core/http-dispatcher.d.ts.map +1 -1
  128. package/dist/core/http-dispatcher.js +7 -0
  129. package/dist/core/http-dispatcher.js.map +1 -1
  130. package/dist/core/index.d.ts +1 -1
  131. package/dist/core/index.d.ts.map +1 -1
  132. package/dist/core/index.js.map +1 -1
  133. package/dist/core/keybindings.d.ts +18 -3
  134. package/dist/core/keybindings.d.ts.map +1 -1
  135. package/dist/core/keybindings.js +12 -3
  136. package/dist/core/keybindings.js.map +1 -1
  137. package/dist/core/model-config.d.ts +542 -0
  138. package/dist/core/model-config.d.ts.map +1 -0
  139. package/dist/core/model-config.js +247 -0
  140. package/dist/core/model-config.js.map +1 -0
  141. package/dist/core/model-registry.d.ts +19 -124
  142. package/dist/core/model-registry.d.ts.map +1 -1
  143. package/dist/core/model-registry.js +56 -727
  144. package/dist/core/model-registry.js.map +1 -1
  145. package/dist/core/model-resolver.d.ts +7 -6
  146. package/dist/core/model-resolver.d.ts.map +1 -1
  147. package/dist/core/model-resolver.js +74 -27
  148. package/dist/core/model-resolver.js.map +1 -1
  149. package/dist/core/model-runtime.d.ts +89 -0
  150. package/dist/core/model-runtime.d.ts.map +1 -0
  151. package/dist/core/model-runtime.js +451 -0
  152. package/dist/core/model-runtime.js.map +1 -0
  153. package/dist/core/models-store.d.ts +17 -0
  154. package/dist/core/models-store.d.ts.map +1 -0
  155. package/dist/core/models-store.js +46 -0
  156. package/dist/core/models-store.js.map +1 -0
  157. package/dist/core/multi-agent/permission-gate.d.ts.map +1 -1
  158. package/dist/core/multi-agent/permission-gate.js +4 -3
  159. package/dist/core/multi-agent/permission-gate.js.map +1 -1
  160. package/dist/core/multi-agent/worktree.d.ts +2 -0
  161. package/dist/core/multi-agent/worktree.d.ts.map +1 -1
  162. package/dist/core/multi-agent/worktree.js +2 -2
  163. package/dist/core/multi-agent/worktree.js.map +1 -1
  164. package/dist/core/package-manager.d.ts +7 -1
  165. package/dist/core/package-manager.d.ts.map +1 -1
  166. package/dist/core/package-manager.js +41 -45
  167. package/dist/core/package-manager.js.map +1 -1
  168. package/dist/core/permission-relay/index.d.ts +19 -0
  169. package/dist/core/permission-relay/index.d.ts.map +1 -0
  170. package/dist/core/permission-relay/index.js +49 -0
  171. package/dist/core/permission-relay/index.js.map +1 -0
  172. package/dist/core/permission-relay/relay-ui-context.d.ts +39 -0
  173. package/dist/core/permission-relay/relay-ui-context.d.ts.map +1 -0
  174. package/dist/core/permission-relay/relay-ui-context.js +788 -0
  175. package/dist/core/permission-relay/relay-ui-context.js.map +1 -0
  176. package/dist/core/permission-relay/types.d.ts +222 -0
  177. package/dist/core/permission-relay/types.d.ts.map +1 -0
  178. package/dist/core/permission-relay/types.js +15 -0
  179. package/dist/core/permission-relay/types.js.map +1 -0
  180. package/dist/core/pi-manifest.d.ts +14 -0
  181. package/dist/core/pi-manifest.d.ts.map +1 -0
  182. package/dist/core/pi-manifest.js +35 -0
  183. package/dist/core/pi-manifest.js.map +1 -0
  184. package/dist/core/project-trust.js +2 -2
  185. package/dist/core/project-trust.js.map +1 -1
  186. package/dist/core/prompt-templates.d.ts +1 -0
  187. package/dist/core/prompt-templates.d.ts.map +1 -1
  188. package/dist/core/prompt-templates.js +4 -4
  189. package/dist/core/prompt-templates.js.map +1 -1
  190. package/dist/core/provider-composer.d.ts +55 -0
  191. package/dist/core/provider-composer.d.ts.map +1 -0
  192. package/dist/core/provider-composer.js +375 -0
  193. package/dist/core/provider-composer.js.map +1 -0
  194. package/dist/core/radius.d.ts +2 -0
  195. package/dist/core/radius.d.ts.map +1 -0
  196. package/dist/core/radius.js +2 -0
  197. package/dist/core/radius.js.map +1 -0
  198. package/dist/core/remote-catalog-provider.d.ts +5 -0
  199. package/dist/core/remote-catalog-provider.d.ts.map +1 -0
  200. package/dist/core/remote-catalog-provider.js +115 -0
  201. package/dist/core/remote-catalog-provider.js.map +1 -0
  202. package/dist/core/resource-loader.d.ts +36 -0
  203. package/dist/core/resource-loader.d.ts.map +1 -1
  204. package/dist/core/resource-loader.js +159 -27
  205. package/dist/core/resource-loader.js.map +1 -1
  206. package/dist/core/runtime-credentials.d.ts +15 -0
  207. package/dist/core/runtime-credentials.d.ts.map +1 -0
  208. package/dist/core/runtime-credentials.js +35 -0
  209. package/dist/core/runtime-credentials.js.map +1 -0
  210. package/dist/core/sandbox/bash-operations.d.ts +149 -0
  211. package/dist/core/sandbox/bash-operations.d.ts.map +1 -0
  212. package/dist/core/sandbox/bash-operations.js +163 -0
  213. package/dist/core/sandbox/bash-operations.js.map +1 -0
  214. package/dist/core/sandbox/env.d.ts +83 -0
  215. package/dist/core/sandbox/env.d.ts.map +1 -0
  216. package/dist/core/sandbox/env.js +123 -0
  217. package/dist/core/sandbox/env.js.map +1 -0
  218. package/dist/core/sandbox/executor.d.ts +104 -0
  219. package/dist/core/sandbox/executor.d.ts.map +1 -0
  220. package/dist/core/sandbox/executor.js +92 -0
  221. package/dist/core/sandbox/executor.js.map +1 -0
  222. package/dist/core/sandbox/index.d.ts +36 -0
  223. package/dist/core/sandbox/index.d.ts.map +1 -0
  224. package/dist/core/sandbox/index.js +36 -0
  225. package/dist/core/sandbox/index.js.map +1 -0
  226. package/dist/core/sandbox/linux.d.ts +121 -0
  227. package/dist/core/sandbox/linux.d.ts.map +1 -0
  228. package/dist/core/sandbox/linux.js +260 -0
  229. package/dist/core/sandbox/linux.js.map +1 -0
  230. package/dist/core/sandbox/policy.d.ts +142 -0
  231. package/dist/core/sandbox/policy.d.ts.map +1 -0
  232. package/dist/core/sandbox/policy.js +297 -0
  233. package/dist/core/sandbox/policy.js.map +1 -0
  234. package/dist/core/sandbox/real-path.d.ts +112 -0
  235. package/dist/core/sandbox/real-path.d.ts.map +1 -0
  236. package/dist/core/sandbox/real-path.js +158 -0
  237. package/dist/core/sandbox/real-path.js.map +1 -0
  238. package/dist/core/sandbox/seatbelt-profile.d.ts +95 -0
  239. package/dist/core/sandbox/seatbelt-profile.d.ts.map +1 -0
  240. package/dist/core/sandbox/seatbelt-profile.js +239 -0
  241. package/dist/core/sandbox/seatbelt-profile.js.map +1 -0
  242. package/dist/core/sandbox/seatbelt.d.ts +95 -0
  243. package/dist/core/sandbox/seatbelt.d.ts.map +1 -0
  244. package/dist/core/sandbox/seatbelt.js +154 -0
  245. package/dist/core/sandbox/seatbelt.js.map +1 -0
  246. package/dist/core/sandbox/self-test.d.ts +109 -0
  247. package/dist/core/sandbox/self-test.d.ts.map +1 -0
  248. package/dist/core/sandbox/self-test.js +369 -0
  249. package/dist/core/sandbox/self-test.js.map +1 -0
  250. package/dist/core/sandbox/spawn.d.ts +33 -0
  251. package/dist/core/sandbox/spawn.d.ts.map +1 -0
  252. package/dist/core/sandbox/spawn.js +87 -0
  253. package/dist/core/sandbox/spawn.js.map +1 -0
  254. package/dist/core/sdk.d.ts +3 -6
  255. package/dist/core/sdk.d.ts.map +1 -1
  256. package/dist/core/sdk.js +25 -22
  257. package/dist/core/sdk.js.map +1 -1
  258. package/dist/core/session-manager.d.ts +74 -7
  259. package/dist/core/session-manager.d.ts.map +1 -1
  260. package/dist/core/session-manager.js +169 -34
  261. package/dist/core/session-manager.js.map +1 -1
  262. package/dist/core/settings-manager.d.ts +22 -1
  263. package/dist/core/settings-manager.d.ts.map +1 -1
  264. package/dist/core/settings-manager.js +36 -16
  265. package/dist/core/settings-manager.js.map +1 -1
  266. package/dist/core/skills.d.ts +3 -1
  267. package/dist/core/skills.d.ts.map +1 -1
  268. package/dist/core/skills.js +19 -6
  269. package/dist/core/skills.js.map +1 -1
  270. package/dist/core/slash-commands.d.ts.map +1 -1
  271. package/dist/core/slash-commands.js +1 -0
  272. package/dist/core/slash-commands.js.map +1 -1
  273. package/dist/core/soak/soak-log.d.ts +298 -0
  274. package/dist/core/soak/soak-log.d.ts.map +1 -0
  275. package/dist/core/soak/soak-log.js +660 -0
  276. package/dist/core/soak/soak-log.js.map +1 -0
  277. package/dist/core/soak/soak-reader.d.ts +60 -0
  278. package/dist/core/soak/soak-reader.d.ts.map +1 -0
  279. package/dist/core/soak/soak-reader.js +106 -0
  280. package/dist/core/soak/soak-reader.js.map +1 -0
  281. package/dist/core/socket-server/discovery.d.ts +78 -1
  282. package/dist/core/socket-server/discovery.d.ts.map +1 -1
  283. package/dist/core/socket-server/discovery.js +356 -37
  284. package/dist/core/socket-server/discovery.js.map +1 -1
  285. package/dist/core/socket-server/index.d.ts +10 -4
  286. package/dist/core/socket-server/index.d.ts.map +1 -1
  287. package/dist/core/socket-server/index.js +6 -3
  288. package/dist/core/socket-server/index.js.map +1 -1
  289. package/dist/core/socket-server/permission-delivery.d.ts +125 -0
  290. package/dist/core/socket-server/permission-delivery.d.ts.map +1 -0
  291. package/dist/core/socket-server/permission-delivery.js +152 -0
  292. package/dist/core/socket-server/permission-delivery.js.map +1 -0
  293. package/dist/core/socket-server/permission-registry.d.ts +301 -0
  294. package/dist/core/socket-server/permission-registry.d.ts.map +1 -0
  295. package/dist/core/socket-server/permission-registry.js +410 -0
  296. package/dist/core/socket-server/permission-registry.js.map +1 -0
  297. package/dist/core/socket-server/permission-relay.d.ts +81 -0
  298. package/dist/core/socket-server/permission-relay.d.ts.map +1 -0
  299. package/dist/core/socket-server/permission-relay.js +528 -0
  300. package/dist/core/socket-server/permission-relay.js.map +1 -0
  301. package/dist/core/socket-server/safe-text.d.ts +83 -0
  302. package/dist/core/socket-server/safe-text.d.ts.map +1 -0
  303. package/dist/core/socket-server/safe-text.js +277 -0
  304. package/dist/core/socket-server/safe-text.js.map +1 -0
  305. package/dist/core/socket-server/session-integration.d.ts +65 -2
  306. package/dist/core/socket-server/session-integration.d.ts.map +1 -1
  307. package/dist/core/socket-server/session-integration.js +434 -32
  308. package/dist/core/socket-server/session-integration.js.map +1 -1
  309. package/dist/core/socket-server/socket-client.d.ts +21 -2
  310. package/dist/core/socket-server/socket-client.d.ts.map +1 -1
  311. package/dist/core/socket-server/socket-client.js +52 -1
  312. package/dist/core/socket-server/socket-client.js.map +1 -1
  313. package/dist/core/socket-server/socket-server.d.ts +152 -1
  314. package/dist/core/socket-server/socket-server.d.ts.map +1 -1
  315. package/dist/core/socket-server/socket-server.js +775 -26
  316. package/dist/core/socket-server/socket-server.js.map +1 -1
  317. package/dist/core/socket-server/types.d.ts +106 -2
  318. package/dist/core/socket-server/types.d.ts.map +1 -1
  319. package/dist/core/socket-server/types.js +13 -1
  320. package/dist/core/socket-server/types.js.map +1 -1
  321. package/dist/core/system-prompt.d.ts.map +1 -1
  322. package/dist/core/system-prompt.js +10 -21
  323. package/dist/core/system-prompt.js.map +1 -1
  324. package/dist/core/tools/bash.d.ts +3 -1
  325. package/dist/core/tools/bash.d.ts.map +1 -1
  326. package/dist/core/tools/bash.js +39 -7
  327. package/dist/core/tools/bash.js.map +1 -1
  328. package/dist/core/tools/edit.d.ts.map +1 -1
  329. package/dist/core/tools/edit.js +17 -2
  330. package/dist/core/tools/edit.js.map +1 -1
  331. package/dist/core/tools/find.d.ts +3 -0
  332. package/dist/core/tools/find.d.ts.map +1 -1
  333. package/dist/core/tools/find.js +11 -18
  334. package/dist/core/tools/find.js.map +1 -1
  335. package/dist/core/tools/read.js +1 -1
  336. package/dist/core/tools/read.js.map +1 -1
  337. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  338. package/dist/core/tools/tool-definition-wrapper.js +3 -1
  339. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  340. package/dist/core/trust-manager.d.ts +6 -4
  341. package/dist/core/trust-manager.d.ts.map +1 -1
  342. package/dist/core/trust-manager.js +55 -21
  343. package/dist/core/trust-manager.js.map +1 -1
  344. package/dist/core/usage-totals.d.ts +19 -0
  345. package/dist/core/usage-totals.d.ts.map +1 -0
  346. package/dist/core/usage-totals.js +52 -0
  347. package/dist/core/usage-totals.js.map +1 -0
  348. package/dist/extensions/index.d.ts +3 -0
  349. package/dist/extensions/index.d.ts.map +1 -0
  350. package/dist/extensions/index.js +7 -0
  351. package/dist/extensions/index.js.map +1 -0
  352. package/dist/extensions/llama/client.d.ts +61 -0
  353. package/dist/extensions/llama/client.d.ts.map +1 -0
  354. package/dist/extensions/llama/client.js +300 -0
  355. package/dist/extensions/llama/client.js.map +1 -0
  356. package/dist/extensions/llama/huggingface.d.ts +23 -0
  357. package/dist/extensions/llama/huggingface.d.ts.map +1 -0
  358. package/dist/extensions/llama/huggingface.js +139 -0
  359. package/dist/extensions/llama/huggingface.js.map +1 -0
  360. package/dist/extensions/llama/index.d.ts +3 -0
  361. package/dist/extensions/llama/index.d.ts.map +1 -0
  362. package/dist/extensions/llama/index.js +208 -0
  363. package/dist/extensions/llama/index.js.map +1 -0
  364. package/dist/extensions/llama/provider.d.ts +10 -0
  365. package/dist/extensions/llama/provider.d.ts.map +1 -0
  366. package/dist/extensions/llama/provider.js +111 -0
  367. package/dist/extensions/llama/provider.js.map +1 -0
  368. package/dist/extensions/llama/ui.d.ts +42 -0
  369. package/dist/extensions/llama/ui.d.ts.map +1 -0
  370. package/dist/extensions/llama/ui.js +400 -0
  371. package/dist/extensions/llama/ui.js.map +1 -0
  372. package/dist/extensions/stub-provider/index.d.ts +9 -0
  373. package/dist/extensions/stub-provider/index.d.ts.map +1 -0
  374. package/dist/extensions/stub-provider/index.js +13 -0
  375. package/dist/extensions/stub-provider/index.js.map +1 -0
  376. package/dist/extensions/stub-provider/provider.d.ts +77 -0
  377. package/dist/extensions/stub-provider/provider.d.ts.map +1 -0
  378. package/dist/extensions/stub-provider/provider.js +193 -0
  379. package/dist/extensions/stub-provider/provider.js.map +1 -0
  380. package/dist/hooks/gsd/draht-quality-gate.js +3 -3
  381. package/dist/index.d.ts +4 -3
  382. package/dist/index.d.ts.map +1 -1
  383. package/dist/index.js +3 -3
  384. package/dist/index.js.map +1 -1
  385. package/dist/main.d.ts.map +1 -1
  386. package/dist/main.js +305 -61
  387. package/dist/main.js.map +1 -1
  388. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  389. package/dist/modes/interactive/components/assistant-message.js +22 -10
  390. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  391. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  392. package/dist/modes/interactive/components/config-selector.js +3 -2
  393. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  394. package/dist/modes/interactive/components/custom-editor.js +1 -1
  395. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  396. package/dist/modes/interactive/components/custom-message.d.ts +3 -1
  397. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  398. package/dist/modes/interactive/components/custom-message.js +9 -2
  399. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  400. package/dist/modes/interactive/components/extension-editor.d.ts +1 -2
  401. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  402. package/dist/modes/interactive/components/extension-editor.js +16 -46
  403. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  404. package/dist/modes/interactive/components/extension-selector.d.ts +49 -0
  405. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  406. package/dist/modes/interactive/components/extension-selector.js +202 -5
  407. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  408. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  409. package/dist/modes/interactive/components/footer.js +24 -23
  410. package/dist/modes/interactive/components/footer.js.map +1 -1
  411. package/dist/modes/interactive/components/login-dialog.d.ts +5 -5
  412. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  413. package/dist/modes/interactive/components/login-dialog.js +17 -8
  414. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  415. package/dist/modes/interactive/components/model-selector.d.ts +11 -4
  416. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  417. package/dist/modes/interactive/components/model-selector.js +74 -41
  418. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  419. package/dist/modes/interactive/components/oauth-selector.d.ts +4 -4
  420. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  421. package/dist/modes/interactive/components/oauth-selector.js +14 -25
  422. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  423. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  424. package/dist/modes/interactive/components/scoped-models-selector.js +22 -13
  425. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  426. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  427. package/dist/modes/interactive/components/session-selector.js +10 -2
  428. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  429. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  430. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  431. package/dist/modes/interactive/components/settings-selector.js +10 -0
  432. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  433. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  434. package/dist/modes/interactive/components/tool-execution.js +10 -1
  435. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  436. package/dist/modes/interactive/components/tree-selector.d.ts +25 -2
  437. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  438. package/dist/modes/interactive/components/tree-selector.js +68 -17
  439. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  440. package/dist/modes/interactive/external-editor.d.ts +12 -0
  441. package/dist/modes/interactive/external-editor.d.ts.map +1 -0
  442. package/dist/modes/interactive/external-editor.js +37 -0
  443. package/dist/modes/interactive/external-editor.js.map +1 -0
  444. package/dist/modes/interactive/interactive-mode.d.ts +107 -10
  445. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  446. package/dist/modes/interactive/interactive-mode.js +763 -285
  447. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  448. package/dist/modes/rpc/rpc-client.d.ts +4 -0
  449. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  450. package/dist/modes/rpc/rpc-client.js +7 -0
  451. package/dist/modes/rpc/rpc-client.js.map +1 -1
  452. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  453. package/dist/modes/rpc/rpc-mode.js +185 -9
  454. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  455. package/dist/modes/rpc/rpc-types.d.ts +79 -1
  456. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  457. package/dist/modes/rpc/rpc-types.js.map +1 -1
  458. package/dist/package-manager-cli.d.ts.map +1 -1
  459. package/dist/package-manager-cli.js +67 -5
  460. package/dist/package-manager-cli.js.map +1 -1
  461. package/dist/prompts/commands/atomic-commit.md +1 -12
  462. package/dist/prompts/commands/brainstorm.md +12 -15
  463. package/dist/prompts/commands/create-verification-skill.md +108 -0
  464. package/dist/prompts/commands/discuss-phase.md +3 -14
  465. package/dist/prompts/commands/execute-phase.md +3 -11
  466. package/dist/prompts/commands/fix.md +41 -18
  467. package/dist/prompts/commands/grill.md +66 -0
  468. package/dist/prompts/commands/init-project.md +5 -15
  469. package/dist/prompts/commands/map-codebase.md +1 -13
  470. package/dist/prompts/commands/new-project.md +5 -15
  471. package/dist/prompts/commands/next-milestone.md +1 -13
  472. package/dist/prompts/commands/orchestrate.md +1 -1
  473. package/dist/prompts/commands/pause-work.md +1 -13
  474. package/dist/prompts/commands/plan-phase.md +2 -11
  475. package/dist/prompts/commands/progress.md +0 -13
  476. package/dist/prompts/commands/quick.md +3 -11
  477. package/dist/prompts/commands/resolve-conflicts.md +71 -0
  478. package/dist/prompts/commands/resume-work.md +0 -13
  479. package/dist/prompts/commands/review.md +4 -13
  480. package/dist/prompts/commands/triage.md +159 -0
  481. package/dist/prompts/commands/verify-work.md +4 -14
  482. package/dist/prompts/commands/why.md +135 -0
  483. package/dist/skills/atomic-reasoning/SKILL.md +115 -0
  484. package/dist/skills/blast-radius/SKILL.md +55 -0
  485. package/dist/skills/epistemics/SKILL.md +99 -0
  486. package/dist/skills/hexagon-animation/SKILL.md +49 -0
  487. package/dist/skills/hexagon-animation/generate.mjs +81 -0
  488. package/dist/skills/hexagon-animation/template.html +361 -0
  489. package/dist/skills/typescript-discipline/SKILL.md +50 -0
  490. package/dist/skills/typescript-discipline/references/patterns.md +294 -0
  491. package/dist/skills/unslop/SKILL.md +101 -0
  492. package/dist/utils/canonical-path.d.ts +28 -0
  493. package/dist/utils/canonical-path.d.ts.map +1 -0
  494. package/dist/utils/canonical-path.js +90 -0
  495. package/dist/utils/canonical-path.js.map +1 -0
  496. package/dist/utils/child-process.d.ts +12 -1
  497. package/dist/utils/child-process.d.ts.map +1 -1
  498. package/dist/utils/child-process.js +25 -8
  499. package/dist/utils/child-process.js.map +1 -1
  500. package/dist/utils/clipboard-native.d.ts +1 -0
  501. package/dist/utils/clipboard-native.d.ts.map +1 -1
  502. package/dist/utils/clipboard-native.js.map +1 -1
  503. package/dist/utils/clipboard.d.ts +2 -0
  504. package/dist/utils/clipboard.d.ts.map +1 -1
  505. package/dist/utils/clipboard.js +53 -9
  506. package/dist/utils/clipboard.js.map +1 -1
  507. package/dist/utils/exif-orientation.d.ts.map +1 -1
  508. package/dist/utils/exif-orientation.js +2 -3
  509. package/dist/utils/exif-orientation.js.map +1 -1
  510. package/dist/utils/paths.d.ts +2 -7
  511. package/dist/utils/paths.d.ts.map +1 -1
  512. package/dist/utils/paths.js +13 -15
  513. package/dist/utils/paths.js.map +1 -1
  514. package/dist/utils/shell.d.ts.map +1 -1
  515. package/dist/utils/shell.js +6 -4
  516. package/dist/utils/shell.js.map +1 -1
  517. package/dist/utils/tools-manager.d.ts.map +1 -1
  518. package/dist/utils/tools-manager.js +3 -5
  519. package/dist/utils/tools-manager.js.map +1 -1
  520. package/dist/utils/version-check.d.ts.map +1 -1
  521. package/dist/utils/version-check.js +3 -1
  522. package/dist/utils/version-check.js.map +1 -1
  523. package/docs/attachable-sessions.md +79 -0
  524. package/docs/compaction.md +29 -24
  525. package/docs/containerization.md +23 -23
  526. package/docs/custom-provider.md +66 -32
  527. package/docs/development.md +9 -9
  528. package/docs/docs.json +6 -2
  529. package/docs/duet.md +42 -0
  530. package/docs/environment-variables.md +88 -0
  531. package/docs/extensions.md +278 -65
  532. package/docs/index.md +12 -10
  533. package/docs/json.md +12 -8
  534. package/docs/keybindings.md +8 -5
  535. package/docs/llama-cpp.md +99 -0
  536. package/docs/models.md +19 -8
  537. package/docs/packages.md +43 -42
  538. package/docs/prompt-templates.md +5 -4
  539. package/docs/providers.md +45 -11
  540. package/docs/quickstart.md +33 -33
  541. package/docs/rpc.md +190 -19
  542. package/docs/sdk.md +18 -15
  543. package/docs/security.md +18 -18
  544. package/docs/session-format.md +53 -15
  545. package/docs/sessions.md +17 -14
  546. package/docs/settings.md +26 -19
  547. package/docs/shell-aliases.md +2 -2
  548. package/docs/skills.md +12 -11
  549. package/docs/terminal-setup.md +12 -12
  550. package/docs/termux.md +6 -6
  551. package/docs/themes.md +11 -11
  552. package/docs/tmux.md +4 -4
  553. package/docs/tui.md +46 -31
  554. package/docs/usage.md +53 -63
  555. package/docs/windows.md +2 -2
  556. package/examples/extensions/custom-compaction.ts +4 -0
  557. package/examples/extensions/custom-provider-anthropic/index.ts +9 -3
  558. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  559. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  560. package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
  561. package/examples/extensions/gondolin/package.json +2 -2
  562. package/examples/extensions/handoff.ts +9 -1
  563. package/examples/extensions/kimi-deferred-tools.ts +61 -0
  564. package/examples/extensions/message-renderer.ts +2 -2
  565. package/examples/extensions/overlay-qa-tests.ts +3 -3
  566. package/examples/extensions/sandbox/package.json +1 -1
  567. package/examples/extensions/summarize.ts +3 -0
  568. package/examples/extensions/with-deps/package.json +1 -1
  569. package/examples/sdk/02-custom-model.ts +5 -8
  570. package/examples/sdk/09-api-keys-and-oauth.ts +15 -31
  571. package/examples/sdk/12-full-control.ts +9 -12
  572. package/hooks/gsd/draht-quality-gate.js +3 -3
  573. package/package.json +14 -11
  574. package/prompts/commands/atomic-commit.md +1 -12
  575. package/prompts/commands/brainstorm.md +12 -15
  576. package/prompts/commands/create-verification-skill.md +108 -0
  577. package/prompts/commands/discuss-phase.md +3 -14
  578. package/prompts/commands/execute-phase.md +3 -11
  579. package/prompts/commands/fix.md +41 -18
  580. package/prompts/commands/grill.md +66 -0
  581. package/prompts/commands/init-project.md +5 -15
  582. package/prompts/commands/map-codebase.md +1 -13
  583. package/prompts/commands/new-project.md +5 -15
  584. package/prompts/commands/next-milestone.md +1 -13
  585. package/prompts/commands/orchestrate.md +1 -1
  586. package/prompts/commands/pause-work.md +1 -13
  587. package/prompts/commands/plan-phase.md +2 -11
  588. package/prompts/commands/progress.md +0 -13
  589. package/prompts/commands/quick.md +3 -11
  590. package/prompts/commands/resolve-conflicts.md +71 -0
  591. package/prompts/commands/resume-work.md +0 -13
  592. package/prompts/commands/review.md +4 -13
  593. package/prompts/commands/triage.md +159 -0
  594. package/prompts/commands/verify-work.md +4 -14
  595. package/prompts/commands/why.md +135 -0
  596. package/skills/atomic-reasoning/SKILL.md +115 -0
  597. package/skills/blast-radius/SKILL.md +55 -0
  598. package/skills/epistemics/SKILL.md +99 -0
  599. package/skills/hexagon-animation/SKILL.md +49 -0
  600. package/skills/hexagon-animation/generate.mjs +81 -0
  601. package/skills/hexagon-animation/template.html +361 -0
  602. package/skills/typescript-discipline/SKILL.md +50 -0
  603. package/skills/typescript-discipline/references/patterns.md +294 -0
  604. package/skills/unslop/SKILL.md +101 -0
  605. package/dist/core/provider-display-names.d.ts +0 -2
  606. package/dist/core/provider-display-names.d.ts.map +0 -1
  607. package/dist/core/provider-display-names.js +0 -36
  608. package/dist/core/provider-display-names.js.map +0 -1
  609. package/dist/prompts/agents/build.md +0 -86
  610. package/dist/prompts/agents/plan.md +0 -79
  611. package/dist/prompts/agents/verify.md +0 -69
  612. package/prompts/agents/build.md +0 -86
  613. package/prompts/agents/plan.md +0 -79
  614. package/prompts/agents/verify.md +0 -69
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Minimal Kimi deferred-tool loading demo.
3
+ *
4
+ * pi -e ./kimi-deferred-tools.ts
5
+ * example prompt: Use the available tools to calculate 100 + 500. Do not calculate it yourself.
6
+ */
7
+
8
+ import type { ExtensionAPI } from "@draht/coding-agent";
9
+ import { Type } from "typebox";
10
+
11
+ function calculate(_expr: string): string {
12
+ return "42";
13
+ }
14
+
15
+ export default function (pi: ExtensionAPI): void {
16
+ pi.registerTool({
17
+ name: "Calculator",
18
+ label: "Calculator",
19
+ description: "Evaluate a simple arithmetic expression.",
20
+ parameters: Type.Object({
21
+ expr: Type.String({ description: "An expression such as 100 + 500" }),
22
+ }),
23
+ async execute(_toolCallId, params) {
24
+ return {
25
+ content: [{ type: "text", text: calculate(params.expr) }],
26
+ details: {},
27
+ };
28
+ },
29
+ });
30
+
31
+ pi.registerTool({
32
+ name: "tool_search",
33
+ label: "Tool Search",
34
+ description: "Find and activate tools for a capability.",
35
+ promptSnippet: "Search for additional tools when the active tools cannot perform the task",
36
+ parameters: Type.Object({
37
+ query: Type.String({ description: "Capability to search for" }),
38
+ }),
39
+ async execute(_toolCallId, params) {
40
+ if (!params.query.toLowerCase().includes("calc")) {
41
+ return {
42
+ content: [{ type: "text", text: "The relevant tools do not exist." }],
43
+ details: { matches: [], added: [] },
44
+ };
45
+ }
46
+
47
+ const active = pi.getActiveTools();
48
+ const added = active.includes("Calculator") ? [] : ["Calculator"];
49
+ if (added.length > 0) pi.setActiveTools([...active, ...added]);
50
+
51
+ return {
52
+ content: [{ type: "text", text: "Success. Found 1 matching tool(s)" }],
53
+ details: { matches: ["Calculator"], added },
54
+ };
55
+ },
56
+ });
57
+
58
+ pi.on("session_start", () => {
59
+ pi.setActiveTools(["tool_search"]);
60
+ });
61
+ }
@@ -12,7 +12,7 @@ import { Box, Text } from "@draht/tui";
12
12
 
13
13
  export default function (pi: ExtensionAPI) {
14
14
  // Register custom renderer for "status-update" messages
15
- pi.registerMessageRenderer("status-update", (message, { expanded }, theme) => {
15
+ pi.registerMessageRenderer("status-update", (message, { expanded, outputPad }, theme) => {
16
16
  const details = message.details as { level: string; timestamp: number } | undefined;
17
17
  const level = details?.level ?? "info";
18
18
 
@@ -29,7 +29,7 @@ export default function (pi: ExtensionAPI) {
29
29
  }
30
30
 
31
31
  // Use Box with customMessageBg for consistent styling
32
- const box = new Box(1, 1, (t) => theme.bg("customMessageBg", t));
32
+ const box = new Box(outputPad, 1, (t) => theme.bg("customMessageBg", t));
33
33
  box.addChild(new Text(text, 0, 0));
34
34
  return box;
35
35
  });
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Overlay QA Tests - comprehensive overlay positioning and edge case tests
3
3
  *
4
- * Usage: pi --extension ./examples/extensions/overlay-qa-tests.ts
4
+ * Usage: draht --extension ./examples/extensions/overlay-qa-tests.ts
5
5
  *
6
6
  * Commands:
7
7
  * /overlay-animation - Real-time animation demo (~30 FPS, proves DOOM-like rendering works)
@@ -485,13 +485,13 @@ class StreamingOverflowComponent extends BaseOverlay {
485
485
  echo ""
486
486
  for i in $(seq 1 100); do
487
487
  # Simulate long file paths with OSC 8 hyperlinks (clickable) - tests width overflow
488
- DIR="/Users/nicobailon/Documents/development/pi-mono/packages/coding-agent/src/modes/interactive"
488
+ DIR="/Users/nicobailon/Documents/development/draht-mono/packages/coding-agent/src/modes/interactive"
489
489
  FILE="\${DIR}/components/very-long-component-name-that-exceeds-width-\${i}.ts"
490
490
  echo -e "\\033]8;;file://\${FILE}\\007▶ read: \${FILE}\\033]8;;\\007"
491
491
 
492
492
  # Add some colored status messages with long text
493
493
  if [ $((i % 5)) -eq 0 ]; then
494
- echo -e " \\033[32m✓ Successfully processed \${i} files in /Users/nicobailon/Documents/development/pi-mono\\033[0m"
494
+ echo -e " \\033[32m✓ Successfully processed \${i} files in /Users/nicobailon/Documents/development/draht-mono\\033[0m"
495
495
  fi
496
496
  if [ $((i % 7)) -eq 0 ]; then
497
497
  echo -e " \\033[33m⚠ Warning: potential issue detected at line \${i} in very-long-component-name-that-exceeds-width.ts\\033[0m"
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "pi-extension-sandbox",
2
+ "name": "draht-extension-sandbox",
3
3
  "private": true,
4
4
  "version": "1.10.6",
5
5
  "type": "module",
@@ -1,3 +1,4 @@
1
+ import { uuidv7 } from "@draht/ai";
1
2
  import { complete, getModel } from "@draht/ai/compat";
2
3
  import type { ExtensionAPI, ExtensionCommandContext } from "@draht/coding-agent";
3
4
  import { DynamicBorder, getMarkdownTheme } from "@draht/coding-agent";
@@ -193,6 +194,8 @@ export default function (pi: ExtensionAPI) {
193
194
  headers: auth.headers,
194
195
  env: auth.env,
195
196
  reasoningEffort: "high",
197
+ cacheRetention: "none",
198
+ sessionId: uuidv7(),
196
199
  },
197
200
  );
198
201
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "pi-extension-with-deps",
2
+ "name": "draht-extension-with-deps",
3
3
  "private": true,
4
4
  "version": "0.80.6",
5
5
  "type": "module",
@@ -5,11 +5,9 @@
5
5
  */
6
6
 
7
7
  import { getModel } from "@draht/ai/compat";
8
- import { AuthStorage, createAgentSession, ModelRegistry } from "@draht/coding-agent";
8
+ import { createAgentSession, ModelRuntime } from "@draht/coding-agent";
9
9
 
10
- // Set up auth storage and model registry
11
- const authStorage = AuthStorage.create();
12
- const modelRegistry = ModelRegistry.create(authStorage);
10
+ const modelRuntime = await ModelRuntime.create();
13
11
 
14
12
  // Option 1: Find a specific built-in model by provider/id
15
13
  const opus = getModel("anthropic", "claude-opus-4-5");
@@ -18,13 +16,13 @@ if (opus) {
18
16
  }
19
17
 
20
18
  // Option 2: Find model via registry (includes custom models from models.json)
21
- const customModel = modelRegistry.find("my-provider", "my-model");
19
+ const customModel = modelRuntime.getModel("my-provider", "my-model");
22
20
  if (customModel) {
23
21
  console.log(`Found custom model: ${customModel.provider}/${customModel.id}`);
24
22
  }
25
23
 
26
24
  // Option 3: Pick from available models (have valid API keys)
27
- const available = await modelRegistry.getAvailable();
25
+ const available = await modelRuntime.getAvailable();
28
26
  console.log(
29
27
  "Available models:",
30
28
  available.map((m) => `${m.provider}/${m.id}`),
@@ -34,8 +32,7 @@ if (available.length > 0) {
34
32
  const { session } = await createAgentSession({
35
33
  model: available[0],
36
34
  thinkingLevel: "medium", // off, low, medium, high
37
- authStorage,
38
- modelRegistry,
35
+ modelRuntime,
39
36
  });
40
37
 
41
38
  try {
@@ -1,52 +1,36 @@
1
1
  /**
2
2
  * API Keys and OAuth
3
3
  *
4
- * Configure API key resolution via AuthStorage and ModelRegistry.
4
+ * Configure provider auth through ModelRuntime.
5
5
  */
6
6
 
7
- import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@draht/coding-agent";
8
-
9
- // Default: AuthStorage uses ~/.pi/agent/auth.json
10
- // ModelRegistry loads built-in + custom models from ~/.pi/agent/models.json
11
- const authStorage = AuthStorage.create();
12
- const modelRegistry = ModelRegistry.create(authStorage);
7
+ import { createAgentSession, ModelRuntime, SessionManager } from "@draht/coding-agent";
13
8
 
9
+ // Default: ModelRuntime uses ~/.pi/agent/auth.json for credentials
10
+ // and loads built-in + custom models from ~/.pi/agent/models.json
11
+ const modelRuntime = await ModelRuntime.create();
14
12
  const { session: defaultAuthSession } = await createAgentSession({
15
13
  sessionManager: SessionManager.inMemory(),
16
- authStorage,
17
- modelRegistry,
14
+ modelRuntime,
18
15
  });
19
- console.log("Session with default auth storage and model registry");
16
+ console.log("Session with default model runtime");
20
17
  defaultAuthSession.dispose();
21
18
 
22
- // Custom auth storage location
23
- const customAuthStorage = AuthStorage.create("/tmp/my-app/auth.json");
24
- const customModelRegistry = ModelRegistry.create(customAuthStorage, "/tmp/my-app/models.json");
25
-
19
+ const customRuntime = await ModelRuntime.create({
20
+ authPath: "/tmp/my-app/auth.json",
21
+ modelsPath: "/tmp/my-app/models.json",
22
+ });
26
23
  const { session: customAuthSession } = await createAgentSession({
27
24
  sessionManager: SessionManager.inMemory(),
28
- authStorage: customAuthStorage,
29
- modelRegistry: customModelRegistry,
25
+ modelRuntime: customRuntime,
30
26
  });
31
- console.log("Session with custom auth storage location");
27
+ console.log("Session with custom auth and models locations");
32
28
  customAuthSession.dispose();
33
29
 
34
- // Runtime API key override (not persisted to disk)
35
- authStorage.setRuntimeApiKey("anthropic", "sk-my-temp-key");
30
+ modelRuntime.setRuntimeApiKey("anthropic", "sk-my-temp-key");
36
31
  const { session: runtimeKeySession } = await createAgentSession({
37
32
  sessionManager: SessionManager.inMemory(),
38
- authStorage,
39
- modelRegistry,
33
+ modelRuntime,
40
34
  });
41
35
  console.log("Session with runtime API key override");
42
36
  runtimeKeySession.dispose();
43
-
44
- // No models.json - only built-in models
45
- const simpleRegistry = ModelRegistry.inMemory(authStorage);
46
- const { session: builtInModelsSession } = await createAgentSession({
47
- sessionManager: SessionManager.inMemory(),
48
- authStorage,
49
- modelRegistry: simpleRegistry,
50
- });
51
- console.log("Session with only built-in models");
52
- builtInModelsSession.dispose();
@@ -6,26 +6,22 @@
6
6
 
7
7
  import { getModel } from "@draht/ai/compat";
8
8
  import {
9
- AuthStorage,
10
9
  createAgentSession,
11
10
  createExtensionRuntime,
12
- ModelRegistry,
11
+ ModelRuntime,
13
12
  type ResourceLoader,
14
13
  SessionManager,
15
14
  SettingsManager,
16
15
  } from "@draht/coding-agent";
17
16
 
18
- // Custom auth storage location
19
- const authStorage = AuthStorage.create("/tmp/my-agent/auth.json");
20
-
21
- // Runtime API key override (not persisted)
17
+ const modelRuntime = await ModelRuntime.create({
18
+ authPath: "/tmp/my-agent/auth.json",
19
+ modelsPath: "/tmp/my-agent/models.json",
20
+ });
22
21
  if (process.env.MY_ANTHROPIC_KEY) {
23
- authStorage.setRuntimeApiKey("anthropic", process.env.MY_ANTHROPIC_KEY);
22
+ modelRuntime.setRuntimeApiKey("anthropic", process.env.MY_ANTHROPIC_KEY);
24
23
  }
25
24
 
26
- // Model registry with no custom models.json
27
- const modelRegistry = ModelRegistry.inMemory(authStorage);
28
-
29
25
  const model = getModel("anthropic", "claude-sonnet-4-5");
30
26
  if (!model) throw new Error("Model not found");
31
27
 
@@ -45,7 +41,9 @@ const resourceLoader: ResourceLoader = {
45
41
  getAgentsFiles: () => ({ agentsFiles: [] }),
46
42
  getSystemPrompt: () => `You are a minimal assistant.
47
43
  Available: read, bash. Be concise.`,
44
+ getSystemPromptSource: () => undefined,
48
45
  getAppendSystemPrompt: () => [],
46
+ getAppendSystemPromptSources: () => [],
49
47
  extendResources: () => {},
50
48
  reload: async () => {},
51
49
  };
@@ -55,8 +53,7 @@ const { session } = await createAgentSession({
55
53
  agentDir: "/tmp/my-agent",
56
54
  model,
57
55
  thinkingLevel: "off",
58
- authStorage,
59
- modelRegistry,
56
+ modelRuntime,
60
57
  resourceLoader,
61
58
  tools: ["read", "bash"],
62
59
  sessionManager: SessionManager.inMemory(cwd),
@@ -75,9 +75,9 @@ try {
75
75
  execSync(tsCmd, { timeout: 60000, encoding: "utf-8", cwd });
76
76
  } catch (error) {
77
77
  const output = error.stdout || error.stderr || "";
78
- const errorCount = (output.match(/error TS/g) || []).length;
79
- if (errorCount > 0) {
80
- issues.push({ severity: strict ? "error" : "warning", message: `${errorCount} TypeScript error(s)`, details: output.slice(0, 500) });
78
+ const errorLines = output.split("\n").filter((line) => /error TS/.test(line));
79
+ if (errorLines.length > 0) {
80
+ issues.push({ severity: strict ? "error" : "warning", message: `${errorLines.length} TypeScript error(s)`, details: errorLines.join("\n").slice(0, 500) });
81
81
  }
82
82
  }
83
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draht/coding-agent",
3
- "version": "2026.7.13",
3
+ "version": "2026.9.5-1",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "drahtConfig": {
@@ -28,6 +28,7 @@
28
28
  "docs",
29
29
  "examples",
30
30
  "prompts",
31
+ "skills",
31
32
  "hooks",
32
33
  "agents",
33
34
  "bin",
@@ -37,21 +38,21 @@
37
38
  "clean": "shx rm -rf dist",
38
39
  "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
39
40
  "build": "tsc -p tsconfig.build.json && shx chmod +x dist/cli.js dist/rpc-entry.js && bun run copy-assets",
40
- "build:binary": "bun run build && bun build --compile ./dist/cli.js ./src/utils/image-resize-worker.ts --outfile dist/draht && bun run copy-binary-assets",
41
- "copy-assets": "shx mkdir -p dist/modes/interactive/theme && shx cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && shx mkdir -p dist/modes/interactive/assets && shx cp src/modes/interactive/assets/*.png dist/modes/interactive/assets/ && shx mkdir -p dist/core/export-html/vendor && shx cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/ && shx cp src/core/export-html/vendor/*.js dist/core/export-html/vendor/ && shx rm -rf dist/prompts dist/hooks dist/agents && shx cp -r prompts dist/prompts && shx cp -r hooks dist/hooks && shx cp -r agents dist/agents",
42
- "copy-binary-assets": "shx cp package.json dist/ && shx cp README.md dist/ && shx cp CHANGELOG.md dist/ && shx mkdir -p dist/theme && shx cp src/modes/interactive/theme/*.json dist/theme/ && shx mkdir -p dist/assets && shx cp src/modes/interactive/assets/*.png dist/assets/ && shx mkdir -p dist/export-html/vendor && shx cp src/core/export-html/template.html dist/export-html/ && shx cp src/core/export-html/vendor/*.js dist/export-html/vendor/ && shx cp -r docs dist/ && shx cp -r examples dist/ && shx cp -r prompts dist/ && shx cp -r hooks dist/ && shx cp -r agents dist/ && shx cp ../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm dist/",
41
+ "build:binary": "bun run build && bun build --compile --no-compile-autoload-bunfig ./dist/cli.js ./src/utils/image-resize-worker.ts --outfile dist/draht && bun run copy-binary-assets",
42
+ "copy-assets": "shx mkdir -p dist/modes/interactive/theme && shx cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && shx mkdir -p dist/modes/interactive/assets && shx cp src/modes/interactive/assets/*.png dist/modes/interactive/assets/ && shx mkdir -p dist/core/export-html/vendor && shx cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/ && shx cp src/core/export-html/vendor/*.js dist/core/export-html/vendor/ && shx rm -rf dist/prompts dist/skills dist/hooks dist/agents && shx cp -r prompts dist/prompts && shx cp -r skills dist/skills && shx cp -r hooks dist/hooks && shx cp -r agents dist/agents",
43
+ "copy-binary-assets": "shx cp package.json dist/ && shx cp README.md dist/ && shx cp CHANGELOG.md dist/ && shx mkdir -p dist/theme && shx cp src/modes/interactive/theme/*.json dist/theme/ && shx mkdir -p dist/assets && shx cp src/modes/interactive/assets/*.png dist/assets/ && shx mkdir -p dist/export-html/vendor && shx cp src/core/export-html/template.html dist/export-html/ && shx cp src/core/export-html/vendor/*.js dist/export-html/vendor/ && shx cp -r docs dist/ && shx cp -r examples dist/ && shx cp -r prompts dist/ && shx cp -r skills dist/ && shx cp -r hooks dist/ && shx cp -r agents dist/ && node -e \"require('fs').copyFileSync(require.resolve('@silvia-odwyer/photon-node/photon_rs_bg.wasm'), 'dist/photon_rs_bg.wasm')\"",
43
44
  "sync-tools": "node ../../scripts/sync-draht-tools.mjs",
44
45
  "test": "vitest --run",
45
46
  "prepublishOnly": "node ../../scripts/sync-draht-tools.mjs && bun run clean && bun run build"
46
47
  },
47
48
  "dependencies": {
48
49
  "@mariozechner/jiti": "^2.6.2",
49
- "@draht/agent-core": "2026.7.13",
50
- "@draht/ai": "2026.7.13",
51
- "@draht/rlm": "2026.7.13",
52
- "@draht/router": "2026.7.13",
53
- "@draht/tools": "2026.7.13",
54
- "@draht/tui": "2026.7.13",
50
+ "@draht/agent-core": "2026.9.5-1",
51
+ "@draht/ai": "2026.9.5-1",
52
+ "@draht/rlm": "2026.9.5-1",
53
+ "@draht/router": "2026.9.5-1",
54
+ "@draht/tools": "2026.9.5-1",
55
+ "@draht/tui": "2026.9.5-1",
55
56
  "@silvia-odwyer/photon-node": "^0.3.4",
56
57
  "@sinclair/typebox": "^0.34.41",
57
58
  "chalk": "^5.6.2",
@@ -68,12 +69,13 @@
68
69
  "proper-lockfile": "^4.1.2",
69
70
  "semver": "^7.8.0",
70
71
  "strip-ansi": "^7.1.0",
71
- "typebox": "^1.1.24",
72
+ "typebox": "^1.3.7",
72
73
  "undici": "^7.19.1",
73
74
  "yaml": "^2.8.2",
74
75
  "uuid": "^14.0.0"
75
76
  },
76
77
  "overrides": {
78
+ "protobufjs": "7.6.5",
77
79
  "rimraf": "6.1.2",
78
80
  "gaxios": {
79
81
  "rimraf": "6.1.2"
@@ -90,6 +92,7 @@
90
92
  "@types/node": "^24.3.0",
91
93
  "@types/proper-lockfile": "^4.1.4",
92
94
  "@types/semver": "^7.7.1",
95
+ "openai": "6.26.0",
93
96
  "shx": "^0.4.0",
94
97
  "typescript": "7.0.2",
95
98
  "vitest": "^3.2.4"
@@ -18,18 +18,7 @@ Surface any of these to the user and split the change set before continuing.
18
18
 
19
19
  ## Atomic Reasoning
20
20
 
21
- Before creating commits, decompose changes into atomic reasoning units:
22
-
23
- **For each file change:**
24
- 1. **State the logical component** — What does this change do? What is its purpose? Does it complete a thought?
25
- 2. **Validate independence** — Can this change be applied independently? Does it depend on other changes? Does it break the build alone?
26
- 3. **Verify correctness** — Is this change logically complete? Does it mix concerns? Should it be split further?
27
-
28
- **Synthesize commit strategy:**
29
- - Group changes by logical concern (one commit = one idea)
30
- - Order commits so each builds successfully
31
- - Write clear commit messages that explain WHY, not just WHAT
32
- - Ensure each commit is self-contained and reviewable
21
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
33
22
 
34
23
  ## Gathering Current State
35
24
 
@@ -6,6 +6,8 @@ description: "Refine a fuzzy idea into a written design spec before planning or
6
6
 
7
7
  The pre-planning gate. Before draht's GSD cycle runs, before code is scaffolded, before `/new-project` or `/init-project`, converge on the idea through dialogue and write it to `.planning/specs/`. This command enforces design-first discipline.
8
8
 
9
+ For subject-agnostic interrogation that does not presume a project — a spec, raw tickets, an architecture decision, an open discussion — use `/grill`; `/brainstorm` stays the project-creation entry and questions with the same whole-frontier protocol.
10
+
9
11
  ## Usage
10
12
  ```
11
13
  /brainstorm [idea or topic]
@@ -15,17 +17,7 @@ Topic: $ARGUMENTS
15
17
 
16
18
  ## Atomic Reasoning
17
19
 
18
- Before asking anything, decompose the idea into atomic reasoning units:
19
-
20
- 1. **State the logical component** — What problem does this solve? Who is it for? What changes for them when it ships?
21
- 2. **Validate independence** — What bounded contexts will exist? What is core vs peripheral? What can be built independently?
22
- 3. **Verify correctness** — What defines v1 success? What constraints exist (time, tech, team)? What is explicitly out of scope?
23
-
24
- **Synthesize design strategy:**
25
- - Ground questions in what is already on disk instead of asking what the user already told you
26
- - Sequence questions foundational → detailed, one at a time
27
- - Surface 2–3 approaches with trade-offs before committing
28
- - Record decisions (not proposals) in a spec file
20
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
29
21
 
30
22
  ## Hear the Problem Beneath the Ask
31
23
 
@@ -43,7 +35,7 @@ The user's words describe an artifact; the design must serve a need. They are ra
43
35
  ## The Hard Gate
44
36
 
45
37
  > Do NOT invoke any planning command, write any code, scaffold any project, or take any implementation action until you have:
46
- > 1. Asked clarifying questions one at a time
38
+ > 1. Worked the question frontier in rounds until it was empty
47
39
  > 2. Proposed 2–3 approaches with trade-offs
48
40
  > 3. Presented a structured design and the user has approved it
49
41
  > 4. Written the design to `.planning/specs/YYYY-MM-DD-<slug>-design.md`
@@ -64,9 +56,9 @@ If an existing codebase is in play (extending a real project), run `draht-tools
64
56
 
65
57
  Use this to ground questions in reality instead of asking things the user has already told you.
66
58
 
67
- ### 2. Ask Clarifying Questions — ONE at a time
59
+ ### 2. Question in Rounds — Ask the Whole Frontier
68
60
 
69
- Most failed projects come from rushing past ambiguity. Ask **one focused question per message**, not a long list. Wait for the answer, then ask the next.
61
+ Most failed projects come from rushing past ambiguity. Map the open decisions as a design tree — every decision branches into the decisions that hang off it. The **frontier** is every question whose prerequisites are already settled. Each round, ask the WHOLE frontier in one message: numbered, foundational → detailed, each question with a *Recommended:* answer line so the user can accept by number ("1 yes, 2: B, 3 later"). A question accepted by number or answered explicitly is **decided**; a recommendation acted on without confirmation is **assumed** and stays flagged. Questions that depend on still-open answers wait for a later round. Environment facts (files, git history, code structure) are your job, never the user's — dispatch a subagent non-blockingly; only the questions downstream of it wait.
70
62
 
71
63
  Question categories (sequence from foundational → detailed):
72
64
  - **Goal** — who is this for? what changes for them when it ships?
@@ -107,6 +99,8 @@ Once all sections are approved:
107
99
  .planning/specs/YYYY-MM-DD-<topic-slug>-design.md
108
100
  ```
109
101
 
102
+ Write spec prose through the `unslop` skill — name mechanisms, not feelings; the spec structure below stays as specified.
103
+
110
104
  The file should include:
111
105
  - Header with date and approver
112
106
  - All approved sections
@@ -142,7 +136,8 @@ The spec file becomes input to those commands.
142
136
 
143
137
  ## Anti-Patterns — STOP
144
138
 
145
- - **Asking multiple questions in one message** — splits the user's attention, lowers answer quality
139
+ - **Dribbling questions one at a time** — a serial interview hides the decision tree and wastes rounds; ask the whole frontier, numbered, with recommended answers
140
+ - **Asking the user for facts you can look up** — filesystem, git history, and code structure are your job; dispatch a subagent and keep the round moving
146
141
  - **Pre-deciding before they've answered** — "I'll just assume you mean X" is a failure mode
147
142
  - **Skipping the alternatives** — proposing only one approach hides the trade-space
148
143
  - **Writing the spec before approval** — the spec records *decisions*, not *proposals*. Get the decision first.
@@ -156,6 +151,8 @@ The spec file becomes input to those commands.
156
151
  | "User said 'just build it'" | They'll be unhappier when the wrong thing gets built. Surface the trade-off. |
157
152
  | "I already know what they want" | Verify by stating it back and getting confirmation. |
158
153
  | "Let's iterate after a first draft" | A first draft in code is more expensive to throw away than a first draft on paper. |
154
+ | "Ten questions at once will overwhelm them" | Numbered questions with recommended answers are skimmable — the user replies "1 yes, 2: B, 3 later". Serial questioning is the slower burden. |
155
+ | "I'll just ask what's in the repo" | Finding facts is your job, never the user's. Dispatch a subagent. |
159
156
 
160
157
  ## Output
161
158
 
@@ -0,0 +1,108 @@
1
+ ---
2
+ description: "Generate a committed project-local verify-<app> skill that drives the real app the way a user does and captures proof artifacts — proven end to end once before handover"
3
+ ---
4
+
5
+ # /create-verification-skill
6
+
7
+ Every serious project needs a scripted way to drive the real app and prove behaviour: launch it, exercise a feature the way a user would, and capture evidence. This command generates that as a committed project-local skill — `.draht/skills/verify-<app>/` — tailored to the repo, so verification is a versioned repo asset instead of per-session improvisation.
8
+
9
+ ## Usage
10
+ ```
11
+ /create-verification-skill [app or surface]
12
+ ```
13
+
14
+ Target: $ARGUMENTS (optional — when empty, the interview below picks the primary user-facing surface)
15
+
16
+ Write the generated skill for the next agent, not for a human: it will be read cold, mid-task, by an agent that has never seen the app.
17
+
18
+ ## Steps
19
+
20
+ ### 1 — Interview the repo, not the user
21
+
22
+ Answer these from the codebase and only ask the user what you cannot observe:
23
+
24
+ - **Surface:** what does a user actually touch? A web UI, a CLI/TUI, a desktop app, an API, a mobile app, a library? A repo can have several; pick the primary one and note the rest.
25
+ - **Run:** how does the app start locally? Prefer the repo's own documented dev command (package scripts, Makefile, README quickstart). Note ports, env vars, seed data, auth.
26
+ - **Drive:** how can an agent interact with it programmatically? Existing harnesses first — Playwright/Cypress specs, expect scripts, PTY helpers, curl-able endpoints, a debug port. Only then pick a generic recipe: a browser debug port (CDP) for web and Electron, a tmux/PTY harness for CLI and TUI, plain HTTP for services. Every recipe must run through plain shell commands — assume the runtime ships no browser-automation or app-control tooling of its own.
27
+ - **Observe:** what evidence can be captured? Screenshots, terminal transcripts, response bodies, logs, exit codes, DB state.
28
+ - **Isolate:** can two instances run side by side (ports, data dirs, profiles)? If not, say so in the generated skill: refusing to double-drive a shared instance beats corrupting the user's session.
29
+
30
+ If the checkout doesn't build or start as-is, fix that first (or report it precisely) before generating; a skill written against a broken base teaches wrong steps. When an irrelevant missing asset blocks startup (a static dir the API never serves, a sample config), the generated skill may create it, clearly marked as verification scaffolding, and remove it in cleanup.
31
+
32
+ ### 2 — Generate the skill
33
+
34
+ Write `.draht/skills/verify-<app>/SKILL.md`. `.draht/skills/` is the project-level skills directory, and project skills win name collisions against installed or shipped skills — the generated skill is authoritative for its repo. (If the target project's agents discover project skills at a different path, write the identical content there instead; the skill body is host-neutral.)
35
+
36
+ Frontmatter is `name: verify-<app>` plus a `description` that names the app, the surface, and when to reach for it — without frontmatter the skill never registers. Then these six sections, each grounded in what the interview actually found (no placeholders left):
37
+
38
+ - **Launch:** the exact command that starts the app for verification, and how to tell it's ready (a log line, a port answering, a prompt). Include teardown. For a short-lived CLI or TUI there is no server to keep alive: launch means build the binary (or install deps) once, then start each drive in its own isolated PTY or tmux session.
39
+ - **Doctor:** one read-only check that answers "is this instance worth driving?" — process up, right version/build, port owned by us, auth valid. Run it before the first drive and again whenever anything looks off.
40
+ - **Drive:** the harness recipe with real selectors/commands from this repo, not examples. Prefer stable handles (ARIA labels, data attributes, prompt strings, route paths) over coordinates and tab order.
41
+ - **Evidence:** what to capture for a proof and where it goes. State the proof standards: exercise the real user path, not internal setters or test-only endpoints; capture the action and the resulting state, not just the final screen; verify side effects (files written, rows inserted, messages sent) alongside what's visible; mocks only where a production boundary already isolates the external system. When the safe path is a dry-run or test mode, verify what it actually skips by observing (files, network, git refs) rather than trusting its name: some dry-runs still touch the network or open a browser.
42
+ - **Cleanup:** how to tear down instances the run created. Never kill by process name; kill what you started. Cleanup removes instances and scratch state, never the evidence: proof artifacts survive the teardown, in a location the skill names.
43
+ - **Helpers:** any script the skill ships is executable and its invocation is shown in the skill body. A helper the reader has to reverse-engineer is not a helper.
44
+
45
+ ### 3 — Seed the feature map
46
+
47
+ Create a `features/` directory inside the generated skill dir, holding `features/README.md` plus one file per user-facing feature you can identify (aim for the top 3-5 to start, from routes, commands, menus, or docs). The README carries the baseline preconditions (launch target, disposable data location, seed data, the Doctor requirement), the driving conventions (stable handles over positions, commands taken literally, restore mutated fixtures, never remove proof artifacts), the proof and skip-reporting rules (record the feature ID and entry point with every artifact; report an unreachable path with the attempted command and the unmet precondition; never report a skipped entry point as verified through a different path), and an index linking every feature file.
48
+
49
+ Each feature file starts with an H1 title and one paragraph of user-visible behaviour, then exactly four H2 sections in this order:
50
+
51
+ 1. `Sub-features` — short IDs with one line per behaviour.
52
+ 2. `How to get to it (user POV)` — every user entry point.
53
+ 3. `Driving it with <harness>` — starts with `Preconditions:`, then labelled bullets pairing each user action with an exact command and its observable result.
54
+ 4. `Gotchas` — traps that can waste or invalidate a verification run.
55
+
56
+ Keep implementation details out of the map: name only user paths, stable handles, required state, commands, and observable proof. A condensed example entry:
57
+
58
+ ```markdown
59
+ # Create a note
60
+
61
+ Create note lets a user save a titled note and confirm it from a second view.
62
+
63
+ ## Sub-features
64
+
65
+ - `create-save` persists a title and body.
66
+
67
+ ## How to get to it (user POV)
68
+
69
+ - Choose the `New note` button in the browser toolbar.
70
+
71
+ ## Driving it with the CDP harness
72
+
73
+ Preconditions:
74
+
75
+ - Notes is healthy at `http://127.0.0.1:4173` and no note is titled `Release checklist`.
76
+
77
+ - **Open editor.** Choose `New note`. Click the button with accessible name `New note`. A form named `Note editor` appears.
78
+ - **Save note.** Fill `Title` with `Release checklist`, choose `Save note`. A status named `Note saved` appears.
79
+ - **Proof.** Reopen the note from `All notes`; screenshot to `artifacts/create-note/list.png`. The list shows `Release checklist`.
80
+
81
+ ## Gotchas
82
+
83
+ - A save status alone is insufficient proof. Reopen the note from the list.
84
+ ```
85
+
86
+ The map is the repo's maintained verification source; a proof that drives one convenient entry point is incomplete when the map lists others.
87
+
88
+ ### 4 — Prove the generated skill before handing it over
89
+
90
+ Run its own instructions end to end once: launch, doctor, drive ONE mapped feature (one is enough — the map exists so later runs can cover the rest), capture evidence, clean up. After cleanup, confirm the evidence still exists at the named location — a cleanup that eats the proof fails this step. Fix what fails, and run the generated cleanup after every failed iteration too, so broken attempts don't strand processes and ports. A generated skill that was never executed is a draft, not a deliverable.
91
+
92
+ ### 5 — Commit and hand over
93
+
94
+ The generated skill versions with the app it verifies: commit `.draht/skills/verify-<app>/` (skill, feature map, helpers) to the target repo. Then tell the user two things:
95
+
96
+ - `/verify-work` picks it up: when a `verify-<app>` skill exists, the phase verifier drives one mapped feature and captures its evidence instead of stopping at the test suite.
97
+ - The map stays honest only if it changes with the app: a change that adds or reshapes a user-facing feature updates the matching feature file in the same change. A map entry the app has outgrown is worse than none — it teaches wrong steps with confidence.
98
+
99
+ ## Failure Modes — STOP
100
+
101
+ Stop immediately if you catch yourself:
102
+
103
+ - Writing recipes against an app you never started — generate from observed behaviour, not from reading the code
104
+ - Trusting a dry-run or test mode by its name instead of observing what it actually skips
105
+ - Proving a feature through a test-only endpoint or internal setter instead of the real user path
106
+ - Driving an instance this run did not start
107
+ - Writing a cleanup that deletes the proof artifacts
108
+ - Handing over a skill whose own instructions were never executed end to end
@@ -15,25 +15,14 @@ Phase: $1
15
15
 
16
16
  ## Atomic Reasoning
17
17
 
18
- Before questioning, decompose this phase scope into atomic reasoning units:
19
-
20
- **For each implementation decision:**
21
- 1. **State the logical component** — What gray area exists? What choice needs to be made? Why does this matter?
22
- 2. **Validate independence** — Can this decision be made independently, or does it depend on other choices? What downstream impacts does it have?
23
- 3. **Verify correctness** — What criteria determine the right answer? What trade-offs exist? What domain terms need clarification?
24
-
25
- **Synthesize discussion strategy:**
26
- - Identify critical decisions that block planning
27
- - Group related decisions (e.g., all API decisions together)
28
- - Sequence questions from foundational to detailed
29
- - Ensure domain language is established first
18
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
30
19
 
31
20
  ## Steps
32
21
  1. Run `draht-tools phase-info $1` to load phase context
33
22
  2. Identify gray areas based on what's being built
34
- 3. Present 1-2 questions at a time about preferences
23
+ 3. Present the whole frontier of open decisions in one numbered round — every question whose prerequisites are settled, each with a recommended answer the user can accept by number; defer questions that depend on still-open answers to the next round. Environment facts are your job, never the user's — dispatch a subagent and only hold back the questions downstream of it.
35
24
  4. If `.planning/DOMAIN.md` exists, load it and validate discovered terms against the glossary. Add any new domain terms found during discussion.
36
- 5. Record decisions with `draht-tools save-context $1` — label each entry **decided** (the user explicitly chose) or **assumed** (you inferred from context). Assumed entries are flagged for confirmation; a plan built on an unlabeled assumption fails silently later.
25
+ 5. Record decisions with `draht-tools save-context $1` — label each entry **decided** (the user explicitly chose) or **assumed** (you inferred from context). An answer accepted by number counts as decided. Assumed entries are flagged for confirmation; a plan built on an unlabeled assumption fails silently later.
37
26
  6. Commit: `draht-tools commit-docs "capture phase $1 context"`
38
27
 
39
28
  ## Workflow