zidane 9.1.1 → 9.1.4

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 (279) hide show
  1. package/dist/{acp-Di9WvMDF.js → acp-Cl4gCZN6.js} +7 -7
  2. package/dist/{acp-Di9WvMDF.js.map → acp-Cl4gCZN6.js.map} +1 -1
  3. package/dist/acp-cli.js +5 -5
  4. package/dist/acp.d.ts +2 -2
  5. package/dist/acp.js +1 -1
  6. package/dist/{agent-DJhpTS-B.js → agent-Dh_XZ7fj.js} +74 -19
  7. package/dist/agent-Dh_XZ7fj.js.map +1 -0
  8. package/dist/agent.d.ts +1 -1
  9. package/dist/agent.js +1 -1
  10. package/dist/{auth-store-port-DFgf22oo.js → auth-store-port-DBl2JUC6.js} +2 -2
  11. package/dist/{auth-store-port-DFgf22oo.js.map → auth-store-port-DBl2JUC6.js.map} +1 -1
  12. package/dist/{auto-update-restart-BFB7Ek87.js → auto-update-restart-CF_kjcJd.js} +277 -41
  13. package/dist/auto-update-restart-CF_kjcJd.js.map +1 -0
  14. package/dist/{browser-BcoCCB_n.js → browser-BkdeKnxO.js} +56 -2
  15. package/dist/browser-BkdeKnxO.js.map +1 -0
  16. package/dist/{browser-entry-ypi8CyE-.d.ts → browser-entry-BCwruqNa.d.ts} +10 -10
  17. package/dist/{browser-entry-ypi8CyE-.d.ts.map → browser-entry-BCwruqNa.d.ts.map} +1 -1
  18. package/dist/channels.d.ts +5 -5
  19. package/dist/chat/browser.d.ts +4 -4
  20. package/dist/chat/browser.js +6 -6
  21. package/dist/chat/pure.d.ts +5 -5
  22. package/dist/chat/pure.js +8 -8
  23. package/dist/chat.d.ts +5 -5
  24. package/dist/chat.js +55 -55
  25. package/dist/chat.js.map +1 -1
  26. package/dist/{cli-shared-CabruH8Z.js → cli-shared-DIV9c5Nr.js} +4 -4
  27. package/dist/{cli-shared-CabruH8Z.js.map → cli-shared-DIV9c5Nr.js.map} +1 -1
  28. package/dist/cli-style-DBEm6CyT.js +105 -0
  29. package/dist/cli-style-DBEm6CyT.js.map +1 -0
  30. package/dist/{client-core-CIixwznM.d.ts → client-core-C_4m_oL6.d.ts} +4 -4
  31. package/dist/{client-core-CIixwznM.d.ts.map → client-core-C_4m_oL6.d.ts.map} +1 -1
  32. package/dist/{client-CCaIXWue.d.ts → client-ygTASGis.d.ts} +2 -2
  33. package/dist/{client-CCaIXWue.d.ts.map → client-ygTASGis.d.ts.map} +1 -1
  34. package/dist/codemode-worker.js +8 -5
  35. package/dist/codemode-worker.js.map +1 -1
  36. package/dist/codemode.d.ts +16 -0
  37. package/dist/codemode.d.ts.map +1 -1
  38. package/dist/codemode.js +2 -2
  39. package/dist/{connection-loop-QmWL-fJf.d.ts → connection-loop-D_pRONCr.d.ts} +4 -4
  40. package/dist/{connection-loop-QmWL-fJf.d.ts.map → connection-loop-D_pRONCr.d.ts.map} +1 -1
  41. package/dist/contexts/daytona.d.ts +3 -3
  42. package/dist/contexts/docker.d.ts +1 -1
  43. package/dist/contexts/e2b.d.ts +2 -2
  44. package/dist/contexts/sandbox.d.ts +1 -1
  45. package/dist/{contexts-C72b0mMa.js → contexts-DLZTSRHU.js} +17 -106
  46. package/dist/contexts-DLZTSRHU.js.map +1 -0
  47. package/dist/contexts.d.ts +4 -4
  48. package/dist/contexts.js +2 -2
  49. package/dist/{credentials-wwETW8rI.js → credentials-D71duF64.js} +2 -2
  50. package/dist/{credentials-wwETW8rI.js.map → credentials-D71duF64.js.map} +1 -1
  51. package/dist/{cwd-picker-CcekODCt.js → cwd-picker-BsHA6HKv.js} +4 -4
  52. package/dist/{cwd-picker-CcekODCt.js.map → cwd-picker-BsHA6HKv.js.map} +1 -1
  53. package/dist/daemon-cli.js +4 -3
  54. package/dist/daemon-cli.js.map +1 -1
  55. package/dist/{decisions-CXmK0nz9.js → decisions-hsw5XS2g.js} +3 -1
  56. package/dist/decisions-hsw5XS2g.js.map +1 -0
  57. package/dist/{discovery-DycXFxdA.js → discovery-DD4wPWKS.js} +4 -4
  58. package/dist/{discovery-DycXFxdA.js.map → discovery-DD4wPWKS.js.map} +1 -1
  59. package/dist/durable/sqlite.d.ts +2 -2
  60. package/dist/durable.d.ts +1 -1
  61. package/dist/{engine-VQ86XGdG.js → engine-BDmtgr2O.js} +6 -6
  62. package/dist/{engine-VQ86XGdG.js.map → engine-BDmtgr2O.js.map} +1 -1
  63. package/dist/{eval-Bod0I1W_.js → eval-CfGUDAkN.js} +3 -3
  64. package/dist/{eval-Bod0I1W_.js.map → eval-CfGUDAkN.js.map} +1 -1
  65. package/dist/eval.d.ts +1 -1
  66. package/dist/eval.js +1 -1
  67. package/dist/{executor-C7RQrkEq.js → executor-EWOhLyd9.js} +4 -4
  68. package/dist/{executor-C7RQrkEq.js.map → executor-EWOhLyd9.js.map} +1 -1
  69. package/dist/{extension-mark-BqKdEZwF.js → extension-mark-_rhkDWL5.js} +9 -6
  70. package/dist/extension-mark-_rhkDWL5.js.map +1 -0
  71. package/dist/extensions/testing.d.ts +1 -1
  72. package/dist/extensions/testing.js +2 -2
  73. package/dist/{extensions-BCx4QuGB.js → extensions-DklXPjiq.js} +8 -8
  74. package/dist/{extensions-BCx4QuGB.js.map → extensions-DklXPjiq.js.map} +1 -1
  75. package/dist/{extensions-client-D8tEAcMw.d.ts → extensions-client-D4Q2XRKV.d.ts} +31 -5
  76. package/dist/extensions-client-D4Q2XRKV.d.ts.map +1 -0
  77. package/dist/extensions.d.ts +1 -1
  78. package/dist/extensions.js +6 -6
  79. package/dist/{fold-rules-DvLK8pbf.d.ts → fold-rules-1DpDwG9h.d.ts} +2 -2
  80. package/dist/{fold-rules-DvLK8pbf.d.ts.map → fold-rules-1DpDwG9h.d.ts.map} +1 -1
  81. package/dist/{google-Crva32sk.js → google-BtMW9KzL.js} +2 -2
  82. package/dist/{google-Crva32sk.js.map → google-BtMW9KzL.js.map} +1 -1
  83. package/dist/{headless-CCm-jLLT.js → headless-CQm19BL0.js} +4 -4
  84. package/dist/{headless-CCm-jLLT.js.map → headless-CQm19BL0.js.map} +1 -1
  85. package/dist/headless.d.ts +1 -1
  86. package/dist/headless.js +1 -1
  87. package/dist/history-worker.js +1 -1
  88. package/dist/{host-BHMs9jsN.js → host-DEoEzQal.js} +13 -4
  89. package/dist/host-DEoEzQal.js.map +1 -0
  90. package/dist/{host-scoped-settings-CrbcqOkP.js → host-scoped-settings-WBYaCork.js} +2 -2
  91. package/dist/{host-scoped-settings-CrbcqOkP.js.map → host-scoped-settings-WBYaCork.js.map} +1 -1
  92. package/dist/{host-signals-Jsjd_-4g.js → host-signals-91zyko_i.js} +5 -5
  93. package/dist/{host-signals-Jsjd_-4g.js.map → host-signals-91zyko_i.js.map} +1 -1
  94. package/dist/{host-wO_6GW0y.js → host-uP3t08w8.js} +276 -103
  95. package/dist/host-uP3t08w8.js.map +1 -0
  96. package/dist/{host-version-CNAr9pov.js → host-version-_RHlAB29.js} +2 -2
  97. package/dist/{host-version-CNAr9pov.js.map → host-version-_RHlAB29.js.map} +1 -1
  98. package/dist/{index-C6nnKu32.d.ts → index-B0PLo9jn.d.ts} +4 -4
  99. package/dist/{index-C6nnKu32.d.ts.map → index-B0PLo9jn.d.ts.map} +1 -1
  100. package/dist/{index-Djnc8Peh.d.ts → index-De4x-s76.d.ts} +14 -14
  101. package/dist/{index-Djnc8Peh.d.ts.map → index-De4x-s76.d.ts.map} +1 -1
  102. package/dist/{index-CGbOWa7y.d.ts → index-WlE93Q6d.d.ts} +411 -3
  103. package/dist/index-WlE93Q6d.d.ts.map +1 -0
  104. package/dist/{index-CCf_WeTQ.d.ts → index-f-XWIoYo.d.ts} +2 -2
  105. package/dist/{index-CCf_WeTQ.d.ts.map → index-f-XWIoYo.d.ts.map} +1 -1
  106. package/dist/index.d.ts +5 -5
  107. package/dist/index.js +17 -17
  108. package/dist/ipc/browser-types.d.ts +304 -7
  109. package/dist/ipc/browser-types.d.ts.map +1 -1
  110. package/dist/ipc/browser.d.ts +4 -4
  111. package/dist/ipc/browser.js +2 -2
  112. package/dist/ipc/remote.d.ts +6 -6
  113. package/dist/ipc/remote.js +3 -3
  114. package/dist/{ipc-BzWhIybr.js → ipc-CatnsVEd.js} +4 -4
  115. package/dist/{ipc-BzWhIybr.js.map → ipc-CatnsVEd.js.map} +1 -1
  116. package/dist/ipc.d.ts +10 -10
  117. package/dist/ipc.js +8 -8
  118. package/dist/{json-Dj-YATkZ.js → json-BjClr43H.js} +2 -20
  119. package/dist/json-BjClr43H.js.map +1 -0
  120. package/dist/{links-CJG_rFvf.js → links-a8C9eby4.js} +9 -9
  121. package/dist/{links-CJG_rFvf.js.map → links-a8C9eby4.js.map} +1 -1
  122. package/dist/{loaded-entry-DTURJo_R.js → loaded-entry-D6jzt5HQ.js} +2 -2
  123. package/dist/{loaded-entry-DTURJo_R.js.map → loaded-entry-D6jzt5HQ.js.map} +1 -1
  124. package/dist/mcp.d.ts +1 -1
  125. package/dist/{media-type-BtA0cbfI.d.ts → media-type-ZSmAGHvg.d.ts} +188 -7
  126. package/dist/media-type-ZSmAGHvg.d.ts.map +1 -0
  127. package/dist/{memory-DuVGrzbl.js → memory-CJy52DNi.js} +132 -31
  128. package/dist/memory-CJy52DNi.js.map +1 -0
  129. package/dist/model-test-CAtJ76kM.js.map +1 -1
  130. package/dist/{move-session-kylExJ5H.js → move-session-D7ILECs-.js} +4 -4
  131. package/dist/{move-session-kylExJ5H.js.map → move-session-D7ILECs-.js.map} +1 -1
  132. package/dist/{nested-call-record-DlzPeTB7.js → nested-call-record-OayszZBQ.js} +4 -3
  133. package/dist/nested-call-record-OayszZBQ.js.map +1 -0
  134. package/dist/output/stream-json.d.ts +1 -1
  135. package/dist/output/terminal.d.ts +1 -1
  136. package/dist/{path-display-COVV71Yu.js → path-display-CAWz-sMq.js} +3 -3
  137. package/dist/{path-display-COVV71Yu.js.map → path-display-CAWz-sMq.js.map} +1 -1
  138. package/dist/plugins.d.ts +1 -1
  139. package/dist/{prelude-CVKoUzV8.js → prelude-BwiSR1uA.js} +16 -5
  140. package/dist/prelude-BwiSR1uA.js.map +1 -0
  141. package/dist/{presets-CBt6rFfS.js → presets-CMY43nUP.js} +3 -3
  142. package/dist/{presets-CBt6rFfS.js.map → presets-CMY43nUP.js.map} +1 -1
  143. package/dist/presets.d.ts +1 -1
  144. package/dist/presets.js +1 -1
  145. package/dist/{protocol-CEVqBO-q.d.ts → protocol-C2lqKuMd.d.ts} +50 -7
  146. package/dist/protocol-C2lqKuMd.d.ts.map +1 -0
  147. package/dist/protocol-DOGyHgLQ.js.map +1 -1
  148. package/dist/protocol-NSllElLw.js.map +1 -1
  149. package/dist/providers/anthropic.d.ts +1 -1
  150. package/dist/providers/arcee.d.ts +1 -1
  151. package/dist/providers/baseten.d.ts +1 -1
  152. package/dist/providers/cerebras.d.ts +1 -1
  153. package/dist/providers/google.d.ts +1 -1
  154. package/dist/providers/google.js +1 -1
  155. package/dist/providers/local.d.ts +1 -1
  156. package/dist/providers/neuralwatt.d.ts +1 -1
  157. package/dist/providers/openai-compat.d.ts +1 -1
  158. package/dist/providers/openai.d.ts +1 -1
  159. package/dist/providers/openrouter.d.ts +1 -1
  160. package/dist/providers/xai.d.ts +1 -1
  161. package/dist/{providers-Z0TaBp1O.js → providers-zVRxiJDv.js} +5 -5
  162. package/dist/providers-zVRxiJDv.js.map +1 -0
  163. package/dist/providers.d.ts +1 -1
  164. package/dist/providers.js +1 -1
  165. package/dist/{readonly-db-D7Z-k0pQ.js → readonly-db-DrbT8tX6.js} +2 -2
  166. package/dist/{readonly-db-D7Z-k0pQ.js.map → readonly-db-DrbT8tX6.js.map} +1 -1
  167. package/dist/{registry-BKjeBnoy.js → registry-CBoYDIND.js} +2 -2
  168. package/dist/{registry-BKjeBnoy.js.map → registry-CBoYDIND.js.map} +1 -1
  169. package/dist/{registry-B6Ww76iW.js → registry-CQOU5jvF.js} +2 -2
  170. package/dist/{registry-B6Ww76iW.js.map → registry-CQOU5jvF.js.map} +1 -1
  171. package/dist/{registry-B9INJwJR.js → registry-YUUqbYGr.js} +324 -39
  172. package/dist/registry-YUUqbYGr.js.map +1 -0
  173. package/dist/{remote-hosts-BMWoHCWO.js → remote-hosts-CT8Q95dR.js} +4 -4
  174. package/dist/{remote-hosts-BMWoHCWO.js.map → remote-hosts-CT8Q95dR.js.map} +1 -1
  175. package/dist/{repo-url-D4Dr8NfZ.js → repo-url-DLjjuVk_.js} +169 -2
  176. package/dist/repo-url-DLjjuVk_.js.map +1 -0
  177. package/dist/restate.d.ts +2 -2
  178. package/dist/{sandbox-BwiPGKF7.d.ts → sandbox-B4OW6oNx.d.ts} +2 -2
  179. package/dist/{sandbox-BwiPGKF7.d.ts.map → sandbox-B4OW6oNx.d.ts.map} +1 -1
  180. package/dist/script-progress-CrZ507Qq.js +900 -0
  181. package/dist/script-progress-CrZ507Qq.js.map +1 -0
  182. package/dist/session/sqlite.d.ts +1 -1
  183. package/dist/session.d.ts +1 -1
  184. package/dist/{setting-BQBSyUq0.js → setting-_jh2OtiL.js} +6 -6
  185. package/dist/{setting-BQBSyUq0.js.map → setting-_jh2OtiL.js.map} +1 -1
  186. package/dist/{settings-catalog-4IU2i_jG.js → settings-catalog-DEZlXP51.js} +14 -2
  187. package/dist/settings-catalog-DEZlXP51.js.map +1 -0
  188. package/dist/{settings-keys-iI_Y-7MC.js → settings-keys-BT0_oKjO.js} +3 -3
  189. package/dist/{settings-keys-iI_Y-7MC.js.map → settings-keys-BT0_oKjO.js.map} +1 -1
  190. package/dist/{skills-CFXRItJ6.js → skills-CEbosUlM.js} +2 -2
  191. package/dist/{skills-CFXRItJ6.js.map → skills-CEbosUlM.js.map} +1 -1
  192. package/dist/skills.d.ts +1 -1
  193. package/dist/skills.js +1 -1
  194. package/dist/{source-Bl1Z501r.js → source-3ZnEPOSa.js} +3 -2
  195. package/dist/source-3ZnEPOSa.js.map +1 -0
  196. package/dist/{sqlite-runtime-BZ2L4RaG.d.ts → sqlite-runtime-CS_LBaAN.d.ts} +2 -2
  197. package/dist/sqlite-runtime-CS_LBaAN.d.ts.map +1 -0
  198. package/dist/{src-BY_ND2xn.js → src-BmTXDta8.js} +2 -2
  199. package/dist/{src-BY_ND2xn.js.map → src-BmTXDta8.js.map} +1 -1
  200. package/dist/{store-C6gI7FfZ.js → store-ByCDaKgJ.js} +14 -3
  201. package/dist/store-ByCDaKgJ.js.map +1 -0
  202. package/dist/{system-freeze-m5o1sGIM.js → system-freeze-DxJ-lRhu.js} +3 -3
  203. package/dist/{system-freeze-m5o1sGIM.js.map → system-freeze-DxJ-lRhu.js.map} +1 -1
  204. package/dist/{todo-edits-CbukbjyV.js → todo-edits-Dyj32ds6.js} +4 -3
  205. package/dist/todo-edits-Dyj32ds6.js.map +1 -0
  206. package/dist/tools/fetch-url.d.ts +1 -1
  207. package/dist/tools/web-search.d.ts +1 -1
  208. package/dist/{tools-CVTGhggj.js → tools-BsrGQ8K4.js} +2 -2
  209. package/dist/{tools-CVTGhggj.js.map → tools-BsrGQ8K4.js.map} +1 -1
  210. package/dist/tools.d.ts +1 -1
  211. package/dist/tools.js +3 -3
  212. package/dist/{transcript-anchors-CiSi_UBn.js → transcript-anchors-DMjvyUjk.js} +3 -3
  213. package/dist/{transcript-anchors-CiSi_UBn.js.map → transcript-anchors-DMjvyUjk.js.map} +1 -1
  214. package/dist/{transcript-reconcile-jbSBjLq2.js → transcript-reconcile-DpQO85wl.js} +3 -3
  215. package/dist/{transcript-reconcile-jbSBjLq2.js.map → transcript-reconcile-DpQO85wl.js.map} +1 -1
  216. package/dist/tui.d.ts +9 -9
  217. package/dist/tui.d.ts.map +1 -1
  218. package/dist/tui.js +289 -38
  219. package/dist/tui.js.map +1 -1
  220. package/dist/{types-bDQagoiL.d.ts → types-2HrgolQz.d.ts} +20 -8
  221. package/dist/types-2HrgolQz.d.ts.map +1 -0
  222. package/dist/types-4q1bFG53.js +122 -0
  223. package/dist/types-4q1bFG53.js.map +1 -0
  224. package/dist/{types-DnRd9_cA.d.ts → types-SXqk6hLD.d.ts} +3 -3
  225. package/dist/{types-DnRd9_cA.d.ts.map → types-SXqk6hLD.d.ts.map} +1 -1
  226. package/dist/types-myxheQkw.js.map +1 -1
  227. package/dist/types.d.ts +3 -3
  228. package/dist/{usage-summary-BfcXjiSM.js → usage-summary-BM7B3JdI.js} +2 -2
  229. package/dist/{usage-summary-BfcXjiSM.js.map → usage-summary-BM7B3JdI.js.map} +1 -1
  230. package/dist/{version-DqqqvHDP.js → version-DwQI12WA.js} +2 -2
  231. package/dist/{version-DqqqvHDP.js.map → version-DwQI12WA.js.map} +1 -1
  232. package/dist/{wait-task-BX4NcOOm.js → wait-task-BiI5UaZQ.js} +13 -3
  233. package/dist/wait-task-BiI5UaZQ.js.map +1 -0
  234. package/dist/{wire-CLm2rMK0.js → wire-Dxwxb7QQ.js} +2 -2
  235. package/dist/{wire-CLm2rMK0.js.map → wire-Dxwxb7QQ.js.map} +1 -1
  236. package/dist/{write-file-0E6TUJ9A.js → write-file-Dquu7MzB.js} +5 -3
  237. package/dist/write-file-Dquu7MzB.js.map +1 -0
  238. package/dist/{ws-DfGGYQ4W.js → ws-CA3o2nie.js} +4 -4
  239. package/dist/{ws-DfGGYQ4W.js.map → ws-CA3o2nie.js.map} +1 -1
  240. package/dist/{ws-client-CFMbhsNq.js → ws-client-C0iPAAzc.js} +2 -2
  241. package/dist/{ws-client-CFMbhsNq.js.map → ws-client-C0iPAAzc.js.map} +1 -1
  242. package/docs/CHAT.md +55 -0
  243. package/docs/CODEMODE.md +37 -0
  244. package/docs/EXTENSIONS.md +8 -6
  245. package/docs/RELEASE-NOTES-NEXT.md +48 -1
  246. package/docs/RELEASE.md +9 -1
  247. package/package.json +2 -3
  248. package/dist/agent-DJhpTS-B.js.map +0 -1
  249. package/dist/auto-update-restart-BFB7Ek87.js.map +0 -1
  250. package/dist/browser-BcoCCB_n.js.map +0 -1
  251. package/dist/contexts-C72b0mMa.js.map +0 -1
  252. package/dist/decisions-CXmK0nz9.js.map +0 -1
  253. package/dist/extension-mark-BqKdEZwF.js.map +0 -1
  254. package/dist/extensions-client-D8tEAcMw.d.ts.map +0 -1
  255. package/dist/host-BHMs9jsN.js.map +0 -1
  256. package/dist/host-wO_6GW0y.js.map +0 -1
  257. package/dist/index-CGbOWa7y.d.ts.map +0 -1
  258. package/dist/json-Dj-YATkZ.js.map +0 -1
  259. package/dist/media-type-BtA0cbfI.d.ts.map +0 -1
  260. package/dist/memory-DuVGrzbl.js.map +0 -1
  261. package/dist/nested-call-events-BYk8XvGX.js +0 -182
  262. package/dist/nested-call-events-BYk8XvGX.js.map +0 -1
  263. package/dist/nested-call-record-DlzPeTB7.js.map +0 -1
  264. package/dist/prelude-CVKoUzV8.js.map +0 -1
  265. package/dist/protocol-CEVqBO-q.d.ts.map +0 -1
  266. package/dist/providers-Z0TaBp1O.js.map +0 -1
  267. package/dist/registry-B9INJwJR.js.map +0 -1
  268. package/dist/repo-url-D4Dr8NfZ.js.map +0 -1
  269. package/dist/settings-catalog-4IU2i_jG.js.map +0 -1
  270. package/dist/source-Bl1Z501r.js.map +0 -1
  271. package/dist/sqlite-runtime-BZ2L4RaG.d.ts.map +0 -1
  272. package/dist/store-C6gI7FfZ.js.map +0 -1
  273. package/dist/todo-edits-CbukbjyV.js.map +0 -1
  274. package/dist/types-DTMEhKJO.js +0 -14
  275. package/dist/types-DTMEhKJO.js.map +0 -1
  276. package/dist/types-bDQagoiL.d.ts.map +0 -1
  277. package/dist/wait-task-BX4NcOOm.js.map +0 -1
  278. package/dist/write-file-0E6TUJ9A.js.map +0 -1
  279. package/scripts/eval.ts +0 -179
