zidane 7.2.5 → 8.0.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 (376) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -6
  3. package/dist/{acp-D-tVyUjw.js → acp-DQDhi2dj.js} +230 -77
  4. package/dist/acp-DQDhi2dj.js.map +1 -0
  5. package/dist/acp-cli.d.ts +1 -1
  6. package/dist/acp-cli.js +9 -66
  7. package/dist/acp-cli.js.map +1 -1
  8. package/dist/acp.d.ts +10 -590
  9. package/dist/acp.d.ts.map +1 -1
  10. package/dist/acp.js +3 -3
  11. package/dist/{agent-D0zZnGbt.js → agent-DSLNmBp0.js} +14401 -13214
  12. package/dist/agent-DSLNmBp0.js.map +1 -0
  13. package/dist/agent.d.ts +1 -1
  14. package/dist/agent.js +3 -2
  15. package/dist/aliasing-lVFbm81n.js +217 -0
  16. package/dist/aliasing-lVFbm81n.js.map +1 -0
  17. package/dist/{anthropic-C2aole0G.js → anthropic-CD00LhUP.js} +1442 -1264
  18. package/dist/anthropic-CD00LhUP.js.map +1 -0
  19. package/dist/artifacts-CV2hUKnL.js.map +1 -1
  20. package/dist/{atomic-write-B7zr1ddF.js → atomic-write-Ijgf2Mhc.js} +13 -3
  21. package/dist/atomic-write-Ijgf2Mhc.js.map +1 -0
  22. package/dist/call-tool-dHlbGOIY.js +70 -0
  23. package/dist/call-tool-dHlbGOIY.js.map +1 -0
  24. package/dist/chat/pure.d.ts +372 -6
  25. package/dist/chat/pure.d.ts.map +1 -1
  26. package/dist/chat/pure.js +35 -244
  27. package/dist/chat/pure.js.map +1 -1
  28. package/dist/{approvals-DKaJZYlm.js → chat-JPJJ8uu5.js} +15879 -14631
  29. package/dist/chat-JPJJ8uu5.js.map +1 -0
  30. package/dist/chat.d.ts +4 -6
  31. package/dist/chat.js +23 -12
  32. package/dist/cli-shared-C-YCaglL.js +159 -0
  33. package/dist/cli-shared-C-YCaglL.js.map +1 -0
  34. package/dist/client-core-BQSyDALT.d.ts +2115 -0
  35. package/dist/client-core-BQSyDALT.d.ts.map +1 -0
  36. package/dist/codemode-worker.d.ts +1 -0
  37. package/dist/codemode-worker.js +155 -0
  38. package/dist/codemode-worker.js.map +1 -0
  39. package/dist/codemode.d.ts +352 -0
  40. package/dist/codemode.d.ts.map +1 -0
  41. package/dist/codemode.js +5 -0
  42. package/dist/connection-Dr-Js4yZ.d.ts +28 -0
  43. package/dist/connection-Dr-Js4yZ.d.ts.map +1 -0
  44. package/dist/connection-loop-gdh22LTI.js +112 -0
  45. package/dist/connection-loop-gdh22LTI.js.map +1 -0
  46. package/dist/context-segments-BHKlagL6.js +1016 -0
  47. package/dist/context-segments-BHKlagL6.js.map +1 -0
  48. package/dist/{context-transport-T_6AYIvy.js → context-transport-DSMTUsK1.js} +3 -3
  49. package/dist/{context-transport-T_6AYIvy.js.map → context-transport-DSMTUsK1.js.map} +1 -1
  50. package/dist/contexts/daytona.d.ts +19 -8
  51. package/dist/contexts/daytona.d.ts.map +1 -1
  52. package/dist/contexts/daytona.js +1 -440
  53. package/dist/contexts/docker.d.ts +36 -7
  54. package/dist/contexts/docker.d.ts.map +1 -1
  55. package/dist/contexts/docker.js +1 -456
  56. package/dist/contexts/e2b.d.ts +68 -13
  57. package/dist/contexts/e2b.d.ts.map +1 -1
  58. package/dist/contexts/e2b.js +1 -382
  59. package/dist/contexts/sandbox.d.ts +1 -1
  60. package/dist/contexts/sandbox.js +5 -0
  61. package/dist/contexts/sandbox.js.map +1 -1
  62. package/dist/{contexts-CRE9pw07.js → contexts-d7UolYot.js} +1059 -524
  63. package/dist/contexts-d7UolYot.js.map +1 -0
  64. package/dist/contexts.d.ts +3 -3
  65. package/dist/contexts.js +1 -1
  66. package/dist/cred-keys-GpBg71cP.js +105 -0
  67. package/dist/cred-keys-GpBg71cP.js.map +1 -0
  68. package/dist/{auth-BG2rVKSt.js → credentials-JttEuRON.js} +55 -206
  69. package/dist/credentials-JttEuRON.js.map +1 -0
  70. package/dist/{cursor-iojRXHF9.js → cursor-CdjaQTBW.js} +3 -3
  71. package/dist/{cursor-iojRXHF9.js.map → cursor-CdjaQTBW.js.map} +1 -1
  72. package/dist/daemon-cli.d.ts +1 -1
  73. package/dist/daemon-cli.js +3 -2
  74. package/dist/daemon-cli.js.map +1 -1
  75. package/dist/daytona-DG3omipZ.js +513 -0
  76. package/dist/daytona-DG3omipZ.js.map +1 -0
  77. package/dist/defaults-Cx3zvDOV.js +23 -0
  78. package/dist/defaults-Cx3zvDOV.js.map +1 -0
  79. package/dist/dispatcher-BMlu2BmZ.js +4941 -0
  80. package/dist/dispatcher-BMlu2BmZ.js.map +1 -0
  81. package/dist/docker-BZhMMJUp.js +727 -0
  82. package/dist/docker-BZhMMJUp.js.map +1 -0
  83. package/dist/e2b-CEVOdRib.js +480 -0
  84. package/dist/e2b-CEVOdRib.js.map +1 -0
  85. package/dist/edit-utils-EGosADZq.js +234 -0
  86. package/dist/edit-utils-EGosADZq.js.map +1 -0
  87. package/dist/environment-8wsKE2Ln.js +214 -0
  88. package/dist/environment-8wsKE2Ln.js.map +1 -0
  89. package/dist/eval-BNcvle_J.js +1595 -0
  90. package/dist/eval-BNcvle_J.js.map +1 -0
  91. package/dist/eval.d.ts +2 -2
  92. package/dist/eval.js +1 -1489
  93. package/dist/executor-Cx5-8yqi.js +621 -0
  94. package/dist/executor-Cx5-8yqi.js.map +1 -0
  95. package/dist/extension-authoring-DyGGmq9V.js +385 -0
  96. package/dist/extension-authoring-DyGGmq9V.js.map +1 -0
  97. package/dist/extensions.d.ts +2 -2
  98. package/dist/extensions.js +3 -3
  99. package/dist/{fetch-url-DX75gpL0.js → fetch-url-Ct2TjDWt.js} +4 -4
  100. package/dist/{fetch-url-DX75gpL0.js.map → fetch-url-Ct2TjDWt.js.map} +1 -1
  101. package/dist/{format-BF745pLL.js → format-C2NQEVUH.js} +39 -2
  102. package/dist/format-C2NQEVUH.js.map +1 -0
  103. package/dist/format-bytes-C7tfc3Zm.js +55 -0
  104. package/dist/format-bytes-C7tfc3Zm.js.map +1 -0
  105. package/dist/headless-C_rNUuYC.js +960 -0
  106. package/dist/headless-C_rNUuYC.js.map +1 -0
  107. package/dist/headless.d.ts +1 -1
  108. package/dist/headless.js +1 -413
  109. package/dist/{history-search-C4bk1Wz_.js → history-search-CcYzF8-0.js} +7 -3
  110. package/dist/history-search-CcYzF8-0.js.map +1 -0
  111. package/dist/history-search-worker.d.ts +1 -1
  112. package/dist/history-search-worker.js +1 -1
  113. package/dist/host-D7NrI03V.js +378 -0
  114. package/dist/host-D7NrI03V.js.map +1 -0
  115. package/dist/host-signals-BcP5QKUD.js +118 -0
  116. package/dist/host-signals-BcP5QKUD.js.map +1 -0
  117. package/dist/identity-CwfO8K-t.js +26 -0
  118. package/dist/identity-CwfO8K-t.js.map +1 -0
  119. package/dist/{index-BgN1T3lk.d.ts → index-BGe1fQT7.d.ts} +10987 -9320
  120. package/dist/index-BGe1fQT7.d.ts.map +1 -0
  121. package/dist/index-BVQsIKGn.d.ts +448 -0
  122. package/dist/index-BVQsIKGn.d.ts.map +1 -0
  123. package/dist/{index-C6NEd5y_.d.ts → index-CHABJd-L.d.ts} +3386 -502
  124. package/dist/index-CHABJd-L.d.ts.map +1 -0
  125. package/dist/{index-C37_ppWv.d.ts → index-D6a7qXpg.d.ts} +2 -3
  126. package/dist/index-D6a7qXpg.d.ts.map +1 -0
  127. package/dist/index.d.ts +6 -6
  128. package/dist/index.js +27 -23
  129. package/dist/{completion-core-BRo86R_L.js → inline-ghost-BVRQeGoL.js} +50 -2
  130. package/dist/inline-ghost-BVRQeGoL.js.map +1 -0
  131. package/dist/ipc/remote.d.ts +313 -0
  132. package/dist/ipc/remote.d.ts.map +1 -0
  133. package/dist/ipc/remote.js +4 -0
  134. package/dist/ipc.d.ts +6 -964
  135. package/dist/ipc.js +403 -4
  136. package/dist/ipc.js.map +1 -0
  137. package/dist/{isolation-Kfoof0MM.d.ts → isolation-D9L650W5.d.ts} +100 -15
  138. package/dist/isolation-D9L650W5.d.ts.map +1 -0
  139. package/dist/json-rpc--HXQti1E.js +350 -0
  140. package/dist/json-rpc--HXQti1E.js.map +1 -0
  141. package/dist/links-j8rED1sR.js +603 -0
  142. package/dist/links-j8rED1sR.js.map +1 -0
  143. package/dist/local-terminal-D8QThwo_.js +252 -0
  144. package/dist/local-terminal-D8QThwo_.js.map +1 -0
  145. package/dist/{logger--C1VQjwJ.js → logger-Gtqlayx8.js} +199 -173
  146. package/dist/logger-Gtqlayx8.js.map +1 -0
  147. package/dist/logs-view-CWG8aUAG.js.map +1 -1
  148. package/dist/{mcp-CgNd-f3F.js → mcp-_wecH9Qe.js} +608 -562
  149. package/dist/mcp-_wecH9Qe.js.map +1 -0
  150. package/dist/mcp.d.ts +2 -2
  151. package/dist/mcp.js +2 -2
  152. package/dist/media-sniff-UKijEaiQ.js.map +1 -1
  153. package/dist/{messages-2jcOA_5R.js → messages-BqiwcD2Q.js} +1017 -1014
  154. package/dist/messages-BqiwcD2Q.js.map +1 -0
  155. package/dist/{oauth-DxHO17JE.js → oauth-Px_pBB9W.js} +5 -5
  156. package/dist/{oauth-DxHO17JE.js.map → oauth-Px_pBB9W.js.map} +1 -1
  157. package/dist/{openai-compat-Dy56weK8.js → openai-compat-CFrpH7uq.js} +432 -589
  158. package/dist/openai-compat-CFrpH7uq.js.map +1 -0
  159. package/dist/orchestration-BCGmB8Ps.js +511 -0
  160. package/dist/orchestration-BCGmB8Ps.js.map +1 -0
  161. package/dist/output/stream-json.d.ts +1 -2
  162. package/dist/output/stream-json.d.ts.map +1 -1
  163. package/dist/output/stream-json.js +1 -1
  164. package/dist/output/terminal.d.ts +1 -2
  165. package/dist/output/terminal.d.ts.map +1 -1
  166. package/dist/output/terminal.js +13 -7
  167. package/dist/output/terminal.js.map +1 -1
  168. package/dist/{plugins-gbI7SBA6.js → plugins-DS7mahzZ.js} +20 -101
  169. package/dist/plugins-DS7mahzZ.js.map +1 -0
  170. package/dist/plugins.d.ts +1 -1
  171. package/dist/plugins.js +1 -2
  172. package/dist/prelude-Cxo4t74B.js +517 -0
  173. package/dist/prelude-Cxo4t74B.js.map +1 -0
  174. package/dist/presets.d.ts +1 -1
  175. package/dist/presets.js +1 -2
  176. package/dist/project-root-B8zADr4o.js +167 -0
  177. package/dist/project-root-B8zADr4o.js.map +1 -0
  178. package/dist/project-user-paths-BSgtrRxl.js +58 -0
  179. package/dist/project-user-paths-BSgtrRxl.js.map +1 -0
  180. package/dist/{prompts-Pqc3JdW_.d.ts → prompts-DYcvqShf.d.ts} +14 -11
  181. package/dist/prompts-DYcvqShf.d.ts.map +1 -0
  182. package/dist/protocol-DnhqqSmE.js +13 -0
  183. package/dist/protocol-DnhqqSmE.js.map +1 -0
  184. package/dist/providers/anthropic.d.ts +2 -2
  185. package/dist/providers/anthropic.js +1 -2
  186. package/dist/providers/arcee.d.ts +1 -1
  187. package/dist/providers/arcee.js +1 -1
  188. package/dist/providers/baseten.d.ts +1 -1
  189. package/dist/providers/baseten.js +1 -1
  190. package/dist/providers/cerebras.d.ts +1 -1
  191. package/dist/providers/cerebras.js +3 -2
  192. package/dist/providers/cerebras.js.map +1 -1
  193. package/dist/providers/local.d.ts +1 -1
  194. package/dist/providers/local.js +1 -1
  195. package/dist/providers/openai-compat.d.ts +1 -1
  196. package/dist/providers/openai-compat.js +1 -2
  197. package/dist/providers/openai.d.ts +1 -1
  198. package/dist/providers/openai.js +15 -12
  199. package/dist/providers/openai.js.map +1 -1
  200. package/dist/providers/openrouter.d.ts +1 -1
  201. package/dist/providers/openrouter.js +3 -2
  202. package/dist/providers/openrouter.js.map +1 -1
  203. package/dist/providers/xai.d.ts +1 -1
  204. package/dist/providers/xai.js +3 -3
  205. package/dist/{providers-BVhnFyiY.js → providers-XUR7F4Hi.js} +4 -4
  206. package/dist/{providers-BVhnFyiY.js.map → providers-XUR7F4Hi.js.map} +1 -1
  207. package/dist/providers.d.ts +1 -1
  208. package/dist/providers.js +4 -4
  209. package/dist/registry-D6ShBWJU.js +5234 -0
  210. package/dist/registry-D6ShBWJU.js.map +1 -0
  211. package/dist/remote-hosts-BtA_9ZGp.js +97 -0
  212. package/dist/remote-hosts-BtA_9ZGp.js.map +1 -0
  213. package/dist/restate.d.ts +2 -3
  214. package/dist/restate.d.ts.map +1 -1
  215. package/dist/restate.js +631 -572
  216. package/dist/restate.js.map +1 -1
  217. package/dist/run-summary-CklLiZ4y.js +288 -0
  218. package/dist/run-summary-CklLiZ4y.js.map +1 -0
  219. package/dist/{sandbox-BH0WQkXn.d.ts → sandbox-C5dR5DwQ.d.ts} +6 -3
  220. package/dist/sandbox-C5dR5DwQ.d.ts.map +1 -0
  221. package/dist/session/sqlite.d.ts +1 -2
  222. package/dist/session/sqlite.d.ts.map +1 -1
  223. package/dist/session/sqlite.js +1 -616
  224. package/dist/session-factory-BUGY5P40.js +1576 -0
  225. package/dist/session-factory-BUGY5P40.js.map +1 -0
  226. package/dist/{session-BqRP1hS7.js → session-xh9JXu6i.js} +94 -52
  227. package/dist/session-xh9JXu6i.js.map +1 -0
  228. package/dist/session.d.ts +1 -1
  229. package/dist/session.js +2 -2
  230. package/dist/settings-keys-Ckf29NeM.js +677 -0
  231. package/dist/settings-keys-Ckf29NeM.js.map +1 -0
  232. package/dist/shell-path-Dqaoow2J.js +412 -0
  233. package/dist/shell-path-Dqaoow2J.js.map +1 -0
  234. package/dist/{skills-BC3dodWp.js → skills-DKqZJm4X.js} +430 -470
  235. package/dist/skills-DKqZJm4X.js.map +1 -0
  236. package/dist/skills.d.ts +2 -2
  237. package/dist/skills.js +1 -2
  238. package/dist/source-mPExaUm8.js +381 -0
  239. package/dist/source-mPExaUm8.js.map +1 -0
  240. package/dist/sqlite-DV1DQzN2.js +698 -0
  241. package/dist/sqlite-DV1DQzN2.js.map +1 -0
  242. package/dist/{src-CkNQKFKr.js → src-BRMYRJib.js} +903 -1121
  243. package/dist/src-BRMYRJib.js.map +1 -0
  244. package/dist/{stdio-DPpBDPx5.js → stdio-C6YyoW3I.js} +4 -4
  245. package/dist/{stdio-DPpBDPx5.js.map → stdio-C6YyoW3I.js.map} +1 -1
  246. package/dist/{stdio-loader-Bbx19dMZ.js → stdio-loader-C830Vg-Z.js} +4 -4
  247. package/dist/{stdio-loader-Bbx19dMZ.js.map → stdio-loader-C830Vg-Z.js.map} +1 -1
  248. package/dist/system-prompt-MNVHatSD.d.ts.map +1 -1
  249. package/dist/timeout-DEaqslLO.d.ts.map +1 -1
  250. package/dist/todo-edits-Dn251YUP.js +1790 -0
  251. package/dist/todo-edits-Dn251YUP.js.map +1 -0
  252. package/dist/{turn-operations-DrbJlpq9.js → tool-formatters-IQFDrdrs.js} +1456 -2120
  253. package/dist/tool-formatters-IQFDrdrs.js.map +1 -0
  254. package/dist/tool-state-Dku6YqAB.js +989 -0
  255. package/dist/tool-state-Dku6YqAB.js.map +1 -0
  256. package/dist/tools/fetch-url.d.ts +1 -2
  257. package/dist/tools/fetch-url.d.ts.map +1 -1
  258. package/dist/tools/fetch-url.js +1 -2
  259. package/dist/tools/prompts.d.ts +1 -1
  260. package/dist/tools/prompts.js +7 -7
  261. package/dist/tools/prompts.js.map +1 -1
  262. package/dist/tools/web-search.d.ts +1 -2
  263. package/dist/tools/web-search.d.ts.map +1 -1
  264. package/dist/tools/web-search.js +2 -2
  265. package/dist/tools/web-search.js.map +1 -1
  266. package/dist/tools-_DnT3AGM.js +578 -0
  267. package/dist/tools-_DnT3AGM.js.map +1 -0
  268. package/dist/tools.d.ts +3 -3
  269. package/dist/tools.js +4 -2
  270. package/dist/tui.d.ts +534 -517
  271. package/dist/tui.d.ts.map +1 -1
  272. package/dist/tui.js +34933 -27243
  273. package/dist/tui.js.map +1 -1
  274. package/dist/turn-operations-B8sokwi5.js +333 -0
  275. package/dist/turn-operations-B8sokwi5.js.map +1 -0
  276. package/dist/turn-operations-DQX5ZZni.d.ts +3089 -0
  277. package/dist/turn-operations-DQX5ZZni.d.ts.map +1 -0
  278. package/dist/types-C7ZFOztE.d.ts +132 -0
  279. package/dist/types-C7ZFOztE.d.ts.map +1 -0
  280. package/dist/types-CH5XpIHw.js +114 -0
  281. package/dist/types-CH5XpIHw.js.map +1 -0
  282. package/dist/{types-CWgENVLY.js → types-Cu0ZGDu9.js} +10 -6
  283. package/dist/types-Cu0ZGDu9.js.map +1 -0
  284. package/dist/types-IqegbJEE.d.ts +624 -0
  285. package/dist/types-IqegbJEE.d.ts.map +1 -0
  286. package/dist/types.d.ts +4 -4
  287. package/dist/types.js +1 -1
  288. package/dist/url-D8HCl65b.js +1259 -0
  289. package/dist/url-D8HCl65b.js.map +1 -0
  290. package/dist/wasm-BVT-j5cl.js +33 -0
  291. package/dist/wasm-BVT-j5cl.js.map +1 -0
  292. package/dist/workspace-exec-stream-SV2R9d5S.js +355 -0
  293. package/dist/workspace-exec-stream-SV2R9d5S.js.map +1 -0
  294. package/dist/ws-CIHMvlSh.js +952 -0
  295. package/dist/ws-CIHMvlSh.js.map +1 -0
  296. package/dist/ws-client-N7NxzvQp.js +230 -0
  297. package/dist/ws-client-N7NxzvQp.js.map +1 -0
  298. package/dist/{xai-CazjStOK.js → xai-CvJTeLrI.js} +165 -5
  299. package/dist/xai-CvJTeLrI.js.map +1 -0
  300. package/dist/xdg-zweed0-t.js +117 -0
  301. package/dist/xdg-zweed0-t.js.map +1 -0
  302. package/docs/ACP.md +52 -0
  303. package/docs/ARCHITECTURE.md +103 -6
  304. package/docs/ARTIFACTS.md +8 -4
  305. package/docs/CHAT.md +165 -14
  306. package/docs/EXECUTION_CONTEXT.md +8 -0
  307. package/docs/EXTENSIONS.md +123 -2
  308. package/docs/HEADLESS.md +2 -0
  309. package/docs/IPC.md +775 -64
  310. package/docs/MACHINES.md +456 -0
  311. package/docs/PANELS.md +3 -0
  312. package/docs/README.md +4 -0
  313. package/docs/RESTATE.md +3 -2
  314. package/docs/RUN_IN_BACKGROUND.md +10 -2
  315. package/docs/SERVER.md +1085 -0
  316. package/docs/SKILL.md +6 -1
  317. package/docs/TERMINAL.md +75 -0
  318. package/docs/TUI.md +65 -14
  319. package/package.json +58 -26
  320. package/scripts/eval.ts +4 -0
  321. package/dist/acp-D-tVyUjw.js.map +0 -1
  322. package/dist/agent-D0zZnGbt.js.map +0 -1
  323. package/dist/anthropic-C2aole0G.js.map +0 -1
  324. package/dist/approvals-DKaJZYlm.js.map +0 -1
  325. package/dist/atomic-write-B7zr1ddF.js.map +0 -1
  326. package/dist/auth-BG2rVKSt.js.map +0 -1
  327. package/dist/completion-core-BRo86R_L.js.map +0 -1
  328. package/dist/contexts/daytona.js.map +0 -1
  329. package/dist/contexts/docker.js.map +0 -1
  330. package/dist/contexts/e2b.js.map +0 -1
  331. package/dist/contexts-CRE9pw07.js.map +0 -1
  332. package/dist/eval.js.map +0 -1
  333. package/dist/format-BF745pLL.js.map +0 -1
  334. package/dist/glob-DluQFSw1.js +0 -270
  335. package/dist/glob-DluQFSw1.js.map +0 -1
  336. package/dist/headless.js.map +0 -1
  337. package/dist/history-search-C4bk1Wz_.js.map +0 -1
  338. package/dist/index-BgN1T3lk.d.ts.map +0 -1
  339. package/dist/index-C37_ppWv.d.ts.map +0 -1
  340. package/dist/index-C6NEd5y_.d.ts.map +0 -1
  341. package/dist/ipc-BKVIIOqH.js +0 -331
  342. package/dist/ipc-BKVIIOqH.js.map +0 -1
  343. package/dist/ipc.d.ts.map +0 -1
  344. package/dist/isolation-Kfoof0MM.d.ts.map +0 -1
  345. package/dist/json-rpc-rSWMUh9b.js +0 -192
  346. package/dist/json-rpc-rSWMUh9b.js.map +0 -1
  347. package/dist/logger--C1VQjwJ.js.map +0 -1
  348. package/dist/mcp-CgNd-f3F.js.map +0 -1
  349. package/dist/messages-2jcOA_5R.js.map +0 -1
  350. package/dist/openai-compat-Dy56weK8.js.map +0 -1
  351. package/dist/output-cap-C9zukcCj.js +0 -100
  352. package/dist/output-cap-C9zukcCj.js.map +0 -1
  353. package/dist/panels-B6gRk4bf.js +0 -789
  354. package/dist/panels-B6gRk4bf.js.map +0 -1
  355. package/dist/plugins-gbI7SBA6.js.map +0 -1
  356. package/dist/prompts-Pqc3JdW_.d.ts.map +0 -1
  357. package/dist/run-summary-BU_NgwUT.js +0 -269
  358. package/dist/run-summary-BU_NgwUT.js.map +0 -1
  359. package/dist/sandbox-BH0WQkXn.d.ts.map +0 -1
  360. package/dist/session/sqlite.js.map +0 -1
  361. package/dist/session-BqRP1hS7.js.map +0 -1
  362. package/dist/shell-path-DfdXrGg9.js +0 -1549
  363. package/dist/shell-path-DfdXrGg9.js.map +0 -1
  364. package/dist/skills-BC3dodWp.js.map +0 -1
  365. package/dist/src-CkNQKFKr.js.map +0 -1
  366. package/dist/todo-edits-UOwgxGKu.js +0 -528
  367. package/dist/todo-edits-UOwgxGKu.js.map +0 -1
  368. package/dist/tool-formatters-DoRLnfuD.d.ts +0 -759
  369. package/dist/tool-formatters-DoRLnfuD.d.ts.map +0 -1
  370. package/dist/transcript-anchors-BeudMbXx.d.ts +0 -1762
  371. package/dist/transcript-anchors-BeudMbXx.d.ts.map +0 -1
  372. package/dist/turn-operations-C8bMBDl_.d.ts +0 -1258
  373. package/dist/turn-operations-C8bMBDl_.d.ts.map +0 -1
  374. package/dist/turn-operations-DrbJlpq9.js.map +0 -1
  375. package/dist/types-CWgENVLY.js.map +0 -1
  376. package/dist/xai-CazjStOK.js.map +0 -1
