@draht/coding-agent 2026.11.5 → 2026.11.14-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 (328) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/bundle/chunks/anthropic-messages-C5ZJVCKX.js +6 -0
  3. package/dist/bundle/chunks/{azure-openai-responses-5YLWRJ4E.js → azure-openai-responses-TNRID5YC.js} +1 -1
  4. package/dist/bundle/chunks/bedrock-converse-stream.js +22 -22
  5. package/dist/bundle/chunks/chunk-2CHTECAU.js +2 -0
  6. package/dist/bundle/chunks/{chunk-MKVW4KK2.js → chunk-2IQVBLH6.js} +1 -1
  7. package/dist/bundle/chunks/chunk-2JZLKNZ4.js +3 -0
  8. package/dist/bundle/chunks/{chunk-LJ3SEGWI.js → chunk-4FPBO5KP.js} +6 -2
  9. package/dist/bundle/chunks/{chunk-3LFBXSCO.js → chunk-5C4MAPF6.js} +1 -1
  10. package/dist/bundle/chunks/chunk-5WEOWREV.js +82 -0
  11. package/dist/bundle/chunks/chunk-6M3D4XVD.js +2 -0
  12. package/dist/bundle/chunks/{chunk-KVH4HR57.js → chunk-6WESOD4H.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-UQSONZLL.js → chunk-ATYP3OSV.js} +3 -1
  14. package/dist/bundle/chunks/chunk-B6S2UR4T.js +2 -0
  15. package/dist/bundle/chunks/chunk-EBTEI43G.js +20 -0
  16. package/dist/bundle/chunks/{chunk-EXZUXBS5.js → chunk-GAABJAG4.js} +13 -16
  17. package/dist/bundle/chunks/chunk-GBFVS2SF.js +12 -0
  18. package/dist/bundle/chunks/{chunk-ITP6IDBA.js → chunk-GQXRTK54.js} +2 -2
  19. package/dist/bundle/chunks/{chunk-YUBUKEPQ.js → chunk-JHKMYVPC.js} +187 -148
  20. package/dist/bundle/chunks/{chunk-QVGSXIKT.js → chunk-KFREX3FS.js} +1 -1
  21. package/dist/bundle/chunks/{chunk-PRT3JHOZ.js → chunk-LCTFXH4P.js} +1 -1
  22. package/dist/bundle/chunks/chunk-LO6CVU2L.js +6 -0
  23. package/dist/bundle/chunks/{chunk-ABW2JATG.js → chunk-MPJIXESS.js} +1 -1
  24. package/dist/bundle/chunks/{chunk-PZKD35UB.js → chunk-MXA4WY3C.js} +1 -1
  25. package/dist/bundle/chunks/chunk-O2XYFH2E.js +30 -0
  26. package/dist/bundle/chunks/{chunk-CLNF6E5P.js → chunk-OUXJRC2W.js} +1 -1
  27. package/dist/bundle/chunks/{chunk-SKQFE2GA.js → chunk-RI7HJ6AF.js} +10 -10
  28. package/dist/bundle/chunks/chunk-RVXTPNXQ.js +44 -0
  29. package/dist/bundle/chunks/{chunk-SPVE2GM7.js → chunk-SXHVGWCU.js} +1 -1
  30. package/dist/bundle/chunks/chunk-WNZ64GW3.js +2 -0
  31. package/dist/bundle/chunks/chunk-XWZLYE4L.js +9 -0
  32. package/dist/bundle/chunks/{chunk-JAT7HEFU.js → chunk-YSE3VKKB.js} +2 -2
  33. package/dist/bundle/chunks/{cli-7AMCJ2UG.js → cli-2QKCAPPD.js} +3 -3
  34. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-QBCV2OWJ.js → cloudflare-workers-ai-system-one-UCG6T3XP.js} +1 -1
  35. package/dist/bundle/chunks/codemode-worker.js +2 -0
  36. package/dist/bundle/chunks/{execute-VOIPQMCI.js → execute-KGJOWTPG.js} +2 -2
  37. package/dist/bundle/chunks/github-copilot.js +1 -1
  38. package/dist/bundle/chunks/google-generative-ai-GPBKPOXA.js +2 -0
  39. package/dist/bundle/chunks/google-vertex-USZY53NF.js +2 -0
  40. package/dist/bundle/chunks/https-proxy-agent-WQIRL24U.js +13 -0
  41. package/dist/bundle/chunks/lib-ULKZYRGD.js +9 -0
  42. package/dist/bundle/chunks/{llama-cpp-classify-WGVYEPG2.js → llama-cpp-classify-7DEQ4ZUF.js} +1 -1
  43. package/dist/bundle/chunks/{mistral-conversations-PV6RDK65.js → mistral-conversations-UOGXPDZ3.js} +1 -1
  44. package/dist/bundle/chunks/{multipart-parser-AZP5BX2W.js → multipart-parser-HMCXZ4BD.js} +1 -1
  45. package/dist/bundle/chunks/{node-BZAVEWJ3.js → node-DXZFQBEO.js} +1 -1
  46. package/dist/bundle/chunks/{node-C2JGH2OB.js → node-LBZLUIBE.js} +1 -1
  47. package/dist/bundle/chunks/{openai-codex-responses-SEOL3EDF.js → openai-codex-responses-VUDXQ3EU.js} +1 -1
  48. package/dist/bundle/chunks/{openai-completions-U32QPS37.js → openai-completions-UQOOS7NM.js} +3 -3
  49. package/dist/bundle/chunks/{openai-decisions-ULSYFV2A.js → openai-decisions-24WNXO2R.js} +1 -1
  50. package/dist/bundle/chunks/{openai-responses-5MYZJYPK.js → openai-responses-5AF6MZ5L.js} +1 -1
  51. package/dist/bundle/chunks/{openrouter-images-SGOP5SDW.js → openrouter-images-OUXVVTYQ.js} +1 -1
  52. package/dist/bundle/chunks/{pi-messages-QALFE2BD.js → pi-messages-DRMOEO6B.js} +1 -1
  53. package/dist/bundle/chunks/{runtime-Z74VFUDD.js → runtime-FZKS2BWI.js} +1 -1
  54. package/dist/bundle/chunks/{runtime-GDH3ZURV.js → runtime-L23MZBKL.js} +1 -1
  55. package/dist/bundle/chunks/{settings-manager-T6UJFO2F.js → settings-manager-CWRQW6PZ.js} +1 -1
  56. package/dist/bundle/chunks/src-KDGO7EGF.js +4 -0
  57. package/dist/bundle/chunks/{typesafe-system-one-GTGS5MG6.js → typesafe-system-one-K63EBJDD.js} +1 -1
  58. package/dist/bundle/chunks/virtual-modules-JZV35VDE.js +2 -0
  59. package/dist/bundle/cli-runtime.js +1 -1
  60. package/dist/bundle/index.js +1 -1
  61. package/dist/bundle/rpc-entry.js +1 -1
  62. package/dist/cli/args.d.ts.map +1 -1
  63. package/dist/cli/args.js +5 -3
  64. package/dist/cli/args.js.map +1 -1
  65. package/dist/cli/auth-command.d.ts.map +1 -1
  66. package/dist/cli/auth-command.js +30 -6
  67. package/dist/cli/auth-command.js.map +1 -1
  68. package/dist/cli/auth-login.d.ts +15 -0
  69. package/dist/cli/auth-login.d.ts.map +1 -0
  70. package/dist/cli/auth-login.js +232 -0
  71. package/dist/cli/auth-login.js.map +1 -0
  72. package/dist/cli/auth-logout.d.ts +14 -0
  73. package/dist/cli/auth-logout.d.ts.map +1 -0
  74. package/dist/cli/auth-logout.js +57 -0
  75. package/dist/cli/auth-logout.js.map +1 -0
  76. package/dist/cli/auth-terminal.d.ts +17 -0
  77. package/dist/cli/auth-terminal.d.ts.map +1 -0
  78. package/dist/cli/auth-terminal.js +63 -0
  79. package/dist/cli/auth-terminal.js.map +1 -0
  80. package/dist/core/agent-session-runtime.d.ts +5 -0
  81. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  82. package/dist/core/agent-session-runtime.js +16 -2
  83. package/dist/core/agent-session-runtime.js.map +1 -1
  84. package/dist/core/agent-session.d.ts +20 -9
  85. package/dist/core/agent-session.d.ts.map +1 -1
  86. package/dist/core/agent-session.js +71 -29
  87. package/dist/core/agent-session.js.map +1 -1
  88. package/dist/core/ai-schemas.d.ts +1 -0
  89. package/dist/core/ai-schemas.d.ts.map +1 -1
  90. package/dist/core/builtins/budgets.d.ts.map +1 -1
  91. package/dist/core/builtins/budgets.js +6 -3
  92. package/dist/core/builtins/budgets.js.map +1 -1
  93. package/dist/core/cache-warmer.d.ts +4 -37
  94. package/dist/core/cache-warmer.d.ts.map +1 -1
  95. package/dist/core/cache-warmer.js +11 -91
  96. package/dist/core/cache-warmer.js.map +1 -1
  97. package/dist/core/compaction/utils.d.ts.map +1 -1
  98. package/dist/core/compaction/utils.js +2 -1
  99. package/dist/core/compaction/utils.js.map +1 -1
  100. package/dist/core/exec.d.ts +1 -0
  101. package/dist/core/exec.d.ts.map +1 -1
  102. package/dist/core/exec.js +4 -1
  103. package/dist/core/exec.js.map +1 -1
  104. package/dist/core/export-html/ansi-to-html.d.ts +5 -0
  105. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  106. package/dist/core/export-html/ansi-to-html.js +57 -20
  107. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  108. package/dist/core/export-html/template.js +1 -1
  109. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  110. package/dist/core/export-html/tool-renderer.js +2 -3
  111. package/dist/core/export-html/tool-renderer.js.map +1 -1
  112. package/dist/core/extensions/types.d.ts +3 -2
  113. package/dist/core/extensions/types.d.ts.map +1 -1
  114. package/dist/core/extensions/types.js.map +1 -1
  115. package/dist/core/model-config.d.ts +13 -0
  116. package/dist/core/model-config.d.ts.map +1 -1
  117. package/dist/core/model-resolver.d.ts +0 -1
  118. package/dist/core/model-resolver.d.ts.map +1 -1
  119. package/dist/core/model-resolver.js +17 -24
  120. package/dist/core/model-resolver.js.map +1 -1
  121. package/dist/core/model-runtime.d.ts +5 -0
  122. package/dist/core/model-runtime.d.ts.map +1 -1
  123. package/dist/core/model-runtime.js +7 -0
  124. package/dist/core/model-runtime.js.map +1 -1
  125. package/dist/core/polyphase/render/format.d.ts +2 -0
  126. package/dist/core/polyphase/render/format.d.ts.map +1 -1
  127. package/dist/core/polyphase/render/format.js +6 -0
  128. package/dist/core/polyphase/render/format.js.map +1 -1
  129. package/dist/core/polyphase/render/run-block.d.ts +4 -0
  130. package/dist/core/polyphase/render/run-block.d.ts.map +1 -1
  131. package/dist/core/polyphase/render/run-block.js +71 -12
  132. package/dist/core/polyphase/render/run-block.js.map +1 -1
  133. package/dist/core/polyphase/render/snapshot.d.ts +1 -1
  134. package/dist/core/polyphase/render/snapshot.d.ts.map +1 -1
  135. package/dist/core/polyphase/render/snapshot.js +22 -7
  136. package/dist/core/polyphase/render/snapshot.js.map +1 -1
  137. package/dist/core/polyphase/ui/dock.d.ts.map +1 -1
  138. package/dist/core/polyphase/ui/dock.js +34 -2
  139. package/dist/core/polyphase/ui/dock.js.map +1 -1
  140. package/dist/core/polyphase/ui/inspector.d.ts +18 -6
  141. package/dist/core/polyphase/ui/inspector.d.ts.map +1 -1
  142. package/dist/core/polyphase/ui/inspector.js +125 -44
  143. package/dist/core/polyphase/ui/inspector.js.map +1 -1
  144. package/dist/core/polyphase/ui/transcript-layout.d.ts.map +1 -1
  145. package/dist/core/polyphase/ui/transcript-layout.js +5 -1
  146. package/dist/core/polyphase/ui/transcript-layout.js.map +1 -1
  147. package/dist/core/preferred-providers.d.ts +17 -0
  148. package/dist/core/preferred-providers.d.ts.map +1 -0
  149. package/dist/core/preferred-providers.js +24 -0
  150. package/dist/core/preferred-providers.js.map +1 -0
  151. package/dist/core/prompt-templates.d.ts.map +1 -1
  152. package/dist/core/prompt-templates.js +18 -2
  153. package/dist/core/prompt-templates.js.map +1 -1
  154. package/dist/core/provider-composer.d.ts.map +1 -1
  155. package/dist/core/provider-composer.js +2 -0
  156. package/dist/core/provider-composer.js.map +1 -1
  157. package/dist/core/provider-matching.d.ts +6 -0
  158. package/dist/core/provider-matching.d.ts.map +1 -0
  159. package/dist/core/provider-matching.js +8 -0
  160. package/dist/core/provider-matching.js.map +1 -0
  161. package/dist/core/radius-mcp.d.ts +13 -0
  162. package/dist/core/radius-mcp.d.ts.map +1 -0
  163. package/dist/core/radius-mcp.js +29 -0
  164. package/dist/core/radius-mcp.js.map +1 -0
  165. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  166. package/dist/core/remote-catalog-provider.js +2 -0
  167. package/dist/core/remote-catalog-provider.js.map +1 -1
  168. package/dist/core/runtime-credentials.d.ts +8 -0
  169. package/dist/core/runtime-credentials.d.ts.map +1 -1
  170. package/dist/core/runtime-credentials.js +15 -1
  171. package/dist/core/runtime-credentials.js.map +1 -1
  172. package/dist/core/session-cwd.d.ts +7 -0
  173. package/dist/core/session-cwd.d.ts.map +1 -1
  174. package/dist/core/session-cwd.js +9 -1
  175. package/dist/core/session-cwd.js.map +1 -1
  176. package/dist/core/session-manager.d.ts.map +1 -1
  177. package/dist/core/session-manager.js +45 -36
  178. package/dist/core/session-manager.js.map +1 -1
  179. package/dist/core/settings-defaults.d.ts +1 -1
  180. package/dist/core/settings-defaults.d.ts.map +1 -1
  181. package/dist/core/settings-defaults.js +1 -1
  182. package/dist/core/settings-defaults.js.map +1 -1
  183. package/dist/core/tools/bash.d.ts.map +1 -1
  184. package/dist/core/tools/bash.js +35 -5
  185. package/dist/core/tools/bash.js.map +1 -1
  186. package/dist/core/tools/edit-diff.d.ts +23 -14
  187. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  188. package/dist/core/tools/edit-diff.js +182 -41
  189. package/dist/core/tools/edit-diff.js.map +1 -1
  190. package/dist/core/tools/edit.d.ts.map +1 -1
  191. package/dist/core/tools/edit.js +8 -7
  192. package/dist/core/tools/edit.js.map +1 -1
  193. package/dist/core/tools/find.d.ts.map +1 -1
  194. package/dist/core/tools/find.js +57 -16
  195. package/dist/core/tools/find.js.map +1 -1
  196. package/dist/core/tools/grep.d.ts +4 -0
  197. package/dist/core/tools/grep.d.ts.map +1 -1
  198. package/dist/core/tools/grep.js +20 -8
  199. package/dist/core/tools/grep.js.map +1 -1
  200. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  201. package/dist/core/tools/output-accumulator.js +4 -1
  202. package/dist/core/tools/output-accumulator.js.map +1 -1
  203. package/dist/core/tools/powershell.d.ts.map +1 -1
  204. package/dist/core/tools/powershell.js +15 -2
  205. package/dist/core/tools/powershell.js.map +1 -1
  206. package/dist/core/tools/read.d.ts +13 -0
  207. package/dist/core/tools/read.d.ts.map +1 -1
  208. package/dist/core/tools/read.js +146 -35
  209. package/dist/core/tools/read.js.map +1 -1
  210. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  211. package/dist/core/tools/renderers/read.js +6 -2
  212. package/dist/core/tools/renderers/read.js.map +1 -1
  213. package/dist/core/tools/truncate.d.ts +4 -0
  214. package/dist/core/tools/truncate.d.ts.map +1 -1
  215. package/dist/core/tools/truncate.js +24 -1
  216. package/dist/core/tools/truncate.js.map +1 -1
  217. package/dist/extensions/codemode/execute.js +4 -4
  218. package/dist/extensions/codemode/execute.js.map +1 -1
  219. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  220. package/dist/extensions/codemode/tool.js +34 -12
  221. package/dist/extensions/codemode/tool.js.map +1 -1
  222. package/dist/extensions/llama/provider.d.ts +1 -1
  223. package/dist/extensions/llama/provider.js +1 -1
  224. package/dist/extensions/llama/provider.js.map +1 -1
  225. package/dist/extensions/llama/ui.d.ts.map +1 -1
  226. package/dist/extensions/llama/ui.js +15 -3
  227. package/dist/extensions/llama/ui.js.map +1 -1
  228. package/dist/extensions/mcp/cli.js +5 -8
  229. package/dist/extensions/mcp/cli.js.map +1 -1
  230. package/dist/extensions/mcp/index.d.ts.map +1 -1
  231. package/dist/extensions/mcp/index.js +2 -1
  232. package/dist/extensions/mcp/index.js.map +1 -1
  233. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  234. package/dist/extensions/mcp/runtime.js +3 -2
  235. package/dist/extensions/mcp/runtime.js.map +1 -1
  236. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  237. package/dist/extensions/tool-search/tool.js +18 -6
  238. package/dist/extensions/tool-search/tool.js.map +1 -1
  239. package/dist/main.d.ts.map +1 -1
  240. package/dist/main.js +67 -15
  241. package/dist/main.js.map +1 -1
  242. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  243. package/dist/modes/interactive/components/login-dialog.js +2 -19
  244. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  245. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  246. package/dist/modes/interactive/components/model-selector.js +14 -6
  247. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  248. package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
  249. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  250. package/dist/modes/interactive/components/oauth-selector.js +32 -5
  251. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  252. package/dist/modes/interactive/components/provider-brand.d.ts +14 -0
  253. package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
  254. package/dist/modes/interactive/components/provider-brand.js +66 -0
  255. package/dist/modes/interactive/components/provider-brand.js.map +1 -0
  256. package/dist/modes/interactive/components/radius-login-selector.d.ts +1 -2
  257. package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
  258. package/dist/modes/interactive/components/radius-login-selector.js +6 -37
  259. package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
  260. package/dist/modes/interactive/components/session-selector.d.ts +6 -1
  261. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  262. package/dist/modes/interactive/components/session-selector.js +23 -5
  263. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  264. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  265. package/dist/modes/interactive/components/tool-execution.js +3 -1
  266. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  267. package/dist/modes/interactive/interactive-mode.d.ts +11 -1
  268. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  269. package/dist/modes/interactive/interactive-mode.js +133 -78
  270. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  271. package/dist/modes/interactive/session-share.js +2 -0
  272. package/dist/modes/interactive/session-share.js.map +1 -1
  273. package/dist/package-manager-cli.d.ts.map +1 -1
  274. package/dist/package-manager-cli.js +27 -4
  275. package/dist/package-manager-cli.js.map +1 -1
  276. package/dist/prompts/commands/test-audit.md +84 -0
  277. package/dist/utils/image-resize.d.ts.map +1 -1
  278. package/dist/utils/image-resize.js +3 -1
  279. package/dist/utils/image-resize.js.map +1 -1
  280. package/dist/utils/terminal-question.d.ts +8 -0
  281. package/dist/utils/terminal-question.d.ts.map +1 -0
  282. package/dist/utils/terminal-question.js +24 -0
  283. package/dist/utils/terminal-question.js.map +1 -0
  284. package/dist/utils/web-url.d.ts +12 -0
  285. package/dist/utils/web-url.d.ts.map +1 -0
  286. package/dist/utils/web-url.js +20 -0
  287. package/dist/utils/web-url.js.map +1 -0
  288. package/docs/cli.md +14 -1
  289. package/docs/extensions.md +6 -4
  290. package/docs/llama-cpp.md +5 -5
  291. package/docs/models-configuration.md +2 -1
  292. package/docs/nvidia-rtx-llama-cpp.md +5 -5
  293. package/docs/polyphase.md +13 -1
  294. package/docs/prompt-templates.md +1 -1
  295. package/docs/providers.md +4 -2
  296. package/docs/quickstart.md +1 -1
  297. package/docs/rpc-commands.md +1 -1
  298. package/docs/rpc.md +1 -1
  299. package/docs/sessions.md +7 -1
  300. package/docs/settings.md +1 -1
  301. package/docs/tui.md +1 -1
  302. package/examples/extensions/gondolin/index.ts +4 -7
  303. package/examples/extensions/subagent/index.ts +5 -1
  304. package/package.json +10 -10
  305. package/prompts/commands/test-audit.md +84 -0
  306. package/schemas/models.schema.json +5 -1
  307. package/schemas/settings.schema.json +1 -1
  308. package/dist/bundle/chunks/anthropic-messages-TXQXPH4S.js +0 -6
  309. package/dist/bundle/chunks/chunk-6MSE6LZ3.js +0 -6
  310. package/dist/bundle/chunks/chunk-736QBNUZ.js +0 -12
  311. package/dist/bundle/chunks/chunk-AOCWORXE.js +0 -2
  312. package/dist/bundle/chunks/chunk-BIBUE2PO.js +0 -2
  313. package/dist/bundle/chunks/chunk-DQ4G4IS4.js +0 -20
  314. package/dist/bundle/chunks/chunk-J7QTCDIN.js +0 -2
  315. package/dist/bundle/chunks/chunk-NNYZSIKR.js +0 -9
  316. package/dist/bundle/chunks/chunk-SUVMF4W5.js +0 -2
  317. package/dist/bundle/chunks/chunk-THDNEOXP.js +0 -44
  318. package/dist/bundle/chunks/chunk-TIA2T6EO.js +0 -3
  319. package/dist/bundle/chunks/chunk-TK3LS5QZ.js +0 -82
  320. package/dist/bundle/chunks/chunk-TYAEYYRA.js +0 -30
  321. package/dist/bundle/chunks/google-generative-ai-NC5KHHW3.js +0 -2
  322. package/dist/bundle/chunks/google-vertex-GAPUJEF7.js +0 -2
  323. package/dist/bundle/chunks/https-proxy-agent-O2PVUIOI.js +0 -13
  324. package/dist/bundle/chunks/lib-XOG5PI3Y.js +0 -9
  325. package/dist/bundle/chunks/src-TIBHS42X.js +0 -4
  326. package/dist/bundle/chunks/virtual-modules-ZUI2T3XR.js +0 -2
  327. /package/dist/bundle/chunks/{chunk-PX3CDFUB.js → chunk-ITKDPD4D.js} +0 -0
  328. /package/dist/bundle/chunks/{chunk-ZZD35WKM.js → chunk-MOOADNVS.js} +0 -0
