@draht/coding-agent 2026.9.5-1 → 2026.10.4-3

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 (1015) hide show
  1. package/CHANGELOG.md +458 -0
  2. package/dist/bun/cli.d.ts +1 -1
  3. package/dist/bun/cli.d.ts.map +1 -1
  4. package/dist/bun/cli.js +6 -3
  5. package/dist/bun/cli.js.map +1 -1
  6. package/dist/bun/sandbox-env-setup.d.ts +2 -0
  7. package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
  8. package/dist/bun/sandbox-env-setup.js +4 -0
  9. package/dist/bun/sandbox-env-setup.js.map +1 -0
  10. package/dist/bundle/chunks/anthropic-messages-E2P6C3P7.js +6 -0
  11. package/dist/bundle/chunks/anthropic.js +75 -0
  12. package/dist/bundle/chunks/azure-openai-responses-JZMSTDIM.js +2 -0
  13. package/dist/bundle/chunks/bedrock-converse-stream.js +79 -0
  14. package/dist/bundle/chunks/chunk-2E5VODES.js +2 -0
  15. package/dist/bundle/chunks/chunk-2FBJKY7F.js +2 -0
  16. package/dist/bundle/chunks/chunk-2JZLKNZ4.js +3 -0
  17. package/dist/bundle/chunks/chunk-2N4I6WXC.js +2 -0
  18. package/dist/bundle/chunks/chunk-3HF756LN.js +1472 -0
  19. package/dist/bundle/chunks/chunk-5QJFWTKA.js +4 -0
  20. package/dist/bundle/chunks/chunk-63BK6WK2.js +2 -0
  21. package/dist/bundle/chunks/chunk-A4OX5CPR.js +146 -0
  22. package/dist/bundle/chunks/chunk-AFL4IDSI.js +82 -0
  23. package/dist/bundle/chunks/chunk-D3HO453P.js +42 -0
  24. package/dist/bundle/chunks/chunk-EBVYI75P.js +2 -0
  25. package/dist/bundle/chunks/chunk-FBU742QF.js +2 -0
  26. package/dist/bundle/chunks/chunk-FHX2S5IG.js +31 -0
  27. package/dist/bundle/chunks/chunk-GBFVS2SF.js +12 -0
  28. package/dist/bundle/chunks/chunk-GVXA72ZA.js +2 -0
  29. package/dist/bundle/chunks/chunk-HJ72RANT.js +2 -0
  30. package/dist/bundle/chunks/chunk-HTJ3L72O.js +2 -0
  31. package/dist/bundle/chunks/chunk-HZ2UHMBT.js +2 -0
  32. package/dist/bundle/chunks/chunk-I5OKY6RH.js +11 -0
  33. package/dist/bundle/chunks/chunk-JTLUBTZT.js +2 -0
  34. package/dist/bundle/chunks/chunk-KPO5375S.js +2 -0
  35. package/dist/bundle/chunks/chunk-KY2BG6BC.js +11 -0
  36. package/dist/bundle/chunks/chunk-LO6CVU2L.js +6 -0
  37. package/dist/bundle/chunks/chunk-QMN7OD6G.js +2 -0
  38. package/dist/bundle/chunks/chunk-SDRCE6OP.js +2 -0
  39. package/dist/bundle/chunks/chunk-SPZUYYP5.js +170 -0
  40. package/dist/bundle/chunks/chunk-UTRX2VHB.js +44 -0
  41. package/dist/bundle/chunks/chunk-V5HG6S2T.js +4 -0
  42. package/dist/bundle/chunks/chunk-VPYAVQLP.js +137 -0
  43. package/dist/bundle/chunks/chunk-VXUJMEMO.js +2 -0
  44. package/dist/bundle/chunks/chunk-XBUEMKIY.js +2 -0
  45. package/dist/bundle/chunks/chunk-XHCO4PPH.js +8 -0
  46. package/dist/bundle/chunks/chunk-XO3IECI5.js +18 -0
  47. package/dist/bundle/chunks/chunk-XOGEYN4Q.js +2 -0
  48. package/dist/bundle/chunks/cli-L74YA5GF.js +51 -0
  49. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-MJKOAE5S.js +2 -0
  50. package/dist/bundle/chunks/codemode-worker.js +315 -0
  51. package/dist/bundle/chunks/execute-EMOVNTD6.js +328 -0
  52. package/dist/bundle/chunks/github-copilot.js +2 -0
  53. package/dist/bundle/chunks/google-antigravity.js +75 -0
  54. package/dist/bundle/chunks/google-gemini-cli.js +75 -0
  55. package/dist/bundle/chunks/google-generative-ai-HPNDIAZD.js +2 -0
  56. package/dist/bundle/chunks/google-vertex-KPAWJ4SP.js +2 -0
  57. package/dist/bundle/chunks/https-proxy-agent-WQIRL24U.js +13 -0
  58. package/dist/bundle/chunks/image-resize-worker.js +2 -0
  59. package/dist/bundle/chunks/jiti-loader-RKXLMQV2.js +2 -0
  60. package/dist/bundle/chunks/kimi-coding.js +2 -0
  61. package/dist/bundle/chunks/lib-ULKZYRGD.js +9 -0
  62. package/dist/bundle/chunks/llama-cpp-classify-EJ5XMSQL.js +22 -0
  63. package/dist/bundle/chunks/meta.js +2 -0
  64. package/dist/bundle/chunks/mistral-conversations-FMSPWQ7A.js +5 -0
  65. package/dist/bundle/chunks/multipart-parser-HMCXZ4BD.js +3 -0
  66. package/dist/bundle/chunks/node-4JNG6XQO.js +16 -0
  67. package/dist/bundle/chunks/node-6IIDYB3K.js +2 -0
  68. package/dist/bundle/chunks/openai-chatgpt.js +75 -0
  69. package/dist/bundle/chunks/openai-codex-responses-TU7NGPXE.js +10 -0
  70. package/dist/bundle/chunks/openai-codex.js +75 -0
  71. package/dist/bundle/chunks/openai-completions-GANCQQO5.js +7 -0
  72. package/dist/bundle/chunks/openai-responses-ASDPAX3E.js +3 -0
  73. package/dist/bundle/chunks/opencode-go.js +2 -0
  74. package/dist/bundle/chunks/openrouter-images-NROSQXMZ.js +2 -0
  75. package/dist/bundle/chunks/openrouter.js +75 -0
  76. package/dist/bundle/chunks/pi-messages-2QEJYOAO.js +8 -0
  77. package/dist/bundle/chunks/radius.js +75 -0
  78. package/dist/bundle/chunks/runtime-RYUR6LRB.js +2 -0
  79. package/dist/bundle/chunks/settings-manager-CHEMMAGQ.js +2 -0
  80. package/dist/bundle/chunks/src-KDGO7EGF.js +4 -0
  81. package/dist/bundle/chunks/typesafe-system-one-YBEEY5XU.js +2 -0
  82. package/dist/bundle/chunks/virtual-modules-OC56AAJ7.js +2 -0
  83. package/dist/bundle/chunks/xai.js +75 -0
  84. package/dist/bundle/cli-runtime.js +3 -0
  85. package/dist/bundle/cli.js +5 -0
  86. package/dist/bundle/index.js +2 -0
  87. package/dist/bundle/rpc-entry.js +3 -0
  88. package/dist/cli/args.d.ts +4 -0
  89. package/dist/cli/args.d.ts.map +1 -1
  90. package/dist/cli/args.js +72 -21
  91. package/dist/cli/args.js.map +1 -1
  92. package/dist/cli/auth-check.d.ts +19 -0
  93. package/dist/cli/auth-check.d.ts.map +1 -0
  94. package/dist/cli/auth-check.js +50 -0
  95. package/dist/cli/auth-check.js.map +1 -0
  96. package/dist/cli/auth-command.d.ts +24 -0
  97. package/dist/cli/auth-command.d.ts.map +1 -0
  98. package/dist/cli/auth-command.js +103 -0
  99. package/dist/cli/auth-command.js.map +1 -0
  100. package/dist/cli/config-selector.d.ts.map +1 -1
  101. package/dist/cli/config-selector.js +3 -2
  102. package/dist/cli/config-selector.js.map +1 -1
  103. package/dist/cli/credential-print.d.ts +5 -3
  104. package/dist/cli/credential-print.d.ts.map +1 -1
  105. package/dist/cli/credential-print.js +42 -30
  106. package/dist/cli/credential-print.js.map +1 -1
  107. package/dist/cli/file-processor.d.ts +1 -1
  108. package/dist/cli/file-processor.d.ts.map +1 -1
  109. package/dist/cli/file-processor.js +2 -1
  110. package/dist/cli/file-processor.js.map +1 -1
  111. package/dist/cli/list-models.d.ts +1 -1
  112. package/dist/cli/list-models.d.ts.map +1 -1
  113. package/dist/cli/list-models.js +2 -2
  114. package/dist/cli/list-models.js.map +1 -1
  115. package/dist/cli/session-picker.d.ts +1 -1
  116. package/dist/cli/session-picker.d.ts.map +1 -1
  117. package/dist/cli/session-picker.js.map +1 -1
  118. package/dist/cli/setup.d.ts +2 -0
  119. package/dist/cli/setup.d.ts.map +1 -0
  120. package/dist/cli/setup.js +12 -0
  121. package/dist/cli/setup.js.map +1 -0
  122. package/dist/cli/startup-ui.d.ts +2 -2
  123. package/dist/cli/startup-ui.d.ts.map +1 -1
  124. package/dist/cli/startup-ui.js +42 -33
  125. package/dist/cli/startup-ui.js.map +1 -1
  126. package/dist/cli.js +3 -12
  127. package/dist/cli.js.map +1 -1
  128. package/dist/config.d.ts +20 -4
  129. package/dist/config.d.ts.map +1 -1
  130. package/dist/config.js +42 -6
  131. package/dist/config.js.map +1 -1
  132. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  133. package/dist/core/agent-session-runtime.js +12 -3
  134. package/dist/core/agent-session-runtime.js.map +1 -1
  135. package/dist/core/agent-session-services.d.ts +1 -0
  136. package/dist/core/agent-session-services.d.ts.map +1 -1
  137. package/dist/core/agent-session-services.js +14 -0
  138. package/dist/core/agent-session-services.js.map +1 -1
  139. package/dist/core/agent-session.d.ts +237 -39
  140. package/dist/core/agent-session.d.ts.map +1 -1
  141. package/dist/core/agent-session.js +1386 -565
  142. package/dist/core/agent-session.js.map +1 -1
  143. package/dist/core/auth-storage.d.ts +20 -8
  144. package/dist/core/auth-storage.d.ts.map +1 -1
  145. package/dist/core/auth-storage.js +199 -56
  146. package/dist/core/auth-storage.js.map +1 -1
  147. package/dist/core/bug-report-upload.d.ts +11 -0
  148. package/dist/core/bug-report-upload.d.ts.map +1 -0
  149. package/dist/core/bug-report-upload.js +20 -0
  150. package/dist/core/bug-report-upload.js.map +1 -0
  151. package/dist/core/bug-report.d.ts +176 -0
  152. package/dist/core/bug-report.d.ts.map +1 -0
  153. package/dist/core/bug-report.js +292 -0
  154. package/dist/core/bug-report.js.map +1 -0
  155. package/dist/core/builtins/duet.js +2 -2
  156. package/dist/core/builtins/duet.js.map +1 -1
  157. package/dist/core/cache-stats.d.ts.map +1 -1
  158. package/dist/core/cache-stats.js +12 -1
  159. package/dist/core/cache-stats.js.map +1 -1
  160. package/dist/core/cache-warmer.d.ts +103 -0
  161. package/dist/core/cache-warmer.d.ts.map +1 -0
  162. package/dist/core/cache-warmer.js +356 -0
  163. package/dist/core/cache-warmer.js.map +1 -0
  164. package/dist/core/checkpoints/checkpoint-manager.d.ts +8 -4
  165. package/dist/core/checkpoints/checkpoint-manager.d.ts.map +1 -1
  166. package/dist/core/checkpoints/checkpoint-manager.js +46 -10
  167. package/dist/core/checkpoints/checkpoint-manager.js.map +1 -1
  168. package/dist/core/checkpoints/rewind.d.ts +4 -2
  169. package/dist/core/checkpoints/rewind.d.ts.map +1 -1
  170. package/dist/core/checkpoints/rewind.js +4 -3
  171. package/dist/core/checkpoints/rewind.js.map +1 -1
  172. package/dist/core/compaction/branch-summarization.js +2 -2
  173. package/dist/core/compaction/branch-summarization.js.map +1 -1
  174. package/dist/core/compaction/compaction.d.ts +9 -6
  175. package/dist/core/compaction/compaction.d.ts.map +1 -1
  176. package/dist/core/compaction/compaction.js +196 -118
  177. package/dist/core/compaction/compaction.js.map +1 -1
  178. package/dist/core/compaction/utils.d.ts +2 -1
  179. package/dist/core/compaction/utils.d.ts.map +1 -1
  180. package/dist/core/compaction/utils.js +25 -18
  181. package/dist/core/compaction/utils.js.map +1 -1
  182. package/dist/core/context-windows.d.ts.map +1 -1
  183. package/dist/core/context-windows.js +13 -3
  184. package/dist/core/context-windows.js.map +1 -1
  185. package/dist/core/crash-log.d.ts +27 -0
  186. package/dist/core/crash-log.d.ts.map +1 -0
  187. package/dist/core/crash-log.js +140 -0
  188. package/dist/core/crash-log.js.map +1 -0
  189. package/dist/core/defaults.d.ts +1 -0
  190. package/dist/core/defaults.d.ts.map +1 -1
  191. package/dist/core/defaults.js +9 -0
  192. package/dist/core/defaults.js.map +1 -1
  193. package/dist/core/experimental.js +1 -1
  194. package/dist/core/experimental.js.map +1 -1
  195. package/dist/core/export-html/template.css +10 -0
  196. package/dist/core/export-html/template.js +72 -18
  197. package/dist/core/extensions/index.d.ts +2 -2
  198. package/dist/core/extensions/index.d.ts.map +1 -1
  199. package/dist/core/extensions/index.js +1 -1
  200. package/dist/core/extensions/index.js.map +1 -1
  201. package/dist/core/extensions/jiti-loader.d.ts +2 -0
  202. package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
  203. package/dist/core/extensions/jiti-loader.js +5 -0
  204. package/dist/core/extensions/jiti-loader.js.map +1 -0
  205. package/dist/core/extensions/loader.d.ts.map +1 -1
  206. package/dist/core/extensions/loader.js +228 -89
  207. package/dist/core/extensions/loader.js.map +1 -1
  208. package/dist/core/extensions/runner.d.ts +47 -8
  209. package/dist/core/extensions/runner.d.ts.map +1 -1
  210. package/dist/core/extensions/runner.js +376 -104
  211. package/dist/core/extensions/runner.js.map +1 -1
  212. package/dist/core/extensions/types.d.ts +521 -88
  213. package/dist/core/extensions/types.d.ts.map +1 -1
  214. package/dist/core/extensions/types.js +3 -0
  215. package/dist/core/extensions/types.js.map +1 -1
  216. package/dist/core/extensions/virtual-modules.d.ts +3 -0
  217. package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
  218. package/dist/core/extensions/virtual-modules.js +37 -0
  219. package/dist/core/extensions/virtual-modules.js.map +1 -0
  220. package/dist/core/extensions/wrapper.d.ts +2 -2
  221. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  222. package/dist/core/extensions/wrapper.js +3 -22
  223. package/dist/core/extensions/wrapper.js.map +1 -1
  224. package/dist/core/footer-data-provider.d.ts +1 -1
  225. package/dist/core/footer-data-provider.js +19 -18
  226. package/dist/core/footer-data-provider.js.map +1 -1
  227. package/dist/core/index.d.ts +2 -1
  228. package/dist/core/index.d.ts.map +1 -1
  229. package/dist/core/index.js.map +1 -1
  230. package/dist/core/keybindings.d.ts +83 -13
  231. package/dist/core/keybindings.d.ts.map +1 -1
  232. package/dist/core/keybindings.js +33 -7
  233. package/dist/core/keybindings.js.map +1 -1
  234. package/dist/core/mcp-servers.d.ts +119 -0
  235. package/dist/core/mcp-servers.d.ts.map +1 -0
  236. package/dist/core/mcp-servers.js +191 -0
  237. package/dist/core/mcp-servers.js.map +1 -0
  238. package/dist/core/messages.d.ts +1 -1
  239. package/dist/core/messages.d.ts.map +1 -1
  240. package/dist/core/messages.js +1 -0
  241. package/dist/core/messages.js.map +1 -1
  242. package/dist/core/model-config.d.ts +202 -20
  243. package/dist/core/model-config.d.ts.map +1 -1
  244. package/dist/core/model-config.js +53 -18
  245. package/dist/core/model-config.js.map +1 -1
  246. package/dist/core/model-registry.d.ts +19 -2
  247. package/dist/core/model-registry.d.ts.map +1 -1
  248. package/dist/core/model-registry.js +39 -2
  249. package/dist/core/model-registry.js.map +1 -1
  250. package/dist/core/model-resolver.d.ts +7 -5
  251. package/dist/core/model-resolver.d.ts.map +1 -1
  252. package/dist/core/model-resolver.js +29 -17
  253. package/dist/core/model-resolver.js.map +1 -1
  254. package/dist/core/model-runtime.d.ts +79 -20
  255. package/dist/core/model-runtime.d.ts.map +1 -1
  256. package/dist/core/model-runtime.js +460 -134
  257. package/dist/core/model-runtime.js.map +1 -1
  258. package/dist/core/models-store.d.ts +12 -7
  259. package/dist/core/models-store.d.ts.map +1 -1
  260. package/dist/core/models-store.js +87 -18
  261. package/dist/core/models-store.js.map +1 -1
  262. package/dist/core/multi-agent/fsm.js +8 -3
  263. package/dist/core/multi-agent/fsm.js.map +1 -1
  264. package/dist/core/multi-agent/mailbox.js +1 -3
  265. package/dist/core/multi-agent/mailbox.js.map +1 -1
  266. package/dist/core/multi-agent/permission-gate.d.ts +5 -2
  267. package/dist/core/multi-agent/permission-gate.d.ts.map +1 -1
  268. package/dist/core/multi-agent/permission-gate.js +597 -34
  269. package/dist/core/multi-agent/permission-gate.js.map +1 -1
  270. package/dist/core/multi-agent/task-board.js +2 -4
  271. package/dist/core/multi-agent/task-board.js.map +1 -1
  272. package/dist/core/multi-agent/worktree.js +1 -3
  273. package/dist/core/multi-agent/worktree.js.map +1 -1
  274. package/dist/core/nested-tool-calls.d.ts +102 -0
  275. package/dist/core/nested-tool-calls.d.ts.map +1 -0
  276. package/dist/core/nested-tool-calls.js +178 -0
  277. package/dist/core/nested-tool-calls.js.map +1 -0
  278. package/dist/core/package-manager.d.ts +10 -0
  279. package/dist/core/package-manager.d.ts.map +1 -1
  280. package/dist/core/package-manager.js +149 -33
  281. package/dist/core/package-manager.js.map +1 -1
  282. package/dist/core/pi-manifest.d.ts.map +1 -1
  283. package/dist/core/pi-manifest.js +13 -12
  284. package/dist/core/pi-manifest.js.map +1 -1
  285. package/dist/core/prompt-templates.d.ts +6 -1
  286. package/dist/core/prompt-templates.d.ts.map +1 -1
  287. package/dist/core/prompt-templates.js +63 -37
  288. package/dist/core/prompt-templates.js.map +1 -1
  289. package/dist/core/provider-attribution.js +5 -5
  290. package/dist/core/provider-attribution.js.map +1 -1
  291. package/dist/core/provider-composer.d.ts +44 -20
  292. package/dist/core/provider-composer.d.ts.map +1 -1
  293. package/dist/core/provider-composer.js +151 -51
  294. package/dist/core/provider-composer.js.map +1 -1
  295. package/dist/core/radius.d.ts +13 -0
  296. package/dist/core/radius.d.ts.map +1 -1
  297. package/dist/core/radius.js +19 -0
  298. package/dist/core/radius.js.map +1 -1
  299. package/dist/core/remote-catalog-provider.d.ts +10 -3
  300. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  301. package/dist/core/remote-catalog-provider.js +105 -81
  302. package/dist/core/remote-catalog-provider.js.map +1 -1
  303. package/dist/core/resource-loader.d.ts +7 -1
  304. package/dist/core/resource-loader.d.ts.map +1 -1
  305. package/dist/core/resource-loader.js +219 -42
  306. package/dist/core/resource-loader.js.map +1 -1
  307. package/dist/core/runtime-credentials.d.ts +5 -5
  308. package/dist/core/runtime-credentials.d.ts.map +1 -1
  309. package/dist/core/runtime-credentials.js +13 -9
  310. package/dist/core/runtime-credentials.js.map +1 -1
  311. package/dist/core/sandbox/executor.js +1 -0
  312. package/dist/core/sandbox/executor.js.map +1 -1
  313. package/dist/core/sdk.d.ts +7 -5
  314. package/dist/core/sdk.d.ts.map +1 -1
  315. package/dist/core/sdk.js +100 -52
  316. package/dist/core/sdk.js.map +1 -1
  317. package/dist/core/session-cwd.js +1 -0
  318. package/dist/core/session-cwd.js.map +1 -1
  319. package/dist/core/session-export.d.ts +8 -0
  320. package/dist/core/session-export.d.ts.map +1 -0
  321. package/dist/core/session-export.js +33 -0
  322. package/dist/core/session-export.js.map +1 -0
  323. package/dist/core/session-manager.d.ts +75 -15
  324. package/dist/core/session-manager.d.ts.map +1 -1
  325. package/dist/core/session-manager.js +314 -144
  326. package/dist/core/session-manager.js.map +1 -1
  327. package/dist/core/settings-diagnostics.d.ts +9 -0
  328. package/dist/core/settings-diagnostics.d.ts.map +1 -0
  329. package/dist/core/settings-diagnostics.js +21 -0
  330. package/dist/core/settings-diagnostics.js.map +1 -0
  331. package/dist/core/settings-manager.d.ts +84 -4
  332. package/dist/core/settings-manager.d.ts.map +1 -1
  333. package/dist/core/settings-manager.js +239 -25
  334. package/dist/core/settings-manager.js.map +1 -1
  335. package/dist/core/skills.d.ts.map +1 -1
  336. package/dist/core/skills.js +51 -33
  337. package/dist/core/skills.js.map +1 -1
  338. package/dist/core/slash-commands.d.ts.map +1 -1
  339. package/dist/core/slash-commands.js +3 -1
  340. package/dist/core/slash-commands.js.map +1 -1
  341. package/dist/core/soak/soak-log.js +6 -0
  342. package/dist/core/soak/soak-log.js.map +1 -1
  343. package/dist/core/socket-server/socket-server.js +11 -0
  344. package/dist/core/socket-server/socket-server.js.map +1 -1
  345. package/dist/core/socket-server/types.d.ts +2 -1
  346. package/dist/core/socket-server/types.d.ts.map +1 -1
  347. package/dist/core/socket-server/types.js.map +1 -1
  348. package/dist/core/source-info.d.ts +8 -0
  349. package/dist/core/source-info.d.ts.map +1 -1
  350. package/dist/core/source-info.js +16 -0
  351. package/dist/core/source-info.js.map +1 -1
  352. package/dist/core/system-prompt.d.ts +49 -6
  353. package/dist/core/system-prompt.d.ts.map +1 -1
  354. package/dist/core/system-prompt.js +126 -89
  355. package/dist/core/system-prompt.js.map +1 -1
  356. package/dist/core/tools/bash.d.ts +32 -2
  357. package/dist/core/tools/bash.d.ts.map +1 -1
  358. package/dist/core/tools/bash.js +82 -143
  359. package/dist/core/tools/bash.js.map +1 -1
  360. package/dist/core/tools/edit-diff.d.ts +0 -5
  361. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  362. package/dist/core/tools/edit-diff.js +2 -5
  363. package/dist/core/tools/edit-diff.js.map +1 -1
  364. package/dist/core/tools/edit.d.ts +5 -12
  365. package/dist/core/tools/edit.d.ts.map +1 -1
  366. package/dist/core/tools/edit.js +19 -171
  367. package/dist/core/tools/edit.js.map +1 -1
  368. package/dist/core/tools/find.d.ts +4 -0
  369. package/dist/core/tools/find.d.ts.map +1 -1
  370. package/dist/core/tools/find.js +11 -58
  371. package/dist/core/tools/find.js.map +1 -1
  372. package/dist/core/tools/grep.d.ts +4 -0
  373. package/dist/core/tools/grep.d.ts.map +1 -1
  374. package/dist/core/tools/grep.js +10 -62
  375. package/dist/core/tools/grep.js.map +1 -1
  376. package/dist/core/tools/index.d.ts +4 -1
  377. package/dist/core/tools/index.d.ts.map +1 -1
  378. package/dist/core/tools/index.js +18 -1
  379. package/dist/core/tools/index.js.map +1 -1
  380. package/dist/core/tools/ls.d.ts +4 -0
  381. package/dist/core/tools/ls.d.ts.map +1 -1
  382. package/dist/core/tools/ls.js +9 -50
  383. package/dist/core/tools/ls.js.map +1 -1
  384. package/dist/core/tools/output-accumulator.d.ts +11 -0
  385. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  386. package/dist/core/tools/output-accumulator.js +54 -12
  387. package/dist/core/tools/output-accumulator.js.map +1 -1
  388. package/dist/core/tools/powershell.d.ts +16 -0
  389. package/dist/core/tools/powershell.d.ts.map +1 -0
  390. package/dist/core/tools/powershell.js +39 -0
  391. package/dist/core/tools/powershell.js.map +1 -0
  392. package/dist/core/tools/read.d.ts +8 -1
  393. package/dist/core/tools/read.d.ts.map +1 -1
  394. package/dist/core/tools/read.js +16 -123
  395. package/dist/core/tools/read.js.map +1 -1
  396. package/dist/core/tools/render-utils.d.ts +6 -0
  397. package/dist/core/tools/render-utils.d.ts.map +1 -1
  398. package/dist/core/tools/render-utils.js +26 -0
  399. package/dist/core/tools/render-utils.js.map +1 -1
  400. package/dist/core/tools/renderers/bash.d.ts +12 -0
  401. package/dist/core/tools/renderers/bash.d.ts.map +1 -0
  402. package/dist/core/tools/renderers/bash.js +117 -0
  403. package/dist/core/tools/renderers/bash.js.map +1 -0
  404. package/dist/core/tools/renderers/edit.d.ts +23 -0
  405. package/dist/core/tools/renderers/edit.d.ts.map +1 -0
  406. package/dist/core/tools/renderers/edit.js +167 -0
  407. package/dist/core/tools/renderers/edit.js.map +1 -0
  408. package/dist/core/tools/renderers/find.d.ts +10 -0
  409. package/dist/core/tools/renderers/find.d.ts.map +1 -0
  410. package/dist/core/tools/renderers/find.js +64 -0
  411. package/dist/core/tools/renderers/find.js.map +1 -0
  412. package/dist/core/tools/renderers/grep.d.ts +10 -0
  413. package/dist/core/tools/renderers/grep.d.ts.map +1 -0
  414. package/dist/core/tools/renderers/grep.js +69 -0
  415. package/dist/core/tools/renderers/grep.js.map +1 -0
  416. package/dist/core/tools/renderers/index.d.ts +28 -0
  417. package/dist/core/tools/renderers/index.d.ts.map +1 -0
  418. package/dist/core/tools/renderers/index.js +47 -0
  419. package/dist/core/tools/renderers/index.js.map +1 -0
  420. package/dist/core/tools/renderers/ls.d.ts +10 -0
  421. package/dist/core/tools/renderers/ls.d.ts.map +1 -0
  422. package/dist/core/tools/renderers/ls.js +58 -0
  423. package/dist/core/tools/renderers/ls.js.map +1 -0
  424. package/dist/core/tools/renderers/read.d.ts +11 -0
  425. package/dist/core/tools/renderers/read.d.ts.map +1 -0
  426. package/dist/core/tools/renderers/read.js +130 -0
  427. package/dist/core/tools/renderers/read.js.map +1 -0
  428. package/dist/core/tools/renderers/write.d.ts +10 -0
  429. package/dist/core/tools/renderers/write.d.ts.map +1 -0
  430. package/dist/core/tools/renderers/write.js +153 -0
  431. package/dist/core/tools/renderers/write.js.map +1 -0
  432. package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
  433. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  434. package/dist/core/tools/tool-definition-wrapper.js +3 -1
  435. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  436. package/dist/core/tools/truncate.d.ts +14 -0
  437. package/dist/core/tools/truncate.d.ts.map +1 -1
  438. package/dist/core/tools/truncate.js +29 -0
  439. package/dist/core/tools/truncate.js.map +1 -1
  440. package/dist/core/tools/write.d.ts +4 -0
  441. package/dist/core/tools/write.d.ts.map +1 -1
  442. package/dist/core/tools/write.js +12 -147
  443. package/dist/core/tools/write.js.map +1 -1
  444. package/dist/core/trust-manager.d.ts.map +1 -1
  445. package/dist/core/trust-manager.js +4 -1
  446. package/dist/core/trust-manager.js.map +1 -1
  447. package/dist/core/usage-totals.d.ts +3 -1
  448. package/dist/core/usage-totals.d.ts.map +1 -1
  449. package/dist/core/usage-totals.js +28 -1
  450. package/dist/core/usage-totals.js.map +1 -1
  451. package/dist/core/virtual-models.d.ts +117 -0
  452. package/dist/core/virtual-models.d.ts.map +1 -0
  453. package/dist/core/virtual-models.js +124 -0
  454. package/dist/core/virtual-models.js.map +1 -0
  455. package/dist/experimental/micro/api.d.ts +81 -0
  456. package/dist/experimental/micro/api.d.ts.map +1 -0
  457. package/dist/experimental/micro/api.js +2 -0
  458. package/dist/experimental/micro/api.js.map +1 -0
  459. package/dist/experimental/micro/main.d.ts +3 -0
  460. package/dist/experimental/micro/main.d.ts.map +1 -0
  461. package/dist/experimental/micro/main.js +21 -0
  462. package/dist/experimental/micro/main.js.map +1 -0
  463. package/dist/experimental/micro/models.d.ts +11 -0
  464. package/dist/experimental/micro/models.d.ts.map +1 -0
  465. package/dist/experimental/micro/models.js +95 -0
  466. package/dist/experimental/micro/models.js.map +1 -0
  467. package/dist/experimental/micro/runtime.d.ts +12 -0
  468. package/dist/experimental/micro/runtime.d.ts.map +1 -0
  469. package/dist/experimental/micro/runtime.js +465 -0
  470. package/dist/experimental/micro/runtime.js.map +1 -0
  471. package/dist/experimental/micro/sessions.d.ts +10 -0
  472. package/dist/experimental/micro/sessions.d.ts.map +1 -0
  473. package/dist/experimental/micro/sessions.js +41 -0
  474. package/dist/experimental/micro/sessions.js.map +1 -0
  475. package/dist/experimental/micro/tools.d.ts +10 -0
  476. package/dist/experimental/micro/tools.d.ts.map +1 -0
  477. package/dist/experimental/micro/tools.js +96 -0
  478. package/dist/experimental/micro/tools.js.map +1 -0
  479. package/dist/experimental/micro/tui.d.ts +3 -0
  480. package/dist/experimental/micro/tui.d.ts.map +1 -0
  481. package/dist/experimental/micro/tui.js +510 -0
  482. package/dist/experimental/micro/tui.js.map +1 -0
  483. package/dist/experimental/mini/main.d.ts +7 -0
  484. package/dist/experimental/mini/main.d.ts.map +1 -0
  485. package/dist/experimental/mini/main.js +21 -0
  486. package/dist/experimental/mini/main.js.map +1 -0
  487. package/dist/experimental/mini/server/entry.d.ts +3 -0
  488. package/dist/experimental/mini/server/entry.d.ts.map +1 -0
  489. package/dist/experimental/mini/server/entry.js +11 -0
  490. package/dist/experimental/mini/server/entry.js.map +1 -0
  491. package/dist/experimental/mini/server/run.d.ts +13 -0
  492. package/dist/experimental/mini/server/run.d.ts.map +1 -0
  493. package/dist/experimental/mini/server/run.js +150 -0
  494. package/dist/experimental/mini/server/run.js.map +1 -0
  495. package/dist/experimental/mini/shared/protocol.d.ts +127 -0
  496. package/dist/experimental/mini/shared/protocol.d.ts.map +1 -0
  497. package/dist/experimental/mini/shared/protocol.js +13 -0
  498. package/dist/experimental/mini/shared/protocol.js.map +1 -0
  499. package/dist/experimental/mini/shared/rpc.d.ts +49 -0
  500. package/dist/experimental/mini/shared/rpc.d.ts.map +1 -0
  501. package/dist/experimental/mini/shared/rpc.js +171 -0
  502. package/dist/experimental/mini/shared/rpc.js.map +1 -0
  503. package/dist/experimental/mini/shared/transport.d.ts +35 -0
  504. package/dist/experimental/mini/shared/transport.d.ts.map +1 -0
  505. package/dist/experimental/mini/shared/transport.js +94 -0
  506. package/dist/experimental/mini/shared/transport.js.map +1 -0
  507. package/dist/experimental/mini/tui/run.d.ts +9 -0
  508. package/dist/experimental/mini/tui/run.d.ts.map +1 -0
  509. package/dist/experimental/mini/tui/run.js +62 -0
  510. package/dist/experimental/mini/tui/run.js.map +1 -0
  511. package/dist/experimental/mini/tui/session.d.ts +26 -0
  512. package/dist/experimental/mini/tui/session.d.ts.map +1 -0
  513. package/dist/experimental/mini/tui/session.js +94 -0
  514. package/dist/experimental/mini/tui/session.js.map +1 -0
  515. package/dist/experimental/mini/tui/view.d.ts +10 -0
  516. package/dist/experimental/mini/tui/view.d.ts.map +1 -0
  517. package/dist/experimental/mini/tui/view.js +461 -0
  518. package/dist/experimental/mini/tui/view.js.map +1 -0
  519. package/dist/experimental/mini/worker/entry.d.ts +3 -0
  520. package/dist/experimental/mini/worker/entry.d.ts.map +1 -0
  521. package/dist/experimental/mini/worker/entry.js +10 -0
  522. package/dist/experimental/mini/worker/entry.js.map +1 -0
  523. package/dist/experimental/mini/worker/lane-service.d.ts +44 -0
  524. package/dist/experimental/mini/worker/lane-service.d.ts.map +1 -0
  525. package/dist/experimental/mini/worker/lane-service.js +97 -0
  526. package/dist/experimental/mini/worker/lane-service.js.map +1 -0
  527. package/dist/experimental/mini/worker/models-service.d.ts +19 -0
  528. package/dist/experimental/mini/worker/models-service.d.ts.map +1 -0
  529. package/dist/experimental/mini/worker/models-service.js +136 -0
  530. package/dist/experimental/mini/worker/models-service.js.map +1 -0
  531. package/dist/experimental/mini/worker/run.d.ts +14 -0
  532. package/dist/experimental/mini/worker/run.d.ts.map +1 -0
  533. package/dist/experimental/mini/worker/run.js +88 -0
  534. package/dist/experimental/mini/worker/run.js.map +1 -0
  535. package/dist/extensions/codemode/execute.d.ts +16 -0
  536. package/dist/extensions/codemode/execute.d.ts.map +1 -0
  537. package/dist/extensions/codemode/execute.js +429 -0
  538. package/dist/extensions/codemode/execute.js.map +1 -0
  539. package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
  540. package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
  541. package/dist/extensions/codemode/execute.lazy.js +3 -0
  542. package/dist/extensions/codemode/execute.lazy.js.map +1 -0
  543. package/dist/extensions/codemode/index.d.ts +21 -0
  544. package/dist/extensions/codemode/index.d.ts.map +1 -0
  545. package/dist/extensions/codemode/index.js +31 -0
  546. package/dist/extensions/codemode/index.js.map +1 -0
  547. package/dist/extensions/codemode/renderer.d.ts +12 -0
  548. package/dist/extensions/codemode/renderer.d.ts.map +1 -0
  549. package/dist/extensions/codemode/renderer.js +137 -0
  550. package/dist/extensions/codemode/renderer.js.map +1 -0
  551. package/dist/extensions/codemode/tool.d.ts +123 -0
  552. package/dist/extensions/codemode/tool.d.ts.map +1 -0
  553. package/dist/extensions/codemode/tool.js +315 -0
  554. package/dist/extensions/codemode/tool.js.map +1 -0
  555. package/dist/extensions/codemode/worker.d.ts +7 -0
  556. package/dist/extensions/codemode/worker.d.ts.map +1 -0
  557. package/dist/extensions/codemode/worker.js +7 -0
  558. package/dist/extensions/codemode/worker.js.map +1 -0
  559. package/dist/extensions/index.d.ts.map +1 -1
  560. package/dist/extensions/index.js +9 -1
  561. package/dist/extensions/index.js.map +1 -1
  562. package/dist/extensions/llama/client.d.ts +8 -0
  563. package/dist/extensions/llama/client.d.ts.map +1 -1
  564. package/dist/extensions/llama/client.js +13 -0
  565. package/dist/extensions/llama/client.js.map +1 -1
  566. package/dist/extensions/llama/huggingface.js +2 -0
  567. package/dist/extensions/llama/huggingface.js.map +1 -1
  568. package/dist/extensions/llama/index.d.ts.map +1 -1
  569. package/dist/extensions/llama/index.js +13 -2
  570. package/dist/extensions/llama/index.js.map +1 -1
  571. package/dist/extensions/llama/provider.d.ts +4 -2
  572. package/dist/extensions/llama/provider.d.ts.map +1 -1
  573. package/dist/extensions/llama/provider.js +119 -17
  574. package/dist/extensions/llama/provider.js.map +1 -1
  575. package/dist/extensions/llama/ui.js +28 -12
  576. package/dist/extensions/llama/ui.js.map +1 -1
  577. package/dist/extensions/mcp/cli.d.ts +21 -0
  578. package/dist/extensions/mcp/cli.d.ts.map +1 -0
  579. package/dist/extensions/mcp/cli.js +500 -0
  580. package/dist/extensions/mcp/cli.js.map +1 -0
  581. package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
  582. package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
  583. package/dist/extensions/mcp/cli.lazy.js +3 -0
  584. package/dist/extensions/mcp/cli.lazy.js.map +1 -0
  585. package/dist/extensions/mcp/config.d.ts +72 -0
  586. package/dist/extensions/mcp/config.d.ts.map +1 -0
  587. package/dist/extensions/mcp/config.js +158 -0
  588. package/dist/extensions/mcp/config.js.map +1 -0
  589. package/dist/extensions/mcp/index.d.ts +76 -0
  590. package/dist/extensions/mcp/index.d.ts.map +1 -0
  591. package/dist/extensions/mcp/index.js +1055 -0
  592. package/dist/extensions/mcp/index.js.map +1 -0
  593. package/dist/extensions/mcp/log.d.ts +16 -0
  594. package/dist/extensions/mcp/log.d.ts.map +1 -0
  595. package/dist/extensions/mcp/log.js +66 -0
  596. package/dist/extensions/mcp/log.js.map +1 -0
  597. package/dist/extensions/mcp/oauth.d.ts +96 -0
  598. package/dist/extensions/mcp/oauth.d.ts.map +1 -0
  599. package/dist/extensions/mcp/oauth.js +333 -0
  600. package/dist/extensions/mcp/oauth.js.map +1 -0
  601. package/dist/extensions/mcp/resources.d.ts +43 -0
  602. package/dist/extensions/mcp/resources.d.ts.map +1 -0
  603. package/dist/extensions/mcp/resources.js +262 -0
  604. package/dist/extensions/mcp/resources.js.map +1 -0
  605. package/dist/extensions/mcp/runtime.d.ts +98 -0
  606. package/dist/extensions/mcp/runtime.d.ts.map +1 -0
  607. package/dist/extensions/mcp/runtime.js +394 -0
  608. package/dist/extensions/mcp/runtime.js.map +1 -0
  609. package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
  610. package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
  611. package/dist/extensions/mcp/runtime.lazy.js +3 -0
  612. package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
  613. package/dist/extensions/mcp/tools.d.ts +84 -0
  614. package/dist/extensions/mcp/tools.d.ts.map +1 -0
  615. package/dist/extensions/mcp/tools.js +251 -0
  616. package/dist/extensions/mcp/tools.js.map +1 -0
  617. package/dist/extensions/mcp/ui.d.ts +60 -0
  618. package/dist/extensions/mcp/ui.d.ts.map +1 -0
  619. package/dist/extensions/mcp/ui.js +174 -0
  620. package/dist/extensions/mcp/ui.js.map +1 -0
  621. package/dist/extensions/stub-provider/provider.d.ts +2 -2
  622. package/dist/extensions/stub-provider/provider.d.ts.map +1 -1
  623. package/dist/extensions/stub-provider/provider.js +2 -1
  624. package/dist/extensions/stub-provider/provider.js.map +1 -1
  625. package/dist/extensions/tool-search/index.d.ts +12 -0
  626. package/dist/extensions/tool-search/index.d.ts.map +1 -0
  627. package/dist/extensions/tool-search/index.js +15 -0
  628. package/dist/extensions/tool-search/index.js.map +1 -0
  629. package/dist/extensions/tool-search/tool.d.ts +73 -0
  630. package/dist/extensions/tool-search/tool.d.ts.map +1 -0
  631. package/dist/extensions/tool-search/tool.js +189 -0
  632. package/dist/extensions/tool-search/tool.js.map +1 -0
  633. package/dist/index.d.ts +20 -11
  634. package/dist/index.d.ts.map +1 -1
  635. package/dist/index.js +12 -6
  636. package/dist/index.js.map +1 -1
  637. package/dist/main.d.ts +4 -0
  638. package/dist/main.d.ts.map +1 -1
  639. package/dist/main.js +123 -51
  640. package/dist/main.js.map +1 -1
  641. package/dist/migrations.d.ts +1 -1
  642. package/dist/migrations.js +7 -6
  643. package/dist/migrations.js.map +1 -1
  644. package/dist/modes/index.d.ts +1 -0
  645. package/dist/modes/index.d.ts.map +1 -1
  646. package/dist/modes/index.js.map +1 -1
  647. package/dist/modes/interactive/bug-report.d.ts +19 -0
  648. package/dist/modes/interactive/bug-report.d.ts.map +1 -0
  649. package/dist/modes/interactive/bug-report.js +211 -0
  650. package/dist/modes/interactive/bug-report.js.map +1 -0
  651. package/dist/modes/interactive/chat-viewport.d.ts +20 -0
  652. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
  653. package/dist/modes/interactive/chat-viewport.js +28 -0
  654. package/dist/modes/interactive/chat-viewport.js.map +1 -0
  655. package/dist/modes/interactive/components/armin.js +10 -6
  656. package/dist/modes/interactive/components/armin.js.map +1 -1
  657. package/dist/modes/interactive/components/assistant-message.d.ts +6 -2
  658. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  659. package/dist/modes/interactive/components/assistant-message.js +38 -15
  660. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  661. package/dist/modes/interactive/components/bash-execution.js +9 -4
  662. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  663. package/dist/modes/interactive/components/bordered-loader.js +3 -0
  664. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  665. package/dist/modes/interactive/components/branch-summary-message.d.ts +1 -1
  666. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  667. package/dist/modes/interactive/components/branch-summary-message.js +15 -6
  668. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  669. package/dist/modes/interactive/components/compaction-summary-message.d.ts +1 -1
  670. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  671. package/dist/modes/interactive/components/compaction-summary-message.js +15 -6
  672. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  673. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  674. package/dist/modes/interactive/components/config-selector.js +35 -8
  675. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  676. package/dist/modes/interactive/components/countdown-timer.js +5 -0
  677. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  678. package/dist/modes/interactive/components/custom-editor.d.ts +10 -1
  679. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  680. package/dist/modes/interactive/components/custom-editor.js +54 -2
  681. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  682. package/dist/modes/interactive/components/custom-entry.js +4 -1
  683. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  684. package/dist/modes/interactive/components/custom-message.js +7 -1
  685. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  686. package/dist/modes/interactive/components/daxnuts.js +8 -6
  687. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  688. package/dist/modes/interactive/components/dynamic-border.js +1 -0
  689. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  690. package/dist/modes/interactive/components/extension-editor.d.ts +4 -1
  691. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  692. package/dist/modes/interactive/components/extension-editor.js +14 -3
  693. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  694. package/dist/modes/interactive/components/extension-input.d.ts +2 -0
  695. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  696. package/dist/modes/interactive/components/extension-input.js +14 -2
  697. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  698. package/dist/modes/interactive/components/extension-selector.d.ts +1 -0
  699. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  700. package/dist/modes/interactive/components/extension-selector.js +16 -1
  701. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  702. package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
  703. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  704. package/dist/modes/interactive/components/first-time-setup.js +12 -4
  705. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  706. package/dist/modes/interactive/components/footer.d.ts +7 -0
  707. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  708. package/dist/modes/interactive/components/footer.js +51 -6
  709. package/dist/modes/interactive/components/footer.js.map +1 -1
  710. package/dist/modes/interactive/components/index.d.ts +1 -1
  711. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  712. package/dist/modes/interactive/components/index.js.map +1 -1
  713. package/dist/modes/interactive/components/login-dialog.js +9 -3
  714. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  715. package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
  716. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
  717. package/dist/modes/interactive/components/markdown-transform.js +19 -0
  718. package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
  719. package/dist/modes/interactive/components/mermaid.d.ts +11 -0
  720. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
  721. package/dist/modes/interactive/components/mermaid.js +75 -0
  722. package/dist/modes/interactive/components/mermaid.js.map +1 -0
  723. package/dist/modes/interactive/components/model-selector.d.ts +10 -4
  724. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  725. package/dist/modes/interactive/components/model-selector.js +101 -40
  726. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  727. package/dist/modes/interactive/components/oauth-selector.js +11 -3
  728. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  729. package/dist/modes/interactive/components/scoped-models-selector.d.ts +4 -0
  730. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  731. package/dist/modes/interactive/components/scoped-models-selector.js +60 -32
  732. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  733. package/dist/modes/interactive/components/session-selector.d.ts +5 -5
  734. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  735. package/dist/modes/interactive/components/session-selector.js +128 -78
  736. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  737. package/dist/modes/interactive/components/settings-selector.d.ts +23 -4
  738. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  739. package/dist/modes/interactive/components/settings-selector.js +230 -67
  740. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  741. package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
  742. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
  743. package/dist/modes/interactive/components/settings-submenu.js +165 -0
  744. package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
  745. package/dist/modes/interactive/components/show-images-selector.js +1 -0
  746. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  747. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  748. package/dist/modes/interactive/components/skill-invocation-message.js +14 -5
  749. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  750. package/dist/modes/interactive/components/status-indicator.d.ts +3 -1
  751. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  752. package/dist/modes/interactive/components/status-indicator.js +12 -3
  753. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  754. package/dist/modes/interactive/components/theme-selector.js +2 -0
  755. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  756. package/dist/modes/interactive/components/themed-text.d.ts +17 -0
  757. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
  758. package/dist/modes/interactive/components/themed-text.js +29 -0
  759. package/dist/modes/interactive/components/themed-text.js.map +1 -0
  760. package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
  761. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  762. package/dist/modes/interactive/components/thinking-selector.js +76 -18
  763. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  764. package/dist/modes/interactive/components/tool-execution.d.ts +21 -4
  765. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  766. package/dist/modes/interactive/components/tool-execution.js +78 -52
  767. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  768. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  769. package/dist/modes/interactive/components/tree-selector.js +44 -18
  770. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  771. package/dist/modes/interactive/components/trust-selector.js +8 -2
  772. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  773. package/dist/modes/interactive/components/user-message-selector.js +6 -3
  774. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  775. package/dist/modes/interactive/components/user-message.d.ts +3 -1
  776. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  777. package/dist/modes/interactive/components/user-message.js +12 -2
  778. package/dist/modes/interactive/components/user-message.js.map +1 -1
  779. package/dist/modes/interactive/components/visual-truncate.d.ts +27 -3
  780. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  781. package/dist/modes/interactive/components/visual-truncate.js +39 -6
  782. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  783. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  784. package/dist/modes/interactive/external-editor.js +2 -1
  785. package/dist/modes/interactive/external-editor.js.map +1 -1
  786. package/dist/modes/interactive/interactive-mode.d.ts +69 -5
  787. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  788. package/dist/modes/interactive/interactive-mode.js +1314 -593
  789. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  790. package/dist/modes/interactive/model-catalog-refresh.d.ts +7 -0
  791. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
  792. package/dist/modes/interactive/model-catalog-refresh.js +34 -0
  793. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
  794. package/dist/modes/interactive/session-share.d.ts +23 -0
  795. package/dist/modes/interactive/session-share.d.ts.map +1 -0
  796. package/dist/modes/interactive/session-share.js +130 -0
  797. package/dist/modes/interactive/session-share.js.map +1 -0
  798. package/dist/modes/interactive/theme/dark.json +54 -63
  799. package/dist/modes/interactive/theme/light.json +52 -60
  800. package/dist/modes/interactive/theme/system-theme.d.ts +54 -0
  801. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
  802. package/dist/modes/interactive/theme/system-theme.js +535 -0
  803. package/dist/modes/interactive/theme/system-theme.js.map +1 -0
  804. package/dist/modes/interactive/theme/theme-controller.d.ts +59 -7
  805. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  806. package/dist/modes/interactive/theme/theme-controller.js +164 -51
  807. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  808. package/dist/modes/interactive/theme/theme-json.d.ts +85 -0
  809. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
  810. package/dist/modes/interactive/theme/theme-json.js +132 -0
  811. package/dist/modes/interactive/theme/theme-json.js.map +1 -0
  812. package/dist/modes/interactive/theme/theme-schema.json +24 -3
  813. package/dist/modes/interactive/theme/theme.d.ts +80 -42
  814. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  815. package/dist/modes/interactive/theme/theme.js +274 -417
  816. package/dist/modes/interactive/theme/theme.js.map +1 -1
  817. package/dist/modes/interactive/tui-renderer.d.ts +22 -0
  818. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
  819. package/dist/modes/interactive/tui-renderer.js +67 -0
  820. package/dist/modes/interactive/tui-renderer.js.map +1 -0
  821. package/dist/modes/json-event.d.ts +34 -0
  822. package/dist/modes/json-event.d.ts.map +1 -0
  823. package/dist/modes/json-event.js +29 -0
  824. package/dist/modes/json-event.js.map +1 -0
  825. package/dist/modes/print-mode.d.ts +1 -1
  826. package/dist/modes/print-mode.d.ts.map +1 -1
  827. package/dist/modes/print-mode.js +12 -2
  828. package/dist/modes/print-mode.js.map +1 -1
  829. package/dist/modes/rpc/rpc-client.d.ts +17 -9
  830. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  831. package/dist/modes/rpc/rpc-client.js +27 -15
  832. package/dist/modes/rpc/rpc-client.js.map +1 -1
  833. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  834. package/dist/modes/rpc/rpc-mode.js +14 -12
  835. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  836. package/dist/modes/rpc/rpc-types.d.ts +22 -1
  837. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  838. package/dist/modes/rpc/rpc-types.js.map +1 -1
  839. package/dist/package-manager-cli.d.ts +1 -0
  840. package/dist/package-manager-cli.d.ts.map +1 -1
  841. package/dist/package-manager-cli.js +217 -63
  842. package/dist/package-manager-cli.js.map +1 -1
  843. package/dist/prompts/commands/plan-phase.md +1 -0
  844. package/dist/prompts/commands/review.md +2 -0
  845. package/dist/prompts/commands/verify-work.md +1 -0
  846. package/dist/prompts/commands/why.md +4 -0
  847. package/dist/rpc-entry.js +1 -0
  848. package/dist/rpc-entry.js.map +1 -1
  849. package/dist/skills/blast-radius/SKILL.md +1 -0
  850. package/dist/skills/explainers/SKILL.md +65 -0
  851. package/dist/skills/unslop/SKILL.md +19 -1
  852. package/dist/utils/abort.d.ts +5 -0
  853. package/dist/utils/abort.d.ts.map +1 -0
  854. package/dist/utils/abort.js +48 -0
  855. package/dist/utils/abort.js.map +1 -0
  856. package/dist/utils/changelog.js +1 -1
  857. package/dist/utils/changelog.js.map +1 -1
  858. package/dist/utils/child-process.d.ts +1 -1
  859. package/dist/utils/child-process.js +1 -1
  860. package/dist/utils/child-process.js.map +1 -1
  861. package/dist/utils/clipboard-command.d.ts +7 -0
  862. package/dist/utils/clipboard-command.d.ts.map +1 -0
  863. package/dist/utils/clipboard-command.js +45 -0
  864. package/dist/utils/clipboard-command.js.map +1 -0
  865. package/dist/utils/clipboard-image.d.ts.map +1 -1
  866. package/dist/utils/clipboard-image.js +60 -91
  867. package/dist/utils/clipboard-image.js.map +1 -1
  868. package/dist/utils/clipboard.d.ts +2 -0
  869. package/dist/utils/clipboard.d.ts.map +1 -1
  870. package/dist/utils/clipboard.js +116 -121
  871. package/dist/utils/clipboard.js.map +1 -1
  872. package/dist/utils/draht-user-agent.d.ts +2 -0
  873. package/dist/utils/draht-user-agent.d.ts.map +1 -0
  874. package/dist/utils/draht-user-agent.js +5 -0
  875. package/dist/utils/draht-user-agent.js.map +1 -0
  876. package/dist/utils/exif-orientation.d.ts +2 -1
  877. package/dist/utils/exif-orientation.d.ts.map +1 -1
  878. package/dist/utils/exif-orientation.js.map +1 -1
  879. package/dist/utils/frontmatter.d.ts.map +1 -1
  880. package/dist/utils/frontmatter.js +2 -1
  881. package/dist/utils/frontmatter.js.map +1 -1
  882. package/dist/utils/management-http.d.ts +25 -0
  883. package/dist/utils/management-http.d.ts.map +1 -0
  884. package/dist/utils/management-http.js +54 -0
  885. package/dist/utils/management-http.js.map +1 -0
  886. package/dist/utils/mime.js +1 -1
  887. package/dist/utils/mime.js.map +1 -1
  888. package/dist/utils/paths.d.ts +4 -3
  889. package/dist/utils/paths.d.ts.map +1 -1
  890. package/dist/utils/paths.js +15 -4
  891. package/dist/utils/paths.js.map +1 -1
  892. package/dist/utils/photon.d.ts +2 -1
  893. package/dist/utils/photon.d.ts.map +1 -1
  894. package/dist/utils/photon.js.map +1 -1
  895. package/dist/utils/shell.d.ts +4 -3
  896. package/dist/utils/shell.d.ts.map +1 -1
  897. package/dist/utils/shell.js +20 -35
  898. package/dist/utils/shell.js.map +1 -1
  899. package/dist/utils/syntax-highlight.d.ts +1 -0
  900. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  901. package/dist/utils/syntax-highlight.js +62 -1
  902. package/dist/utils/syntax-highlight.js.map +1 -1
  903. package/dist/utils/text.d.ts +8 -0
  904. package/dist/utils/text.d.ts.map +1 -0
  905. package/dist/utils/text.js +9 -0
  906. package/dist/utils/text.js.map +1 -0
  907. package/dist/utils/tool-result-images.d.ts +21 -0
  908. package/dist/utils/tool-result-images.d.ts.map +1 -0
  909. package/dist/utils/tool-result-images.js +48 -0
  910. package/dist/utils/tool-result-images.js.map +1 -0
  911. package/dist/utils/tools-manager.d.ts +11 -1
  912. package/dist/utils/tools-manager.d.ts.map +1 -1
  913. package/dist/utils/tools-manager.js +53 -36
  914. package/dist/utils/tools-manager.js.map +1 -1
  915. package/dist/utils/version-check.d.ts +4 -1
  916. package/dist/utils/version-check.d.ts.map +1 -1
  917. package/dist/utils/version-check.js +30 -9
  918. package/dist/utils/version-check.js.map +1 -1
  919. package/dist/utils/wsl.d.ts +3 -0
  920. package/dist/utils/wsl.d.ts.map +1 -0
  921. package/dist/utils/wsl.js +15 -0
  922. package/dist/utils/wsl.js.map +1 -0
  923. package/dist/utils/zip.d.ts +7 -0
  924. package/dist/utils/zip.d.ts.map +1 -0
  925. package/dist/utils/zip.js +60 -0
  926. package/dist/utils/zip.js.map +1 -0
  927. package/docs/cli-integration.md +106 -0
  928. package/docs/cli.md +374 -0
  929. package/docs/compaction.md +91 -29
  930. package/docs/configuration.md +47 -0
  931. package/docs/containerization.md +100 -66
  932. package/docs/custom-provider.md +109 -707
  933. package/docs/docs.json +155 -99
  934. package/docs/environment-variables.md +30 -17
  935. package/docs/extensions.md +169 -2811
  936. package/docs/how-pi-works.md +53 -0
  937. package/docs/images/interactive-mode.png +0 -0
  938. package/docs/index.md +25 -69
  939. package/docs/json.md +197 -56
  940. package/docs/keybindings.md +89 -93
  941. package/docs/llama-cpp.md +18 -3
  942. package/docs/mcp.md +231 -0
  943. package/docs/message-types.md +261 -0
  944. package/docs/models.md +94 -478
  945. package/docs/packages.md +67 -163
  946. package/docs/prompt-templates.md +31 -68
  947. package/docs/providers.md +118 -215
  948. package/docs/quickstart.md +55 -108
  949. package/docs/rpc-commands.md +860 -0
  950. package/docs/rpc-extension-ui.md +200 -0
  951. package/docs/rpc.md +139 -1518
  952. package/docs/sdk.md +79 -1127
  953. package/docs/security.md +76 -32
  954. package/docs/session-format.md +73 -219
  955. package/docs/sessions.md +36 -116
  956. package/docs/settings.md +124 -257
  957. package/docs/shell-aliases.md +85 -5
  958. package/docs/skills.md +52 -189
  959. package/docs/slash-commands.md +61 -0
  960. package/docs/terminal-setup.md +132 -61
  961. package/docs/termux.md +74 -84
  962. package/docs/themes.md +91 -252
  963. package/docs/tmux.md +31 -39
  964. package/docs/tui.md +74 -891
  965. package/docs/usage.md +54 -255
  966. package/docs/virtual-models.md +114 -0
  967. package/docs/windows.md +57 -7
  968. package/examples/extensions/antigravity-image-gen.ts +9 -9
  969. package/examples/extensions/bash-spawn-hook.ts +1 -1
  970. package/examples/extensions/border-status-editor.ts +1 -1
  971. package/examples/extensions/built-in-tool-renderer.ts +16 -40
  972. package/examples/extensions/custom-compaction.ts +1 -16
  973. package/examples/extensions/custom-provider-anthropic/index.ts +20 -13
  974. package/examples/extensions/custom-provider-gitlab-duo/index.ts +4 -3
  975. package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
  976. package/examples/extensions/debug-provider.ts +90 -0
  977. package/examples/extensions/doom-overlay/wad-finder.ts +7 -3
  978. package/examples/extensions/dynamic-resources/dynamic.json +3 -1
  979. package/examples/extensions/git-checkpoint.ts +2 -2
  980. package/examples/extensions/handoff.ts +2 -11
  981. package/examples/extensions/jev-router.ts +113 -0
  982. package/examples/extensions/minimal-mode.ts +24 -96
  983. package/examples/extensions/notify.ts +3 -1
  984. package/examples/extensions/prompt-customizer.ts +19 -67
  985. package/examples/extensions/qna.ts +3 -7
  986. package/examples/extensions/subagent/agents.ts +40 -9
  987. package/examples/extensions/subagent/index.ts +27 -4
  988. package/examples/extensions/summarize.ts +7 -18
  989. package/examples/extensions/titlebar-spinner.ts +1 -1
  990. package/examples/rpc-client.ts +35 -0
  991. package/examples/rpc-extension-ui.ts +38 -9
  992. package/examples/sdk/02-custom-model.ts +1 -2
  993. package/examples/sdk/06-extensions.ts +1 -1
  994. package/examples/sdk/09-api-keys-and-oauth.ts +1 -1
  995. package/examples/sdk/12-full-control.ts +1 -1
  996. package/examples/sdk/14-codemode-mcp.ts +61 -0
  997. package/package.json +25 -30
  998. package/prompts/commands/plan-phase.md +1 -0
  999. package/prompts/commands/review.md +2 -0
  1000. package/prompts/commands/verify-work.md +1 -0
  1001. package/prompts/commands/why.md +4 -0
  1002. package/skills/blast-radius/SKILL.md +1 -0
  1003. package/skills/explainers/SKILL.md +65 -0
  1004. package/skills/unslop/SKILL.md +19 -1
  1005. package/dist/utils/clipboard-native.d.ts +0 -11
  1006. package/dist/utils/clipboard-native.d.ts.map +0 -1
  1007. package/dist/utils/clipboard-native.js +0 -20
  1008. package/dist/utils/clipboard-native.js.map +0 -1
  1009. package/dist/utils/pi-user-agent.d.ts +0 -2
  1010. package/dist/utils/pi-user-agent.d.ts.map +0 -1
  1011. package/dist/utils/pi-user-agent.js +0 -5
  1012. package/dist/utils/pi-user-agent.js.map +0 -1
  1013. package/docs/development.md +0 -71
  1014. package/docs/tree.md +0 -231
  1015. package/examples/extensions/kimi-deferred-tools.ts +0 -61
