@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
@@ -1,6 +1,6 @@
1
- # Compaction & Branch Summarization
1
+ # Compaction Reference
2
2
 
3
- LLMs have limited context windows. When conversations grow too long, draht uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
3
+ This reference describes automatic compaction, branch summarization, persisted entries, and extension hooks. For the user workflow, see [Sessions and Context](sessions.md#manage-conversation-context).
4
4
 
5
5
  **Source files** ([draht](https://github.com/draht-dev/draht)):
6
6
  - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
@@ -20,7 +20,7 @@ draht has two summarization mechanisms:
20
20
  | Compaction | Context exceeds threshold, or `/compact` | Summarize old messages to free up context |
21
21
  | Branch summarization | `/tree` navigation | Preserve context when switching branches |
22
22
 
23
- Both use the same structured summary format and track file operations cumulatively. Compaction and branch-summary requests use fresh routing session IDs and, where supported by the provider, disable prompt-cache writes because these one-off prompts are unlikely to be reused.
23
+ Both use closely related structured formats and track file operations cumulatively. Summarization requests disable prompt-cache writes because these one-off prompts are unlikely to be reused.
24
24
 
25
25
  ## Compaction
26
26
 
@@ -34,21 +34,25 @@ contextTokens > contextWindow - reserveTokens
34
34
 
35
35
  By default, `reserveTokens` is 16384 tokens (configurable in `~/.draht/agent/settings.json` or `<project-dir>/.draht/settings.json`). This leaves room for the LLM's response.
36
36
 
37
+ During a multi-turn agent run, draht checks the canonical projected context after tools finish and their results are appended, before starting the next assistant response. If the threshold is crossed, draht compacts during `prepareNextTurn`, then performs the existing catch-up steering poll before `turn_start`. It skips this between-turn check when the completed tool batch terminates the run and no queued message requires another response. draht also checks before a new user prompt and performs final-attempt overflow recovery after the low-level run ends.
38
+
39
+ A provider context-overflow error or an early final `stopReason: "length"` can select one compact-and-retry recovery attempt. Length responses with tool calls retain their synthetic failed tool results and follow the ordinary tool/queue scheduler rather than forcing the run to end.
40
+
37
41
  You can also trigger manually with `/compact [instructions]`, where optional instructions focus the summary.
38
42
 
39
43
  ### How It Works
40
44
 
41
- 1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.draht/agent/settings.json` or `<project-dir>/.draht/settings.json`) is reached
42
- 2. **Extract messages**: Collect messages from the previous kept boundary (or session start) up to the cut point
45
+ 1. **Find cut point**: Walk backwards through the finalized session projection, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.draht/agent/settings.json` or `<project-dir>/.draht/settings.json`) is reached
46
+ 2. **Extract messages**: Collect projected messages from the previous kept boundary (or session start) up to the cut point
43
47
  3. **Generate summary**: Call LLM to summarize with structured format, passing the previous summary as iterative context when present
44
48
  4. **Append entry**: Save `CompactionEntry` with summary and `firstKeptEntryId`
45
- 5. **Reload**: Session reloads, using summary + messages from `firstKeptEntryId` onwards
49
+ 5. **Rebuilds context**: Session rebuilds the context for the next request, using summary + messages from `firstKeptEntryId` onwards
46
50
 
47
51
  ```
48
52
  Before compaction:
49
53
 
50
54
  entry: 0 1 2 3 4 5 6 7 8 9
51
- ┌─────┬─────┬─────┬─────┬──────┬─────┬─────┬──────┬──────┬─────┐
55
+ ┌─────┬─────┬─────┬──────┬─────┬─────┬──────┬──────┬─────┬─────┐
52
56
  │ hdr │ usr │ ass │ tool │ usr │ ass │ tool │ tool │ ass │ tool│
53
57
  └─────┴─────┴─────┴──────┴─────┴─────┴──────┴──────┴─────┴─────┘
54
58
  └────────┬───────┘ └──────────────┬──────────────┘
@@ -59,7 +63,7 @@ Before compaction:
59
63
  After compaction (new entry appended):
60
64
 
61
65
  entry: 0 1 2 3 4 5 6 7 8 9 10
62
- ┌─────┬─────┬─────┬─────┬──────┬─────┬─────┬──────┬──────┬─────┬─────┐
66
+ ┌─────┬─────┬─────┬──────┬─────┬─────┬──────┬──────┬─────┬─────┬─────┐
63
67
  │ hdr │ usr │ ass │ tool │ usr │ ass │ tool │ tool │ ass │ tool│ cmp │
64
68
  └─────┴─────┴─────┴──────┴─────┴─────┴──────┴──────┴─────┴─────┴─────┘
65
69
  └──────────┬──────┘ └──────────────────────┬───────────────────┘
@@ -76,16 +80,31 @@ What the LLM sees:
76
80
  prompt from cmp messages from firstKeptEntryId
77
81
  ```
78
82
 
79
- On repeated compactions, the summarized span starts at the previous compaction's kept boundary (`firstKeptEntryId`), not at the compaction entry itself, falling back to the entry after the previous compaction if that kept entry cannot be found in the path. This preserves messages that survived the earlier compaction by including them in the next summarization pass as well. draht also recalculates `tokensBefore` from the rebuilt session context before writing the new `CompactionEntry`, so the token count reflects the actual pre-compaction context being replaced.
83
+ On repeated compactions, the summarized span starts at the previous compaction's kept boundary (`firstKeptEntryId`), not at the compaction entry itself, falling back to the entry after the previous compaction if that kept entry cannot be found in the path. A retain-none compaction records its own ID as `firstKeptEntryId`; repeated compaction starts after that entry. This preserves messages that survived the earlier compaction by including them in the next summarization pass as well. draht also recalculates `tokensBefore` from the rebuilt, context-edited session projection before writing the new `CompactionEntry`, so the token count reflects the actual pre-compaction context being replaced. Omitted raw entries remain stored but do not affect cut selection, summaries, checkpoints, or token estimates.
84
+
85
+ ### Overflow and Length Recovery Ordering
86
+
87
+ Recovery preserves the existing lifecycle and queue order. The completed attempt remains visible to `turn_end` and `agent_end`; post-run recovery then repairs persisted model context before a fresh retry:
88
+
89
+ ```text
90
+ persist final assistant response
91
+ → extension/public turn_end
92
+ → extension/public agent_end
93
+ → append context_edit omissions for the selected attempt
94
+ → for overflow/length: run session_before_compact and append compaction on success
95
+ → start the retry as a fresh run
96
+ ```
97
+
98
+ If recovery compaction fails or is cancelled, draht keeps the omission edits, appends no compaction, and schedules no internal retry. Existing queued work remains governed by ordinary steering and follow-up rules. `agent_before_settle` sees the repaired projection after recovery processing. Raw transcript history, exports, billing totals, and history-search extensions can still inspect the omitted attempt.
80
99
 
81
- ### Split Turns
100
+ ### Split user-message spans
82
101
 
83
- A "turn" starts with a user message and includes all assistant responses and tool calls until the next user message. Normally, compaction cuts at turn boundaries.
102
+ A user-message span starts with a user message and includes all turns until the next user message. Normally, compaction cuts at user-message boundaries.
84
103
 
85
- When a single turn exceeds `keepRecentTokens`, the cut point lands mid-turn at an assistant message. This is a "split turn":
104
+ When one user-message span exceeds `keepRecentTokens`, the cut point lands within that span at an assistant message. This is a split user-message span:
86
105
 
87
106
  ```
88
- Split turn (one huge turn exceeds budget):
107
+ Split user-message span (one span exceeds budget):
89
108
 
90
109
  entry: 0 1 2 3 4 5 6 7 8
91
110
  ┌─────┬─────┬─────┬──────┬─────┬──────┬──────┬─────┬──────┐
@@ -98,13 +117,13 @@ Split turn (one huge turn exceeds budget):
98
117
  └── kept (7-8)
99
118
 
100
119
  isSplitTurn = true
101
- messagesToSummarize = [] (no complete turns before)
120
+ messagesToSummarize = [] (no earlier user-message spans)
102
121
  turnPrefixMessages = [usr, ass, tool, ass, tool, tool]
103
122
  ```
104
123
 
105
- For split turns, draht generates two summaries and merges them:
124
+ For split user-message spans, draht generates two summaries and merges them:
106
125
  1. **History summary**: Previous context (if any)
107
- 2. **Turn prefix summary**: The early part of the split turn
126
+ 2. **User-message-span prefix summary**: The early part of the split user-message span
108
127
 
109
128
  ### Cut Point Rules
110
129
 
@@ -116,6 +135,8 @@ Valid cut points are:
116
135
 
117
136
  Never cut at tool results (they must stay with their tool call).
118
137
 
138
+ Preparation advances the kept boundary into a context-invisible suffix only when that suffix contains an omitted assistant attempt and no unomitted context-producing entries. Recovery `context_edit` omissions satisfy this rule; intrinsically context-invisible metadata may coexist with them. Metadata alone and newly appended custom messages do not move the cut. A replacement edit affecting the candidate input or summarized prefix also blocks advancement because the omitted assistant answered the pre-edit input; replacements of suffix entries that are ultimately omitted remain safe. This allows an over-budget recovered input to be summarized while retaining the edits that keep the abandoned attempt omitted, without making bookkeeping change whether new model input is preserved verbatim.
139
+
119
140
  ### CompactionEntry Structure
120
141
 
121
142
  Defined in [`session-manager.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/session-manager.ts):
@@ -124,8 +145,8 @@ Defined in [`session-manager.ts`](https://github.com/draht-dev/draht/blob/main/p
124
145
  interface CompactionEntry<T = unknown> {
125
146
  type: "compaction";
126
147
  id: string;
127
- parentId: string;
128
- timestamp: number;
148
+ parentId: string | null;
149
+ timestamp: string;
129
150
  summary: string;
130
151
  firstKeptEntryId: string;
131
152
  tokensBefore: number;
@@ -171,18 +192,16 @@ Entries to summarize: B, C, D
171
192
 
172
193
  After navigation with summary:
173
194
 
174
- ┌─ B ─ C ─ D ─ [summary of B,C,D]
195
+ ┌─ B ─ C ─ D
175
196
  A ───┤
176
- └─ E ─ F (new leaf)
197
+ └─ E ─ F ─ [summary of B,C,D] (new leaf)
177
198
  ```
178
199
 
179
200
  ### Cumulative File Tracking
180
201
 
181
- Both compaction and branch summarization track files cumulatively. When generating a summary, draht extracts file operations from:
182
- - Tool calls in the messages being summarized
183
- - Previous compaction or branch summary `details` (if any)
202
+ Default compaction and branch summarization track files cumulatively. Both extract file operations from tool calls in the messages being summarized. Compaction also carries file lists from the previous draht-generated compaction. Branch summarization carries file lists from draht-generated branch summaries in the entries it summarizes.
184
203
 
185
- This means file tracking accumulates across multiple compactions or nested branch summaries, preserving the full history of read and modified files.
204
+ File tracking therefore accumulates across default compactions and nested default branch summaries. draht does not automatically carry file lists from extension-generated summaries whose `fromHook` field is `true`; extensions manage their own `details` format.
186
205
 
187
206
  ### BranchSummaryEntry Structure
188
207
 
@@ -192,8 +211,8 @@ Defined in [`session-manager.ts`](https://github.com/draht-dev/draht/blob/main/p
192
211
  interface BranchSummaryEntry<T = unknown> {
193
212
  type: "branch_summary";
194
213
  id: string;
195
- parentId: string;
196
- timestamp: number;
214
+ parentId: string | null;
215
+ timestamp: string;
197
216
  summary: string;
198
217
  fromId: string; // Entry we navigated from
199
218
  usage?: Usage; // LLM usage that generated the summary
@@ -214,7 +233,9 @@ See [`collectEntriesForBranchSummary()`](https://github.com/draht-dev/draht/blob
214
233
 
215
234
  ## Summary Format
216
235
 
217
- Both compaction and branch summarization use the same structured format:
236
+ Both formats include Goal, Constraints & Preferences, Progress, Key Decisions, and Next Steps. Compaction summaries also include Critical Context. Branch summaries stop after Next Steps. draht appends file lists to either format when relevant.
237
+
238
+ Compaction summaries use this format:
218
239
 
219
240
  ```markdown
220
241
  ## Goal
@@ -281,12 +302,12 @@ pi.on("session_before_compact", async (event, ctx) => {
281
302
  const { preparation, branchEntries, customInstructions, signal } = event;
282
303
 
283
304
  // preparation.messagesToSummarize - messages to summarize
284
- // preparation.turnPrefixMessages - split turn prefix (if isSplitTurn)
305
+ // preparation.turnPrefixMessages - user-message-span prefix (if isSplitTurn)
285
306
  // preparation.previousSummary - previous compaction summary
286
307
  // preparation.fileOps - extracted file operations
287
308
  // preparation.tokensBefore - context tokens before compaction
288
309
  // preparation.firstKeptEntryId - where kept messages start
289
- // preparation.settings - compaction settings
310
+ // preparation.settings - effective settings after applying model overrides
290
311
 
291
312
  // branchEntries - all entries on current branch (for custom state)
292
313
  // signal - AbortSignal (pass to LLM calls)
@@ -344,6 +365,21 @@ pi.on("session_before_compact", async (event, ctx) => {
344
365
 
345
366
  See [custom-compaction.ts](../examples/extensions/custom-compaction.ts) for a complete example using a different model.
346
367
 
368
+ ### session_compact_failed
369
+
370
+ Fired when manual or automatic compaction fails or is aborted. This is useful for telemetry extensions that need to pair `session_before_compact` attempts with terminal outcomes.
371
+
372
+ ```typescript
373
+ pi.on("session_compact_failed", async (event, ctx) => {
374
+ const { reason, errorMessage, aborted, willRetry, fromExtension } = event;
375
+ // reason - "manual" (/compact), "threshold", or "overflow"
376
+ // errorMessage - present for non-abort failures
377
+ // aborted - true for canceled/aborted compactions
378
+ // willRetry - whether the aborted turn would have retried after compaction
379
+ // fromExtension - whether extension-provided compaction content was being used
380
+ });
381
+ ```
382
+
347
383
  ### session_before_tree
348
384
 
349
385
  Fired before `/tree` navigation. Always fires regardless of whether user chose to summarize. Can cancel navigation or provide custom summary.
@@ -397,3 +433,29 @@ Configure compaction in `~/.draht/agent/settings.json` or `<project-dir>/.draht/
397
433
  | `keepRecentTokens` | `20000` | Recent tokens to keep (not summarized) |
398
434
 
399
435
  Disable auto-compaction with `"enabled": false`. You can still compact manually with `/compact`.
436
+
437
+ ### Per-model overrides
438
+
439
+ Use `compaction.modelOverrides` to tune token budgets for different models:
440
+
441
+ ```json
442
+ {
443
+ "compaction": {
444
+ "reserveTokens": 16384,
445
+ "keepRecentTokens": 20000,
446
+ "modelOverrides": {
447
+ "some-provider/big-model": {
448
+ "reserveTokens": 400000
449
+ }
450
+ }
451
+ }
452
+ }
453
+ ```
454
+
455
+ For a model with a 1M context window, this override triggers compaction above 600K tokens and keeps the ordinary 20000 recent tokens. Other models retain the ordinary 16384-token reserve. `reserveTokens` also influences summarization output limits, capped by the model's maximum output tokens; it is not solely a trigger threshold.
456
+
457
+ Keys are exact, case-sensitive `provider/modelId` values, including any slashes within the model ID. Each `reserveTokens` and `keepRecentTokens` value falls back independently from the model override to the ordinary setting to the built-in default. Values must be non-negative safe integers. Invalid values in the matching model override produce an error when read; only omitted fields fall back to the ordinary setting. Model override entries must be objects. Invalid ordinary token settings produce an error when read, even if the active model has a valid override. Only omitted ordinary values use built-in defaults. `enabled` remains global, not model-specific.
458
+
459
+ These resolved values are used for manual compaction, all automatic threshold checks, overflow recovery, and extension-visible `preparation.settings`. Model switches affect subsequent checks and compactions without changing ordinary settings. Compaction already in progress uses the model and settings captured for that operation. Branch summarization settings are unaffected.
460
+
461
+ Overrides work in both global and project settings. The files merge recursively before lookup, so a global model-specific value beats a project-wide fallback; a project must override that model entry to change it. See [Settings](settings.md#per-model-compaction-overrides) for details.
@@ -0,0 +1,47 @@
1
+ # Configuration
2
+
3
+ draht supports user-level and project configuration. User-level configuration lives in the agent directory, which defaults to `~/.draht/agent`. Project configuration lives in `.draht` under the working directory and loads after [project trust](security.md#understand-project-trust) is granted. The only exception is `sessionDir`, which draht reads before resolving trust so it can locate sessions.
4
+
5
+ In interactive mode, use `/settings` to change common preferences. For other options, ask draht to update the configuration or edit the relevant files directly. Run `/reload` after manually changing settings, keybindings, instructions, or resources.
6
+
7
+ ## Agent directory
8
+
9
+ The agent directory is shown as `<agent-dir>` below. Set its location with the `DRAHT_CODING_AGENT_DIR` environment variable or the SDK's [`agentDir`](sdk.md) option.
10
+
11
+ | Path | Responsibility |
12
+ |---|---|
13
+ | `<agent-dir>/settings.json` | User-level [settings](settings.md), including preferences, defaults, resource paths, and draht package declarations. |
14
+ | `<agent-dir>/keybindings.json` | Custom terminal UI and application [keybindings](keybindings.md). |
15
+ | `<agent-dir>/mcp.json` | [MCP servers](mcp.md) available in every project. |
16
+ | `<agent-dir>/models.json` | [Compatible endpoints, models, and model overrides](models.md#configure-a-compatible-endpoint). |
17
+ | `<agent-dir>/auth.json` | Saved API keys and OAuth credentials. |
18
+ | `<agent-dir>/AGENTS.override.md`, `AGENTS.md`, `AGENTS.MD`, `CLAUDE.md`, or `CLAUDE.MD` | User instructions applied across working directories. |
19
+ | `<agent-dir>/SYSTEM.md` | Replaces draht’s default system prompt. |
20
+ | `<agent-dir>/APPEND_SYSTEM.md` | Adds instructions to draht’s system prompt. |
21
+ | `<agent-dir>/extensions/` | User [extensions](extensions.md). |
22
+ | `<agent-dir>/skills/` | User [skills](skills.md) and supporting files. |
23
+ | `<agent-dir>/prompts/` | User [prompt templates](prompt-templates.md) exposed as slash commands. |
24
+ | `<agent-dir>/themes/` | User [theme](themes.md) files. |
25
+
26
+ ## Project `.draht` directory
27
+
28
+ | Path | Responsibility |
29
+ |---|---|
30
+ | `.draht/settings.json` | Project-level [settings](settings.md), resource paths, and draht package declarations. |
31
+ | `.draht/mcp.json` | Project [MCP servers](mcp.md). |
32
+ | `.draht/SYSTEM.md` | Replaces the system prompt for the project. |
33
+ | `.draht/APPEND_SYSTEM.md` | Adds project-specific instructions to the system prompt. |
34
+ | `.draht/extensions/` | Project extensions. |
35
+ | `.draht/skills/` | Project skills and supporting files. |
36
+ | `.draht/prompts/` | Project prompt templates exposed as slash commands. |
37
+ | `.draht/themes/` | Project theme files. |
38
+
39
+ For `SYSTEM.md` and `APPEND_SYSTEM.md`, the trusted project file takes precedence over the corresponding agent-directory file. Files with the same name are not combined.
40
+
41
+ ## Context files
42
+
43
+ Context files are separate from project `.draht` configuration. draht loads them from the agent directory, the working directory, and its parent directories. A context file applies whenever draht runs in its directory or anywhere below it.
44
+
45
+ An `AGENTS.override.md` replaces `AGENTS.md` or `CLAUDE.md` only in the same directory. It does not suppress context files from the agent directory or other directories.
46
+
47
+ Context-file discovery does not require project trust. Pass `--context-root <path>` to stop the parent-directory walk at an absolute project root and refuse context files that resolve outside it, or `--no-context-files` to disable discovery. See [Command Line](cli.md#resources).
@@ -1,111 +1,145 @@
1
- # Containerization
1
+ # Run draht in an isolated environment
2
2
 
3
- draht runs with all permissions by default, but in some cases, you will want to have more control over what directories draht can write to and which accesses it has.
3
+ Use an isolated environment to limit the files, credentials, processes, and network services that generated commands can access or affect.
4
4
 
5
- There are two general options. You can either
6
- 1. run the whole `draht` process inside an isolated environment, or
7
- 2. run `draht` on the host and route tool execution into an isolated environment.
5
+ You can isolate the complete draht process or keep draht on the host and route selected tools into an isolated environment.
8
6
 
9
- ## Choose a pattern
7
+ ## Choose an isolation method
10
8
 
11
- | Pattern | What is isolated | Best for | Notes |
12
- | --- | --- | --- | --- |
13
- | OpenShell | Whole `draht` process in a policy-controlled sandbox | Local or remote managed sandbox | Requires an OpenShell gateway |
14
- | Gondolin extension | Built-in tools and `!` commands | Local micro-VM isolation while keeping auth on host | See [`examples/extensions/gondolin/`](../examples/extensions/gondolin/). |
15
- | Plain Docker | Whole `draht` process in a local container | Simple local isolation | Provider API keys enter the container. |
9
+ | Method | Where draht runs | What is isolated | Credential handling | Best for |
10
+ |---|---|---|---|---|
11
+ | Plain Docker | Container | draht, built-in tools, `!` commands, and extensions | Credentials passed into the container | A straightforward local container boundary |
12
+ | OpenShell | Local or remote sandbox | draht, built-in tools, `!` commands, and extensions | Policy-controlled credentials and inference routing | Filesystem, process, network, and credential policies |
13
+ | Gondolin extension | Host | Built-in tools and `!` commands | Stored draht credentials remain on the host, but commands inherit host environment variables | A local micro-VM for tool execution while retaining the host interface |
16
14
 
17
- Extensions run wherever the `draht` process runs. If you run host `draht` with a tool-routing extension, other custom extension tools still run on the host unless they also delegate their operations.
15
+ The method changes where extensions run. When the complete draht process runs inside an isolated environment, its extensions run there too. When host draht delegates built-in tools through Gondolin, other extension tools still run on the host unless they also delegate their work.
18
16
 
19
- ## OpenShell
17
+ ## Decide what draht can access
20
18
 
21
- Use [NVIDIA OpenShell](https://docs.nvidia.com/openshell/about/overview) when you want a policy-controlled sandbox with filesystem, process, network, credential, and inference controls.
22
- OpenShell can run sandboxes through a local gateway backed by Docker, Podman, or a VM runtime, or through a remote Kubernetes gateway.
19
+ An isolated process can still affect resources you expose to it:
23
20
 
24
- Every sandbox requires an active gateway.
25
- Register and select one before creating a sandbox:
21
+ - A read-write host mount lets draht modify those host files.
22
+ - Mounting `~/.draht/agent` exposes your draht credentials, settings, extensions, and sessions.
23
+ - Environment variables passed into a container are available to processes inside it.
24
+ - Network access may allow code or tool output to leave the environment.
25
+ - Tool-only isolation does not constrain the host draht process or extension tools that do not use the isolated backend.
26
26
 
27
- ```bash
28
- openshell gateway add <gateway-url> --name <name>
29
- openshell gateway select <name>
27
+ Expose only the working folder, credentials, and network destinations needed for the task. Use read-only mounts or copy files into and out of the environment when you do not want writes to affect the host.
28
+
29
+ ## Run draht in plain Docker
30
+
31
+ Plain Docker provides the simplest whole-process container boundary.
32
+
33
+ ### Build the image
34
+
35
+ Create `Dockerfile.draht`:
36
+
37
+ ```dockerfile
38
+ FROM node:24-bookworm-slim
39
+
40
+ RUN apt-get update \
41
+ && apt-get install -y --no-install-recommends bash ca-certificates git ripgrep \
42
+ && rm -rf /var/lib/apt/lists/*
43
+ RUN npm install -g --ignore-scripts @draht/coding-agent
44
+
45
+ WORKDIR /workspace
46
+ ENTRYPOINT ["draht"]
30
47
  ```
31
48
 
32
- Launch `draht` inside an OpenShell sandbox:
49
+ Build it from the directory containing the file:
33
50
 
34
51
  ```bash
35
- openshell sandbox create --name draht-sandbox --from pi -- draht
52
+ docker build -t draht-sandbox -f Dockerfile.draht .
36
53
  ```
37
54
 
38
- In this pattern, the whole `draht` process runs inside the sandbox.
39
- Built-in tools, `!` commands, and extension tools execute inside the OpenShell boundary.
55
+ ### Start draht
40
56
 
41
- If the gateway is remote, project files are not bind-mounted from the host, meaning writes in the sandbox are not reflected on your machine.
42
- Clone the repository inside the sandbox or use OpenShell file transfer commands:
57
+ From the working folder you want draht to access, run:
43
58
 
44
59
  ```bash
45
- openshell sandbox upload draht-sandbox ./repo /workspace
46
- openshell sandbox download draht-sandbox /workspace/repo ./repo-out
60
+ docker run --rm -it \
61
+ -e ANTHROPIC_API_KEY \
62
+ -v "$PWD:/workspace" \
63
+ -v draht-agent-home:/root/.draht/agent \
64
+ draht-sandbox
65
+ ```
66
+
67
+ Replace `ANTHROPIC_API_KEY` with the credential required by your provider. The named `draht-agent-home` volume keeps container-local settings, credentials, and sessions between runs.
68
+
69
+ Do not mount the host's `~/.draht/agent` unless the container should have access to your host draht configuration and credentials.
70
+
71
+ ### Verify the workspace
72
+
73
+ Inside draht, run:
74
+
75
+ ```text
76
+ !pwd
47
77
  ```
48
78
 
49
- OpenShell providers can keep raw model API keys outside the sandbox.
50
- When inference routing is configured, code inside the sandbox can call `https://inference.local`, and the gateway injects the configured provider credentials upstream.
51
- Configure draht to use the corresponding OpenAI-compatible or Anthropic-compatible endpoint if you want model traffic to use this route.
79
+ The command should report `/workspace`. Changes under `/workspace` write through to the mounted host folder. Remove the bind mount or use a read-only mount when that is not acceptable.
80
+
81
+ ## Run draht with OpenShell
52
82
 
53
- ## Gondolin
83
+ [NVIDIA OpenShell](https://docs.nvidia.com/openshell/about/overview) provides local or remote sandboxes with filesystem, process, network, credential, and inference policies.
54
84
 
55
- [Gondolin](https://github.com/earendil-works/gondolin) is a local Linux micro-VM.
56
- Use the [example extension](../examples/extensions/gondolin) when you want `draht` on the host but all built-in tools routed into the VM.
85
+ ### Select a gateway
57
86
 
58
- Setup:
87
+ Every sandbox requires an active gateway:
59
88
 
60
89
  ```bash
61
- cp -R packages/coding-agent/examples/extensions/gondolin ~/.draht/agent/extensions/gondolin
62
- cd ~/.draht/agent/extensions/gondolin
63
- npm install --ignore-scripts
90
+ openshell gateway add <gateway-url> --name <name>
91
+ openshell gateway select <name>
64
92
  ```
65
93
 
66
- Run from the project you want mounted:
94
+ ### Create the sandbox
95
+
96
+ Create the sandbox from an image that has `@draht/coding-agent` installed, such as the `draht-sandbox` image from [Run draht in plain Docker](#run-draht-in-plain-docker):
67
97
 
68
98
  ```bash
69
- cd /path/to/project
70
- draht -e ~/.draht/agent/extensions/gondolin
99
+ openshell sandbox create --name draht-sandbox --from <image-with-draht> -- draht
71
100
  ```
72
101
 
73
- The extension mounts the host cwd at `/workspace` in the VM and overrides `read`, `write`, `edit`, `bash`, `grep`, `find`, and `ls`.
74
- User `!` commands are routed into the VM, as well.
75
- File changes under `/workspace` write through to the host.
102
+ draht, its built-in tools, `!` commands, and extension tools run inside the OpenShell boundary.
76
103
 
77
- Requirements: Node.js >= 23.6.0 for `@earendil-works/gondolin`, plus QEMU (requires installation through your package manager).
104
+ ### Transfer files to a remote sandbox
78
105
 
79
- ## Plain Docker
106
+ A remote gateway does not bind-mount your host working folder. Clone the repository inside the sandbox or transfer files explicitly:
80
107
 
81
- Run the whole `draht` process in Docker when you want the simplest local container boundary.
108
+ ```bash
109
+ openshell sandbox upload draht-sandbox ./working-folder /workspace
110
+ openshell sandbox download draht-sandbox /workspace/working-folder ./working-folder-out
111
+ ```
82
112
 
83
- `Dockerfile.draht`:
113
+ OpenShell inference routing can keep raw model credentials outside the sandbox. When configured, point draht at the corresponding OpenAI-compatible or Anthropic-compatible endpoint exposed by the gateway.
84
114
 
85
- ```dockerfile
86
- FROM node:24-bookworm-slim
115
+ ## Route tools through Gondolin
87
116
 
88
- RUN apt-get update \
89
- && apt-get install -y --no-install-recommends bash ca-certificates git ripgrep \
90
- && rm -rf /var/lib/apt/lists/*
91
- RUN npm install -g --ignore-scripts @draht/coding-agent
117
+ [Gondolin](https://github.com/earendil-works/gondolin) is a local Linux micro-VM. Its example extension keeps the draht process and file-based provider credentials on the host while routing the built-in tools and user `!` commands into the VM.
92
118
 
93
- WORKDIR /workspace
94
- ENTRYPOINT ["draht"]
95
- ```
119
+ Commands inside the VM inherit the host process environment. Provider keys supplied through environment variables can therefore be visible inside the VM. Do not use this pattern as a credential boundary unless you remove sensitive variables or change the extension's environment handling.
96
120
 
97
- Build and run:
121
+ Gondolin requires Node.js 23.6 or newer and QEMU installed through your operating-system package manager.
122
+
123
+ ### Install the extension
124
+
125
+ From a draht source checkout:
98
126
 
99
127
  ```bash
100
- docker build -t draht-sandbox -f Dockerfile.draht .
128
+ mkdir -p ~/.draht/agent/extensions
129
+ cp -R packages/coding-agent/examples/extensions/gondolin ~/.draht/agent/extensions/gondolin
130
+ cd ~/.draht/agent/extensions/gondolin
131
+ npm install --ignore-scripts
132
+ ```
101
133
 
102
- docker run --rm -it \
103
- -e ANTHROPIC_API_KEY \
104
- -v "$PWD:/workspace" \
105
- -v draht-agent-home:/root/.draht/agent \
106
- draht-sandbox
134
+ ### Start draht
135
+
136
+ Run draht from the working folder you want mounted:
137
+
138
+ ```bash
139
+ cd /path/to/working-folder
140
+ draht -e ~/.draht/agent/extensions/gondolin
107
141
  ```
108
142
 
109
- The `-v "$PWD:/workspace"` mounts your current directory into the container at /workspace such that reads and writes in `/workspace` inside Docker directly affect your host files, like in the Gondolin example.
143
+ The extension mounts the host working folder at `/workspace` in the VM and overrides `read`, `write`, `edit`, `bash`, `grep`, `find`, and `ls`. File changes under `/workspace` write through to the host.
110
144
 
111
- Use a named volume for `/root/.draht/agent` if you want container-local settings and sessions. Mounting your host `~/.draht/agent` exposes host auth and session files to the container.
145
+ Other extension tools still run on the host unless they explicitly delegate their operations. Review the [Gondolin example](../examples/extensions/gondolin/) before adding tools that could bypass the VM boundary.