@@ -28,8 +28,11 @@ import { createCompactionSummaryMessage, createCustomMessage } from "../../core/
28
28
  import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScopeFromModels, } from "../../core/model-resolver.js";
29
29
  import { CredentialSynchronizationError } from "../../core/model-runtime.js";
30
30
  import { DefaultPackageManager } from "../../core/package-manager.js";
31
- import { RADIUS_MCP_URL, RADIUS_PROVIDER_ID } from "../../core/radius.js";
32
- import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
31
+ import { compareProviders } from "../../core/preferred-providers.js";
32
+ import { findMatchingProviders } from "../../core/provider-matching.js";
33
+ import { RADIUS_PROVIDER_ID } from "../../core/radius.js";
34
+ import { planRadiusMcpServer } from "../../core/radius-mcp.js";
35
+ import { formatMissingSessionCwdPrompt, getMissingSessionCwdOptions, MissingSessionCwdError, } from "../../core/session-cwd.js";
33
36
  import { SessionManager, sessionEntryToContextMessages, } from "../../core/session-manager.js";
34
37
  import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
35
38
  import { boundedSafeText } from "../../core/socket-server/safe-text.js";
@@ -37,7 +40,7 @@ import { getSourcePackageKey } from "../../core/source-info.js";
37
40
  import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