@@ -1,440 +1 @@
1
- import { r as capBufferedExecOutput } from "../output-cap-C9zukcCj.js";
2
- import { u as errorMessage } from "../errors-DKiMrOKq.js";
3
- import { r as createLogger, t as consoleSink } from "../logger--C1VQjwJ.js";
4
- import { t as StreamQueue } from "../stream-queue-Cd9OJxl7.js";
5
- import { Buffer } from "node:buffer";
6
- //#region src/contexts/daytona.ts
7
- /** Per-probe timeout for the readiness `true` command. */
8
- const READINESS_PROBE_TIMEOUT_SECONDS = 5;
9
- /** Pause between readiness probes while the sandbox is still warming up. */
10
- const READINESS_BACKOFF_MS = 250;
11
- /** Setup scripts commonly install dependencies, so give them a generous cap. */
12
- const PREGAME_TIMEOUT_SECONDS = 1800;
13
- function resolveDaytonaEnv(optionEnv, perSpawnEnv) {
14
- const merged = {
15
- ...optionEnv,
16
- ...perSpawnEnv
17
- };
18
- return Object.keys(merged).length > 0 ? merged : void 0;
19
- }
20
- function normalizeDaytonaExecResult(response) {
21
- return {
22
- stdout: response.stdout ?? response.artifacts?.stdout ?? response.result ?? response.output ?? "",
23
- stderr: response.stderr ?? "",
24
- exitCode: typeof response.exitCode === "number" ? response.exitCode : 0
25
- };
26
- }
27
- function capExecResult(result) {
28
- return {
29
- ...capBufferedExecOutput(result.stdout, result.stderr),
30
- exitCode: result.exitCode
31
- };
32
- }
33
- function normalizeDaytonaExecError(error) {
34
- const err = error;
35
- if (typeof err.exitCode === "number") return {
36
- stdout: typeof err.stdout === "string" ? err.stdout : typeof err.result === "string" ? err.result : typeof err.output === "string" ? err.output : "",
37
- stderr: typeof err.stderr === "string" ? err.stderr : typeof err.message === "string" ? err.message : "",
38
- exitCode: err.exitCode
39
- };
40
- return {
41
- stdout: "",
42
- stderr: error instanceof Error ? error.message : String(error),
43
- exitCode: 124
44
- };
45
- }
46
- function toClientConfig(apiKey, apiUrl, target) {
47
- const config = {};
48
- if (apiKey !== void 0) config.apiKey = apiKey;
49
- if (apiUrl !== void 0) config.apiUrl = apiUrl;
50
- if (target !== void 0) config.target = target;
51
- return Object.keys(config).length > 0 ? config : void 0;
52
- }
53
- function takeString(value) {
54
- return typeof value === "string" && value.length > 0 ? value : void 0;
55
- }
56
- function resolveDaytonaCreateParams(sandboxConfig, options, envVars) {
57
- const reserved = /* @__PURE__ */ new Set([
58
- "provider",
59
- "apiKey",
60
- "apiUrl",
61
- "target",
62
- "sandboxId"
63
- ]);
64
- const params = {};
65
- for (const [key, value] of Object.entries(sandboxConfig)) if (!reserved.has(key) && value !== void 0) params[key] = value;
66
- const language = takeString(sandboxConfig.language) ?? options.language;
67
- const snapshot = takeString(sandboxConfig.snapshot) ?? options.snapshot;
68
- const image = sandboxConfig.image ?? options.image;
69
- const resources = sandboxConfig.resources ?? options.resources;
70
- const configEnvVars = sandboxConfig.envVars;
71
- const mergedEnvVars = resolveDaytonaEnv(envVars, configEnvVars);
72
- if (language !== void 0) params.language = language;
73
- if (snapshot !== void 0) params.snapshot = snapshot;
74
- if (image !== void 0) params.image = image;
75
- if (resources !== void 0) params.resources = resources;
76
- if (mergedEnvVars !== void 0) params.envVars = mergedEnvVars;
77
- return Object.keys(params).length > 0 ? params : void 0;
78
- }
79
- async function waitForDaytonaReady(sandbox, logger, opts) {
80
- if (opts.timeoutSeconds <= 0) return;
81
- const now = opts.now ?? Date.now;
82
- const sleep = opts.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
83
- const start = now();
84
- const deadline = start + opts.timeoutSeconds * 1e3;
85
- logger.info("waiting for Daytona sandbox to initialize", { sandboxId: sandbox.id });
86
- while (true) try {
87
- await sandbox.process.executeCommand("true", void 0, void 0, READINESS_PROBE_TIMEOUT_SECONDS);
88
- logger.info("Daytona sandbox ready", {
89
- sandboxId: sandbox.id,
90
- elapsedMs: now() - start
91
- });
92
- return;
93
- } catch {
94
- if (now() >= deadline) {
95
- await opts.cleanupOnTimeout?.().catch(() => {});
96
- throw new Error(`Daytona sandbox ${sandbox.id} did not become ready within ${opts.timeoutSeconds}s`);
97
- }
98
- await sleep(READINESS_BACKOFF_MS);
99
- }
100
- }
101
- async function runDaytonaPregame(sandbox, logger, opts) {
102
- const path = `/tmp/${opts.name}`;
103
- logger.info("running Daytona pregame script", {
104
- sandboxId: sandbox.id,
105
- path
106
- });
107
- await sandbox.fs.uploadFile(Buffer.from(opts.content), path);
108
- const quoted = JSON.stringify(path);
109
- let result;
110
- try {
111
- result = normalizeDaytonaExecResult(await sandbox.process.executeCommand(`chmod +x ${quoted} && ${quoted}`, opts.cwd, opts.envVars, PREGAME_TIMEOUT_SECONDS));
112
- } catch (err) {
113
- result = normalizeDaytonaExecError(err);
114
- }
115
- if (result.exitCode !== 0) {
116
- logger.error("Daytona pregame script failed", {
117
- sandboxId: sandbox.id,
118
- exitCode: result.exitCode,
119
- stdout: result.stdout,
120
- stderr: result.stderr
121
- });
122
- throw new Error(`Daytona pregame script ${opts.name} failed with exit code ${result.exitCode}`);
123
- }
124
- logger.info("Daytona pregame ready", {
125
- sandboxId: sandbox.id,
126
- stdout: result.stdout,
127
- stderr: result.stderr
128
- });
129
- }
130
- function createDaytonaProvider(options = {}) {
131
- const live = /* @__PURE__ */ new Map();
132
- const logger = options.logger ?? createLogger(consoleSink());
133
- const readinessTimeoutSeconds = options.readinessTimeoutSeconds ?? 60;
134
- async function loadSdk() {
135
- try {
136
- return (await import("@daytona/sdk")).Daytona;
137
- } catch (err) {
138
- const message = errorMessage(err);
139
- const notInstalled = /cannot find (?:module|package)|module not found|failed to resolve/i.test(message);
140
- throw new Error(notInstalled ? "@daytona/sdk is required for the Daytona sandbox provider. Install it with: bun add @daytona/sdk" : `@daytona/sdk is installed but failed to load: ${message}. If this mentions tslib, pin it with a root override: "overrides": { "tslib": "^2.8.1" } — see docs/RESTATE.md.`, { cause: err });
141
- }
142
- }
143
- function get(sandboxId) {
144
- const entry = live.get(sandboxId);
145
- if (!entry) throw new Error(`Daytona sandbox ${sandboxId} is not tracked by this provider`);
146
- return entry;
147
- }
148
- async function deleteOwnedSandbox(sandbox) {
149
- try {
150
- await sandbox.delete();
151
- } catch {}
152
- }
153
- async function stopOwnedSandbox(sandbox) {
154
- if (!sandbox.stop) {
155
- logger.error("cannot stop Daytona sandbox: this @daytona/sdk install exposes no stop() method; leaving it running", { sandboxId: sandbox.id });
156
- return;
157
- }
158
- try {
159
- await sandbox.stop();
160
- logger.info("stopped Daytona sandbox; reconnect later via the sandboxId option (CLI: --sandbox)", { sandboxId: sandbox.id });
161
- } catch (err) {
162
- logger.error("failed to stop Daytona sandbox; it will run until Daytona lifecycle policy stops it", {
163
- sandboxId: sandbox.id,
164
- error: err instanceof Error ? err.message : String(err)
165
- });
166
- }
167
- }
168
- async function archiveOwnedSandbox(sandbox) {
169
- if (!sandbox.stop || !sandbox.archive) {
170
- logger.error("cannot archive Daytona sandbox: this @daytona/sdk install exposes no stop() and archive() pair; leaving it running", { sandboxId: sandbox.id });
171
- return;
172
- }
173
- try {
174
- await sandbox.stop();
175
- await sandbox.archive();
176
- logger.info("archived Daytona sandbox; reconnect later via the sandboxId option (CLI: --sandbox)", { sandboxId: sandbox.id });
177
- } catch (err) {
178
- logger.error("failed to archive Daytona sandbox; it will run until Daytona lifecycle policy stops it", {
179
- sandboxId: sandbox.id,
180
- error: err instanceof Error ? err.message : String(err)
181
- });
182
- }
183
- }
184
- async function startAttachedSandboxIfNeeded(sandbox) {
185
- if (sandbox.state !== "stopped" && sandbox.state !== "archived") return;
186
- if (!sandbox.start) {
187
- logger.error("cannot start Daytona sandbox before attach readiness probe: this @daytona/sdk install exposes no start() method", {
188
- sandboxId: sandbox.id,
189
- state: sandbox.state
190
- });
191
- return;
192
- }
193
- logger.info("starting Daytona sandbox before attach readiness probe", {
194
- sandboxId: sandbox.id,
195
- state: sandbox.state
196
- });
197
- await sandbox.start(readinessTimeoutSeconds > 0 ? readinessTimeoutSeconds : void 0);
198
- }
199
- return {
200
- name: "daytona",
201
- async spawn(config = {}) {
202
- const Daytona = await loadSdk();
203
- const sb = config.sandbox ?? {};
204
- const apiKey = takeString(sb.apiKey) ?? options.apiKey;
205
- const apiUrl = takeString(sb.apiUrl) ?? options.apiUrl;
206
- const target = takeString(sb.target) ?? options.target;
207
- const connectId = takeString(sb.sandboxId) ?? options.sandboxId;
208
- const snapshot = takeString(sb.snapshot) ?? options.snapshot;
209
- const envVars = resolveDaytonaEnv(options.env, config.env);
210
- const daytona = new Daytona(toClientConfig(apiKey, apiUrl, target));
211
- let attached = connectId !== void 0;
212
- let sandbox = connectId !== void 0 ? await daytona.get(connectId) : await daytona.create(resolveDaytonaCreateParams(sb, options, envVars));
213
- if (attached && snapshot !== void 0 && sandbox.snapshot !== snapshot) {
214
- logger.info("recreating Daytona sandbox: snapshot changed", {
215
- sandboxId: sandbox.id,
216
- previousSnapshot: sandbox.snapshot,
217
- newSnapshot: snapshot
218
- });
219
- await deleteOwnedSandbox(sandbox);
220
- attached = false;
221
- sandbox = await daytona.create(resolveDaytonaCreateParams(sb, options, envVars));
222
- }
223
- const owned = !attached || options.ownAttached === true;
224
- if (attached) await startAttachedSandboxIfNeeded(sandbox);
225
- live.set(sandbox.id, {
226
- sandbox,
227
- env: envVars,
228
- owned
229
- });
230
- try {
231
- await waitForDaytonaReady(sandbox, logger, {
232
- timeoutSeconds: readinessTimeoutSeconds,
233
- ...!attached ? { cleanupOnTimeout: () => deleteOwnedSandbox(sandbox) } : {}
234
- });
235
- } catch (err) {
236
- live.delete(sandbox.id);
237
- throw err;
238
- }
239
- const requestedCwd = config.cwd ?? options.cwd;
240
- let cwd;
241
- if (requestedCwd) {
242
- cwd = requestedCwd;
243
- await sandbox.process.executeCommand(`mkdir -p ${JSON.stringify(cwd)}`).catch(() => {});
244
- } else if (sandbox.getWorkDir) {
245
- cwd = await sandbox.getWorkDir().catch(() => "");
246
- if (!cwd) cwd = await sandbox.process.executeCommand("pwd").then((r) => normalizeDaytonaExecResult(r).stdout.trim()).catch(() => "") || "/home/daytona";
247
- } else cwd = await sandbox.process.executeCommand("pwd").then((r) => normalizeDaytonaExecResult(r).stdout.trim()).catch(() => "") || "/home/daytona";
248
- if (options.pregame) try {
249
- await runDaytonaPregame(sandbox, logger, {
250
- name: options.pregame.name,
251
- content: options.pregame.content,
252
- cwd,
253
- envVars
254
- });
255
- } catch (err) {
256
- if (!attached) await deleteOwnedSandbox(sandbox);
257
- live.delete(sandbox.id);
258
- throw err;
259
- }
260
- return {
261
- id: sandbox.id,
262
- cwd
263
- };
264
- },
265
- async exec(sandboxId, command, opts) {
266
- const { sandbox, env } = get(sandboxId);
267
- const timeoutSeconds = opts?.timeout ?? 30;
268
- try {
269
- return capExecResult(normalizeDaytonaExecResult(await sandbox.process.executeCommand(command, opts?.cwd, resolveDaytonaEnv(env, opts?.env), timeoutSeconds > 0 ? timeoutSeconds : void 0)));
270
- } catch (err) {
271
- return capExecResult(normalizeDaytonaExecError(err));
272
- }
273
- },
274
- /**
275
- * Live bidirectional stream — see `ExecutionContext.execStream`.
276
- *
277
- * PTY-backed, and not by preference: Daytona's process + session API
278
- * exposes no stdin at all (sessions are fire-and-forget with log
279
- * streaming), so a pseudo-terminal is the only interactive channel the
280
- * platform offers. That forces three mitigations, all in the launch
281
- * wrapper below, because a PTY is a terminal and a protocol stream is
282
- * not:
283
- *
284
- * 1. `stty -echo` — a terminal echoes everything written to stdin back
285
- * onto stdout. Without this the caller reads its own requests back
286
- * as if they were responses.
287
- * 2. `stty raw` — canonical mode rewrites `\n`→`\r\n` and caps a line
288
- * at ~4096 bytes. Protocol frames routinely exceed that and would
289
- * be silently truncated mid-message.
290
- * 3. `2><file>` — a PTY has ONE stream, so the child's stderr would
291
- * otherwise interleave into the protocol data and corrupt framing.
292
- * It is redirected to a file inside the sandbox and surfaced on the
293
- * returned handle by polling that file through the exec API.
294
- *
295
- * The mitigations must run before the child's first byte — but the
296
- * launch line ITSELF is typed into a canonical-mode terminal, so it is
297
- * echoed once (a short non-JSON line the transport's tolerant framing
298
- * discards) and subject to the ~4096-byte line cap. That is why the
299
- * real command lives in an uploaded script and the typed line stays
300
- * short and constant: a long command line would be truncated before
301
- * `stty` ever ran. The script also restores `sh` compound-command
302
- * semantics that a bare `exec <command>` would break.
303
- */
304
- async execStream(sandboxId, command, opts) {
305
- const { sandbox, env } = get(sandboxId);
306
- if (!sandbox.process.createPty) throw new Error("Daytona SDK is too old: `process.createPty` is required for execStream (used to run stdio MCP servers inside the sandbox).");
307
- opts?.signal?.throwIfAborted();
308
- const token = Math.random().toString(36).slice(2, 10);
309
- const stderrPath = `/tmp/.zidane-stream-${token}.err`;
310
- const scriptPath = `/tmp/.zidane-stream-${token}.sh`;
311
- await sandbox.fs.uploadFile(Buffer.from(`exec 2>${stderrPath}\n${command}\n`), scriptPath);
312
- const warnBacklog = (which) => (bytes) => logger.warn("execStream consumer is not draining output", {
313
- sandboxId,
314
- stream: which,
315
- bufferedBytes: bytes
316
- });
317
- const stdout = new StreamQueue(warnBacklog("stdout"));
318
- const stderr = new StreamQueue(warnBacklog("stderr"));
319
- const sentinel = `Z-${token}-READY`;
320
- let gateOpen = false;
321
- let gateBuffer = "";
322
- let openGate = () => {};
323
- const gateReady = new Promise((r) => {
324
- openGate = r;
325
- });
326
- const pty = await sandbox.process.createPty({
327
- id: `zidane-stream-${token}`,
328
- ...opts?.cwd ? { cwd: opts.cwd } : {},
329
- envs: resolveDaytonaEnv(env, opts?.env) ?? {},
330
- onData: (data) => {
331
- if (gateOpen) {
332
- stdout.push(data);
333
- return;
334
- }
335
- gateBuffer += Buffer.from(data).toString("utf8");
336
- const at = gateBuffer.indexOf(sentinel);
337
- if (at === -1) {
338
- if (gateBuffer.length > 64 * 1024) gateBuffer = gateBuffer.slice(-1024);
339
- return;
340
- }
341
- gateOpen = true;
342
- openGate();
343
- const rest = gateBuffer.slice(at + sentinel.length).replace(/^\r?\n/, "");
344
- gateBuffer = "";
345
- if (rest.length > 0) stdout.push(new TextEncoder().encode(rest));
346
- }
347
- });
348
- await pty.waitForConnection();
349
- await pty.sendInput(`stty raw -echo; printf 'Z-%s-READY\\n' ${token}; exec sh ${scriptPath}\n`);
350
- let gateTimer;
351
- await Promise.race([gateReady, new Promise((r) => {
352
- gateTimer = setTimeout(r, 3e4);
353
- })]);
354
- clearTimeout(gateTimer);
355
- if (!gateOpen) {
356
- await (pty.kill?.() ?? Promise.resolve()).catch(() => {});
357
- await pty.disconnect().catch(() => {});
358
- await sandbox.process.executeCommand(`rm -f ${scriptPath} ${stderrPath}`).catch(() => {});
359
- throw new Error(`Daytona execStream: PTY did not reach the ready sentinel within 30s (sandbox ${sandboxId}). The login shell may not have started.`);
360
- }
361
- let stderrOffset = 0;
362
- let torndown = false;
363
- const eofMark = `ZEOF-${token}:`;
364
- const drainStderr = async () => {
365
- try {
366
- const res = normalizeDaytonaExecResult(await sandbox.process.executeCommand(`tail -c +${stderrOffset + 1} ${stderrPath} 2>/dev/null; printf '${eofMark}%s' "$(wc -c < ${stderrPath} 2>/dev/null || echo 0)"`));
367
- const at = res.stdout.lastIndexOf(eofMark);
368
- if (at === -1) return;
369
- const content = res.stdout.slice(0, at);
370
- const size = Number.parseInt(res.stdout.slice(at + eofMark.length).trim(), 10);
371
- if (content.length > 0) stderr.push(new TextEncoder().encode(content));
372
- if (Number.isFinite(size) && size > stderrOffset) stderrOffset = size;
373
- } catch {}
374
- };
375
- const stderrTimer = setInterval(() => {
376
- drainStderr();
377
- }, 2e3);
378
- stderrTimer.unref?.();
379
- const teardown = async () => {
380
- if (torndown) return;
381
- torndown = true;
382
- clearInterval(stderrTimer);
383
- await drainStderr();
384
- await sandbox.process.executeCommand(`rm -f ${scriptPath} ${stderrPath}`).catch(() => {});
385
- stdout.close();
386
- stderr.close();
387
- };
388
- const exited = pty.wait().then((result) => result?.exitCode ?? 0).catch(() => 137).finally(teardown);
389
- const kill = async () => {
390
- await (pty.kill?.() ?? Promise.resolve()).catch(() => {});
391
- await pty.disconnect().catch(() => {});
392
- await teardown();
393
- };
394
- if (opts?.signal) if (opts.signal.aborted) kill();
395
- else {
396
- const onAbort = () => {
397
- kill();
398
- };
399
- const detach = () => opts.signal.removeEventListener("abort", onAbort);
400
- opts.signal.addEventListener("abort", onAbort, { once: true });
401
- exited.then(detach, detach);
402
- }
403
- return {
404
- pid: pty.pid ?? -1,
405
- stdout,
406
- stderr,
407
- write: async (data) => {
408
- await pty.sendInput(data);
409
- },
410
- kill,
411
- exited
412
- };
413
- },
414
- async readFile(sandboxId, path) {
415
- return (await get(sandboxId).sandbox.fs.downloadFile(path)).toString("utf8");
416
- },
417
- async writeFile(sandboxId, path, content, encoding = "utf-8") {
418
- const data = typeof content === "string" ? Buffer.from(content, encoding) : content;
419
- await get(sandboxId).sandbox.fs.uploadFile(data, path);
420
- },
421
- async listFiles(sandboxId, path) {
422
- return (await get(sandboxId).sandbox.fs.listFiles(path)).map((e) => e.isDir ? `${e.name}/` : e.name);
423
- },
424
- async destroy(sandboxId) {
425
- const entry = live.get(sandboxId);
426
- if (!entry) return;
427
- if (entry.owned) {
428
- const action = options.onDestroy ?? "delete";
429
- if (action === "stop" || action === "pause") await stopOwnedSandbox(entry.sandbox);
430
- else if (action === "archive") await archiveOwnedSandbox(entry.sandbox);
431
- else if (action === "delete" || action === "kill") await deleteOwnedSandbox(entry.sandbox);
432
- }
433
- live.delete(sandboxId);
434
- }
435
- };
436
- }
437
- //#endregion
438
- export { createDaytonaProvider, normalizeDaytonaExecResult, resolveDaytonaCreateParams, resolveDaytonaEnv, runDaytonaPregame, waitForDaytonaReady };
439
-
440
- //# sourceMappingURL=daytona.js.map
1
+ export { t as createDaytonaProvider, a as normalizeDaytonaExecResult, n as resolveDaytonaCreateParams, o as resolveDaytonaEnv, r as runDaytonaPregame, i as waitForDaytonaReady } from "../daytona-DG3omipZ.js";
@@ -1,7 +1,6 @@
1
- import { m as ExecutionContext, y as SpawnConfig } from "../isolation-Kfoof0MM.js";
1
+ import { b as SpawnConfig, d as ContextMount, h as ExecutionContext } from "../isolation-D9L650W5.js";
2
2
  import { Buffer } from "node:buffer";