@@ -0,0 +1,106 @@
1
+ # CLI Integration
2
+
3
+ By default, running `draht` opens the interactive terminal interface. When input or output is piped or redirected, draht uses print mode instead. You can also select print, JSON, or RPC mode explicitly for scripts and applications.
4
+
5
+ All four modes use the same agent, sessions, resources, and tools. The mode determines how input enters draht, how output is exposed, and whether the process remains available for more commands.
6
+
7
+ The SDK is not a CLI mode. It embeds the agent directly in a Node.js or Bun process. See the [SDK](sdk.md) when direct TypeScript access is preferable to a process boundary.
8
+
9
+ ## Choose a mode
10
+
11
+ | Mode | Interface | Lifetime | Use it when |
12
+ |---|---|---|---|
13
+ | Interactive | Terminal UI | Until the user exits | A person is working with draht directly |
14
+ | Print | Final text on stdout | One invocation | A script needs the final assistant response |
15
+ | JSON | JSONL events on stdout | One invocation | A process needs structured progress from a run |
16
+ | RPC | JSONL commands, responses, and events | Long-lived | A process needs bidirectional control |
17
+
18
+ CLI options still select the working directory, model, tools, resources, and session persistence independently of the mode. See [Command Line](cli.md) for the complete startup options.
19
+
20
+ ## Print to stdout
21
+
22
+ Print mode runs the supplied prompts, writes the final assistant text to stdout, and exits:
23
+
24
+ ```bash
25
+ draht --print "Summarize the changes in this repository"
26
+ ```
27
+
28
+ Use print mode when only the final text is needed, including command substitution, pipelines, and one-shot jobs. Intermediate events are not exposed.
29
+
30
+ Print mode writes errors to stderr. A final assistant response with an `error` or `aborted` stop reason produces a nonzero exit status.
31
+
32
+ When no mode is selected explicitly, non-TTY stdin or stdout also selects print mode. This allows piped input and output without adding `--print`.
33
+
34
+ ## Stream JSON events
35
+
36
+ JSON mode writes a session header followed by agent and session events as newline-delimited JSON:
37
+
38
+ ```bash
39
+ draht --mode json "Review this repository" > events.jsonl
40
+ ```
41
+
42
+ This is structured event output, not a single JSON result or a constraint on the format of the model’s response.
43
+
44
+ All prompts are supplied when the process starts. The process streams events for that run and then exits; it does not accept later commands.
45
+
46
+ A failed or aborted assistant response appears in the event stream but does not by itself produce a nonzero exit status. Inspect the events when success or failure matters. draht still exits nonzero if the invocation throws an error.
47
+
48
+ Streaming `message_update` records contain deltas rather than a growing message snapshot. Assemble live output from the delta events, then replace it with the authoritative message from `message_end`.
49
+
50
+ `agent_end` can be followed by automatic recovery or queued work. `agent_settled` marks the end of automatic work for the current run.
51
+
52
+ Stdout is reserved for JSONL. Diagnostics and application logging are written to stderr. See [JSON Event Stream](json.md) for framing, event shapes, and reconstruction rules.
53
+
54
+ ## Control draht with RPC
55
+
56
+ RPC mode keeps draht running while another process sends commands and receives responses and events:
57
+
58
+ ```bash
59
+ draht --mode rpc --no-session
60
+ ```
61
+
62
+ Commands are JSON objects written to stdin. Responses and events are JSON objects written to stdout. Every record occupies one line.
63
+
64
+ Add an `id` to commands that need correlation. The matching response repeats that ID. Events generally have no command ID because they describe session activity rather than one request.
65
+
66
+ A successful `prompt` response means the prompt was accepted, queued, or handled. It does not mean the run completed. Continue consuming events through `agent_settled` when completion matters.
67
+
68
+ RPC commands can change models, inspect state, manage sessions, run shell commands, and answer extension UI requests.
69
+
70
+ Extension dialogs form a request-response subprotocol. Other extension UI updates are notifications that a client may display or ignore. TUI-only extension capabilities are unavailable or degraded outside interactive mode.
71
+
72
+ For Node.js or TypeScript integrations, prefer `RpcClient` from `@draht/coding-agent`. It starts a draht RPC child process, correlates requests, exposes typed command methods, and delivers session events to listeners.
73
+
74
+ The [RPC client example](../examples/rpc-client.ts) sends one prompt, streams text and tool activity, waits for `agent_settled`, and shuts down the child process. It is included in the repository’s TypeScript checks.
75
+
76
+ `RpcClient.promptAndWait()` installs its event listener before sending the prompt, avoiding a race with fast completions. For separate operations, subscribe before calling `prompt()` and call `waitForIdle()` only while a run is active.
77
+
78
+ The client requires a path to a runnable draht CLI. The repository example points at `dist/cli.js`, so the package must be built before that example runs from a checkout.
79
+
80
+ If you are building a client without `RpcClient`, start with [RPC Protocol](rpc.md), then use [RPC Commands](rpc-commands.md) and [JSON Event Stream](json.md) as the wire references.
81
+
82
+ ## Fork and rebrand draht
83
+
84
+ A source fork can change the CLI name and configuration directory through `package.json`:
85
+
86
+ ```json
87
+ {
88
+ "drahtConfig": {
89
+ "name": "my-agent",
90
+ "configDir": ".my-agent"
91
+ }
92
+ }
93
+ ```
94
+
95
+ Change the top-level `bin` field to set the executable name. These settings affect the CLI banner, configuration paths, and derived environment variable names.
96
+
97
+ ## Examples and references
98
+
99
+ - [RPC client](../examples/rpc-client.ts): typed Node.js integration
100
+ - [RPC extension UI](../examples/rpc-extension-ui.ts): custom terminal client with extension dialogs
101
+ - [Command Line](cli.md): startup options and mode selection
102
+ - [JSON Event Stream](json.md): JSON event reference
103
+ - [RPC Protocol](rpc.md): RPC lifecycle, framing, errors, and shutdown
104
+ - [RPC Commands](rpc-commands.md): command and response reference
105
+ - [RPC Extension UI](rpc-extension-ui.md): extension interaction subprotocol
106
+ - [SDK examples](../examples/sdk/): in-process TypeScript integrations
package/docs/cli.md ADDED
@@ -0,0 +1,374 @@
1
+ <a id="cli-and-modes-reference"></a>
2
+
3
+ # Command Line
4
+
5
+ This page documents draht's built-in command-line commands and options. Run `draht --help` or append `--help` to a command for the exact interface in your installed version. The top-level help also includes options registered by loaded extensions.
6
+
7
+ ```sh
8
+ draht [options] [--] [@files...] [messages...]
9
+ draht install <source> [options]
10
+ draht remove <source> [options]
11
+ draht uninstall <source> [options]
12
+ draht update [target] [options]
13
+ draht list
14
+ draht config [options]
15
+ draht auth <check|print-api-key|print-bearer-token> [options]
16
+ draht mcp <list|login|logout> [options]
17
+ draht checkpoint prune [--days <n>] [--max-per-session <n>] [--dry-run]
18
+ draht rlm --input <path|glob|url> --query "..." [--max-cost <n>]
19
+ draht rlm replay <trajectory-id> [--verbose]
20
+ draht --list-sessions
21
+ draht --attach <session-id>
22
+ ```
23
+
24
+ <a id="modes"></a>
25
+
26
+ ## Invocation and output
27
+
28
+ ```sh
29
+ draht
30
+ draht --print "Summarize this repository"
31
+ git diff | draht --print "Review this change"
32
+ draht --mode json "Inspect this repository" > events.jsonl
33
+ ```
34
+
35
+ With terminal stdin and stdout, draht opens the terminal UI unless `--print`, `--mode json`, or `--mode rpc` selects another interface. When either stream is redirected and neither JSON nor RPC mode is selected, draht uses print mode. See [CLI Integration](cli-integration.md) for choosing between interactive, print, JSON, RPC, and SDK integration.
36
+
37
+ | Input | Behavior |
38
+ |---|---|
39
+ | `message` | Provide an initial prompt |
40
+ | `@path` | Include a text file or image in the first prompt |
41
+ | Piped stdin | Prepend its contents to the first prompt |
42
+ | `--` | Stop option parsing so a prompt can begin with `-` |
43
+
44
+ draht resolves `@path` from the current working directory. The working directory also controls project configuration, resource discovery, and session grouping.
45
+
46
+ `--print` controls whether draht runs once and exits. `--mode` selects the output interface. `--mode text` does not force one-shot execution when stdin and stdout are terminals; use `--print` for that behavior.
47
+
48
+ | Option | Behavior |
49
+ |---|---|
50
+ | `-p`, `--print` | Run the supplied prompts, write the final assistant text to stdout, then exit |
51
+ | `--mode text` | Select text output; still open the terminal UI when stdin and stdout are terminals |
52
+ | `--mode json` | Run the supplied prompts, write JSONL events to stdout, then exit |
53
+ | `--mode rpc` | Read JSONL commands from stdin and write responses and events to stdout until shutdown |
54
+ | `--export <input> [output]` | Export a session file to HTML and exit; derive the destination when `output` is omitted |
55
+
56
+ RPC mode rejects `@file` arguments. JSON and RPC modes reserve stdout for protocol records. See [JSON Event Stream](json.md) and [RPC Protocol](rpc.md).
57
+
58
+ <a id="model-options"></a>
59
+
60
+ ## Models
61
+
62
+ ```sh
63
+ draht --model sonnet:high
64
+ ```
65
+
66
+ See [Choose a Model](models.md) for model selection and [Provider Authentication](providers.md) for credentials.
67
+
68
+ - `--provider <name>`<br>
69
+ Restricts `--model` lookup to one provider.
70
+ - `--model <pattern>`<br>
71
+ Selects by exact ID or fuzzy ID/name match. It accepts `provider/id` and an optional `:<thinking>` suffix.
72
+ - `--api-key <key>`<br>
73
+ Uses a non-persistent API-key override. It requires a model selected through `--model` or `--models`.
74
+ - `--thinking <level>`<br>
75
+ Sets `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. It overrides a `--model` suffix and is clamped to the model's capabilities.
76
+ - `--models <patterns>`<br>
77
+ Sets a comma-separated scope for startup and cycling. It accepts exact IDs, fuzzy matches, case-insensitive globs, and optional `:<thinking>` suffixes.
78
+ - `--list-models [search]`<br>
79
+ Lists available models, optionally filtered by a fuzzy search, then exits.
80
+
81
+ <a id="session-options"></a>
82
+
83
+ ## Sessions
84
+
85
+ ```sh
86
+ draht --continue
87
+ ```
88
+
89
+ See [Sessions and Context](sessions.md) for resuming, forking, naming, and storing sessions.
90
+
91
+ - `-c`, `--continue`<br>
92
+ Continues the most recent session for the current project.
93
+ - `-r`, `--resume`<br>
94
+ Opens the session selector.
95
+ - `--session <path|id>`<br>
96
+ Opens by file path, exact ID, or partial ID. draht searches the current project first and offers to fork a cross-project match.
97
+ - `--session-id <id>`<br>
98
+ Opens the exact project session ID or creates it if absent. IDs accept letters, numbers, `.`, `_`, and `-`.
99
+ - `--fork <path|id>`<br>
100
+ Forks an existing session into a new session for the current project.
101
+ - `--session-dir <dir>`<br>
102
+ Overrides storage and lookup. It takes precedence over `DRAHT_CODING_AGENT_SESSION_DIR` and the `sessionDir` setting.
103
+ - `--no-session`<br>
104
+ Uses an in-memory session that is not persisted.
105
+ - `-n`, `--name <name>`<br>
106
+ Sets the session display name.
107
+ - `--attachable`<br>
108
+ Exposes the session on an owner-only Unix socket so your other terminals can attach. Interactive sessions do this by default; the flag also enables it in `--print` and `--mode rpc` and makes a registration failure fatal. See [Attachable Sessions](attachable-sessions.md).
109
+ - `--no-attachable`<br>
110
+ Does not expose the session on a socket. Equivalent to `DRAHT_NO_ATTACHABLE=1` or `"attachableSessions": false` in global settings.
111
+ - `--attach <session-id>`<br>
112
+ Attaches to a running attachable session by its full ID.
113
+ - `--list-sessions`<br>
114
+ Lists running attachable sessions, then exits.
115
+
116
+ Constraints:
117
+
118
+ - Session IDs must start and end with a letter or number.
119
+ - `--fork` cannot be combined with `--session`, `--continue`, `--resume`, or `--no-session`.
120
+ - `--session-id` cannot be combined with `--session`, `--continue`, or `--resume`. Combine it with `--fork` to choose the new ID.
121
+
122
+ <a id="tool-options"></a>
123
+
124
+ ## Tools
125
+
126
+ ```sh
127
+ draht --tools read,grep,find,ls --print "Review this project"
128
+ ```
129
+
130
+ See [Settings](settings.md#tools) for configuring the default tool selection.
131
+
132
+ - `-t`, `--tools <list>`<br>
133
+ Replaces the default selection with a comma-separated allowlist of built-in, extension, or custom tools.
134
+ - `-xt`, `--exclude-tools <list>`<br>
135
+ Disables comma-separated tool names after all other selection options.
136
+ - `-nbt`, `--no-builtin-tools`<br>
137
+ Disables default built-in tools while retaining extension and custom tools.
138
+ - `-nt`, `--no-tools`<br>
139
+ Starts with all built-in, extension, and custom tools disabled.
140
+
141
+ Default enabled tools are `read`, `bash`, `edit`, and `write`, unless `defaultTools` changes them. `--tools` replaces the whole selection, so name every tool you want; `defaultTools` also accepts `+name` and `-name` to change the defaults instead.
142
+
143
+ | Built-in | Purpose |
144
+ |---|---|
145
+ | `read` | Read text files and supported images |
146
+ | `bash` | Run shell commands |
147
+ | `powershell` | Run PowerShell commands on Windows |
148
+ | `edit` | Apply exact text replacements to an existing file |
149
+ | `write` | Create or overwrite a file |
150
+ | `grep` | Search file contents |
151
+ | `find` | Find paths using glob patterns |
152
+ | `ls` | List directory contents |
153
+
154
+ Built-in extensions add two more tools. They are off by default; the MCP extension turns them on when an MCP server needs them (see [MCP](mcp.md#exposure)). To enable them yourself, name them in `--tools` or `defaultTools`.
155
+
156
+ | Built-in extension | Purpose |
157
+ |---|---|
158
+ | `codemode` | Run JavaScript that calls the other tools, for example in parallel with `Promise.allSettled`; only the script's output reaches the model |
159
+ | `tool_search` | Search tools that are not declared to the model (`codemode` and `deferred` exposure, such as MCP tools) and declare the matches for the next call |
160
+
161
+ ### Enable codemode
162
+
163
+ To turn on `codemode` for every session, add it to the default tools in `~/.draht/agent/settings.json` or a project's `.draht/settings.json`:
164
+
165
+ ```json
166
+ {
167
+ "defaultTools": ["+codemode"]
168
+ }
169
+ ```
170
+
171
+ This keeps `read`, `bash`, `edit`, and `write` and adds `codemode`. For one invocation, list every tool, since `--tools` replaces the selection:
172
+
173
+ ```sh
174
+ draht --tools read,bash,edit,write,codemode
175
+ ```
176
+
177
+ Codemode is useful without MCP: scripts can run several tool calls in parallel, filter large output before it reaches the model, and call classifier models such as TypeSafe's Jev through `models.classify()` (see [Classifier models](models.md#use-classifier-models)).
178
+
179
+ ### How codemode works
180
+
181
+ Codemode scripts run in a QuickJS sandbox that can only reach the other tools, through `tools.<name>(args)`; `ALL_TOOLS` lists them. Output comes from `text(value)`, `image(dataUrlOrImageContent)`, `console.*`, and a top-level `return value`; `exit()` ends the script early. The result starts with `Script completed` or `Script failed`, the wall time, and the output; a failed script keeps its partial output, followed by `Script error:` and the error.
182
+
183
+ A script may start with an options line such as `// @options: {"max_output_tokens": 2000, "timeout_ms": 60000}`. `max_output_tokens` (default 10000) limits the output: longer output keeps its start and end, and the full text is written to a temp file whose path is included in the result. `timeout_ms` is a hard deadline, unset by default.
184
+
185
+ While `codemode` is active, `codemode.mode` in [settings](settings.md#tools) decides how the other tools are presented. With `on` (default) declared tools keep being declared and their descriptions show how to call them from scripts. With `only` they are hidden from the model and listed in the `codemode` description instead, so the model calls them through scripts.
186
+
187
+ The `codemode` description lists the callable tools with their TypeScript declarations, grouped by namespace (for example one MCP server). Tools with `deferred` exposure, which includes MCP tools with the default `codemode` exposure, are not listed and do not affect the description, so it stays the same while MCP servers connect. Declarations share a budget of 3000 estimated tokens (`codemode.inlineBudget` in [settings](settings.md#tools)). Scripts find the rest with `await searchTools(query, { limit, namespace })`, which ranks tools with BM25, and `await describeTool(name)`, or by filtering `ALL_TOOLS`. `await describeNamespace(name)` returns a namespace's description, its instructions (for MCP servers, the server instructions), and the names of its tools.
188
+
189
+ Tools with an output schema resolve to structured values: `bash` to `{ output, truncated, full_output_path?, exit_code, wall_time_seconds }`, also for non-zero exit codes, and MCP tools to their `CallToolResult`. Other tools resolve to their text output. The `output` of `bash` is not limited to the 2000 lines or 50KB the model sees: it holds up to 1 MiB, and longer output keeps its first and last 512 KiB around an omission marker, with `truncated` set and the full output in `full_output_path`.
190
+
191
+ `store(key, value)` and `load(key)` keep JSON values across `codemode` calls: each successful script that stores values appends a `codemode-store` custom entry to the session, so resumed sessions keep the values and each branch sees only the values written on its path. Scripts can also use `models`: `getModelsOfType`, `getAvailableOfType`, and `getModelOfType` list the model catalog, and `classify(model, context)` runs a classifier model with the session's credentials, at most four at a time per script.
192
+
193
+ ### Tool search
194
+
195
+ `tool_search` is off by default; enable it with `"defaultTools": ["+tool_search"]` or `--tools`. It uses the same ranking as `searchTools()` over tools that are not declared yet and declares the matches for the next model call. Loaded tools are recorded in the session like other tool changes, so they stay declared on that branch.
196
+
197
+ <a id="resource-options"></a>
198
+
199
+ ## Resources
200
+
201
+ ```sh
202
+ draht --extension ./review.ts
203
+ ```
204
+
205
+ See [Configuration](configuration.md) for conventional directories and project trust, [Settings](settings.md#resources) for configured paths, and [draht Packages](packages.md) for package sources.
206
+
207
+ - `-e`, `--extension <path>`<br>
208
+ Loads an extension file or directory, or a built-in extension such as `builtin:mcp`, and is repeatable.
209
+ - `-ne`, `--no-extensions`<br>
210
+ Disables discovered, configured, and built-in extensions. Explicit `-e` paths still load, so `draht -ne -e builtin:mcp` keeps only the built-in MCP support.
211
+ - `--skill <path>`<br>
212
+ Loads a skill file or directory and is repeatable.
213
+ - `-ns`, `--no-skills`<br>
214
+ Disables discovered and configured skills. Explicit `--skill` paths still load.
215
+ - `--prompt-template <path>`<br>
216
+ Loads a prompt-template file or directory and is repeatable.
217
+ - `-np`, `--no-prompt-templates`<br>
218
+ Disables discovered and configured templates. Explicit `--prompt-template` paths still load.
219
+ - `--theme <path>`<br>
220
+ Loads a theme file or directory and is repeatable.
221
+ - `--use-theme <name[/name]>`<br>
222
+ Selects the initial interactive theme for this run.
223
+ - `--no-themes`<br>
224
+ Disables discovered and configured themes. Explicit `--theme` paths still load.
225
+ - `-nc`, `--no-context-files`<br>
226
+ Disables `AGENTS.md` and `CLAUDE.md` discovery.
227
+ - `--context-root <path>`<br>
228
+ Confines `AGENTS.md` and `CLAUDE.md` discovery to an absolute project root. The ancestor walk stops at that root, and context files that resolve outside it are refused. Relative paths are rejected.
229
+
230
+ Resource paths apply only to the current process. Relative paths resolve from the current working directory.
231
+
232
+ <a id="prompt-and-display-options"></a>
233
+
234
+ ## Prompts and process
235
+
236
+ ```sh
237
+ draht --append-system-prompt ./instructions.md
238
+ ```
239
+
240
+ See [Configuration](configuration.md) for saved configuration, [Security](security.md#understand-project-trust) for project trust, and [Environment Variables](environment-variables.md) for process controls.
241
+
242
+ - `--system-prompt <text|path>`<br>
243
+ Replaces the default system prompt with text or the contents of an existing file.
244
+ - `--append-system-prompt <text|path>`<br>
245
+ Appends text or an existing file to the system prompt and is repeatable.
246
+ - `--tui-mode <mode>`<br>
247
+ Uses `regular` or `fullscreen` terminal mode.
248
+ - `--verbose`<br>
249
+ Shows verbose interactive startup information, overriding `quietStartup`.
250
+ - `-a`, `--approve`<br>
251
+ Trusts project-local configuration and resources for this process.
252
+ - `-na`, `--no-approve`<br>
253
+ Ignores trust-gated project-local configuration and resources for this process.
254
+ - `--offline`<br>
255
+ Disables automatic network activity, including model catalog refreshes. Equivalent to `DRAHT_OFFLINE=1`.
256
+ - `-h`, `--help`<br>
257
+ Shows help, including flags registered by loaded extensions, then exits.
258
+ - `-v`, `--version`<br>
259
+ Shows the draht version, then exits.
260
+
261
+ Extensions may register additional long-form options. Unknown short options are rejected.
262
+
263
+ ## Package commands
264
+
265
+ ```sh
266
+ draht install npm:@scope/package
267
+ ```
268
+
269
+ See [draht Packages](packages.md) for source formats, filtering, installation, and project scope.
270
+
271
+ ### Common tasks
272
+
273
+ | Task | Command |
274
+ |---|---|
275
+ | Install a package | `draht install <source>` |
276
+ | List configured packages | `draht list` |
277
+ | Remove a package and its settings entry | `draht remove <source>` |
278
+ | Configure which package resources load | `draht config` |
279
+
280
+ Add `--local` or `-l` to `install`, `remove`, `uninstall`, or `config` to use project settings instead of global settings.
281
+
282
+ ### Update draht or packages
283
+
284
+ Running `draht update` without a target updates draht itself.
285
+
286
+ | Task | Command |
287
+ |---|---|
288
+ | Update draht | `draht update` |
289
+ | Update all installed packages | `draht update --extensions` |
290
+ | Update one installed package | `draht update <source>` |
291
+ | Refresh model catalogs | `draht update --models` |
292
+ | Update draht and all installed packages | `draht update --all` |
293
+
294
+ Add `--force` to reinstall draht when the selected update includes draht.
295
+
296
+ ### Aliases and command options
297
+
298
+ - `draht uninstall <source>` is an alias for `draht remove <source>`.
299
+ - `draht update --self` and `draht update self` are aliases for `draht update`.
300
+ - `draht update --extension <source>` is an alias for `draht update <source>`.
301
+ - `-a`, `--approve` trusts project-local files for one command. `-na`, `--no-approve` ignores trust-gated project-local files.
302
+ - Append `-h` or `--help` to a command for its exact usage and option constraints.
303
+
304
+ ## Credential commands
305
+
306
+ ```sh
307
+ draht auth check --provider openai --json
308
+ ```
309
+
310
+ Authentication commands require `--provider <provider>` or `--model <model>`. See [Provider Authentication](providers.md) for supported methods.
311
+
312
+ | Command | Description |
313
+ |---|---|
314
+ | `draht auth check` | Print `ready`, `not_ready`, or `invalid`; exit with status `0`, `1`, or `2`, respectively |
315
+ | `draht auth print-api-key` | Print the resolved API key |
316
+ | `draht auth print-bearer-token` | Print a resolved OAuth bearer token |
317
+
318
+ | Option | Applies to | Description |
319
+ |---|---|---|
320
+ | `--provider <provider>` | All | Resolve credentials for a provider |
321
+ | `--model <model>` | All | Resolve credentials from a model; may be combined with `--provider` |
322
+ | `--json` | `auth check` | Write the structured result as JSON |
323
+ | `--credentials` | `auth check` | Emit the resolved credential when ready |
324
+ | `--no-refresh` | `auth check` | Do not refresh expired OAuth credentials; refresh is the default |
325
+ | `--min-expiry <duration>` | `print-bearer-token` | Require remaining token lifetime using `ms`, `s`, `m`, or `h`, such as `30m` |
326
+
327
+ Credential-printing commands write secrets to stdout.
328
+
329
+ ## Checkpoint commands
330
+
331
+ ```sh
332
+ draht checkpoint prune --dry-run
333
+ ```
334
+
335
+ `draht checkpoint prune` deletes checkpoint snapshots for the repository in the current directory. Without options it applies the configured retention policy (`checkpoints.retentionDays` and `checkpoints.maxPerSession`, see [Settings](settings.md)).
336
+
337
+ | Option | Description |
338
+ |---|---|
339
+ | `--days <n>` | Delete snapshots older than `n` days |
340
+ | `--max-per-session <n>` | Keep at most `n` snapshots per session |
341
+ | `--dry-run` | Report what would be deleted without deleting it |
342
+
343
+ ## RLM commands
344
+
345
+ ```sh
346
+ draht rlm --input ./big-log.txt --query "What caused the outage?"
347
+ ```
348
+
349
+ `draht rlm` runs a Recursive Language Model query against a large input without loading it into a session's context. The root model writes Python that inspects the input inside a sandboxed REPL and returns a final answer.
350
+
351
+ | Option | Description |
352
+ |---|---|
353
+ | `--input <source>` | Required. A file path, glob pattern, `http(s)://` URL, or `knowledge:<client-slug>` reference |
354
+ | `--query <text>` | Required. The question to answer about the input |
355
+ | `--max-cost <n>` | Optional soft USD cost hint |
356
+
357
+ `draht rlm replay <trajectory-id>` prints the recorded final answer from `.draht/rlm/<trajectory-id>.jsonl` without calling a model. Add `--verbose` to also print each recorded step.
358
+
359
+ ## MCP commands
360
+
361
+ These commands work outside a session, so agents can run them through `bash`. See [MCP Servers](mcp.md).
362
+
363
+ | Command | Description |
364
+ |---|---|
365
+ | `draht mcp add <server> [options] -- <command> [args...]` | Add or replace a stdio server in `mcp.json`; `--env KEY=VALUE` (repeatable) and `--cwd <dir>` set its environment and working directory. Arguments after the command are passed to it |
366
+ | `draht mcp add <server> [options] --url <url>` | Add or replace a streamable HTTP server; `--header KEY=VALUE` (repeatable), `--bearer-token-env-var <NAME>` (sends `Authorization: Bearer ${NAME}`), `--oauth-client-id`, `--oauth-client-secret`, `--oauth-callback-port`, and `--oauth-client-name` configure authentication |
367
+ | `draht mcp remove <server>` | Remove a server from `mcp.json`; stored OAuth credentials are kept |
368
+ | `draht mcp list [--json]` | Connect to every enabled server and print its state, tools, and errors; exit with `1` when a config entry is invalid or an enabled server is not connected |
369
+ | `draht mcp login <server> [--timeout <seconds>]` | Sign in to an OAuth server: open the authorization page and wait for the browser (default 300 seconds); a terminal also accepts the pasted redirect URL |
370
+ | `draht mcp logout <server>` | Delete the stored OAuth credentials of a server |
371
+
372
+ `add` and `remove` change `~/.draht/agent/mcp.json`, or `.draht/mcp.json` in the current directory with `--local` (`-l`). `add` also takes `--exposure <mode>` (see [Exposure](mcp.md#exposure)) and `--description <text>` and does not connect; run `draht mcp list` to check the server.
373
+
374
+ Project `.draht/mcp.json` files are only read for projects that are already trusted.