38
41
  import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
39
42
  import { getUsageCostBreakdown } from "../../core/usage-totals.js";
40
- import { addMcpServerConfig, loadMcpConfig } from "../../extensions/mcp/config.js";
43
+ import { addMcpServerConfig } from "../../extensions/mcp/config.js";
41
44
  import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
42
45
  import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
43
46
  import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
@@ -213,7 +216,7 @@ function getLoginProviderCompletionOptions(providerOptions) {
213
216
  subscription: provider.subscription,
214
217
  });
215
218
  }
216
- return Array.from(byId.values()).sort((a, b) => a.name.localeCompare(b.name));
219
+ return Array.from(byId.values()).sort(compareProviders);
217
220
  }
218
221
  function getLoginProviderSearchText(provider) {
219
222
  const authTypes = provider.authTypes
@@ -271,6 +274,8 @@ export class InteractiveMode {
271
274
  changelogMarkdown = undefined;
272
275
  extensionChangelogUpdates = [];
273
276
  startupNoticesShown = false;
277
+ /** Last cache-warming notice, extended in place while it is the last chat line. */
278
+ cacheWarmingNotice;
274
279
  anthropicSubscriptionWarningShown = false;
275
280
  // Status line tracking (for mutating immediately-sequential status updates)
276
281
  lastStatusSpacer = undefined;
@@ -332,6 +337,13 @@ export class InteractiveMode {
332
337
  extensionDialogs = [];
333
338
  /** Label of the surface that decided the open ask elsewhere, pending a one-line notice. */
334
339
  extensionDialogDecidedBy = undefined;
340
+ /** Numbers the program status sources of blocking overlays, so closing one keeps the others. */
341
+ nextBlockingOverlayId = 0;
342
+ /**
343
+ * Open extension overlays (custom with overlay: true) and the function that removes each, in opening
344
+ * order. Reset removes only these, not draht's own overlays.
345
+ */
346
+ extensionOverlays = new Map();
335
347
  extensionTerminalInputSubscriptions = new Set();
336
348
  // Extension widgets (components rendered above/below the editor)
337
349
  extensionWidgetsAbove = new Map();
@@ -1782,6 +1794,7 @@ export class InteractiveMode {
1782
1794
  this.loadedResourcesContainer.clear();
1783
1795
  this.chatContainer.clear();
1784
1796
  this.pendingMessagesContainer.clear();
1797
+ this.pendingBashComponents = [];
1785
1798
  this.compactionQueuedMessages = [];
1786
1799
  this.streamingComponent = undefined;
1787
1800
  this.streamingMessage = undefined;
@@ -1996,7 +2009,10 @@ export class InteractiveMode {
1996
2009
  }
1997
2010
  resetExtensionUI() {
1998
2011
  this.closeAllExtensionDialogs();
1999
- this.ui.hideOverlay();
2012
+ // Reload and session switches replace every extension without calling done(): remove their overlays,
2013
+ // newest first, the same way done() does, but leave the promises pending as for inline dialogs.
2014
+ for (const removeOverlay of [...this.extensionOverlays.values()].reverse())
2015
+ removeOverlay();
2000
2016
  this.clearExtensionTerminalInputListeners();
2001
2017
  this.setExtensionFooter(undefined);
2002
2018
  this.setExtensionHeader(undefined);
@@ -2394,8 +2410,9 @@ export class InteractiveMode {
2394
2410
  return [...summaryRows, ...labeledRows];
2395
2411
  }
2396
2412
  async promptForMissingSessionCwd(error) {
2397
- const confirmed = await this.showExtensionConfirm("Session cwd not found", formatMissingSessionCwdPrompt(error.issue));
2398
- return confirmed ? error.issue.fallbackCwd : undefined;
2413
+ const options = getMissingSessionCwdOptions(error.issue);
2414
+ const label = await this.showExtensionSelector(formatMissingSessionCwdPrompt(error.issue), options.map((option) => option.label));
2415
+ return options.find((option) => option.label === label)?.value;
2399
2416
  }
2400
2417
  /**
2401
2418
  * Show a text input for extensions.
@@ -2547,6 +2564,8 @@ export class InteractiveMode {
2547
2564
  return new Promise((resolve, reject) => {
2548
2565
  let component;
2549
2566
  let overlayHandle;
2567
+ // An overlay stays blocked until its interaction ends, also while setHidden() hides it.
2568
+ const overlayStatusSource = isOverlay && options?.blocked ? `extension-overlay:${this.nextBlockingOverlayId++}` : undefined;
2550
2569
  let closed = false;
2551
2570
  const restoreEditor = () => {
2552
2571
  if (component)
@@ -2554,17 +2573,7 @@ export class InteractiveMode {
2554
2573
  this.editor.setText(savedText);
2555
2574
  this.ui.requestRender();
2556
2575
  };
2557
- const close = (result) => {
2558
- if (closed)
2559
- return;
2560
- closed = true;
2561
- // Remove this overlay, not the topmost one: another overlay may have opened above it.
2562
- if (isOverlay)
2563
- overlayHandle?.hide();
2564
- else
2565
- restoreEditor();
2566
- // Note: both branches above already call requestRender
2567
- resolve(result);
2576
+ const disposeComponent = () => {
2568
2577
  try {
2569
2578
  component?.dispose?.();
2570
2579
  }
@@ -2572,6 +2581,30 @@ export class InteractiveMode {
2572
2581
  /* ignore dispose errors */
2573
2582
  }
2574
2583
  };
2584
+ // Shared by done() and resetExtensionUI(). Removing the map entry first makes a second call a no-op.
2585
+ const removeOverlay = () => {
2586
+ if (!overlayHandle || !this.extensionOverlays.delete(overlayHandle))
2587
+ return;
2588
+ // Remove this overlay, not the topmost one: another overlay may have opened above it.
2589
+ overlayHandle.hide();
2590
+ if (overlayStatusSource)
2591
+ this.programStatus.setBlocked(overlayStatusSource, undefined);
2592
+ disposeComponent();
2593
+ };
2594
+ const close = (result) => {
2595
+ if (closed)
2596
+ return;
2597
+ closed = true;
2598
+ if (isOverlay) {
2599
+ removeOverlay();
2600
+ resolve(result);
2601
+ }
2602
+ else {
2603
+ restoreEditor();
2604
+ resolve(result);
2605
+ disposeComponent();
2606
+ }
2607
+ };
2575
2608
  Promise.resolve(factory(this.ui, theme, this.keybindings, close))
2576
2609
  .then((c) => {
2577
2610
  if (closed)
@@ -2591,6 +2624,9 @@ export class InteractiveMode {
2591
2624
  return w ? { width: w } : undefined;
2592
2625
  };
2593
2626
  overlayHandle = this.ui.showOverlay(c, resolveOptions());
2627
+ this.extensionOverlays.set(overlayHandle, removeOverlay);
2628
+ if (overlayStatusSource)
2629
+ this.programStatus.setBlocked(overlayStatusSource, options?.blocked);
2594
2630
  // Expose handle to caller for visibility control
2595
2631
  options?.onHandle?.(overlayHandle);
2596
2632
  }
@@ -3219,6 +3255,9 @@ export class InteractiveMode {
3219
3255
  this.ui.requestRender();
3220
3256
  break;
3221
3257
  case "agent_settled":
3258
+ // The session records deferred user bash results when the run settles; show them there too.
3259
+ this.flushPendingBashComponents();
3260
+ this.ui.requestRender();
3222
3261
  await this.checkShutdownRequested();
3223
3262
  break;
3224
3263
  case "compaction_start": {
@@ -3602,9 +3641,18 @@ export class InteractiveMode {
3602
3641
  addCacheWarmingUsage(entry) {
3603
3642
  if (!this.settingsManager.getShowCacheMissNotices())
3604
3643
  return;
3644
+ // Back-to-back warms collapse into one line with the cumulative cost.
3645
+ const previous = this.cacheWarmingNotice;
3646
+ if (previous && this.chatContainer.children.at(-1) === previous.component && previous.note === entry.note) {
3647
+ previous.total.cost += entry.usage.cost.total;
3648
+ previous.component.invalidate();
3649
+ return;
3650
+ }
3651
+ const total = { cost: entry.usage.cost.total };
3652
+ const component = new ThemedText(() => theme.fg("dim", formatCacheWarmingUsage(total.cost, entry.note)), 1, 0);
3653
+ this.cacheWarmingNotice = { component, total, note: entry.note };
3605
3654
  this.chatContainer.addChild(new Spacer(1));
3606
- const usage = formatCacheWarmingUsage(entry);
3607
- this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", usage), 1, 0));
3655
+ this.chatContainer.addChild(component);
3608
3656
  }
3609
3657
  /**
3610
3658
  * Render billing usage for a compaction or branch summary. The notice is derived
@@ -4060,7 +4108,7 @@ export class InteractiveMode {
4060
4108
  if (isExpandable(activeHeader)) {
4061
4109
  activeHeader.setExpanded(expanded);
4062
4110
  }
4063
- for (const container of [this.loadedResourcesContainer, this.chatContainer]) {
4111
+ for (const container of [this.loadedResourcesContainer, this.chatContainer, this.pendingMessagesContainer]) {
4064
4112
  for (const child of container.children) {
4065
4113
  if (isExpandable(child)) {
4066
4114
  child.setExpanded(expanded);
@@ -4185,6 +4233,10 @@ export class InteractiveMode {
4185
4233
  }
4186
4234
  updatePendingMessagesDisplay() {
4187
4235
  this.pendingMessagesContainer.clear();
4236
+ // User bash output shown while the agent works lives here until it moves to the chat.
4237
+ for (const component of this.pendingBashComponents) {
4238
+ this.pendingMessagesContainer.addChild(component);
4239
+ }
4188
4240
  const { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();
4189
4241
  if (steeringMessages.length > 0 || followUpMessages.length > 0) {
4190
4242
  this.pendingMessagesContainer.addChild(new Spacer(1));
@@ -5243,25 +5295,43 @@ export class InteractiveMode {
5243
5295
  }
5244
5296
  catch (error) {
5245
5297
  if (error instanceof MissingSessionCwdError) {
5246
- const selectedCwd = await this.promptForMissingSessionCwd(error);
5247
- if (!selectedCwd) {
5248
- this.showStatus("Resume cancelled");
5249
- return { cancelled: true };
5250
- }
5251
- const result = await this.runtimeHost.switchSession(sessionPath, {
5252
- cwdOverride: selectedCwd,
5253
- withSession: options?.withSession,
5254
- projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
5255
- });
5256
- if (result.cancelled) {
5257
- return result;
5298
+ switch (await this.promptForMissingSessionCwd(error)) {
5299
+ case "continue": {
5300
+ const result = await this.runtimeHost.switchSession(sessionPath, {
5301
+ cwdOverride: error.issue.fallbackCwd,
5302
+ withSession: options?.withSession,
5303
+ projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
5304
+ });
5305
+ if (!result.cancelled)
5306
+ this.showStatus(`Resumed session in ${error.issue.fallbackCwd}`);
5307
+ return result;
5308
+ }
5309
+ case "fork":
5310
+ return this.switchToForkedSession(sessionPath, error.issue.fallbackCwd, options);
5311
+ case undefined:
5312
+ this.showStatus("Resume cancelled");
5313
+ return { cancelled: true };
5258
5314
  }
5259
- this.showStatus("Resumed session in current cwd");
5260
- return result;
5261
5315
  }
5262
5316
  return this.handleFatalRuntimeError("Failed to resume session", error);
5263
5317
  }
5264
5318
  }
5319
+ /** Fork a session whose stored cwd is gone into `cwd` and switch to the fork, like `--session <id>` from another project (#11060). */
5320
+ async switchToForkedSession(sourcePath, cwd, options) {
5321
+ const fork = SessionManager.forkFrom(sourcePath, cwd, this.sessionManager.getSessionDir());
5322
+ const forkPath = fork.getSessionFile();
5323
+ const result = await this.runtimeHost.switchSession(forkPath, {
5324
+ withSession: options?.withSession,
5325
+ projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
5326
+ });
5327
+ if (result.cancelled) {
5328
+ // An extension vetoed the switch; drop the fork so cancelling leaves no copy behind.
5329
+ fs.rmSync(forkPath, { force: true });
5330
+ return result;
5331
+ }
5332
+ this.showStatus(`Forked into new session ${fork.getSessionId()} in ${cwd}`);
5333
+ return result;
5334
+ }
5265
5335
  getLoginProviderOptions(authType) {
5266
5336
  const options = [];
5267
5337
  for (const provider of this.session.modelRuntime.getProviders()) {
@@ -5294,7 +5364,8 @@ export class InteractiveMode {
5294
5364
  });
5295
5365
  }
5296
5366
  }
5297
- return options.sort((a, b) => a.name.localeCompare(b.name));
5367
+ // The sort is stable, so a provider's account option stays above its API key option.
5368
+ return options.sort(compareProviders);
5298
5369
  }
5299
5370
  async getLogoutProviderOptions() {
5300
5371
  return (await this.session.modelRuntime.listCredentials({ signal: AbortSignal.timeout(15_000) }))
@@ -5308,22 +5379,14 @@ export class InteractiveMode {
5308
5379
  subscription: provider?.auth.oauth?.isSubscription === true,
5309
5380
  };
5310
5381
  })
5311
- .sort((a, b) => a.name.localeCompare(b.name));
5312
- }
5313
- findLoginProviderOptions(providerRef) {
5314
- const normalizedProviderRef = providerRef.trim().toLowerCase();
5315
- if (!normalizedProviderRef) {
5316
- return [];
5317
- }
5318
- return this.getLoginProviderOptions().filter((provider) => provider.id.toLowerCase() === normalizedProviderRef ||
5319
- provider.name.toLowerCase() === normalizedProviderRef);
5382
+ .sort(compareProviders);
5320
5383
  }
5321
5384
  async handleLoginCommand(providerRef) {
5322
5385
  if (!providerRef) {
5323
5386
  this.showLoginAuthTypeSelector();
5324
5387
  return;
5325
5388
  }
5326
- const providerOptions = this.findLoginProviderOptions(providerRef);
5389
+ const providerOptions = findMatchingProviders(this.getLoginProviderOptions(), providerRef);
5327
5390
  if (providerOptions.length === 1) {
5328
5391
  await this.startProviderLogin(providerOptions[0]);
5329
5392
  return;
@@ -5440,8 +5503,8 @@ export class InteractiveMode {
5440
5503
  else {
5441
5504
  this.ui.requestRender();
5442
5505
  }
5443
- }, initialSearchInput);
5444
- return { component: selector, focus: selector };
5506
+ }, initialSearchInput, this.ui);
5507
+ return { component: selector, focus: selector, dispose: () => selector.dispose() };
5445
5508
  });