@@ -404,6 +404,19 @@ interface ContextMount {
404
404
  }
405
405
  /** Kind of execution context: `process`, `docker` or `sandbox`. */
406
406
  type ContextType = 'process' | 'docker' | 'sandbox';
407
+ /** Options of {@link ExecutionContext.exec}. */
408
+ interface ExecOptions {
409
+ /** Folder to run in, resolved against the handle's. Default: the handle's folder. */
410
+ cwd?: string;
411
+ /** Variables added to the command's environment. */
412
+ env?: Record<string, string>;
413
+ /** Seconds. Default 30. */
414
+ timeout?: number;
415
+ /** Kills the command (its whole process group, in the process context) when aborted. */
416
+ signal?: AbortSignal;
417
+ /** Output as it arrives, decoded per stream. A chunk can end mid-line. */
418
+ onOutput?: (stream: 'stdout' | 'stderr', text: string) => void;
419
+ }
407
420
  /** An environment where an agent runs commands and reads and writes files: the host process, a Docker container or a remote sandbox. */
408
421
  interface ExecutionContext {
409
422
  /** Context type identifier */
@@ -433,13 +446,12 @@ interface ExecutionContext {
433
446
  * with coreutils `timeout`, sandbox SDKs take seconds/ms per their API).
434
447
  * Documented here because the unit is invisible at call sites and a
435
448
  * caller assuming milliseconds would set an instant-kill timeout.
449
+ *
450
+ * `onOutput` hears the output as it arrives, decoded, before the result
451
+ * settles (a UI showing a running command). Optional for implementations:
452
+ * one that cannot stream calls it never, and the result is the same.
436
453
  */
437
- exec: (handle: ExecutionHandle, command: string, options?: {
438
- cwd?: string;
439
- env?: Record<string, string>;
440
- timeout?: number;
441
- signal?: AbortSignal;
442
- }) => Promise<ExecResult>;
454
+ exec: (handle: ExecutionHandle, command: string, options?: ExecOptions) => Promise<ExecResult>;
443
455
  /**
444
456
  * Start a process in the background. Settles as soon as `spawn` returns
445
457
  * — does NOT wait for the child to exit. Stdout + stderr stream
@@ -951,5 +963,5 @@ interface TaskStallInfo {
951
963
  bytesWritten: number;
952
964
  }
953
965
  //#endregion
954
- export { resolveWritableRootsAsync as A, TerminalProcess as C, isolationAvailability as D, IsolationPolicy as E, parseAllowWriteSetting as O, TerminalOptions as S, IsolationBackend as T, StreamHandle as _, ContextMount as a, TaskHandle as b, EntryKind as c, ExecutionContext as d, ExecutionHandle as f, SpawnConfig as g, ListFilesOptions as h, ContextHardening as i, resolveWritableRoots as k, EntryPort as l, ListFilesEntry as m, BackgroundTerminalOptions as n, ContextType as o, ListFileMetadata as p, ContextCapabilities as r, DetachedTasksCapability as s, BackgroundTaskStatus as t, ExecResult as u, TaskEntry as v, resolveDetachedTasksCapability as w, TaskStallInfo as x, TaskExitInfo as y };
955
- //# sourceMappingURL=types-bDQagoiL.d.ts.map
966
+ export { resolveWritableRoots as A, TerminalOptions as C, IsolationPolicy as D, IsolationBackend as E, isolationAvailability as O, TaskStallInfo as S, resolveDetachedTasksCapability as T, SpawnConfig as _, ContextMount as a, TaskExitInfo as b, EntryKind as c, ExecResult as d, ExecutionContext as f, ListFilesOptions as g, ListFilesEntry as h, ContextHardening as i, resolveWritableRootsAsync as j, parseAllowWriteSetting as k, EntryPort as l, ListFileMetadata as m, BackgroundTerminalOptions as n, ContextType as o, ExecutionHandle as p, ContextCapabilities as r, DetachedTasksCapability as s, BackgroundTaskStatus as t, ExecOptions as u, StreamHandle as v, TerminalProcess as w, TaskHandle as x, TaskEntry as y };
967
+ //# sourceMappingURL=types-2HrgolQz.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-2HrgolQz.d.ts","names":[],"sources":["../src/contexts/isolation.ts","../src/contexts/types.ts"],"mappings":";;;UAoCiB;;;;;;;EAOf;;;;;;;EAOA;;;;;EAKA;;;KAIU;KA2CA;EAA0B;EAAU,SAAS;EAAkB;;EAAyB;EAAW;;;;;;;;;;;iBAgC/F,sBACd,WAAU,OAAO,UACjB,MAAK,OAAO,aACX;;;;;;;;;;iBAqCa,uBAAuB,aAAa,aAAa;UAuDhD;;EAEf;EACA,MAAM,OAAO;EACb,WAAW,OAAO;;;;;;EAMlB,gBAAgB;;;;;;;;;;iBAiFF,qBAAqB,aAAa,UAAS;;;;;;iBAUrC,0BACpB,aACA,UAAS,KAAK;EAAiD,gBAAgB,gBAAgB;IAC9F;;;;;;;;;;;;;;;;;;KC9SS;;UAGK;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;EAWA;;;;;;;;EAQA;;;;;;;EAOA,gBAAgB;;;;;;;;iBASF,+BAA+B,SAAS,mBAAmB;;UAU1D;;EAEf;;EAEA,MAAM;;EAEN;;;UAQe;;EAEf;;EAEA;;EAEA;;;KAIU;;;;;;;UAQK;;EAEf,OAA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;;;;;;;;;KAa1E;;;;;;;;;UAUK;;;;;;;EAOf;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;UAce;;EAEf;;;;;;;;;;;;;;;;;;;;;;EAsBA,QAAQ,cAAc;;;;;;;;EAQtB,SAAS,cAAc;;EAEvB,QAAQ,MAAM,eAAe;;EAE7B,YAAY;;;;;EAKZ,QAAQ;;;;;;;;;;;;UAaO;;EAEf;;EAEA,QAAQ,QAAQ;;EAEhB;;EAEA,SAAS,OAAO;;EAEhB;;EAEA;;EAEA;;;;;;;UAQe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;EAMA;;EAEA;;EAEA,QAAQ;;EAER;;EAEA,SAAS,OAAO;;EAEhB;;;;;;;;UASe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA"}
@@ -0,0 +1,122 @@
1
+ //#region src/contexts/ansi-strip.ts
2
+ /** Parser states: plain text, after ESC, in a CSI, in an OSC/DCS string, after ESC inside one. */
3
+ const State = {
4
+ Text: 0,
5
+ Esc: 1,
6
+ Csi: 2,
7
+ Str: 3,
8
+ StrEsc: 4
9
+ };
10
+ /** Runs of plain text at least this long are appended in one slice; shorter ones char by char, which is cheaper for them. */
11
+ const SLICE_MIN = 4;
12
+ /** Printable text, appended to the line as is: tab, or neither a control (C0, DEL, C1) nor ESC. */
13
+ const isPlain = (code) => code === 9 || code >= 32 && (code < 127 || code >= 160);
14
+ function createAnsiStripper(options = {}) {
15
+ let state = State.Text;
16
+ /** Body of the OSC / DCS / APC string being read; OSC only is kept. */
17
+ let str = "";
18
+ let strIsOsc = false;
19
+ let line = "";
20
+ /** A `\r` arrived; the next printable rewinds the line unless `\n` follows. */
21
+ let pendingCr = false;
22
+ /** Part of the current line was handed out by `takePartial`: a rewind must start a new line. */
23
+ let taken = false;
24
+ const endString = () => {
25
+ if (strIsOsc && options.onTitle) {
26
+ const semi = str.indexOf(";");
27
+ const code = semi === -1 ? str : str.slice(0, semi);
28
+ if ((code === "0" || code === "2") && semi !== -1) options.onTitle(str.slice(semi + 1));
29
+ }
30
+ str = "";
31
+ state = State.Text;
32
+ };
33
+ return {
34
+ push(chunk) {
35
+ let out = "";
36
+ for (let i = 0; i < chunk.length; i++) {
37
+ const ch = chunk[i];
38
+ const code = ch.charCodeAt(0);
39
+ switch (state) {
40
+ case State.Text:
41
+ if (code === 27) state = State.Esc;
42
+ else if (ch === "\n") {
43
+ out += `${line}\n`;
44
+ line = "";
45
+ pendingCr = false;
46
+ taken = false;
47
+ } else if (ch === "\r") pendingCr = true;
48
+ else if (code === 8) line = line.slice(0, -1);
49
+ else if (code === 155) state = State.Csi;
50
+ else if (code === 157) {
51
+ state = State.Str;
52
+ strIsOsc = true;
53
+ } else if (ch === " " || code >= 32) {
54
+ if (code >= 127 && code < 160) break;
55
+ if (pendingCr) {
56
+ if (taken) out += "\n";
57
+ taken = false;
58
+ line = "";
59
+ pendingCr = false;
60
+ }
61
+ let end = i + 1;
62
+ while (end < chunk.length && isPlain(chunk.charCodeAt(end))) end++;
63
+ if (end - i < SLICE_MIN) for (let k = i; k < end; k++) line += chunk[k];
64
+ else line += chunk.slice(i, end);
65
+ i = end - 1;
66
+ }
67
+ break;
68
+ case State.Esc:
69
+ if (ch === "[") state = State.Csi;
70
+ else if (ch === "]" || ch === "P" || ch === "X" || ch === "^" || ch === "_") {
71
+ state = State.Str;
72
+ strIsOsc = ch === "]";
73
+ str = "";
74
+ } else if (code >= 32 && code <= 47) {} else state = State.Text;
75
+ break;
76
+ case State.Csi:
77
+ if (code >= 64 && code <= 126) state = State.Text;
78
+ break;
79
+ case State.Str:
80
+ if (code === 7) endString();
81
+ else if (code === 27) state = State.StrEsc;
82
+ else if (code === 156) endString();
83
+ else if (str.length < 4096) str += ch;
84
+ break;
85
+ case State.StrEsc: if (ch === "\\") endString();
86
+ else {
87
+ str += `\x1B${ch}`;
88
+ state = State.Str;
89
+ }
90
+ }
91
+ }
92
+ return out;
93
+ },
94
+ partial: () => line,
95
+ takePartial() {
96
+ const text = line;
97
+ if (text) taken = true;
98
+ line = "";
99
+ return text;
100
+ }
101
+ };
102
+ }
103
+ /** One-shot convenience: the plain text of a complete chunk of terminal output. */
104
+ function stripAnsi(text) {
105
+ const s = createAnsiStripper();
106
+ return s.push(text) + s.partial();
107
+ }
108
+ //#endregion
109
+ //#region src/contexts/types.ts
110
+ /**
111
+ * Effective {@link DetachedTasksCapability} of a context, with the
112
+ * backward-compatible inference for contexts that predate the field.
113
+ *
114
+ * @param context - Execution context to inspect.
115
+ */
116
+ function resolveDetachedTasksCapability(context) {
117
+ return context.capabilities.detachedTasks ?? (context.execBackground ? "process-lifetime" : "none");
118
+ }
119
+ //#endregion
120
+ export { createAnsiStripper as n, stripAnsi as r, resolveDetachedTasksCapability as t };
121
+
122
+ //# sourceMappingURL=types-4q1bFG53.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-4q1bFG53.js","names":[],"sources":["../src/contexts/ansi-strip.ts","../src/contexts/types.ts"],"sourcesContent":["/**\n * Terminal output → plain text, incrementally. A PTY emits colors, cursor\n * moves, titles and carriage-return redraws; a model (or a log file) wants\n * the words. Sequences may be split across chunks, so the parser keeps its\n * state between `push` calls.\n *\n * Line semantics follow what a person sees on a terminal, roughly: `\\r\\n`\n * ends a line, a lone `\\r` rewinds it (a progress bar redraws in place, so\n * only its last state survives), backspace erases a character. Anything\n * fancier (cursor addressing in full-screen apps) is dropped, not replayed.\n */\n\nexport interface AnsiStripper {\n /** Feed raw output; returns the lines it completed (each ends with `\\n`). */\n push: (chunk: string) => string\n /** The line being written, not yet ended. */\n partial: () => string\n /**\n * Hand out the unfinished line and treat it as written: a later rewind\n * starts a fresh line instead of editing text that is already out. For\n * logs that must show a prompt waiting on the same line.\n */\n takePartial: () => string\n}\n\nexport interface AnsiStripperOptions {\n /** Window title set by the program (OSC 0 / 2), e.g. the running command. */\n onTitle?: (title: string) => void\n}\n\n/** Parser states: plain text, after ESC, in a CSI, in an OSC/DCS string, after ESC inside one. */\nconst State = { Text: 0, Esc: 1, Csi: 2, Str: 3, StrEsc: 4 } as const\n\n/** Runs of plain text at least this long are appended in one slice; shorter ones char by char, which is cheaper for them. */\nconst SLICE_MIN = 4\n\n/** Printable text, appended to the line as is: tab, or neither a control (C0, DEL, C1) nor ESC. */\nconst isPlain = (code: number) => code === 0x09 || (code >= 0x20 && (code < 0x7F || code >= 0xA0))\n\nexport function createAnsiStripper(options: AnsiStripperOptions = {}): AnsiStripper {\n let state: (typeof State)[keyof typeof State] = State.Text\n /** Body of the OSC / DCS / APC string being read; OSC only is kept. */\n let str = ''\n let strIsOsc = false\n let line = ''\n /** A `\\r` arrived; the next printable rewinds the line unless `\\n` follows. */\n let pendingCr = false\n /** Part of the current line was handed out by `takePartial`: a rewind must start a new line. */\n let taken = false\n\n const endString = () => {\n if (strIsOsc && options.onTitle) {\n const semi = str.indexOf(';')\n const code = semi === -1 ? str : str.slice(0, semi)\n if ((code === '0' || code === '2') && semi !== -1)\n options.onTitle(str.slice(semi + 1))\n }\n str = ''\n state = State.Text\n }\n\n return {\n push(chunk) {\n let out = ''\n for (let i = 0; i < chunk.length; i++) {\n const ch = chunk[i]!\n const code = ch.charCodeAt(0)\n switch (state) {\n case State.Text:\n if (code === 0x1B) {\n state = State.Esc\n }\n else if (ch === '\\n') {\n out += `${line}\\n`\n line = ''\n pendingCr = false\n taken = false\n }\n else if (ch === '\\r') {\n pendingCr = true\n }\n else if (code === 0x08) {\n line = line.slice(0, -1)\n }\n else if (code === 0x9B) {\n state = State.Csi\n }\n else if (code === 0x9D) {\n state = State.Str\n strIsOsc = true\n }\n else if (ch === '\\t' || code >= 0x20) {\n if (code >= 0x7F && code < 0xA0)\n break\n if (pendingCr) {\n if (taken)\n out += '\\n'\n taken = false\n line = ''\n pendingCr = false\n }\n let end = i + 1\n while (end < chunk.length && isPlain(chunk.charCodeAt(end)))\n end++\n if (end - i < SLICE_MIN) {\n for (let k = i; k < end; k++) line += chunk[k]\n }\n else {\n line += chunk.slice(i, end)\n }\n i = end - 1\n }\n break\n case State.Esc:\n if (ch === '[') {\n state = State.Csi\n }\n else if (ch === ']' || ch === 'P' || ch === 'X' || ch === '^' || ch === '_') {\n state = State.Str\n strIsOsc = ch === ']'\n str = ''\n }\n else if (code >= 0x20 && code <= 0x2F) {\n // intermediate (e.g. `ESC ( B` charset): swallow the final byte next\n }\n else {\n state = State.Text\n }\n break\n case State.Csi:\n // parameters / intermediates until a final byte in @..~\n if (code >= 0x40 && code <= 0x7E)\n state = State.Text\n break\n case State.Str:\n if (code === 0x07) {\n endString()\n }\n else if (code === 0x1B) {\n state = State.StrEsc\n }\n else if (code === 0x9C) {\n endString()\n }\n else if (str.length < 4096) {\n str += ch\n }\n break\n case State.StrEsc:\n if (ch === '\\\\') {\n endString()\n }\n else {\n str += `\\x1B${ch}`\n state = State.Str\n }\n break\n }\n }\n return out\n },\n partial: () => line,\n takePartial() {\n const text = line\n if (text)\n taken = true\n line = ''\n return text\n },\n }\n}\n\n/** One-shot convenience: the plain text of a complete chunk of terminal output. */\nexport function stripAnsi(text: string): string {\n const s = createAnsiStripper()\n return s.push(text) + s.partial()\n}\n","/**\n * Execution context types.\n *\n * An execution context defines *where* and *how* an agent's tools run.\n * The agent loop and tools interact through this interface without knowing\n * whether they're running in-process, in a Docker container, or in a\n * remote sandbox.\n */\n\nimport type { Buffer } from 'node:buffer'\nimport type { IsolationPolicy } from './isolation'\n\n// ---------------------------------------------------------------------------\n// Capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Lifetime guarantee of background tasks started through\n * {@link ExecutionContext.execBackground}.\n *\n * - `'none'` — the context cannot detach tasks at all.\n * - `'process-lifetime'` — tasks live as long as the HOST process; a\n * crash/restart of the host orphans or kills them (`ProcessContext`).\n * - `'durable'` — tasks live on a remote runner and survive host process\n * death (remote execution contexts driven by durable runtimes).\n *\n * Durable-execution runtimes consult this to decide whether backgrounding\n * is safe to expose (`disableBackgroundTasks: 'non-durable'`, the default\n * in replay mode): a `'durable'` context keeps its tasks across worker\n * crashes, so there is no reason to strip the capability from the model.\n */\nexport type DetachedTasksCapability = 'none' | 'process-lifetime' | 'durable'\n\n/** Features an execution context supports. Consumers check these before relying on a feature. */\nexport interface ContextCapabilities {\n /** Can execute shell commands */\n shell: boolean\n /** Can read/write files in a workspace */\n filesystem: boolean\n /** Can enumerate glob matches through `ExecutionContext.listFiles(..., { glob: true })`. */\n glob?: boolean\n /** Can make outbound network requests */\n network: boolean\n /** Has GPU access */\n gpu: boolean\n /**\n * Can open a bidirectional byte stream to a long-lived process through\n * {@link ExecutionContext.execStream}. Absent / `false` = the context\n * only supports the buffered {@link ExecutionContext.exec} and (maybe)\n * the write-to-a-log-file {@link ExecutionContext.execBackground}.\n *\n * Consumers that NEED live stdin (stdio MCP servers routed into the\n * context) must check this before calling; the seam is optional so\n * contexts backed by a request/response-only API stay valid.\n */\n stream?: boolean\n /**\n * Shell commands run under an ENFORCED OS-level sandbox (macOS Seatbelt /\n * Linux bwrap) — see `SpawnConfig.isolation`. `false` when isolation was\n * not requested AND when it was requested but the backend is unavailable\n * (that context fails every command closed instead). Absent / `false` =\n * commands do not run sandboxed.\n */\n isolated?: boolean\n /**\n * Background-task lifetime guarantee. Optional for backward\n * compatibility — when absent, callers infer `'process-lifetime'`\n * if the context implements `execBackground`, `'none'` otherwise\n * (see {@link resolveDetachedTasksCapability}).\n */\n detachedTasks?: DetachedTasksCapability\n}\n\n/**\n * Effective {@link DetachedTasksCapability} of a context, with the\n * backward-compatible inference for contexts that predate the field.\n *\n * @param context - Execution context to inspect.\n */\nexport function resolveDetachedTasksCapability(context: ExecutionContext): DetachedTasksCapability {\n return context.capabilities.detachedTasks\n ?? (context.execBackground ? 'process-lifetime' : 'none')\n}\n\n// ---------------------------------------------------------------------------\n// Execution handle\n// ---------------------------------------------------------------------------\n\n/** Opaque handle to a running execution context instance */\nexport interface ExecutionHandle {\n /** Identifier of the spawned instance, unique within its context. */\n id: string\n /** Type of the context that created the handle. */\n type: ContextType\n /** Working directory within the context */\n cwd: string\n}\n\n// ---------------------------------------------------------------------------\n// Exec result\n// ---------------------------------------------------------------------------\n\n/** Result of a buffered command. */\nexport interface ExecResult {\n /** Captured standard output. */\n stdout: string\n /** Captured standard error. */\n stderr: string\n /** Process exit code. `0` means success. */\n exitCode: number\n}\n\n/** What a path is: a file (a symlink counts as one, never followed) or a folder. */\nexport type EntryKind = 'file' | 'dir'\n\n/**\n * The few file operations every entry action is built from\n * (`createEntryOps`, `zidane/chat`), paths resolved like the context's\n * other file methods. None of them overwrites: a target is checked missing\n * first, and the operations refuse one that appeared since.\n */\nexport interface EntryPort {\n /** What `path` is, `null` when nothing is there. Never follows a final symlink. */\n stat: (path: string) => Promise<EntryKind | null>\n /** The names in folder `path`. */\n list: (path: string) => Promise<string[]>\n /** Creates folder `path` and its missing parents. */\n mkdir: (path: string) => Promise<void>\n /** Writes a new file (its folder exists). */\n write: (path: string, bytes: Uint8Array) => Promise<void>\n /** Renames `from` to `to` (missing; its folder exists). */\n move: (from: string, to: string) => Promise<void>\n /** Copies `from` (a folder whole, symlinks as links) to `to` (missing; its folder exists). */\n copy: (from: string, to: string) => Promise<void>\n /** Removes `path` (a folder whole). */\n remove: (path: string) => Promise<void>\n /** Empty folders under folder `path` (`.git` and `node_modules` skipped), relative to it, at most `limit`. */\n emptyDirs: (path: string, limit: number) => Promise<string[]>\n}\n\n/** A listed file with optional metadata. */\nexport interface ListFileMetadata {\n /** Path of the file. */\n path: string\n /** Size in bytes. */\n size?: number\n /** Last modification time, in milliseconds since the epoch. */\n mtimeMs?: number\n}\n\n/** One listing entry: a plain path, or a {@link ListFileMetadata} object when metadata was requested. */\nexport type ListFilesEntry = string | ListFileMetadata\n\n/** Options for {@link ExecutionContext.listFiles}. */\nexport interface ListFilesOptions {\n /** Treat `path` as a glob match pattern instead of a literal directory path. */\n glob?: boolean\n /** Maximum number of entries to return. */\n limit?: number\n /** Return {@link ListFileMetadata} objects instead of plain paths. */\n metadata?: boolean\n /**\n * Skip git-ignored files when globbing. Default `true`. Contexts that can\n * resolve git's ignore rules (e.g. the local process context) honor it; the\n * rest treat it as a no-op. Set `false` to match every file, ignored or not.\n */\n gitignore?: boolean\n /** Abort the listing early — forwarded from the calling tool's `ctx.signal`. */\n signal?: AbortSignal\n}\n\n// ---------------------------------------------------------------------------\n// Spawn config\n// ---------------------------------------------------------------------------\n\n/** Configuration for {@link ExecutionContext.spawn}. Not every context honors every field. */\nexport interface SpawnConfig {\n /** Working directory (created if it doesn't exist) */\n cwd?: string\n /**\n * Optional workspace-containment root for the file methods (`readFile`,\n * `writeFile`, `listFiles`) of the process context.\n *\n * When set, a resolved path that escapes this root (via absolute path,\n * `..`, or a symlink pointing outside) is rejected before any I/O. Default\n * unset = no containment (back-compat; the agent can read/write anywhere\n * the host process can). Set this for untrusted workloads to confine file\n * tools to a directory. Shell commands are not covered — use a sandbox /\n * docker context for full isolation.\n */\n workspaceRoot?: string\n /** Environment variables */\n env?: Record<string, string>\n /**\n * Whether spawned shells inherit the parent `process.env` (process context).\n *\n * Default `true` (preserves existing behavior — children see the parent\n * environment including anything Bun auto-loaded from `.env`). Set `false`\n * for untrusted workloads so secrets in the parent environment aren't\n * readable by tool commands; only `env` / per-call env plus a minimal base\n * (`PATH`, `HOME`, `SHELL`, `LANG`, `LC_ALL`, `USER`, `TERM`, `TMPDIR`) are\n * passed through.\n */\n inheritEnv?: boolean\n /**\n * OS-level sandboxing of shell commands (process context only). When set,\n * every `exec` / `execStream` / `execBackground` runs `/bin/sh -c` under\n * macOS `sandbox-exec` or Linux `bwrap`: filesystem writes are limited to\n * `writableRoots`, credential directories are hidden, and network is\n * `allow`ed or `deny`ed as a whole. `writeFile` applies the same\n * `writableRoots` check in-process (reads are unrestricted — this is the\n * Claude Code / Codex boundary, not a full jail; use `workspaceRoot` for\n * read containment).\n *\n * Fails closed: when the backend is unavailable on the host, every command\n * returns exit 127 with the reason instead of running unsandboxed.\n *\n * Build the policy with `resolveWritableRoots` from `contexts/isolation`.\n */\n isolation?: IsolationPolicy\n /**\n * The session this context runs commands for (process context only): each\n * command it starts (`exec`, `execStream`, `execBackground`) is recorded in\n * the session-process registry (`listSessionProcesses`) while it runs.\n */\n sessionId?: string\n /** Docker image (only for 'docker' context) */\n image?: string\n /** Docker container name prefix (only for 'docker' context) */\n name?: string\n /** Host paths mounted into the context (only for 'docker' context today) */\n mounts?: ContextMount[]\n /** Resource limits */\n limits?: {\n /** Memory limit in MB */\n memory?: number\n /** CPU limit (e.g. '1.0' = 1 core) */\n cpu?: string\n /**\n * Timeout in seconds. The process and docker contexts use it as the\n * default for each `exec` call that passes no `timeout`. The e2b\n * context uses it as the sandbox lifetime.\n */\n timeout?: number\n }\n /** Sandbox provider config (only for 'sandbox' context) */\n sandbox?: {\n provider: string\n apiKey?: string\n /**\n * Attach to a pre-existing sandbox by id rather than creating one\n * (provider-specific; E2B maps it to `Sandbox.connect`). The provider\n * leaves a connected sandbox running on teardown.\n */\n sandboxId?: string\n [key: string]: unknown\n }\n\n /**\n * How long `destroy()` waits for a SIGTERM'd background task to settle\n * before escalating to SIGKILL and abandoning the wait (process context\n * only). Bounds `agent.destroy()` against tasks that trap SIGTERM or\n * whose stdio pipes are held open by escaped grandchildren.\n *\n * Default: `5000`.\n */\n destroyGraceMs?: number\n\n /**\n * Publish container ports on the host (docker context only).\n *\n * Each entry maps a container port to either an explicit host port or\n * (when `host` is omitted) a Docker-assigned random port. Retrieve the\n * actual host port at runtime via `getMappedPort(handle, containerPort)`\n * on the docker context.\n */\n ports?: Array<{ container: number, host?: number, proto?: 'tcp' | 'udp' }>\n\n /**\n * UID/GID the container should run as (docker context only).\n *\n * Accepts the same forms Docker's `--user` does: `uid`, `uid:gid`, or a\n * named user that exists in the image. Default is the image's default\n * user (typically root). Setting this to the host user's `uid:gid`\n * avoids the EACCES-on-cleanup problem when sharing a workspace via\n * a `shared` mount.\n */\n user?: string\n\n /**\n * User-defined Docker network to join (docker context only).\n *\n * Defaults to Docker's default bridge. Use a user network when you\n * need multiple sibling containers (e.g. agent + database + dev\n * server) to discover each other by name.\n */\n network?: string\n\n /**\n * Docker labels to attach to the container (docker context only).\n *\n * Useful for ownership tracking — callers can sweep abandoned\n * containers (e.g. from a crashed parent process) by filtering on\n * a label they own: `docker ps -aq --filter label=my-app=true`.\n */\n labels?: Record<string, string>\n\n /**\n * Container hardening options (docker context only).\n *\n * All fields are opt-in and OFF by default to preserve existing behavior\n * (containers run with the image's default user/capabilities). Enable them\n * for untrusted workloads. `dropAllCapabilities` and a non-root `user`\n * (see {@link SpawnConfig.user}) can break images that expect root or\n * specific capabilities, so they are not applied unless requested.\n */\n hardening?: ContextHardening\n}\n\n/**\n * Opt-in container hardening for the docker context. Every field defaults to\n * \"unset\" so an omitted `hardening` (or omitted field) leaves the container\n * unrestricted.\n */\nexport interface ContextHardening {\n /**\n * Drop all Linux capabilities (`CapDrop: ['ALL']`). Strong isolation, but\n * breaks images needing capabilities (e.g. binding low ports, `ping`).\n * Default: `false`.\n */\n dropAllCapabilities?: boolean\n /**\n * Set `no-new-privileges` so processes can't gain privileges via setuid\n * binaries. Low blast radius; safe for most workloads. Default: `false`.\n */\n noNewPrivileges?: boolean\n /**\n * Mount the container root filesystem read-only. Pair with writable mounts\n * for scratch space. Default: `false`.\n */\n readonlyRootfs?: boolean\n /**\n * Max number of processes (`PidsLimit`) — caps fork-bombs. Default: unset\n * (no limit). A few hundred is usually plenty for an agent sandbox.\n */\n pidsLimit?: number\n}\n\n/** A host directory bind-mounted into an execution context. */\nexport interface ContextMount {\n /** Absolute host path to mount. */\n source: string\n /** Absolute path inside the execution context. */\n target: string\n /** Mount read-only. Defaults to false for Docker's native bind behavior. */\n readonly?: boolean\n /**\n * Apply the SELinux shared label (`:z`) so the host user and the container\n * user can both read/write the mount (docker context only). No-op on\n * non-SELinux hosts. Combine with `SpawnConfig.user` to avoid root-owned\n * files leaking onto the host. Mutually exclusive with `readonly`.\n */\n shared?: boolean\n}\n\n// ---------------------------------------------------------------------------\n// Execution context interface\n// ---------------------------------------------------------------------------\n\n/** Kind of execution context: `process`, `docker` or `sandbox`. */\nexport type ContextType = 'process' | 'docker' | 'sandbox'\n\n/** Options of {@link ExecutionContext.exec}. */\nexport interface ExecOptions {\n /** Folder to run in, resolved against the handle's. Default: the handle's folder. */\n cwd?: string\n /** Variables added to the command's environment. */\n env?: Record<string, string>\n /** Seconds. Default 30. */\n timeout?: number\n /** Kills the command (its whole process group, in the process context) when aborted. */\n signal?: AbortSignal\n /** Output as it arrives, decoded per stream. A chunk can end mid-line. */\n onOutput?: (stream: 'stdout' | 'stderr', text: string) => void\n}\n\n/** An environment where an agent runs commands and reads and writes files: the host process, a Docker container or a remote sandbox. */\nexport interface ExecutionContext {\n /** Context type identifier */\n readonly type: ContextType\n\n /** What this context supports */\n readonly capabilities: ContextCapabilities\n\n /** Spawn a new execution environment */\n spawn: (config?: SpawnConfig) => Promise<ExecutionHandle>\n\n /**\n * Execute a shell command in the context.\n *\n * `signal` propagates abort all the way down to the underlying child\n * process — the implementation is expected to wire it into whatever\n * spawn primitive it uses so the OS receives a SIGTERM (or equivalent)\n * when the caller aborts. Without it, a cancelled tool returns its\n * cancellation marker to the model but the underlying process keeps\n * running in the background, orphaning compute / locks / IO. Pass\n * `ctx.signal` from a tool body to inherit the per-call + run-level\n * abort union; pass a freshly-built one for a host-driven kill.\n *\n * Implementations are free to ignore `signal` (the contract degrades\n * gracefully — the process simply won't be killed), but the process\n * context honors it.\n *\n * `timeout` is in SECONDS (default 30) — every\n * implementation converts internally (process ×1000 to ms, docker wraps\n * with coreutils `timeout`, sandbox SDKs take seconds/ms per their API).\n * Documented here because the unit is invisible at call sites and a\n * caller assuming milliseconds would set an instant-kill timeout.\n *\n * `onOutput` hears the output as it arrives, decoded, before the result\n * settles (a UI showing a running command). Optional for implementations:\n * one that cannot stream calls it never, and the result is the same.\n */\n exec: (handle: ExecutionHandle, command: string, options?: ExecOptions) => Promise<ExecResult>\n\n /**\n * Start a process in the background. Settles as soon as `spawn` returns\n * — does NOT wait for the child to exit. Stdout + stderr stream\n * interleaved to the file at the returned `outputPath`. The caller\n * (typically the agent) reads incremental output via the regular\n * {@link ExecutionContext.readFile} seam.\n *\n * Optional — contexts without background support (some remote sandboxes)\n * just don't implement it. The shell tool surfaces a clean\n * \"background mode is not supported in this execution context\" error\n * when this is undefined.\n *\n * `onExit` is called once when the child terminates (natural, killed,\n * or error). The same instance that called `execBackground` is the\n * exclusive owner of the callback — it's not a multi-cast bus. Hosts\n * wire this to the agent's pending-notification queue so the model\n * gets a `<task-notification>` on its next turn.\n *\n * `onExit` is OPTIONAL: remote / durable contexts may have no legal\n * way to push a callback from a timer back into the host (a replay\n * journal, for instance, forbids out-of-band writes). Such contexts\n * record the exit in their registry; the agent loop reconciles\n * by polling {@link ExecutionContext.listBackground} at run\n * boundaries, where a host journal wrapper is legal (the\n * `background:reconcile` hook is the journalable seam).\n *\n * See `docs/RUN_IN_BACKGROUND.md` for the broader design contract\n * (file location, replay semantics, suppression rules).\n */\n execBackground?: (\n handle: ExecutionHandle,\n command: string,\n options: {\n cwd?: string\n env?: Record<string, string>\n /**\n * Absolute directory the context appends `<task-id>.log` to. The\n * agent owns this path because it carries session-shaped knowledge\n * (`<userDir>/tasks/<sessionId>/`) the context can't synthesize.\n * Must already exist OR be creatable by the context — the\n * implementation handles `mkdir -p` defensively.\n */\n outputDir: string\n /** Push-style exit callback. Optional — see the method doc. */\n onExit?: (info: TaskExitInfo) => void\n /**\n * Cap on bytes written to the output file. Beyond the cap the\n * process KEEPS RUNNING; further output is counted but dropped,\n * and a `<output-truncated bytes-dropped=\"N\"/>` marker is\n * appended when the task settles. Unset / non-positive = no cap.\n */\n maxOutputBytes?: number\n /**\n * Stall watchdog: when the task produces no output for this many\n * milliseconds, `onStall` fires ONCE (one-shot — re-arms only\n * after fresh output arrives). The process is NOT killed; the\n * consumer decides (typically by telling the model the task may\n * be stuck at an interactive prompt). Unset = no watchdog.\n */\n stallTimeoutMs?: number\n /** One-shot stall callback — see `stallTimeoutMs`. */\n onStall?: (info: TaskStallInfo) => void\n /**\n * Run the task in a terminal — see {@link BackgroundTerminalOptions}.\n * Contexts without terminal support ignore it and use pipes; check\n * {@link TaskHandle.terminal} to know which one happened.\n */\n terminal?: BackgroundTerminalOptions\n },\n ) => Promise<TaskHandle>\n\n /**\n * Open a LIVE bidirectional byte stream to a long-lived process in the\n * context. The third execution mode, alongside the buffered `exec`\n * (request/response) and `execBackground` (fire-and-forget into a log\n * file): neither of those can carry a protocol that interleaves reads\n * and writes over the child's lifetime.\n *\n * Motivating consumer: stdio MCP servers. An MCP server is an ordinary\n * process doing `fs.readFileSync` / `fs.writeFile` against whatever\n * filesystem it was spawned on. Spawned on the host (the default — see\n * `McpServerConfig.scope`) it sees the HOST filesystem while the agent's\n * own tools see the context's, so the two disagree about what a path\n * means. Routing the server through this seam puts both on the same\n * filesystem.\n *\n * Optional — a context backed by a request/response-only API can't\n * implement it. Advertise support via `capabilities.stream`; callers\n * check that (or `execStream !== undefined`) and degrade with a clear\n * error rather than silently falling back to a host spawn, which would\n * reintroduce exactly the split this seam exists to close.\n *\n * IMPLEMENTOR CONTRACT — the shape is deliberately the SUPERSET of what\n * the backing APIs can do, because they do not agree:\n *\n * - `stdout` / `stderr` are byte streams, never pre-decoded strings.\n * A provider SDK that hands back `string` has already destroyed any\n * multibyte codepoint split across a chunk boundary; the caller\n * needs the raw bytes to run its own streaming decoder.\n * - `stderr` is OPTIONAL because a PTY-backed context physically\n * cannot separate it — one terminal, one stream. Such contexts\n * redirect the child's stderr to a file; they may then surface it\n * here out-of-band (the Daytona context polls that file back), but\n * they are not obliged to, so consumers must tolerate its absence.\n * - A PTY-backed context MUST also neutralise terminal semantics\n * before the child's first byte (echo of everything written to\n * stdin, `\\n`→`\\r\\n` rewriting, and the ~4096-byte canonical-mode\n * line cap that arbitrary protocol frames exceed). In practice:\n * launch through `stty raw -echo; exec <cmd> 2><file>`.\n * - `exited` resolves with the exit code. On a PTY the child is an\n * interactive shell that never exits on its own, so `kill()` is\n * the normal termination path, not an abnormal one.\n * - Providers that impose a default command timeout (E2B and Daytona\n * both default to 60s) MUST disable or maximise it here. A stream\n * opened by this method is expected to live for the whole session.\n */\n execStream?: (\n handle: ExecutionHandle,\n command: string,\n options?: {\n cwd?: string\n env?: Record<string, string>\n /** Aborts startup and kills the child once running. */\n signal?: AbortSignal\n },\n ) => Promise<StreamHandle>\n\n /**\n * Open an interactive terminal (a PTY running the user's login shell) in\n * the context: on the host, in the container, in the sandbox. For people,\n * not protocols: the opposite of {@link execStream}, which defeats every\n * terminal semantic this one keeps (echo, line editing, job control,\n * window size).\n *\n * Optional: a context without a PTY primitive (or a runtime without one:\n * the local contexts need Bun) leaves it undefined, and callers offer no\n * terminal rather than falling back to a host shell.\n */\n openTerminal?: (handle: ExecutionHandle, options: TerminalOptions) => Promise<TerminalProcess>\n\n /**\n * Re-attach to a terminal opened earlier, by its {@link TerminalProcess.id},\n * after the host lost the connection (daemon restart, paused sandbox).\n * Resolves `null` when it is gone. Only contexts whose terminals outlive\n * the host (remote sandboxes) implement it.\n */\n reconnectTerminal?: (handle: ExecutionHandle, id: string, options: TerminalOptions) => Promise<TerminalProcess | null>\n\n /**\n * SIGTERM the whole process group of a running background task.\n * Idempotent — second call returns `null` (or the cached exit info).\n * Resolves once the process has exited AND its output stream has\n * been flushed + closed.\n *\n * `null` return on miss (unknown id, already cleaned up) so the\n * shell_kill tool can surface a clean \"no such task\" message\n * without throwing.\n */\n killBackground?: (\n handle: ExecutionHandle,\n taskId: string,\n ) => Promise<TaskExitInfo | null>\n\n /**\n * Snapshot of every task in the context's registry — running AND\n * terminated (entries remain until the next context destroy, so\n * the model can still read output of exited tasks).\n */\n listBackground?: (\n handle: ExecutionHandle,\n ) => Promise<readonly TaskEntry[]>\n\n /**\n * Block until a background task terminates, then resolve with its\n * exit info. Resolves immediately for already-terminated tasks.\n *\n * Returns `null` when:\n * - the task id is unknown (or owned by another handle — same\n * isolation contract as `killBackground`), OR\n * - `timeoutMs` elapsed / `signal` aborted before the task exited.\n *\n * Callers that need to distinguish \"unknown\" from \"still running\"\n * should consult `listBackground` first (the `wait_task` tool does).\n *\n * This is the injectable wait seam for the `wait_task` tool:\n * in-process contexts implement it on the existing `onExit`\n * machinery; durable hosts implement it as an awakeable park\n * (runner fires task-exit over their bridge → resolveAwakeable).\n */\n waitBackground?: (\n handle: ExecutionHandle,\n taskId: string,\n options?: { timeoutMs?: number, signal?: AbortSignal },\n ) => Promise<TaskExitInfo | null>\n\n /**\n * Transfer ownership of every still-running task from `fromHandle`\n * to `toHandle`. Used by the spawn tool to \"promote\" a subagent's\n * background tasks up to the parent's handle so they outlive the\n * subagent's destroy() — matching shell semantics, where a `&`-ed\n * command outlives the parent process.\n *\n * With `fromHandle === toHandle` ownership stays put and only the\n * callbacks are rebound: a host that keeps one handle across agent\n * rebuilds (`chat/execution-cache.ts`) hands the running tasks to the\n * freshly built agent this way.\n *\n * Side effects:\n * - The task's `handleId` is rewritten, so subsequent\n * `listBackground(toHandle)` / `killBackground(toHandle, …)` /\n * `destroy(toHandle)` see it (and `fromHandle`-scoped operations\n * don't).\n * - When `newOnExit` / `newOnStall` are provided, the task's OWNER\n * callbacks are REPLACED with them. Critical: they were captured\n * against the spawning agent's hook bus, which is about to be\n * destroyed; without rewiring, the new owner never learns when the\n * task terminates or stalls. Pass closures that fire the new owner's\n * `background:exit` / `background:stall` hooks. In-flight\n * `killBackground` / `waitBackground` resolvers are not owner\n * callbacks and keep firing.\n *\n * Returns the entries that were actually reassigned (running tasks\n * only; terminated ones stay where they are). Implementations that\n * don't support reassignment can leave this undefined; the caller\n * (spawn.ts) falls back to the current behavior of killing child\n * tasks at subagent shutdown.\n */\n reassignBackgroundTasks?: (\n fromHandle: ExecutionHandle,\n toHandle: ExecutionHandle,\n newOnExit?: (info: TaskExitInfo) => void,\n newOnStall?: (info: TaskStallInfo) => void,\n ) => Promise<readonly TaskEntry[]>\n\n /** Read a file from the context's filesystem */\n readFile: (handle: ExecutionHandle, path: string) => Promise<string>\n\n /**\n * Read a file from the context's filesystem as raw bytes.\n *\n * Used by `read_file` to dispatch image / binary files into the multimodal\n * `ToolResultContent[]` route. Optional — when not implemented, the tool\n * falls back to `base64 < path` via the `exec` seam, which works in any\n * shell-capable context. Implementations that already have a native\n * binary read (in-process `fs.readFile` without encoding, container API,\n * sandbox SDK) should override for the latency win.\n */\n readFileBinary?: (handle: ExecutionHandle, path: string) => Promise<Uint8Array>\n\n /**\n * Cheap size probe for a file in the context's filesystem, in bytes.\n * `null` = unknowable (missing file, not a regular file, probe failed,\n * or containment rejected the path — a probe must not leak even the\n * size of files outside the workspace root).\n *\n * Exists because `readFile` has no partial-read form: tools that must\n * materialize a whole file (read_file's text path, edit/multi_edit,\n * grep's no-rg fallback) consult this first to refuse multi-GB targets\n * instead of OOMing the HOST — the read lands in host memory no matter\n * where the file lives. Per-context posture:\n *\n * - `process` — implements it (local stat, µs).\n * - `docker` — implements it via `wc -c` through its exec; its\n * `readFile` gets transport headroom above the tool ceiling so\n * the probe (tool policy), not the 10MB exec cap, decides read\n * limits — same experience as every other context.\n * - `sandbox` (and the e2b / daytona providers behind it) —\n * implements it via `wc -c` through the provider's exec: one extra\n * round-trip per whole-read tool call, paid so a multi-GB sandbox\n * file is refused BEFORE the SDK transfers it into host memory.\n *\n * KNOWN RESIDUAL (sandbox providers): this guards the `readFile` path\n * only. Their `exec` output is buffered inside the provider SDKs\n * (e2b `commands.run`, daytona `executeCommand`), which we cannot cap\n * from this side — a command that streams GBs to stdout within its\n * timeout window can still balloon host memory. Docker doesn't share\n * the residual (we own its transport; see `output-cap.ts`). A shell\n * wrapper (`| head -c`) was considered and rejected: preserving exit\n * codes, stderr separation, and timeout semantics through a pipe for\n * EVERY command is fragile, and the timeout already time-bounds the\n * exposure.\n */\n fileSize?: (handle: ExecutionHandle, path: string) => Promise<number | null>\n\n /**\n * Write a file to the context's filesystem.\n *\n * `encoding` applies only when `content` is a string (how its bytes are\n * produced; defaults to utf-8) and is ignored for a Buffer, which is\n * written verbatim.\n */\n writeFile: (handle: ExecutionHandle, path: string, content: string | Buffer, encoding?: BufferEncoding) => Promise<void>\n\n /**\n * List files in the context filesystem.\n *\n * Plain paths list immediate directory entries. Paths that\n * contain glob metacharacters (`*`, `?`, `[]`, `{}`) request matched file\n * enumeration inside the target context. Contexts that cannot support\n * globbing should throw a clear error rather than silently returning no\n * matches. `metadata` is best-effort and only required when the context can\n * provide it without expensive per-file shell calls.\n */\n listFiles: (handle: ExecutionHandle, path: string, options?: ListFilesOptions) => Promise<ListFilesEntry[]>\n\n /**\n * The context's own entry operations (create, move, copy, remove) for\n * `handle`, with paths resolved like every other file method. Optional:\n * without it, `entryPortOf` (`./entries`) runs POSIX commands through\n * `exec` (`mkdir -p`, `mv`, `cp -RP`, `rm -rf`), which every shell\n * context can do. Implement it where a native call is cheaper or safer\n * (in-process fs, a machine link).\n */\n entries?: (handle: ExecutionHandle) => EntryPort\n\n /**\n * Resolve the host-side port that a container port was published on\n * (docker context only, and only when the matching entry was created\n * with `host` omitted in `SpawnConfig.ports`).\n *\n * Resolves to `null` if the container port isn't published. Other\n * contexts (process, sandbox) don't implement this; they don't have\n * a port-mapping concept.\n */\n getMappedPort?: (handle: ExecutionHandle, containerPort: number) => Promise<number | null>\n\n /** Destroy the execution environment and clean up resources */\n destroy: (handle: ExecutionHandle) => Promise<void>\n}\n\n// ---------------------------------------------------------------------------\n// Background task types\n// ---------------------------------------------------------------------------\n\n/** Options for {@link ExecutionContext.openTerminal} and {@link ExecutionContext.reconnectTerminal}. */\nexport interface TerminalOptions {\n /** Working directory; defaults to the handle's cwd. */\n cwd?: string\n /** Terminal width in columns. */\n cols: number\n /** Terminal height in rows. */\n rows: number\n /** Extra environment on top of what the context's commands get. */\n env?: Record<string, string>\n /** Variables to drop from the inherited environment (local contexts). */\n unsetEnv?: readonly string[]\n /** Raw terminal output. Called synchronously; never slowed by the consumer. */\n onData: (data: Uint8Array) => void\n}\n\n/** An interactive terminal opened by {@link ExecutionContext.openTerminal}. */\nexport interface TerminalProcess {\n /** Opaque id for {@link ExecutionContext.reconnectTerminal}. */\n id: string\n /** Whether {@link ExecutionContext.reconnectTerminal} can find it again later. */\n reconnectable: boolean\n /** Host pid of the shell, when it runs on this machine (for labels). */\n localPid?: number\n write: (data: string | Uint8Array) => void\n resize: (cols: number, rows: number) => void\n /** End the shell and everything it started. Idempotent. */\n kill: () => Promise<void>\n /** Let go without ending it (a remote PTY keeps running for a reconnect). */\n detach: () => Promise<void>\n /** Resolves once with the exit code; `-1` when the connection was lost instead. */\n exited: Promise<number>\n}\n\n/**\n * Terminal mode for {@link ExecutionContext.execBackground}: run the task in\n * a PTY instead of pipes, so it behaves as it would for a person (colors,\n * progress, tools that insist on a TTY) and can be watched and typed into.\n * The log file still receives the output, with terminal control sequences\n * removed, and the registry (kill, wait, list, reassign) is unchanged.\n */\nexport interface BackgroundTerminalOptions {\n cols: number\n rows: number\n /** Raw output as it arrives (the log gets the stripped text). */\n onData: (data: Uint8Array) => void\n /** Receives the functions to type into and resize the task's terminal. */\n onReady?: (io: { write: (data: string | Uint8Array) => void, resize: (cols: number, rows: number) => void }) => void\n}\n\n/**\n * Lifecycle status of a background task.\n *\n * - `'running'` — process is still live; `exitCode` / `signal` unset.\n * - `'exited'` — process terminated on its own (clean or non-zero exit).\n * - `'killed'` — the host issued `killBackground` (SIGTERM to the group).\n *\n * The status is a coarse-grained signal; the exit code carries the\n * fine-grained detail (e.g. `143 = SIGTERM` for `'killed'`).\n */\nexport type BackgroundTaskStatus = 'running' | 'exited' | 'killed'\n\n/**\n * Returned by `execBackground` once the process has spawned — the handle the model and\n * the framework use to refer to the task until it terminates.\n *\n * `outputPath` is an absolute path to the log file the context is\n * appending stdout + stderr to (interleaved by emit order). The model\n * reads it via the normal `read_file` tool; no special tool is required.\n */\nexport interface TaskHandle {\n /**\n * Stable id minted by the context — typically `bash_<n>` for\n * `ProcessContext`. Sequential within a single context instance,\n * resets when a new context is constructed. Forwarded to `killBackground` /\n * `listBackground` and stamped into every `<task-notification>` block.\n */\n taskId: string\n /** OS pid of the spawned shell wrapper (process-group leader on POSIX). */\n pid: number\n /** Absolute path to the log file the context is streaming output into. */\n outputPath: string\n /** True when the task runs in a terminal (`execBackground`'s `terminal` option was honored). */\n terminal?: boolean\n}\n\n/**\n * A live bidirectional stream to a process in the context. Returned by\n * {@link ExecutionContext.execStream}; see that method for the full\n * implementor contract (why the streams are bytes, why `stderr` is\n * optional, what PTY-backed contexts must do before the first byte).\n *\n * Ownership: the caller owns the lifetime. Nothing reaps this handle\n * automatically, so `kill()` belongs in the consumer's teardown path —\n * for MCP that is the transport's `close()`, reached via the agent's\n * `mcpConnection.close()` during `destroy()`.\n */\nexport interface StreamHandle {\n /** Process id inside the context — NOT meaningful on the host. */\n pid: number\n /**\n * Child's stdout as raw byte chunks, in emit order.\n *\n * CONSUMER OBLIGATION: drain this (and {@link stderr}) for the stream's\n * lifetime. Nothing here is bounded, and the consequence of ignoring it\n * varies by backend and by host runtime, none of it good:\n *\n * - `process` / `docker` hand back real OS pipes. Under Node an unread\n * stream stops draining the fd and the child BLOCKS once the pipe\n * fills (~64 KiB) — a deadlock, not a slowdown. Under Bun the runtime\n * buffers eagerly instead, so it presents as unbounded host memory\n * (measured: 32 MiB of unread stderr never blocked the child).\n * - `e2b` / `daytona` buffer in a `StreamQueue`, which grows without\n * limit. It cannot do otherwise: both SDKs push output through a\n * synchronous `(data) => void` callback, so there is no channel to\n * apply backpressure, and dropping bytes would desynchronise a framed\n * protocol permanently. The queue logs a one-shot warning once the\n * unread backlog passes 8 MiB so a stalled consumer is diagnosable.\n *\n * `createContextStdioTransport` satisfies this for both streams.\n */\n stdout: AsyncIterable<Uint8Array>\n /**\n * Child's stderr, when the implementation can provide it separately.\n * Present on pipe-backed contexts. A PTY-backed context cannot split it\n * from the terminal stream, so it redirects stderr to a file and either\n * surfaces it here out-of-band or leaves this unset — expect a lower\n * latency guarantee there than on stdout.\n */\n stderr?: AsyncIterable<Uint8Array>\n /** Write to the child's stdin. Resolves once the bytes are handed off. */\n write: (data: Uint8Array) => Promise<void>\n /** Terminate the child. Idempotent — killing a dead child is a no-op. */\n kill: () => Promise<void>\n /**\n * Resolves with the exit code when the child terminates, including\n * termination via {@link kill}. Never rejects.\n */\n exited: Promise<number>\n}\n\n/**\n * Fired exactly once per task when the child process terminates, via\n * `execBackground`'s `onExit` callback. The agent layer translates this\n * into a queued `<task-notification>` for the next turn.\n *\n * `signal` is set when the child was terminated by a signal (e.g.\n * SIGTERM from our own kill-tree, SIGKILL from oom-killer); absent on\n * natural exit. `exitCode` is `128 + signal-number` on signal-killed\n * children, matching POSIX shell conventions — `143` for SIGTERM, etc.\n */\nexport interface TaskExitInfo {\n /** Id of the task, as in {@link TaskHandle.taskId}. */\n taskId: string\n /** How the task ended. */\n status: Exclude<BackgroundTaskStatus, 'running'>\n /** Exit code of the process. */\n exitCode: number\n /** Signal that terminated the process, when there was one. */\n signal?: NodeJS.Signals\n /** Absolute path of the log file holding the task output. */\n outputPath: string\n /** `Date.now()` delta between spawn and exit. */\n durationMs: number\n /** The original command string the model invoked — useful for telemetry / banner summary. */\n command: string\n}\n\n/**\n * One row in `listBackground`'s snapshot. Living entries (status `'running'`)\n * have `exitCode` / `signal` / `endedAt` unset; terminated entries carry the\n * same data `TaskExitInfo` returned at exit time.\n */\nexport interface TaskEntry {\n /** Id of the task, as in {@link TaskHandle.taskId}. */\n taskId: string\n /** Process id. */\n pid: number\n /** Command the task runs. */\n command: string\n /** Working directory of the task. */\n cwd: string\n /** Start time, in milliseconds since the epoch. */\n startedAt: number\n /**\n * Set when the task terminated. Lets pull-based consumers (the agent's\n * run-boundary reconcile) derive `durationMs = endedAt - startedAt`\n * without depending on when the snapshot was taken.\n */\n endedAt?: number\n /** Absolute path of the log file holding the task output. */\n outputPath: string\n /** Current state of the task. */\n status: BackgroundTaskStatus\n /** Exit code. Set once the task terminated. */\n exitCode?: number\n /** Signal that terminated the process, when there was one. */\n signal?: NodeJS.Signals\n /** Total bytes written to the output file so far — useful for \"task X has produced N KB\" UX hints. */\n bytesWritten: number\n}\n\n/**\n * Fired by the optional stall watchdog (see `execBackground`'s\n * `stallTimeoutMs`) when a running task has produced no output for the\n * configured window. The process is still alive — this is a signal, not\n * a state transition.\n */\nexport interface TaskStallInfo {\n /** Id of the stalled task. */\n taskId: string\n /** Command the task runs. */\n command: string\n /** Absolute path of the log file holding the task output. */\n outputPath: string\n /** Milliseconds since the last output chunk (>= the configured window). */\n stalledForMs: number\n /** Total bytes the task has written so far. */\n bytesWritten: number\n}\n"],"mappings":";;AA+BA,MAAM,QAAQ;CAAE,MAAM;CAAG,KAAK;CAAG,KAAK;CAAG,KAAK;CAAG,QAAQ;AAAE;;AAG3D,MAAM,YAAY;;AAGlB,MAAM,WAAW,SAAiB,SAAS,KAAS,QAAQ,OAAS,OAAO,OAAQ,QAAQ;AAE5F,SAAgB,mBAAmB,UAA+B,CAAC,GAAiB;CAClF,IAAI,QAA4C,MAAM;;CAEtD,IAAI,MAAM;CACV,IAAI,WAAW;CACf,IAAI,OAAO;;CAEX,IAAI,YAAY;;CAEhB,IAAI,QAAQ;CAEZ,MAAM,kBAAkB;EACtB,IAAI,YAAY,QAAQ,SAAS;GAC/B,MAAM,OAAO,IAAI,QAAQ,GAAG;GAC5B,MAAM,OAAO,SAAS,KAAK,MAAM,IAAI,MAAM,GAAG,IAAI;GAClD,KAAK,SAAS,OAAO,SAAS,QAAQ,SAAS,IAC7C,QAAQ,QAAQ,IAAI,MAAM,OAAO,CAAC,CAAC;EACvC;EACA,MAAM;EACN,QAAQ,MAAM;CAChB;CAEA,OAAO;EACL,KAAK,OAAO;GACV,IAAI,MAAM;GACV,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;IACrC,MAAM,KAAK,MAAM;IACjB,MAAM,OAAO,GAAG,WAAW,CAAC;IAC5B,QAAQ,OAAR;KACE,KAAK,MAAM;MACT,IAAI,SAAS,IACX,QAAQ,MAAM;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AEJ;GACF;GACA,OAAO;EACT;EACA,eAAe;EACf,cAAc;GACZ,MAAM,OAAO;GACb,IAAI,MACF,QAAQ;GACV,OAAO;GACP,OAAO;EACT;CACF;AACF;;AAGA,SAAgB,UAAU,MAAsB;CAC9C,MAAM,IAAI,mBAAmB;CAC7B,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,QAAQ;AAClC;;;;;;;;;ACjGA,SAAgB,+BAA+B,SAAoD;CACjG,OAAO,QAAQ,aAAa,kBACtB,QAAQ,iBAAiB,qBAAqB;AACtD"}
@@ -1,5 +1,5 @@
1
- import { $k as Provider, Eo as Preset, NP as ToolDef, QN as SessionContentBlock, UN as PromptPart, Wo as AgentOptions, aL as Session, gP as ToolResultContent, jN as McpServerConfig, lN as AgentBehavior, pL as SessionStore, zo as Agent } from "./index-CGbOWa7y.js";
2
- import { d as ExecutionContext } from "./types-bDQagoiL.js";
1
+ import { BL as Session, CP as PromptPart, Eo as Preset, JL as SessionStore, MP as SessionContentBlock, NA as Provider, UN as AgentBehavior, Wo as AgentOptions, ZP as ToolResultContent, dP as McpServerConfig, mF as ToolDef, zo as Agent } from "./index-WlE93Q6d.js";
2
+ import { f as ExecutionContext } from "./types-2HrgolQz.js";
3
3
  //#region src/acp/client-declared-tools.d.ts
4
4
  /** JSON-RPC method the agent sends to the client to run a client-declared tool. */
5
5
  declare const CLIENT_TOOL_CALL_METHOD = "_zidane/tool_call";
@@ -1044,4 +1044,4 @@ type AcpContentMapper = (content: string | ToolResultContent[]) => ToolCallConte
1044
1044
  type AcpSessionContentMapper = (blocks: SessionContentBlock[]) => ContentBlock[];
1045
1045
  //#endregion
1046
1046
  export { PermissionOption as $, DeleteSessionRequest as A, ToolCallContent as At, JsonRpcId as B, createClientDeclaredTools as Bt, CancelNotification as C, SetSessionConfigOptionResponse as Ct, ContentChunk as D, TerminalOutputResponse as Dt, ContentBlock as E, TerminalExitStatus as Et, ImageContent as F, WriteTextFileRequest as Ft, JsonRpcSuccess as G, JsonRpcNotification as H, InitializeRequest as I, AcpClientToolSpec as It, LoadSessionRequest as J, ListSessionsRequest as K, InitializeResponse as L, CLIENT_TOOL_CALL_METHOD as Lt, EmbeddedResourceResource as M, ToolCallStatus as Mt, EnvVariable as N, ToolCallUpdate as Nt, Cost as O, TextContent as Ot, HttpHeader as P, ToolKind as Pt, NewSessionResponse as Q, JsonRpcError as R, CLIENT_TOOL_CANCEL_METHOD as Rt, BlobResourceContents as S, SetSessionConfigOptionRequest as St, ContentAnnotations as T, StopReason as Tt, JsonRpcRequest as U, JsonRpcMessage as V, parseClientToolSpecs as Vt, JsonRpcResponse as W, McpCapabilities as X, LoadSessionResponse as Y, NewSessionRequest as Z, AudioContent as _, SessionInfo as _t, AcpImplementationInfo as a, RequestPermissionOutcome as at, AvailableCommand as b, SessionNotification as bt, AcpModelOption as c, ResumeSessionRequest as ct, AcpPromptMapping as d, SessionCapabilities as dt, PlanEntry as et, AcpServerOptions as f, SessionConfigOption as ft, AgentCapabilities as g, SessionConfigSelectOptions as gt, AgentAuthCapabilities as h, SessionConfigSelectOption as ht, AcpErrorCode as i, ReadTextFileRequest as it, EmbeddedResource as j, ToolCallLocation as jt, CreateTerminalRequest as k, TextResourceContents as kt, AcpPeer as l, ResumeSessionResponse as lt, AcpSessionRuntime as m, SessionConfigSelectGroup as mt, AcpClientCapabilities as n, PromptRequest as nt, AcpMcpServer as o, RequestPermissionRequest as ot, AcpSessionContentMapper as p, SessionConfigOptionCategory as pt, ListSessionsResponse as q, AcpContentMapper as r, PromptResponse as rt, AcpModelChoice as s, ResourceLink as st, ACP_PROTOCOL_VERSION as t, PromptCapabilities as tt, AcpPermissionPolicy as u, Role as ut, AuthMethod as v, SessionMode as vt, CloseSessionRequest as w, SetSessionModeRequest as wt, AvailableCommandInput as x, SessionUpdate as xt, AuthenticateRequest as y, SessionModeState as yt, JsonRpcFailure as z, ClientToolCallResponse as zt };
1047
- //# sourceMappingURL=types-DnRd9_cA.d.ts.map
1047
+ //# sourceMappingURL=types-SXqk6hLD.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-DnRd9_cA.d.ts","names":["_$__client_declared_tools0.AcpClientToolSpec","_$___agent0.Agent"],"sources":["../src/acp/client-declared-tools.ts","../src/acp/types.ts"],"mappings":";;;;cAKa;;cAGA;;;;;;;UAUI;;EAEf;;EAEA;;EAEA,aAAa;;EAEb;;;UAIe;;EAEf;;EAEA;;;;;;;iBAac,qBAAqB,MAAM,6CAA6C;;;;;;;;iBAwDxE,0BACd,gBAAgB,qBAChB;EAAW,QAAQ;EAAS;IAC3B,eAAe;;;;cCjGL;;KAGD;;UAGK;;EAEf;;EAEA,IAAI;;EAEJ;;EAEA;;;UAIe;;EAEf;;EAEA;;EAEA;;;UAIe;;EAEf;;EAEA,IAAI;;EAEJ;;;UAIe;;EAEf;;EAEA,IAAI;;EAEJ,OAAO;;;KAIG,kBAAkB,iBAAiB;;KAEnC,iBAAiB,iBAAiB,sBAAsB;;UAGnD;;EAEf;;EAEA;;EAEA;;;aAIU;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf,cAAc,gBAAgB,qBAAqB;;EAEnD,mBAAmB,gBAAgB,4BAA4B;;;;;;;UAQhD;;EAEf;;EAEA;;EAEA;;EAEA,QAAQ;;;UAIO;;EAEf;;IAEE;;IAEA;;;EAGF;;EAEA,QAAQ;;;UAIO;;EAEf;;EAEA,qBAAqB;;EAErB,aAAa,QAAQ;;EAErB,QAAQ;;;UAIO;;EAEf;;EAEA,qBAAqB;;EAErB,kBAAkB;;EAElB,sBAAsB;;EAEtB,OAAO;;EAEP,QAAQ;;;UAIO;;EAEf;;EAEA;;EAEA;;EAEA,QAAQ;;;UAIO;;EAEf;;EAEA;;EAEA,QAAQ;;;UAIO;;EAEf,SAAS;;EAET,QAAQ;;;UAIO;;EAEf,OAAO;;EAEP,SAAS;;EAET,wBAAwB;;EAExB,SAAS;;EAET,QAAQ;;EAER,QAAQ;;;UAIO;;E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