@draht/coding-agent 2026.10.4 → 2026.10.8-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 (282) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +32 -6
  3. package/dist/bundle/chunks/{anthropic-messages-GAKYXF65.js → anthropic-messages-E2P6C3P7.js} +1 -1
  4. package/dist/bundle/chunks/anthropic.js +1 -1
  5. package/dist/bundle/chunks/{azure-openai-responses-ZIXMK6JO.js → azure-openai-responses-JZMSTDIM.js} +1 -1
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +20 -20
  7. package/dist/bundle/chunks/chunk-2JZLKNZ4.js +3 -0
  8. package/dist/bundle/chunks/chunk-5QJFWTKA.js +4 -0
  9. package/dist/bundle/chunks/{chunk-XKDTJ4YR.js → chunk-6QIFWMDF.js} +1 -1
  10. package/dist/bundle/chunks/{chunk-5VZWYVZB.js → chunk-AHGUOQPH.js} +2 -2
  11. package/dist/bundle/chunks/{chunk-H6FT43VC.js → chunk-BOGY4QVF.js} +4 -4
  12. package/dist/bundle/chunks/{chunk-RZKPFWMH.js → chunk-D3HO453P.js} +2 -2
  13. package/dist/bundle/chunks/{chunk-KVH4HR57.js → chunk-FHX2S5IG.js} +1 -1
  14. package/dist/bundle/chunks/chunk-GBFVS2SF.js +12 -0
  15. package/dist/bundle/chunks/chunk-GD2WVXWT.js +65 -0
  16. package/dist/bundle/chunks/{chunk-Z2INEV2J.js → chunk-KJJJSTND.js} +307 -168
  17. package/dist/bundle/chunks/{chunk-BXSHCX3G.js → chunk-KY2BG6BC.js} +1 -1
  18. package/dist/bundle/chunks/chunk-LO6CVU2L.js +6 -0
  19. package/dist/bundle/chunks/chunk-PGJAHC3R.js +107 -0
  20. package/dist/bundle/chunks/chunk-QVFELZW2.js +312 -0
  21. package/dist/bundle/chunks/{chunk-COF5JT7R.js → chunk-QVTLBSTH.js} +1 -1
  22. package/dist/bundle/chunks/{chunk-DPE4ALPU.js → chunk-U6LDZZGM.js} +10 -10
  23. package/dist/bundle/chunks/{chunk-D6TMD5Q2.js → chunk-UTRX2VHB.js} +8 -8
  24. package/dist/bundle/chunks/{chunk-LDAOC5RB.js → chunk-VQOV5VFH.js} +1 -1
  25. package/dist/bundle/chunks/chunk-VXUJMEMO.js +2 -0
  26. package/dist/bundle/chunks/{cli-SR5QBZH4.js → cli-O6OWCY7N.js} +1 -1
  27. package/dist/bundle/chunks/execute-4JU5WQXP.js +18 -0
  28. package/dist/bundle/chunks/google-antigravity.js +1 -1
  29. package/dist/bundle/chunks/google-gemini-cli.js +1 -1
  30. package/dist/bundle/chunks/{google-generative-ai-RPUPQ6PM.js → google-generative-ai-HPNDIAZD.js} +1 -1
  31. package/dist/bundle/chunks/{google-vertex-EZES5QVQ.js → google-vertex-KPAWJ4SP.js} +1 -1
  32. package/dist/bundle/chunks/https-proxy-agent-WQIRL24U.js +13 -0
  33. package/dist/bundle/chunks/lib-ULKZYRGD.js +9 -0
  34. package/dist/bundle/chunks/{mistral-conversations-AOYGU43Y.js → mistral-conversations-FMSPWQ7A.js} +1 -1
  35. package/dist/bundle/chunks/{multipart-parser-AZP5BX2W.js → multipart-parser-HMCXZ4BD.js} +1 -1
  36. package/dist/bundle/chunks/{node-LQ52KV6B.js → node-4JNG6XQO.js} +1 -1
  37. package/dist/bundle/chunks/{node-C2JGH2OB.js → node-6IIDYB3K.js} +1 -1
  38. package/dist/bundle/chunks/openai-chatgpt.js +1 -1
  39. package/dist/bundle/chunks/{openai-codex-responses-M2Y77JEQ.js → openai-codex-responses-TU7NGPXE.js} +1 -1
  40. package/dist/bundle/chunks/openai-codex.js +1 -1
  41. package/dist/bundle/chunks/{openai-completions-A4OKYOYV.js → openai-completions-GANCQQO5.js} +1 -1
  42. package/dist/bundle/chunks/{openai-responses-6IXV53T3.js → openai-responses-ASDPAX3E.js} +1 -1
  43. package/dist/bundle/chunks/{openrouter-images-LYV4NKFM.js → openrouter-images-NROSQXMZ.js} +1 -1
  44. package/dist/bundle/chunks/openrouter.js +1 -1
  45. package/dist/bundle/chunks/{pi-messages-KKMEUT3Z.js → pi-messages-2QEJYOAO.js} +1 -1
  46. package/dist/bundle/chunks/radius.js +1 -1
  47. package/dist/bundle/chunks/{runtime-6YJPGSP7.js → runtime-FIGQHW75.js} +1 -1
  48. package/dist/bundle/chunks/runtime-TJ3EAMJK.js +3 -0
  49. package/dist/bundle/chunks/{settings-manager-D2EG7WDO.js → settings-manager-HC5RR36T.js} +1 -1
  50. package/dist/bundle/chunks/src-KDGO7EGF.js +4 -0
  51. package/dist/bundle/chunks/virtual-modules-UIGTRGHQ.js +2 -0
  52. package/dist/bundle/chunks/xai.js +1 -1
  53. package/dist/bundle/cli-runtime.js +1 -1
  54. package/dist/bundle/index.js +1 -1
  55. package/dist/bundle/rpc-entry.js +1 -1
  56. package/dist/cli/args.js +3 -3
  57. package/dist/cli/args.js.map +1 -1
  58. package/dist/core/builtins/duet.d.ts +5 -2
  59. package/dist/core/builtins/duet.d.ts.map +1 -1
  60. package/dist/core/builtins/duet.js +65 -27
  61. package/dist/core/builtins/duet.js.map +1 -1
  62. package/dist/core/builtins/index.d.ts.map +1 -1
  63. package/dist/core/builtins/index.js +2 -0
  64. package/dist/core/builtins/index.js.map +1 -1
  65. package/dist/core/builtins/polyphase.d.ts +15 -0
  66. package/dist/core/builtins/polyphase.d.ts.map +1 -0
  67. package/dist/core/builtins/polyphase.js +196 -0
  68. package/dist/core/builtins/polyphase.js.map +1 -0
  69. package/dist/core/builtins/subagent.d.ts +44 -34
  70. package/dist/core/builtins/subagent.d.ts.map +1 -1
  71. package/dist/core/builtins/subagent.js +827 -560
  72. package/dist/core/builtins/subagent.js.map +1 -1
  73. package/dist/core/extensions/types.d.ts +17 -2
  74. package/dist/core/extensions/types.d.ts.map +1 -1
  75. package/dist/core/extensions/types.js.map +1 -1
  76. package/dist/core/keybindings.d.ts +30 -0
  77. package/dist/core/keybindings.d.ts.map +1 -1
  78. package/dist/core/keybindings.js +24 -0
  79. package/dist/core/keybindings.js.map +1 -1
  80. package/dist/core/model-resolver.js +4 -4
  81. package/dist/core/model-resolver.js.map +1 -1
  82. package/dist/core/multi-agent/permission-gate.d.ts.map +1 -1
  83. package/dist/core/multi-agent/permission-gate.js +4 -1
  84. package/dist/core/multi-agent/permission-gate.js.map +1 -1
  85. package/dist/core/polyphase/approval.d.ts +35 -0
  86. package/dist/core/polyphase/approval.d.ts.map +1 -0
  87. package/dist/core/polyphase/approval.js +184 -0
  88. package/dist/core/polyphase/approval.js.map +1 -0
  89. package/dist/core/polyphase/child-events.d.ts +107 -0
  90. package/dist/core/polyphase/child-events.d.ts.map +1 -0
  91. package/dist/core/polyphase/child-events.js +862 -0
  92. package/dist/core/polyphase/child-events.js.map +1 -0
  93. package/dist/core/polyphase/child-process.d.ts +65 -0
  94. package/dist/core/polyphase/child-process.d.ts.map +1 -0
  95. package/dist/core/polyphase/child-process.js +361 -0
  96. package/dist/core/polyphase/child-process.js.map +1 -0
  97. package/dist/core/polyphase/commands.d.ts +44 -0
  98. package/dist/core/polyphase/commands.d.ts.map +1 -0
  99. package/dist/core/polyphase/commands.js +244 -0
  100. package/dist/core/polyphase/commands.js.map +1 -0
  101. package/dist/core/polyphase/details.d.ts +40 -0
  102. package/dist/core/polyphase/details.d.ts.map +1 -0
  103. package/dist/core/polyphase/details.js +538 -0
  104. package/dist/core/polyphase/details.js.map +1 -0
  105. package/dist/core/polyphase/emitter.d.ts +20 -0
  106. package/dist/core/polyphase/emitter.d.ts.map +1 -0
  107. package/dist/core/polyphase/emitter.js +90 -0
  108. package/dist/core/polyphase/emitter.js.map +1 -0
  109. package/dist/core/polyphase/jsonl-reader.d.ts +31 -0
  110. package/dist/core/polyphase/jsonl-reader.d.ts.map +1 -0
  111. package/dist/core/polyphase/jsonl-reader.js +161 -0
  112. package/dist/core/polyphase/jsonl-reader.js.map +1 -0
  113. package/dist/core/polyphase/keyword.d.ts +27 -0
  114. package/dist/core/polyphase/keyword.d.ts.map +1 -0
  115. package/dist/core/polyphase/keyword.js +97 -0
  116. package/dist/core/polyphase/keyword.js.map +1 -0
  117. package/dist/core/polyphase/limiter.d.ts +38 -0
  118. package/dist/core/polyphase/limiter.d.ts.map +1 -0
  119. package/dist/core/polyphase/limiter.js +129 -0
  120. package/dist/core/polyphase/limiter.js.map +1 -0
  121. package/dist/core/polyphase/model-selection.d.ts +35 -0
  122. package/dist/core/polyphase/model-selection.d.ts.map +1 -0
  123. package/dist/core/polyphase/model-selection.js +72 -0
  124. package/dist/core/polyphase/model-selection.js.map +1 -0
  125. package/dist/core/polyphase/render/format.d.ts +52 -0
  126. package/dist/core/polyphase/render/format.d.ts.map +1 -0
  127. package/dist/core/polyphase/render/format.js +169 -0
  128. package/dist/core/polyphase/render/format.js.map +1 -0
  129. package/dist/core/polyphase/render/renderers.d.ts +63 -0
  130. package/dist/core/polyphase/render/renderers.d.ts.map +1 -0
  131. package/dist/core/polyphase/render/renderers.js +277 -0
  132. package/dist/core/polyphase/render/renderers.js.map +1 -0
  133. package/dist/core/polyphase/render/run-block.d.ts +45 -0
  134. package/dist/core/polyphase/render/run-block.d.ts.map +1 -0
  135. package/dist/core/polyphase/render/run-block.js +843 -0
  136. package/dist/core/polyphase/render/run-block.js.map +1 -0
  137. package/dist/core/polyphase/render/snapshot.d.ts +106 -0
  138. package/dist/core/polyphase/render/snapshot.d.ts.map +1 -0
  139. package/dist/core/polyphase/render/snapshot.js +292 -0
  140. package/dist/core/polyphase/render/snapshot.js.map +1 -0
  141. package/dist/core/polyphase/result-text.d.ts +41 -0
  142. package/dist/core/polyphase/result-text.d.ts.map +1 -0
  143. package/dist/core/polyphase/result-text.js +326 -0
  144. package/dist/core/polyphase/result-text.js.map +1 -0
  145. package/dist/core/polyphase/session.d.ts +33 -0
  146. package/dist/core/polyphase/session.d.ts.map +1 -0
  147. package/dist/core/polyphase/session.js +106 -0
  148. package/dist/core/polyphase/session.js.map +1 -0
  149. package/dist/core/polyphase/settings.d.ts +18 -0
  150. package/dist/core/polyphase/settings.d.ts.map +1 -0
  151. package/dist/core/polyphase/settings.js +93 -0
  152. package/dist/core/polyphase/settings.js.map +1 -0
  153. package/dist/core/polyphase/store.d.ts +197 -0
  154. package/dist/core/polyphase/store.d.ts.map +1 -0
  155. package/dist/core/polyphase/store.js +558 -0
  156. package/dist/core/polyphase/store.js.map +1 -0
  157. package/dist/core/polyphase/types.d.ts +371 -0
  158. package/dist/core/polyphase/types.d.ts.map +1 -0
  159. package/dist/core/polyphase/types.js +36 -0
  160. package/dist/core/polyphase/types.js.map +1 -0
  161. package/dist/core/polyphase/ui/controller.d.ts +28 -0
  162. package/dist/core/polyphase/ui/controller.d.ts.map +1 -0
  163. package/dist/core/polyphase/ui/controller.js +150 -0
  164. package/dist/core/polyphase/ui/controller.js.map +1 -0
  165. package/dist/core/polyphase/ui/dock.d.ts +27 -0
  166. package/dist/core/polyphase/ui/dock.d.ts.map +1 -0
  167. package/dist/core/polyphase/ui/dock.js +121 -0
  168. package/dist/core/polyphase/ui/dock.js.map +1 -0
  169. package/dist/core/polyphase/ui/inspector.d.ts +117 -0
  170. package/dist/core/polyphase/ui/inspector.d.ts.map +1 -0
  171. package/dist/core/polyphase/ui/inspector.js +1016 -0
  172. package/dist/core/polyphase/ui/inspector.js.map +1 -0
  173. package/dist/core/polyphase/ui/transcript-layout.d.ts +55 -0
  174. package/dist/core/polyphase/ui/transcript-layout.d.ts.map +1 -0
  175. package/dist/core/polyphase/ui/transcript-layout.js +210 -0
  176. package/dist/core/polyphase/ui/transcript-layout.js.map +1 -0
  177. package/dist/core/polyphase/update-pump.d.ts +18 -0
  178. package/dist/core/polyphase/update-pump.d.ts.map +1 -0
  179. package/dist/core/polyphase/update-pump.js +132 -0
  180. package/dist/core/polyphase/update-pump.js.map +1 -0
  181. package/dist/core/polyphase/workflow/agent-host.d.ts +26 -0
  182. package/dist/core/polyphase/workflow/agent-host.d.ts.map +1 -0
  183. package/dist/core/polyphase/workflow/agent-host.js +187 -0
  184. package/dist/core/polyphase/workflow/agent-host.js.map +1 -0
  185. package/dist/core/polyphase/workflow/guidance.d.ts +19 -0
  186. package/dist/core/polyphase/workflow/guidance.d.ts.map +1 -0
  187. package/dist/core/polyphase/workflow/guidance.js +119 -0
  188. package/dist/core/polyphase/workflow/guidance.js.map +1 -0
  189. package/dist/core/polyphase/workflow/launch.d.ts +41 -0
  190. package/dist/core/polyphase/workflow/launch.d.ts.map +1 -0
  191. package/dist/core/polyphase/workflow/launch.js +173 -0
  192. package/dist/core/polyphase/workflow/launch.js.map +1 -0
  193. package/dist/core/polyphase/workflow/meta.d.ts +43 -0
  194. package/dist/core/polyphase/workflow/meta.d.ts.map +1 -0
  195. package/dist/core/polyphase/workflow/meta.js +529 -0
  196. package/dist/core/polyphase/workflow/meta.js.map +1 -0
  197. package/dist/core/polyphase/workflow/prelude.d.ts +24 -0
  198. package/dist/core/polyphase/workflow/prelude.d.ts.map +1 -0
  199. package/dist/core/polyphase/workflow/prelude.js +93 -0
  200. package/dist/core/polyphase/workflow/prelude.js.map +1 -0
  201. package/dist/core/polyphase/workflow/runtime.d.ts +79 -0
  202. package/dist/core/polyphase/workflow/runtime.d.ts.map +1 -0
  203. package/dist/core/polyphase/workflow/runtime.js +217 -0
  204. package/dist/core/polyphase/workflow/runtime.js.map +1 -0
  205. package/dist/core/polyphase/workflow/runtime.lazy.d.ts +3 -0
  206. package/dist/core/polyphase/workflow/runtime.lazy.d.ts.map +1 -0
  207. package/dist/core/polyphase/workflow/runtime.lazy.js +3 -0
  208. package/dist/core/polyphase/workflow/runtime.lazy.js.map +1 -0
  209. package/dist/core/polyphase/workflow/saved.d.ts +55 -0
  210. package/dist/core/polyphase/workflow/saved.d.ts.map +1 -0
  211. package/dist/core/polyphase/workflow/saved.js +299 -0
  212. package/dist/core/polyphase/workflow/saved.js.map +1 -0
  213. package/dist/core/polyphase/workflow/structured-output.d.ts +22 -0
  214. package/dist/core/polyphase/workflow/structured-output.d.ts.map +1 -0
  215. package/dist/core/polyphase/workflow/structured-output.js +66 -0
  216. package/dist/core/polyphase/workflow/structured-output.js.map +1 -0
  217. package/dist/core/polyphase/workflow/tool.d.ts +24 -0
  218. package/dist/core/polyphase/workflow/tool.d.ts.map +1 -0
  219. package/dist/core/polyphase/workflow/tool.js +139 -0
  220. package/dist/core/polyphase/workflow/tool.js.map +1 -0
  221. package/dist/core/sdk.d.ts +1 -1
  222. package/dist/core/sdk.js +1 -1
  223. package/dist/core/sdk.js.map +1 -1
  224. package/dist/core/settings-manager.d.ts +27 -0
  225. package/dist/core/settings-manager.d.ts.map +1 -1
  226. package/dist/core/settings-manager.js.map +1 -1
  227. package/dist/core/socket-server/permission-relay.js +4 -0
  228. package/dist/core/socket-server/permission-relay.js.map +1 -1
  229. package/dist/core/trust-manager.d.ts +3 -2
  230. package/dist/core/trust-manager.d.ts.map +1 -1
  231. package/dist/core/trust-manager.js +5 -2
  232. package/dist/core/trust-manager.js.map +1 -1
  233. package/dist/experimental/micro/runtime.js +1 -1
  234. package/dist/experimental/micro/runtime.js.map +1 -1
  235. package/dist/modes/interactive/components/keybinding-hints.d.ts +7 -0
  236. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  237. package/dist/modes/interactive/components/keybinding-hints.js +18 -0
  238. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  239. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  240. package/dist/modes/interactive/interactive-mode.js +11 -2
  241. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  242. package/dist/modes/rpc/rpc-types.d.ts +9 -0
  243. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  244. package/dist/modes/rpc/rpc-types.js.map +1 -1
  245. package/dist/prompts/commands/orchestrate.md +1 -1
  246. package/dist/utils/shell.d.ts.map +1 -1
  247. package/dist/utils/shell.js +7 -1
  248. package/dist/utils/shell.js.map +1 -1
  249. package/docs/docs.json +4 -0
  250. package/docs/duet.md +3 -3
  251. package/docs/environment-variables.md +11 -0
  252. package/docs/json.md +7 -0
  253. package/docs/keybindings.md +20 -0
  254. package/docs/polyphase.md +391 -0
  255. package/docs/rpc-commands.md +9 -9
  256. package/docs/settings.md +12 -0
  257. package/docs/virtual-models.md +3 -3
  258. package/examples/extensions/preset.ts +3 -3
  259. package/examples/extensions/subagent/README.md +1 -1
  260. package/examples/extensions/subagent/agents/planner.md +1 -1
  261. package/examples/extensions/subagent/agents/reviewer.md +1 -1
  262. package/examples/extensions/subagent/agents/scout.md +1 -1
  263. package/examples/extensions/subagent/agents/worker.md +1 -1
  264. package/examples/extensions/summarize.ts +3 -3
  265. package/examples/sdk/02-custom-model.ts +1 -1
  266. package/examples/sdk/12-full-control.ts +1 -1
  267. package/examples/sdk/README.md +1 -1
  268. package/package.json +10 -10
  269. package/prompts/commands/orchestrate.md +1 -1
  270. package/dist/bundle/chunks/chunk-6MSE6LZ3.js +0 -6
  271. package/dist/bundle/chunks/chunk-6ZJKIMU7.js +0 -2
  272. package/dist/bundle/chunks/chunk-736QBNUZ.js +0 -12
  273. package/dist/bundle/chunks/chunk-CEJJ5XF2.js +0 -170
  274. package/dist/bundle/chunks/chunk-IWTUBX6V.js +0 -4
  275. package/dist/bundle/chunks/chunk-TIA2T6EO.js +0 -3
  276. package/dist/bundle/chunks/execute-VCYDHEYA.js +0 -328
  277. package/dist/bundle/chunks/https-proxy-agent-O2PVUIOI.js +0 -13
  278. package/dist/bundle/chunks/lib-XOG5PI3Y.js +0 -9
  279. package/dist/bundle/chunks/src-TIBHS42X.js +0 -4
  280. package/dist/bundle/chunks/virtual-modules-JTCGDL2Z.js +0 -2
  281. /package/dist/bundle/chunks/{chunk-ZZD35WKM.js → chunk-FBU742QF.js} +0 -0
  282. /package/dist/bundle/chunks/{chunk-SVNWI7EV.js → chunk-XHCO4PPH.js} +0 -0