3
-
4
- //#region src/contexts/docker.d.ts
3
+ //#region src/contexts/docker-files.d.ts
5
4
  /**
6
5
  * `readFile` transport cap: headroom above the whole-read tool ceiling
7
6
  * (256MB in tools/whole-read-guard.ts) so tool policy — not the docker
@@ -10,9 +9,6 @@ import { Buffer } from "node:buffer";
10
9
  * more than this into host memory.
11
10
  */
12
11
  declare const READ_FILE_MAX_BUFFER: number;
13
- declare function createDockerContext(config?: SpawnConfig): ExecutionContext;
14
- /** Assemble dockerode `HostConfig.Binds` from the context's `mounts`. */
15
- declare function buildBindSpecs(mounts: NonNullable<SpawnConfig['mounts']>): string[];
16
12
  /**
17
13
  * Pack a single file into an in-memory tar archive for `putArchive`, via
18
14
  * `tar-stream` (the same battle-tested packer the dockerode ecosystem uses
@@ -21,5 +17,38 @@ declare function buildBindSpecs(mounts: NonNullable<SpawnConfig['mounts']>): str
21
17
  */
22
18
  declare function packTarFile(name: string, data: Buffer): Promise<Buffer>;
23
19
  //#endregion
24
- export { READ_FILE_MAX_BUFFER, buildBindSpecs, createDockerContext, packTarFile };
20
+ //#region src/contexts/docker-spawn.d.ts
21
+ /** Assemble dockerode `HostConfig.Binds` from the context's `mounts`. */
22
+ declare function buildBindSpecs(mounts: NonNullable<SpawnConfig['mounts']>): string[];
23
+ //#endregion
24
+ //#region src/contexts/docker.d.ts
25
+ declare function createDockerContext(config?: SpawnConfig): ExecutionContext;
26
+ /**
27
+ * Path-equal bind mounts that make a HOST working directory usable inside a
28
+ * container: the enclosing git worktree (or `cwd` itself outside git) at the
29
+ * same absolute path, plus the git common dir when it lives outside that
30
+ * tree (a linked worktree's `.git` file points there — without it, git fails
31
+ * in the container). Path-equal keeps host-side features (diffs, artifacts,
32
+ * `@`-paths) valid for the same absolute paths the agent sees.
33
+ *
34
+ * The git dir's `hooks/` and `config` (plus `config.worktree` when present or
35
+ * enabled) are overlaid read-only — created empty first if absent: host-side git
36
+ * (zidane's own diff/workspace calls included) would otherwise run hooks or
37
+ * `core.fsmonitor` / `core.hooksPath` planted from inside the container.
38
+ * Deliberate cost: git commands that WRITE config fail inside the container —
39
+ * `git push -u` / `--set-upstream`, `git branch --set-upstream-to`,
40
+ * `git remote add`, `git config …`. Commits, fetches and a plain
41
+ * `git push <remote> <branch>` work; environments that publish a branch must
42
+ * push without recording an upstream.
43
+ *
44
+ * Returns `[]` when `cwd` is not an existing host directory, so a
45
+ * container-only path (`--cwd /workspace`) keeps its historical meaning, and
46
+ * when the tree to mount is `/`, `$HOME`, or an ancestor of `$HOME` (too broad
47
+ * to hand a container read-write). A git root that is too broad falls back to
48
+ * `cwd` alone (no git dir), so a dotfiles repo at `$HOME` doesn't blank every
49
+ * project under it.
50
+ */
51
+ declare function hostWorkspaceMounts(cwd: string): ContextMount[];
52
+ //#endregion
53
+ export { READ_FILE_MAX_BUFFER, buildBindSpecs, createDockerContext, hostWorkspaceMounts, packTarFile };
25
54
  //# sourceMappingURL=docker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"docker.d.ts","names":[],"sources":["../../src/contexts/docker.ts"],"mappings":";;;;;;;;;;;cAyBa,oBAAA;AAAA,iBAiBG,mBAAA,CAAoB,MAAA,GAAS,WAAA,GAAc,gBAAgB;;iBAknB3D,cAAA,CAAe,MAAA,EAAQ,WAAW,CAAC,WAAA;;;;;;AAAsB;iBAUnD,WAAA,CAAY,IAAA,UAAc,IAAA,EAAM,MAAA,GAAS,OAAA,CAAQ,MAAA"}
1
+ {"version":3,"file":"docker.d.ts","names":[],"sources":["../../src/contexts/docker-files.ts","../../src/contexts/docker-spawn.ts","../../src/contexts/docker.ts"],"mappings":";;;;;;;;;;cAsBa;;;;;;;iBA6HS,YAAY,cAAc,MAAM,SAAS,QAAQ;;;;iBC3HvD,eAAe,QAAQ,YAAY;;;iBCSnC,oBAAoB,SAAS,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiH3C,oBAAoB,cAAc"}