5446
5509
  }
5447
5510
  async showOAuthSelector(mode) {
@@ -5487,8 +5550,8 @@ export class InteractiveMode {
5487
5550
  }, () => {
5488
5551
  done();
5489
5552
  this.ui.requestRender();
5490
- });
5491
- return { component: selector, focus: selector };
5553
+ }, undefined, this.ui);
5554
+ return { component: selector, focus: selector, dispose: () => selector.dispose() };
5492
5555
  });
5493
5556
  }
5494
5557
  async completeProviderAuthentication(providerId, providerName, authType, previousModel) {
@@ -5765,24 +5828,10 @@ export class InteractiveMode {
5765
5828
  * when missing. Nothing is asked when a global server already uses this login.
5766
5829
  */
5767
5830
  offerRadiusMcpServer(providerId, providerName) {
5768
- const mcpPath = path.join(getAgentDir(), "mcp.json");
5769
- const normalizeUrl = (url) => url.replace(/\/+$/u, "");
5770
- const { servers } = loadMcpConfig({
5771
- agentDir: getAgentDir(),
5772
- cwd: this.sessionManager.getCwd(),
5773
- projectTrusted: false,
5774
- });
5775
- const existing = servers.find((server) => "url" in server.config && normalizeUrl(server.config.url) === normalizeUrl(RADIUS_MCP_URL));
5776
- if (existing && "url" in existing.config && existing.config.auth?.provider === providerId)
5831
+ const plan = planRadiusMcpServer(providerId, getAgentDir(), this.sessionManager.getCwd());
5832
+ if (!plan)
5777
5833
  return;
5778
- let name = existing?.name ?? "radius";
5779
- if (!existing && servers.some((server) => server.name === name))
5780
- name = "radius-mcp";
5781
- const config = existing && "url" in existing.config
5782
- ? { ...existing.config, auth: { provider: providerId } }
5783
- : { url: RADIUS_MCP_URL, auth: { provider: providerId } };
5784
- // `auth` replaces the MCP OAuth sign-in.
5785
- delete config.oauth;
5834
+ const { mcpPath, name, config } = plan;
5786
5835
  this.showSelector((done) => {
5787
5836
  const selector = new ExtensionSelectorComponent(`Configure ${providerName} MCP in ${mcpPath}?`, ["Yes", "No"], (option) => {
5788
5837
  done();
@@ -5948,18 +5997,22 @@ export class InteractiveMode {
5948
5997
  }
5949
5998
  catch (error) {
5950
5999
  if (error instanceof MissingSessionCwdError) {
5951
- const selectedCwd = await this.promptForMissingSessionCwd(error);
5952
- if (!selectedCwd) {
5953
- this.showStatus("Import cancelled");
5954
- return;
5955
- }
5956
- const result = await this.runtimeHost.importFromJsonl(inputPath, selectedCwd);
5957
- if (result.cancelled) {
5958
- this.showStatus("Import cancelled");
5959
- return;
6000
+ switch (await this.promptForMissingSessionCwd(error)) {
6001
+ case "continue": {
6002
+ const result = await this.runtimeHost.importFromJsonl(inputPath, error.issue.fallbackCwd);
6003
+ this.showStatus(result.cancelled ? "Import cancelled" : `Session imported from: ${inputPath}`);
6004
+ return;
6005
+ }
6006
+ case "fork": {
6007
+ const result = await this.switchToForkedSession(inputPath, error.issue.fallbackCwd);
6008
+ if (result.cancelled)
6009
+ this.showStatus("Import cancelled");
6010
+ return;
6011
+ }
6012
+ case undefined:
6013
+ this.showStatus("Import cancelled");
6014
+ return;
5960
6015
  }
5961
- this.showStatus(`Session imported from: ${inputPath}`);
5962
- return;
5963
6016
  }
5964
6017
  if (error instanceof SessionImportFileNotFoundError) {
5965
6018
  this.showError(`Failed to import session: ${error.message}`);
@@ -6341,6 +6394,7 @@ ${cycleContextWindow ? `| \`${cycleContextWindow}\` | Cycle context window |\n`
6341
6394
  const result = eventResult.result;
6342
6395
  // Create UI component for display
6343
6396
  this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
6397
+ this.bashComponent.setExpanded(this.toolOutputExpanded);
6344
6398
  if (this.session.isStreaming) {
6345
6399
  this.pendingMessagesContainer.addChild(this.bashComponent);
6346
6400
  this.pendingBashComponents.push(this.bashComponent);
@@ -6362,6 +6416,7 @@ ${cycleContextWindow ? `| \`${cycleContextWindow}\` | Cycle context window |\n`
6362
6416
  // Normal execution path (possibly with custom operations)
6363
6417
  const isDeferred = this.session.isStreaming;
6364
6418
  this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
6419
+ this.bashComponent.setExpanded(this.toolOutputExpanded);
6365
6420
  if (isDeferred) {
6366
6421
  // Show in pending area when agent is streaming
6367
6422
  this.pendingMessagesContainer.addChild(this.bashComponent);