@@ -0,0 +1,391 @@
1
+ # Orchestrate agents with polyphase
2
+
3
+ Polyphase gives you live oversight of every agent draht fans out: `subagent` calls (single,
4
+ parallel, or chain) and model-written `workflow` scripts. In the TUI you get a live line per agent
5
+ in the tool row, a one-line dock above the editor, and a popup inspector (`alt+a`). Outside the
6
+ TUI, you get the same final text and bounded structured results, without the live views. Duet
7
+ triage (`duet_delegate`) shares the dock, the inspector, and the concurrency limiter, but keeps its
8
+ own, unrelated tool row.
9
+
10
+ ## Overview
11
+
12
+ A `subagent` call, a duet triage batch, or a `workflow` script all spawn one child `draht` process
13
+ per agent, each running `--mode json -p --no-session`. Polyphase parses that child's JSON event
14
+ stream into live state (model, activity, transcript, usage, tool calls), coalesces updates through
15
+ one timer per session, and renders them into the dock and the inspector; `subagent` and `workflow`
16
+ calls additionally render into the tool row. All of this state is session-scoped: it is created on
17
+ first use and disposed when the session shuts down, so attached or multiplexed sessions never
18
+ share it.
19
+
20
+ The `subagent` tool, `duet_delegate` triage, and the `workflow` tool share one child-process
21
+ runner, one per-session concurrency limiter, and one live-view store feeding the dock and the
22
+ inspector. `duet_delegate` keeps its own tool-row renderer and result format — see
23
+ [Tool rows](#tool-rows).
24
+
25
+ ## Tool rows
26
+
27
+ Each subagent or workflow tool call renders as a block in the transcript, one line per agent.
28
+ `duet_delegate` is not covered by this section: it renders its own, unchanged tool-row block (a
29
+ partial result shows only a `N/M teammates active` status; the finished result is plain text).
30
+
31
+ ```
32
+ subagent parallel · 3 agents
33
+ ◐ 1 running · ✓ 1 done · ◌ 1 queued (4/4 slots busy) 0:42 · 12.3k tok · $0.08
34
+ ✓ investigator claude-sonnet-5 high 0:31 STATUS: DONE — 3 candidate files
35
+ ◐ reviewer#1 claude-sonnet-5 high 0:12 thinking · The refresh path calls…
36
+ ◌ reviewer#2 claude-sonnet-5 high queued
37
+ alt+a inspect agents · ctrl+o expand
38
+ ```
39
+
40
+ - **Glyphs:** `◐`/`◓`/`◑`/`◒` spinner or `●` (running), `◌` (queued), `·` (pending), `✓` (done),
41
+ `✗` (failed), `⊘` (cancelled), `–` (skipped), `⚠` (blocked tool call).
42
+ - **Only the focus row animates.** The focus row is the newest running tool-origin `subagent` or
43
+ `workflow` run. Every other row shows a static `●` glyph with no elapsed time, no live tokens,
44
+ and no "what it's doing now" text, so scrolling past a background run never forces a full
45
+ terminal redraw.
46
+ - **Expand/collapse** with `app.tools.expand` (`ctrl+o`, the existing key). The expanded view adds
47
+ per-agent task text, tool-call counts, and either the live transcript tail (thinking/text/tool
48
+ items) or, once finished, a head+tail preview of the output (up to 10 lines; longer output shows
49
+ the first 3 lines, an `… N lines omitted …` marker, and the last 6).
50
+ - **Chain** rows show one line per step with step numbers; not-yet-reached steps read
51
+ `waits for step N` and skipped steps read `not run`.
52
+ - **Workflow** rows show a phase tree instead of a flat agent list: one line per phase with a
53
+ `done/total` tally and elapsed time, the active phase's agents indented, the last `log(...)` line
54
+ prefixed `»`, and, once finished, the returned value prefixed `→`.
55
+ - **Resumed sessions** (after `/resume`, a crash, or a fork) render the final block from the
56
+ persisted `details` only — see [Non-TUI behavior and the details schema](#non-tui-behavior-and-the-details-schema).
57
+ Old sessions recorded before polyphase existed fall back to a legacy renderer.
58
+
59
+ ## The dock
60
+
61
+ While any run is active, a one-line widget appears above the editor (`polyphase.dock`, default
62
+ on):
63
+
64
+ ```
65
+ ◐ polyphase · 2 runs · 3 running · 1 queued · 6 done · 1 failed · $0.69 · alt+a inspect
66
+ ```
67
+
68
+ A running workflow started from a slash command (`/<name>` or `/workflow <name>`) additionally
69
+ shows its compact phase tree under the summary line, capped at 10 lines total for the whole dock.
70
+ The dock disappears again once nothing is running, and is skipped entirely when
71
+ `polyphase.dock` is `false` or there is no TUI (print, JSON, RPC).
72
+
73
+ ## The agent inspector
74
+
75
+ Press `app.polyphase.inspector` (default `alt+a`) to open a full-screen overlay listing runs and
76
+ agents, and to follow any agent's live thinking, text, and tool calls. A second press — or
77
+ `escape` — closes it; `escape` from a detail or run view instead steps back one level.
78
+
79
+ ### Views
80
+
81
+ - **Runs** — live runs, runs finished earlier in this session (recovered from the transcript),
82
+ and saved workflows; `enter` on a saved workflow inserts its run command (`/<name> ` or
83
+ `/workflow <name> `) into the editor and closes the inspector. Opens automatically when there
84
+ is no exactly-one live run, or on `/workflows`.
85
+ - **Run** — phase-grouped for workflows, a flat numbered list of steps for chains, a flat list of
86
+ agents otherwise. Opens automatically when exactly one run is live, with its first running
87
+ agent selected.
88
+ - **Agent detail** — the live transcript tail for one agent: tool calls with status and duration,
89
+ thinking and text, and a footer showing `◆ following` or `‖ paused · f to follow`.
90
+ - **Split view** — at 120 columns or more, the run view's agent list (left, 40 columns) and the
91
+ selected agent's detail (right) render side by side; `enter` switches to the full-width detail.
92
+
93
+ Archived (no-longer-live) runs render from their persisted summary only, with the note
94
+ "Live transcript is only kept while the run is in memory."
95
+
96
+ ### Keys
97
+
98
+ All keys are configurable bindings (see [Keybindings Reference](keybindings.md)); none are
99
+ hardcoded.
100
+
101
+ | Action | Binding id | Default |
102
+ |---|---|---|
103
+ | Open / close the inspector | `app.polyphase.inspector` | `alt+a` |
104
+ | Move selection | `tui.select.up` / `tui.select.down` | up / down |
105
+ | Page | `tui.select.pageUp` / `tui.select.pageDown` | pageUp / pageDown |
106
+ | Open / drill in | `tui.select.confirm` | enter |
107
+ | Back / close | `tui.select.cancel` | escape, ctrl+c |
108
+ | Next / previous agent | `app.polyphase.nextAgent` / `app.polyphase.previousAgent` | tab / shift+tab |
109
+ | Toggle follow (detail view) | `app.polyphase.follow` | f |
110
+ | Cancel the selected agent | `app.polyphase.cancelAgent` | x |
111
+ | Cancel the selected run | `app.polyphase.cancelRun` | shift+x |
112
+ | Show / hide thinking | `app.thinking.toggle` (reused) | ctrl+t |
113
+ | Show / hide tool-result previews | `app.tools.expand` (reused) | ctrl+o |
114
+
115
+ Opening the inspector over an active permission or confirmation dialog is suppressed, so `alt+a`
116
+ never hides a prompt you still need to answer; conversely, the inspector closes itself right
117
+ before such a dialog opens, so it is never left covering one.
118
+
119
+ ### Cancel semantics
120
+
121
+ Cancelling takes two presses of the same key, with no timer: the first press arms it and the
122
+ footer shows a `press the same key again to cancel <label>` (or `... to cancel the run`) prompt;
123
+ any other key disarms it; a second press of the same key confirms. Pressing cancel on an agent
124
+ that has already finished shows `already finished` and does not arm.
125
+
126
+ Cancelling an agent inside a running `workflow` script makes its `agent()` call return `null` to
127
+ the script (the script sees it exactly like a failed or budget-exhausted call — check for `null`).
128
+ Cancelling a run cancels every unfinished agent in it and stops the run.
129
+
130
+ ## Model inheritance and per-task overrides
131
+
132
+ Model and thinking level for a child agent are resolved in this order, first match wins:
133
+
134
+ 1. An explicit `model` (and `thinking`/`effort`) on the call itself — the `subagent` tool's
135
+ per-task `model`/`thinking` fields, or `agent(prompt, { model, effort })` in a workflow script.
136
+ 2. A workflow phase's `model` from `meta.phases[n].model`.
137
+ 3. The agent type's frontmatter `model:`, passed through to the child verbatim (so an invalid
138
+ pattern is still diagnosed by the child, as before).
139
+ 4. The parent session's current model and thinking level ("inherited"). Subagents without an
140
+ explicit or frontmatter model now inherit the parent's model and thinking level, instead of
141
+ falling back to the child's own default.
142
+ 5. The child's own default model, when nothing above resolved to a usable model.
143
+
144
+ When an inherited model turns out to be one the child process cannot resolve on its own (an
145
+ extension-registered or virtual model that only exists in the parent), the runner retries once
146
+ without `--model`/`--thinking` and the row shows `default model` instead. This fallback only
147
+ applies to inherited models; an invalid explicit override or frontmatter model is reported as a
148
+ failure, not silently swapped.
149
+
150
+ Model labels: collapsed rows show `id thinking` (e.g. `claude-sonnet-5 high`); expanded rows show
151
+ `provider/id thinking (source)`, with `(source)` shown only for `inherited` and `child-default`.
152
+
153
+ ## Parent-model results
154
+
155
+ When a `subagent` or `workflow` tool call finishes, the text returned to the parent model is
156
+ capped and shaped so it stays informative without flooding context:
157
+
158
+ - **Single mode:** the full output, head+tail capped at 50,000 characters, keeping the last
159
+ `STATUS:` line even when the tail cut would otherwise drop it. A failure instead shows
160
+ `FAILED (exit 1, model <provider/id>)` with an 8,000-character output cap and the last 2,000
161
+ characters of stderr. A cancellation shows `CANCELLED by <reason> after <elapsed>` plus any
162
+ partial output.
163
+ - **Parallel mode:** a summary line (`Parallel: 2/3 succeeded, 1 failed`), then one block per
164
+ agent with its status, model, and elapsed time, and a per-agent output cap that divides a
165
+ shared budget (`polyphase.resultChars`, default 64,000) across all agents (2,000-16,000
166
+ characters per agent). Failed agents' blocks include a stderr tail.
167
+ - **Chain mode:** one status line per step, then the last step's output (50,000-character cap),
168
+ or — on failure or cancellation — `Chain failed|cancelled at step k (<label>)` with that step's
169
+ output and stderr.
170
+ - **Workflow:** a header line (status, agent counts, elapsed, tokens, cost), a `Phases:` tally,
171
+ the returned value as pretty JSON (or text) capped at 32,000 characters, the last 30 `log(...)`
172
+ lines, up to 8,000 characters of console output, and up to 100 per-agent summary lines, followed
173
+ by any budget notice, script error (with its source line), and blocked-call note.
174
+
175
+ Every mode appends, when applicable, a note about tool calls blocked inside subagents — see
176
+ [Permissions](#permissions) below.
177
+
178
+ Tokens and cost shown anywhere in polyphase (rows, dock, inspector, result text) are *billable*
179
+ tokens: input + output + cache-write tokens, excluding cache reads. The same measure drives token
180
+ budgets. Cost is shown in USD (`usage.cost.total`) but is never itself budgeted.
181
+
182
+ ## Workflows
183
+
184
+ A workflow is a script the model writes (or you save to a file) that orchestrates one or more
185
+ subagents through a multi-phase task, with the same live oversight as a `subagent` call.
186
+
187
+ ### The keyword
188
+
189
+ The `workflow` tool is not registered by default. Saying the configured keyword (default
190
+ `polyphase`, `polyphase.keyword`) anywhere in a prompt enables it for that prompt: draht registers
191
+ the tool, activates it, and — whenever the authoring guide is not already in context (the first
192
+ time, and again after each compaction) — sends the model a one-line visible message
193
+ (`◆ polyphase · workflow tool enabled · authoring guide sent to the model`, expandable to the full
194
+ script-authoring guide) so the model knows the API without a system-prompt change. The tool
195
+ deactivates again once the agent settles, unless it was activated some other way. An input
196
+ starting with `/` or `!` never triggers the keyword. Set `polyphase.workflowTool` to `"always"` to
197
+ keep it active for the whole session, or `"off"` to disable the keyword entirely (saved-workflow
198
+ commands still work either way).
199
+
200
+ ### The script API
201
+
202
+ A workflow script is plain JavaScript with no imports, no filesystem access, and no network access
203
+ of its own — all real work happens inside the subagents it starts with `agent()`. It must start
204
+ with a `meta` block written as a pure literal (no identifiers, function calls, spreads, computed
205
+ keys, template interpolation, or regex literals):
206
+
207
+ ```js
208
+ export const meta = {
209
+ name: "review-pr", // ^[a-z][a-z0-9-]{0,47}$, used for /review-pr if saved
210
+ description: "Review a change in parallel and synthesize findings", // 1-300 chars
211
+ whenToUse: "...", // optional, <= 300 chars
212
+ phases: [ // 1-20 entries
213
+ { title: "Scan" },
214
+ { title: "Review" },
215
+ { title: "Synthesize", model: "anthropic/claude-opus-5-5" }, // optional per-phase model
216
+ ],
217
+ };
218
+ ```
219
+
220
+ Unknown keys in `meta` are ignored, not errors. Validation errors report the exact field path
221
+ (e.g. `meta.phases[2].title`) and a 1-based line and column.
222
+
223
+ The async body after `meta` uses:
224
+
225
+ - `agent(prompt, opts)` — starts one subagent and returns its final text, or (with `opts.schema`
226
+ set) the schema-validated object. Returns `null` when the agent failed, was cancelled (by the
227
+ user or the token budget), the budget was already exhausted, or produced no valid structured
228
+ output when a schema was requested — always check for `null`. Throws for invalid options, an
229
+ unknown `agentType`/model, an invalid `effort`, or the per-run agent cap.
230
+ `opts`: `{ label, phase, schema, model, effort, isolation: "worktree", agentType }`.
231
+ - `parallel(thunks)` — runs an array of zero-argument thunks (each should call `agent()`) and
232
+ waits for all of them (a barrier). A throwing thunk becomes `null` in the result array, with a
233
+ warning logged. `parallel()` itself throws for invalid arguments: a non-array, a non-function
234
+ item, or more items than `polyphase.maxItemsPerCall`.
235
+ - `pipeline(items, ...stages)` — runs every item through the same stages in sequence, with **no**
236
+ barrier between stages: each stage `(prev, item, index)` receives the previous stage's result
237
+ (or the item itself for the first stage). A throwing stage makes that item `null` and skips its
238
+ later stages for that item only — other items keep advancing.
239
+ - `phase(title)` — groups the agents started after it under that phase for the live view. A title
240
+ not declared in `meta.phases` becomes a dynamic phase (logged once).
241
+ - `log(...parts)` — writes a narrator line visible in the dock and inspector.
242
+ - `args` — the verbatim string passed to this call (or to `/<name> ...`).
243
+ - `meta` — the frozen meta object, readable in the body.
244
+ - `budget` — `{ total, spent(), remaining() }`; `spent()` is this run's total billable tokens as
245
+ of the latest `agent()` reply.
246
+
247
+ Reserved names that a script must never redeclare: `agent`, `parallel`, `pipeline`, `phase`,
248
+ `log`, `args`, `budget`, `meta`.
249
+
250
+ ### Determinism
251
+
252
+ The orchestrating script itself must be deterministic: `Math.random`, `Date.now()`, `Date()`,
253
+ `new Date()`, and `performance.now` all throw. `new Date(value)` still works. Non-determinism
254
+ inside an `agent()` call is fine — only the script around it is restricted.
255
+
256
+ ### Caps and budget
257
+
258
+ - Up to `polyphase.maxAgentsPerRun` (default 200) `agent()` calls per run.
259
+ - Up to `polyphase.maxItemsPerCall` (default 1,024) items per `parallel()`/`pipeline()` call.
260
+ - Up to `polyphase.maxConcurrency` (default `clamp(cpuCount - 2, 2, 8)`) child processes running
261
+ at once across the whole session — shared with `subagent` and duet triage, so a workflow and a
262
+ concurrent `subagent` call compete for the same slots.
263
+ - A token budget (`budgetTokens` on the tool call, or `polyphase.defaultBudgetTokens`) is counted
264
+ in billable tokens. Once spent tokens reach the budget, every unfinished agent in the run is
265
+ cancelled and `agent()` starts returning `null`; a warning is logged once. Because output tokens
266
+ for an in-flight response often only arrive at that response's end, the actual spend can
267
+ overshoot the budget by up to one response per agent that was running at the moment the budget
268
+ was reached — this is a bound, not a guarantee of an exact stop.
269
+ - A workflow cannot start another workflow, and a workflow's agents are excluded from the
270
+ `duet_delegate` tool. See [Nesting depth](#nesting-depth).
271
+ - `polyphase.workflowTimeoutMs` (default `0`, no deadline) is a wall-clock deadline over the
272
+ whole run, including time spent waiting on `agent()` calls. On expiry the script fails with a
273
+ timeout and every agent still in flight is cancelled.
274
+
275
+ ### Structured output
276
+
277
+ Set `opts.schema` on an `agent()` call to get a schema-validated object back instead of raw text.
278
+ Under the hood, the child process is told to call the `polyphase_result` tool (registered only in
279
+ that child, only for that call) with arguments matching the schema; its arguments are validated
280
+ against the schema back in the parent, and the validated value — unwrapped from a `{ value: ... }`
281
+ wrapper when the schema's root type isn't `object` — becomes `agent()`'s return value. The child
282
+ is instructed to call `polyphase_result` exactly once, as its last action; anything it says
283
+ afterward is not seen by the script. An agent that never calls it, or calls it with arguments that
284
+ fail validation, makes `agent()` return `null` and logs a notice.
285
+
286
+ ## Saved workflows
287
+
288
+ A workflow saved as a `.js` file can be run directly with `/<name> [args]` or
289
+ `/workflow <name> [args]`, without the model writing it first.
290
+
291
+ - **Locations:** project workflows live in `.draht/workflows/*.js` (nearest ancestor directory,
292
+ only when the project is trusted — see [Permissions](#permissions)); user workflows live in
293
+ `<agent-dir>/workflows/*.js` (`~/.draht/agent/workflows` by default). A project workflow with the
294
+ same name overrides a user workflow of that name.
295
+ - **Naming:** the file's basename (without `.js`) must match the same pattern as `meta.name`
296
+ (`^[a-z][a-z0-9-]{0,47}$`); a file that doesn't is skipped with a warning. If `meta.name` doesn't
297
+ match the basename, the basename still wins, with an informational note.
298
+ - **Size:** files over 256 KiB are skipped.
299
+ - **Collisions.** `/<name>` is not registered when `<name>` collides with a built-in command, an
300
+ extension command or prompt template, a skill (`skill:<name>`), or a reserved polyphase name
301
+ (`workflow`, `workflows`, `polyphase`); the workflow is still runnable through
302
+ `/workflow <name>`, and one aggregated warning names every skipped workflow and its conflict.
303
+ - **`/workflow [name] [args]`** with no name opens a picker (TUI) or lists saved workflows and
304
+ diagnostics (non-TUI); choosing "Describe a new workflow…" fills the editor with the keyword so
305
+ the model can write one.
306
+ - **`/workflows [list]`** opens the inspector's runs view (TUI, no `list` argument) or lists live
307
+ and archived runs plus saved workflows as plain text.
308
+
309
+ ### Command-run results
310
+
311
+ A workflow started from `/<name>` or `/workflow` is **host-side**: it runs independently of any
312
+ agent turn, is cancelled only from the inspector or on session shutdown, and never blocks on the
313
+ model. When it finishes, its result is appended to the conversation as a custom message (visible
314
+ in the transcript and to the model on its next turn) **without triggering a new model turn or
315
+ spending a paid request** — the model only sees it if and when it is prompted again.
316
+
317
+ In print mode, the same custom message is recorded, but nothing from it is written to the
318
+ process's stdout output: the final text a `draht -p` invocation prints is the model's own last
319
+ response, not a background command-run result that may finish after (or without) a model turn.
320
+
321
+ Command-run token and dollar cost are shown in the dock, the inspector, and the result message,
322
+ but are **not** added to the session footer's running totals (the footer has no API for an
323
+ extension to append usage outside a model turn).
324
+
325
+ ## Permissions
326
+
327
+ Each `workflow` tool call and each `/<name>`/`/workflow` command run goes through the same
328
+ permission gate as every other tool call: an explicit `allow`/`deny` rule in `.draht/permissions.yml`
329
+ applies as written; otherwise the call needs approval, shown with the workflow's name, phases
330
+ (with any per-phase model), source, truncated args, and limits (concurrency, max agents, budget).
331
+ A `workflow` tool call with an invalid `meta` block still needs approval, but is described as such
332
+ and fails immediately once approved; a `/<name>`/`/workflow` command run instead rejects an
333
+ invalid `meta` block up front, before the gate. With no UI available (print or JSON, or any other
334
+ headless caller) and no matching rule, the call is blocked rather than left waiting; RPC mode has
335
+ a UI context, so it forwards the approval to the client as a `confirm` request instead.
336
+
337
+ Saved workflows under `.draht/workflows` require project trust, the same as `.draht/agents`: a
338
+ project that only contains a `workflows` directory under `.draht` still triggers the trust prompt,
339
+ because a saved workflow can start subagents just like a saved agent definition can.
340
+
341
+ **Blocked tool calls inside subagents.** A subagent process cannot show an approval prompt of its
342
+ own (there is no UI in a non-interactive child), so by default any of its tool calls that would
343
+ otherwise need approval are blocked instead, and surfaced with a warning line, a `⚠` glyph in the
344
+ row, and a note in the parent-model result text listing a few blocked samples. The note's own hint
345
+ names `/permissions auto` and `/yolo` as remedies, but typing either into the parent session only
346
+ changes that session's own permission mode — it never reaches an already-running or future
347
+ subagent, which reads its mode from the `DRAHT_PERMISSION_MODE` environment variable at startup
348
+ (inherited from whatever started the parent draht process; unset means `default`, the most
349
+ restrictive mode). The remedies that actually work are an explicit `allow` rule in
350
+ `permissions.yml`, or setting `DRAHT_PERMISSION_MODE` before launching draht.
351
+
352
+ ## Nesting depth
353
+
354
+ `polyphase.maxDepth` (default 2) limits how many levels of subagent-starts-a-subagent are
355
+ possible: a child at that depth is spawned without the `subagent` tool at all, so it cannot start
356
+ grandchildren. Independently of depth, the `workflow` and `duet_delegate` tools are always
357
+ excluded from every child process — a subagent (or a workflow's agent) can never start a workflow
358
+ or a duet triage batch of its own, regardless of `maxDepth`.
359
+
360
+ ## Non-TUI behavior and the details schema
361
+
362
+ Outside the TUI (print, JSON, RPC), there is no dock, no inspector, and no terminal-input
363
+ listener — polyphase's UI installer is inert in those modes. What still works:
364
+
365
+ - the keyword and `/workflow name` (and saved `/<name>` commands);
366
+ - `/workflows` as plain text instead of the inspector;
367
+ - the final parent-model result text (see [Parent-model results](#parent-model-results));
368
+ - in `json`/RPC-style streaming, `tool_execution_update` partial results carrying a short status
369
+ text (at most 20 lines of 120 characters) and the same bounded details object described below,
370
+ throttled to about once per second per run, with state transitions (an agent finishing, a tool
371
+ call getting blocked) emitted promptly instead of waiting out that interval.
372
+
373
+ **The persisted `details` schema.** Every `subagent` and `workflow` tool result, and every
374
+ command-run custom message, carries a `details` object with `v: 1`: a run summary (kind, status,
375
+ timing, phases for workflows), one entry per agent (model, status, token/cost totals, a bounded
376
+ output preview), and run totals. Final details are capped at 16 KiB; partial (in-progress)
377
+ details are capped at 8 KiB and additionally carry a `now` line per agent that final details omit.
378
+ When a run has far more agents or output than fits, successive levels of detail are dropped (long
379
+ agent output, then per-agent tool-call breakdowns, then low-priority agents entirely) rather than
380
+ truncating in a way that would hide a failure — failed, running, and queued agents are kept
381
+ preferentially over agents that finished cleanly. Resuming a session (`/resume`, a fork, or a
382
+ restart after a crash) rebuilds the final tool-row block from this persisted object only, so a
383
+ resumed row renders identically to how it looked when the run finished; sessions recorded before
384
+ polyphase existed have no (or an empty) `details` object and fall back to a legacy renderer.
385
+
386
+ ## Settings and environment variables
387
+
388
+ All settings live under the `polyphase` key — see [Settings Reference](settings.md). The two
389
+ internal environment variables children use to coordinate with their parent
390
+ (`DRAHT_POLYPHASE_DEPTH`, `DRAHT_POLYPHASE_SCHEMA_FILE`) are listed in
391
+ [Environment Variables](environment-variables.md); you should not need to set either by hand.
@@ -212,7 +212,7 @@ Messages are `AgentMessage` objects (see [Message Types](message-types.md)).
212
212
  Switch to a specific model.
213
213
 
214
214
  ```json
215
- {"type": "set_model", "provider": "anthropic", "modelId": "claude-sonnet-4-20250514"}
215
+ {"type": "set_model", "provider": "anthropic", "modelId": "claude-sonnet-5"}
216
216
  ```
217
217
 
218
218
  Response contains the full [Model](#model-object) object:
@@ -839,20 +839,20 @@ Model commands return the complete configured model definition. Costs are in US
839
839
 
840
840
  ```json
841
841
  {
842
- "id": "claude-sonnet-4-20250514",
843
- "name": "Claude Sonnet 4",
842
+ "id": "claude-sonnet-5",
843
+ "name": "Claude Sonnet 5",
844
844
  "api": "anthropic-messages",
845
845
  "provider": "anthropic",
846
846
  "baseUrl": "https://api.anthropic.com",
847
847
  "reasoning": true,
848
848
  "input": ["text", "image"],
849
- "contextWindow": 200000,
850
- "maxTokens": 16384,
849
+ "contextWindow": 1000000,
850
+ "maxTokens": 128000,
851
851
  "cost": {
852
- "input": 3.0,
853
- "output": 15.0,
854
- "cacheRead": 0.3,
855
- "cacheWrite": 3.75
852
+ "input": 2.0,
853
+ "output": 10.0,
854
+ "cacheRead": 0.2,
855
+ "cacheWrite": 2.5
856
856
  }
857
857
  }
858
858
  ```
package/docs/settings.md CHANGED
@@ -41,6 +41,18 @@ See [Choose a Model](models.md) for model selection and thinking controls.
41
41
  | `defaultTools` | `string[]` | `read`, `bash`, `edit`, `write` | Tools enabled at startup. Plain names replace the defaults; `+name` adds a tool and `-name` removes one. An empty array disables all built-in tools but not extension or SDK tools. |
42
42
  | `codemode.mode` | `"on"` \| `"only"` | `"on"` | How the `codemode` tool presents tools while it is active. `on`: declared tools get their `codemode` declaration appended to their description, and `codemode` lists only tools that are not declared. `only`: `codemode` lists every tool scripts can call, and active built-in and extension tools are hidden from the model, so it reaches them through `codemode`. |
43
43
  | `codemode.inlineBudget` | number | `3000` | Estimated tokens (characters / 4) the `codemode` tool's description may spend on tool declarations. Tools that do not fit are left out and found with `searchTools()`. `0` lists only namespaces. |
44
+ | `polyphase.maxConcurrency` | number | `clamp(availableParallelism() - 2, 2, 8)` | Child agent processes at once across the session (`subagent`, `workflow`, duet). Range 1-16. |
45
+ | `polyphase.maxAgentsPerRun` | number | `200` | `agent()` calls allowed per workflow run. Range 1-1000. |
46
+ | `polyphase.maxItemsPerCall` | number | `1024` | Items allowed per `parallel()`/`pipeline()` call. Range 1-4096. |
47
+ | `polyphase.workflowTool` | `"keyword"` \| `"always"` \| `"off"` | `"keyword"` | When the `workflow` tool is available: on the keyword, always, or never. |
48
+ | `polyphase.keyword` | string | `"polyphase"` | Keyword that enables the `workflow` tool for one prompt. Must match `/^[A-Za-z][A-Za-z0-9_-]{2,31}$/`. |
49
+ | `polyphase.defaultBudgetTokens` | number | Unlimited | Token budget for workflow runs that set none. Minimum `1000`. |
50
+ | `polyphase.resultChars` | number | `64000` | Characters of agent output returned to the parent model for a parallel `subagent` call, split across agents (2,000-16,000 each). Single, chain, and `workflow` calls use fixed caps instead. Range 8000-400000. |
51
+ | `polyphase.dock` | boolean | `true` | Show the running-agents dock above the editor. |
52
+ | `polyphase.maxDepth` | number | `2` | Delegation depth. A child spawned at this depth gets no `subagent` tool. Range 1-4. |
53
+ | `polyphase.liveUpdateMs` | number | `250` | Live update interval for tool rows, in milliseconds. Range 100-2000. |
54
+ | `polyphase.retainRuns` | number | `20` | Finished runs kept in memory for the agent inspector. Range 1-100. |
55
+ | `polyphase.workflowTimeoutMs` | number | `0` | Wall-clock deadline for a workflow run, in milliseconds, including time spent waiting on agents. `0` means no deadline. |
44
56
 
45
57
  Available built-in tools are `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, and `ls`. `defaultTools` can also name `codemode` and `tool_search`, which built-in extensions register inactive, and other extension tools registered inactive.
46
58
 
@@ -10,7 +10,7 @@ A virtual model selects a model and a thinking level. A router maps that pair to
10
10
 
11
11
  ```
12
12
  selected (virtual model, virtual level) -> dispatched (physical model, physical level)
13
- jev/auto:low -> anthropic/claude-sonnet-4-5:high
13
+ jev/auto:low -> anthropic/claude-sonnet-5:high
14
14
  ```
15
15
 
16
16
  The virtual thinking level is an input to the router. Its meaning is up to the router; it need not correspond to a reasoning budget.
@@ -45,7 +45,7 @@ export default function (pi: ExtensionAPI) {
45
45
  if (request.reason !== "user" && sticky) {
46
46
  return { model: sticky.model, thinkingLevel: sticky.thinkingLevel ?? "medium" };
47
47
  }
48
- const id = request.thinkingLevel === "high" ? "claude-sonnet-4-5" : "claude-haiku-4-5";
48
+ const id = request.thinkingLevel === "high" ? "claude-sonnet-5" : "claude-haiku-4-5";
49
49
  return { model: ctx.modelRegistry.find("anthropic", id)!, thinkingLevel: "medium" };
50
50
  },
51
51
  });
@@ -96,7 +96,7 @@ pi.registerVirtualModel<{ phase: "plan" | "build" }>({
96
96
  name: "Phased",
97
97
  route(request, ctx) {
98
98
  const state = request.state ?? { phase: "plan" };
99
- const id = state.phase === "plan" ? "claude-opus-4-5" : "claude-haiku-4-5";
99
+ const id = state.phase === "plan" ? "claude-opus-5-5" : "claude-haiku-4-5";
100
100
  return { model: ctx.modelRegistry.find("anthropic", id)!, thinkingLevel: "medium", state };
101
101
  },
102
102
  });
@@ -14,14 +14,14 @@
14
14
  * {
15
15
  * "plan": {
16
16
  * "provider": "openai-codex",
17
- * "model": "gpt-5.2-codex",
17
+ * "model": "gpt-6.1-sol",
18
18
  * "thinkingLevel": "high",
19
19
  * "tools": ["read", "grep", "find", "ls"],
20
20
  * "instructions": "You are in PLANNING MODE. Your job is to deeply understand the problem and create a detailed implementation plan.\n\nRules:\n- DO NOT make any changes. You cannot edit or write files.\n- Read files IN FULL (no offset/limit) to get complete context. Partial reads miss critical details.\n- Explore thoroughly: grep for related code, find similar patterns, understand the architecture.\n- Ask clarifying questions if requirements are ambiguous. Do not assume.\n- Identify risks, edge cases, and dependencies before proposing solutions.\n\nOutput:\n- Create a structured plan with numbered steps.\n- For each step: what to change, why, and potential risks.\n- List files that will be modified.\n- Note any tests that should be added or updated.\n\nWhen done, ask the user if they want you to:\n1. Write the plan to a markdown file (e.g., PLAN.md)\n2. Create a GitHub issue with the plan\n3. Proceed to implementation (they should switch to 'implement' preset)"
21
21
  * },
22
22
  * "implement": {
23
23
  * "provider": "anthropic",
24
- * "model": "claude-sonnet-4-5",
24
+ * "model": "claude-sonnet-5",
25
25
  * "thinkingLevel": "high",
26
26
  * "tools": ["read", "bash", "edit", "write"],
27
27
  * "instructions": "You are in IMPLEMENTATION MODE. Your job is to make focused, correct changes.\n\nRules:\n- Keep scope tight. Do exactly what was asked, no more.\n- Read files before editing to understand current state.\n- Make surgical edits. Prefer edit over write for existing files.\n- Explain your reasoning briefly before each change.\n- Run tests or type checks after changes if the project has them (npm test, npm run check, etc.).\n- If you encounter unexpected complexity, STOP and explain the issue rather than hacking around it.\n\nIf no plan exists:\n- Ask clarifying questions before starting.\n- Propose what you'll do and get confirmation for non-trivial changes.\n\nAfter completing changes:\n- Summarize what was done.\n- Note any follow-up work or tests that should be added."
@@ -49,7 +49,7 @@ import { Container, Key, type SelectItem, SelectList, Text } from "@draht/tui";
49
49
  interface Preset {
50
50
  /** Provider name (e.g., "anthropic", "openai") */
51
51
  provider?: string;
52
- /** Model ID (e.g., "claude-sonnet-4-5") */
52
+ /** Model ID (e.g., "claude-sonnet-5") */
53
53
  model?: string;
54
54
  /** Thinking level */
55
55
  thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
@@ -129,7 +129,7 @@ Agents are markdown files with YAML frontmatter:
129
129
  name: my-agent
130
130
  description: What this agent does
131
131
  tools: read, grep, find, ls
132
- model: claude-haiku-4-5
132
+ model: anthropic/claude-haiku-4-5
133
133
  ---
134
134
 
135
135
  System prompt for the agent goes here.
@@ -2,7 +2,7 @@
2
2
  name: planner
3
3
  description: Creates implementation plans from context and requirements
4
4
  tools: read, grep, find, ls
5
- model: claude-sonnet-4-5
5
+ model: anthropic/claude-sonnet-5
6
6
  ---
7
7
 
8
8
  You are a planning specialist. You receive context (from a scout) and requirements, then produce a clear implementation plan.
@@ -2,7 +2,7 @@
2
2
  name: reviewer
3
3
  description: Code review specialist for quality and security analysis
4
4
  tools: read, grep, find, ls, bash
5
- model: claude-sonnet-4-5
5
+ model: anthropic/claude-sonnet-5
6
6
  ---
7
7
 
8
8
  You are a senior code reviewer. Analyze code for quality, security, and maintainability.
@@ -2,7 +2,7 @@
2
2
  name: scout
3
3
  description: Fast codebase recon that returns compressed context for handoff to other agents
4
4
  tools: read, grep, find, ls, bash
5
- model: claude-haiku-4-5
5
+ model: anthropic/claude-haiku-4-5
6
6
  ---
7
7
 
8
8
  You are a scout. Quickly investigate a codebase and return structured findings that another agent can use without re-reading everything.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: worker
3
3
  description: General-purpose subagent with full capabilities, isolated context
4
- model: claude-sonnet-4-5
4
+ model: anthropic/claude-sonnet-5
5
5
  ---
6
6
 
7
7
  You are a worker agent with full capabilities. You operate in an isolated context window to handle delegated tasks without polluting the main conversation.
@@ -160,13 +160,13 @@ export default function (pi: ExtensionAPI) {
160
160
  ctx.ui.notify("Preparing summary...", "info");
161
161
  }
162
162
 
163
- const model = ctx.modelRegistry.find("openai", "gpt-5.2");
163
+ const model = ctx.modelRegistry.find("openai", "gpt-6.1-sol");
164
164
  if (!model) {
165
- if (ctx.hasUI) ctx.ui.notify("Model openai/gpt-5.2 not found", "warning");
165
+ if (ctx.hasUI) ctx.ui.notify("Model openai/gpt-6.1-sol not found", "warning");
166
166
  return;
167
167
  }
168
168
  if (!ctx.modelRegistry.hasConfiguredAuth(model)) {
169
- if (ctx.hasUI) ctx.ui.notify("No authentication configured for openai/gpt-5.2", "warning");
169
+ if (ctx.hasUI) ctx.ui.notify("No authentication configured for openai/gpt-6.1-sol", "warning");
170
170
  return;
171
171
  }
172
172
 
@@ -9,7 +9,7 @@ import { createAgentSession, ModelRuntime } from "@draht/coding-agent";
9
9
  const modelRuntime = await ModelRuntime.create();
10
10
 
11
11
  // Option 1: Find a specific built-in model by provider/id
12
- const opus = modelRuntime.getModel("anthropic", "claude-opus-4-5");
12
+ const opus = modelRuntime.getModel("anthropic", "claude-opus-5-5");
13
13
  if (opus) {
14
14
  console.log(`Found model: ${opus.provider}/${opus.id}`);
15
15
  }
@@ -22,7 +22,7 @@ if (process.env.MY_ANTHROPIC_KEY) {
22
22
  await modelRuntime.setRuntimeApiKey("anthropic", process.env.MY_ANTHROPIC_KEY);
23
23
  }
24
24
 
25
- const model = getModel("anthropic", "claude-sonnet-4-5");
25
+ const model = getModel("anthropic", "claude-sonnet-5");
26
26
  if (!model) throw new Error("Model not found");
27
27
 
28
28
  // In-memory settings with overrides
@@ -53,7 +53,7 @@ const modelRegistry = ModelRegistry.create(authStorage);
53
53
  const { session } = await createAgentSession({ authStorage, modelRegistry });
54
54
 
55
55
  // Custom model
56
- const model = getModel("anthropic", "claude-opus-4-5");
56
+ const model = getModel("anthropic", "claude-opus-5-5");
57
57
  const { session } = await createAgentSession({ model, thinkingLevel: "high", authStorage, modelRegistry });
58
58
 
59
59
  // Modify prompt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draht/coding-agent",
3
- "version": "2026.10.4",
3
+ "version": "2026.10.8-1",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "drahtConfig": {
@@ -47,16 +47,16 @@
47
47
  "prepublishOnly": "node ../../scripts/sync-draht-tools.mjs && bun run clean && bun run build"
48
48
  },
49
49
  "dependencies": {
50
- "@draht/chord": "2026.10.4",
50
+ "@draht/chord": "2026.10.8-1",
51
51
  "@mariozechner/jiti": "^2.6.2",
52
- "@draht/agent-core": "2026.10.4",
53
- "@draht/ai": "2026.10.4",
54
- "@draht/codemode": "2026.10.4",
55
- "@draht/mcp": "2026.10.4",
56
- "@draht/rlm": "2026.10.4",
57
- "@draht/router": "2026.10.4",
58
- "@draht/tools": "2026.10.4",
59
- "@draht/tui": "2026.10.4",
52
+ "@draht/agent-core": "2026.10.8-1",
53
+ "@draht/ai": "2026.10.8-1",
54
+ "@draht/codemode": "2026.10.8-1",
55
+ "@draht/mcp": "2026.10.8-1",
56
+ "@draht/rlm": "2026.10.8-1",
57
+ "@draht/router": "2026.10.8-1",
58
+ "@draht/tools": "2026.10.8-1",
59
+ "@draht/tui": "2026.10.8-1",
60
60
  "@silvia-odwyer/photon-node": "^0.3.4",
61
61
  "@sinclair/typebox": "^0.34.41",
62
62
  "chalk": "^5.6.2",