@madarco/agentbox 0.33.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (913) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/_cloud-attach-KEFEQ2YH.js +32 -0
  3. package/dist/{chunk-L55DASHB.js → chunk-2SKTXZGX.js} +8 -8
  4. package/dist/{chunk-YZZKWZO2.js → chunk-3PTSPFR6.js} +7 -1
  5. package/dist/chunk-3PTSPFR6.js.map +1 -0
  6. package/dist/{chunk-BKOKMZNK.js → chunk-3QTWB66F.js} +6 -6
  7. package/dist/{chunk-VSWIJHCH.js → chunk-5ZBNVZSU.js} +3 -3
  8. package/dist/{chunk-IX7S6NJR.js → chunk-72LKKHPI.js} +4 -4
  9. package/dist/{chunk-AXAMPAP3.js → chunk-7ELRQNNH.js} +3 -3
  10. package/dist/chunk-7ELRQNNH.js.map +1 -0
  11. package/dist/{chunk-WJ4MZESJ.js → chunk-7RDDR6BW.js} +27 -8
  12. package/dist/chunk-7RDDR6BW.js.map +1 -0
  13. package/dist/{chunk-7TPGIQOP.js → chunk-BORN6FJK.js} +10 -10
  14. package/dist/{chunk-OVLM2EZV.js → chunk-CUMSI7N3.js} +97 -83
  15. package/dist/chunk-CUMSI7N3.js.map +1 -0
  16. package/dist/{chunk-Z6LK4P54.js → chunk-EUE6F7HL.js} +40 -12
  17. package/dist/chunk-EUE6F7HL.js.map +1 -0
  18. package/dist/{chunk-7AMMBUEW.js → chunk-F2CNFPIA.js} +67 -33
  19. package/dist/chunk-F2CNFPIA.js.map +1 -0
  20. package/dist/{chunk-77IAHAQY.js → chunk-FBQC6TKM.js} +6 -6
  21. package/dist/{chunk-IJFP7N34.js → chunk-FPYYDMCR.js} +26 -9
  22. package/dist/chunk-FPYYDMCR.js.map +1 -0
  23. package/dist/{chunk-U7J7JT6R.js → chunk-G35FJ4KT.js} +108 -43
  24. package/dist/chunk-G35FJ4KT.js.map +1 -0
  25. package/dist/{chunk-JUTAYI2N.js → chunk-GCUJUUNE.js} +5 -5
  26. package/dist/{chunk-S77B5POZ.js → chunk-GKBAEX2P.js} +6 -6
  27. package/dist/{chunk-XKUF67M6.js → chunk-GT7VDGNV.js} +4 -4
  28. package/dist/{chunk-52OXHGKQ.js → chunk-HNPYVRX7.js} +35 -16
  29. package/dist/chunk-HNPYVRX7.js.map +1 -0
  30. package/dist/{chunk-AGHR7XOJ.js → chunk-HOJKUVH6.js} +3 -3
  31. package/dist/{chunk-PENAXZMR.js → chunk-INJIW6PP.js} +7 -7
  32. package/dist/{chunk-OYWP4SII.js → chunk-IZPNDZXI.js} +5 -5
  33. package/dist/{chunk-U3BCLGTH.js → chunk-JHS4ROJH.js} +11 -11
  34. package/dist/{chunk-CWN4DJYI.js → chunk-JVZZPJ2C.js} +3 -3
  35. package/dist/{chunk-KOGQNHV3.js → chunk-KA67IGEG.js} +4 -4
  36. package/dist/{chunk-OTAYAFYF.js → chunk-KRF2JODE.js} +3 -3
  37. package/dist/{chunk-SDWKZLGP.js → chunk-LFMJXQDL.js} +5 -5
  38. package/dist/{chunk-FM7PHYBD.js → chunk-NEU5B2VO.js} +162 -8
  39. package/dist/chunk-NEU5B2VO.js.map +1 -0
  40. package/dist/{chunk-2U4HKKM7.js → chunk-NSYCXUN5.js} +6 -6
  41. package/dist/{chunk-U4Z5OOOD.js → chunk-NZN3BME7.js} +32 -12
  42. package/dist/chunk-NZN3BME7.js.map +1 -0
  43. package/dist/{chunk-KWDFEQO6.js → chunk-PI4A3TGV.js} +24 -71
  44. package/dist/chunk-PI4A3TGV.js.map +1 -0
  45. package/dist/{chunk-HS6B3CE4.js → chunk-PJCIZLIX.js} +472 -138
  46. package/dist/chunk-PJCIZLIX.js.map +1 -0
  47. package/dist/{chunk-GERRSRQZ.js → chunk-PZK5KRFB.js} +12 -10
  48. package/dist/{chunk-GERRSRQZ.js.map → chunk-PZK5KRFB.js.map} +1 -1
  49. package/dist/{chunk-5JDGKHWH.js → chunk-QALBGVPR.js} +2 -2
  50. package/dist/{chunk-JCDC5S32.js → chunk-QDBDDJKT.js} +4 -4
  51. package/dist/{chunk-R7J7WFM5.js → chunk-QUBP3AZD.js} +220 -49
  52. package/dist/chunk-QUBP3AZD.js.map +1 -0
  53. package/dist/{chunk-YVIC7TNH.js → chunk-QZW3WXBW.js} +43 -23
  54. package/dist/{chunk-YVIC7TNH.js.map → chunk-QZW3WXBW.js.map} +1 -1
  55. package/dist/{chunk-ZPFTFIKP.js → chunk-S5WFZHC5.js} +5 -5
  56. package/dist/{chunk-UFOUBCPW.js → chunk-UDSNFS67.js} +34 -36
  57. package/dist/{chunk-UFOUBCPW.js.map → chunk-UDSNFS67.js.map} +1 -1
  58. package/dist/{chunk-PVZUQTLW.js → chunk-VUTEVIYG.js} +5 -5
  59. package/dist/{chunk-3HJQZQ76.js → chunk-WNFUSPZR.js} +25 -72
  60. package/dist/chunk-WNFUSPZR.js.map +1 -0
  61. package/dist/{chunk-OWCTDO67.js → chunk-WVBTRK6R.js} +13 -13
  62. package/dist/{chunk-4IQGL4KD.js → chunk-ZMKRUD6J.js} +6 -6
  63. package/dist/{chunk-J2AD7MLR.js → chunk-ZQWOZ5BL.js} +3 -3
  64. package/dist/{cli-6IPZVUXF.js → cli-B4VVKKYV.js} +10 -10
  65. package/dist/{cli-QIBPY2HQ.js → cli-ENMWXMKO.js} +10 -10
  66. package/dist/{cli-QSV6K33P.js → cli-F2UBHH7H.js} +11 -11
  67. package/dist/{cli-E2ZC5S4U.js → cli-JKSQBGRO.js} +11 -11
  68. package/dist/{cli-3WZP5JHA.js → cli-MIIWRJDK.js} +11 -11
  69. package/dist/cloud-backends.js +6 -6
  70. package/dist/{control-plane-I2QKMHPK.js → control-plane-R4ELXZHL.js} +22 -22
  71. package/dist/{cp-hub-upload-GW566DGZ.js → cp-hub-upload-IUQVJGOW.js} +10 -10
  72. package/dist/custody-client-PVDBOT7Y.js +18 -0
  73. package/dist/{deploy-hetzner-IIAXES7B.js → deploy-hetzner-KY6KWN4M.js} +11 -11
  74. package/dist/{dist-4K66F4UR.js → dist-2QGMP2UI.js} +10 -10
  75. package/dist/{dist-SZTW3RMB.js → dist-5MCQFGLX.js} +28 -8
  76. package/dist/{dist-XZXZSTTA.js → dist-7EKSUISW.js} +33 -18
  77. package/dist/dist-7EKSUISW.js.map +1 -0
  78. package/dist/{dist-5RMJLMYG.js → dist-EIVYC2MR.js} +3 -3
  79. package/dist/{dist-VKKHIHCZ.js → dist-JWXPKGPZ.js} +10 -10
  80. package/dist/{dist-HIQCE4H2.js → dist-ONAAPVBD.js} +21 -11
  81. package/dist/{dist-WR2HYACA.js → dist-OXLTCVA2.js} +10 -10
  82. package/dist/{dist-WTPYXNRH.js → dist-PBO4UHJK.js} +2 -2
  83. package/dist/{dist-YED5YJQN.js → dist-RCBMUPVR.js} +12 -4
  84. package/dist/{dist-IXPKVU3R.js → dist-TD74GXLP.js} +6 -6
  85. package/dist/{dist-44RSFOGQ.js → dist-VCZ3LZPJ.js} +22 -12
  86. package/dist/{dist-3EZQDIOD.js → dist-WGV7LRDC.js} +11 -9
  87. package/dist/{host-reach-drainer-A4ZO6UKT.js → host-reach-drainer-AZYC6UIB.js} +2 -2
  88. package/dist/{host-session-POJP4WO6.js → host-session-EGUDGE4R.js} +12 -12
  89. package/dist/hub-76RHPA7X.js +40 -0
  90. package/dist/{hub-adopt-YR7S5TNB.js → hub-adopt-5G7SKI2E.js} +9 -9
  91. package/dist/{hub-api-client-BUQDTSQ3.js → hub-api-client-WPZTG5AT.js} +5 -5
  92. package/dist/{hub-docker-target-XA5U2ZU5.js → hub-docker-target-CNJHYH4B.js} +16 -16
  93. package/dist/index.js +299 -224
  94. package/dist/index.js.map +1 -1
  95. package/dist/{manager-pty-XCGH6AUC-EZML75UO.js → manager-pty-XCGH6AUC-O3UNISN2.js} +5 -5
  96. package/dist/{plugin-update-BIPJZA24.js → plugin-update-UZYPWL4N.js} +6 -6
  97. package/dist/prepare-4GOTJXQL.js +48 -0
  98. package/dist/prepared-custody-4YJ4ZT7J.js +40 -0
  99. package/dist/{prepared-state-FO74QUCP-4WLAYPEO.js → prepared-state-FO74QUCP-GUIPQORN.js} +5 -5
  100. package/dist/pty-host.js +4 -4
  101. package/dist/{publish-credentials-N2JD2D3A.js → publish-credentials-RLRLNL33.js} +12 -12
  102. package/dist/registry-QMHCNR5X.js +18 -0
  103. package/dist/relay-VBWFCWKK.js +23 -0
  104. package/dist/{remote-docker-share-GIH6JNKY.js → remote-docker-share-TKG7SXHX.js} +13 -13
  105. package/dist/{tool-grant-push-7K765QKW.js → tool-grant-push-V7E3Y2W6.js} +3 -3
  106. package/package.json +2 -1
  107. package/runtime/_shared/ctl.cjs +138 -40
  108. package/runtime/digitalocean/ctl.cjs +138 -40
  109. package/runtime/docker/packages/ctl/dist/bin.cjs +138 -40
  110. package/runtime/e2b/ctl.cjs +138 -40
  111. package/runtime/hetzner/ctl.cjs +138 -40
  112. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  113. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  114. package/runtime/hub/apps/hub/.next/prerender-manifest.json +3 -3
  115. package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page/next-font-manifest.json +3 -3
  116. package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
  117. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -1
  118. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -1
  119. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -1
  120. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/agent/route.js.nft.json +1 -1
  121. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/backup/route.js.nft.json +1 -1
  122. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -1
  123. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js.nft.json +1 -1
  124. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/clone/route.js.nft.json +1 -1
  125. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -1
  126. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -1
  127. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/logs/route.js.nft.json +1 -1
  128. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -1
  129. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -1
  130. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -1
  131. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -1
  132. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -1
  133. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/upload/route.js.nft.json +1 -1
  134. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js.nft.json +1 -1
  135. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/web/route.js.nft.json +1 -1
  136. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -1
  137. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/checkpoints/route.js.nft.json +1 -1
  138. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -1
  139. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -1
  140. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -1
  141. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -1
  142. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -1
  143. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -1
  144. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/route.js.nft.json +1 -1
  145. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js.nft.json +1 -1
  146. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach-box/route.js.nft.json +1 -1
  147. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/heartbeat/route.js.nft.json +1 -1
  148. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js.nft.json +1 -1
  149. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js.nft.json +1 -1
  150. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/pin/route.js.nft.json +1 -1
  151. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js.nft.json +1 -1
  152. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js.nft.json +1 -1
  153. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js.nft.json +1 -1
  154. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js.nft.json +1 -1
  155. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js.nft.json +1 -1
  156. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -1
  157. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/bots/route.js.nft.json +1 -1
  158. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -1
  159. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/create-preflight/route.js.nft.json +1 -1
  160. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/restore/route.js.nft.json +1 -1
  161. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -1
  162. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/seed/route.js.nft.json +1 -1
  163. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -1
  164. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -1
  165. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -1
  166. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/size-check/route.js.nft.json +1 -1
  167. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -1
  168. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js.nft.json +1 -1
  169. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/system/route.js.nft.json +1 -1
  170. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js.nft.json +1 -1
  171. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/register/route.js.nft.json +1 -1
  172. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js.nft.json +1 -1
  173. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js.nft.json +1 -1
  174. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js.nft.json +1 -1
  175. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js.nft.json +1 -1
  176. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js.nft.json +1 -1
  177. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js.nft.json +1 -1
  178. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js.nft.json +1 -1
  179. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js.nft.json +1 -1
  180. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js.nft.json +1 -1
  181. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js.nft.json +1 -1
  182. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js.nft.json +1 -1
  183. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js.nft.json +1 -1
  184. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/events/route.js.nft.json +1 -1
  185. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js.nft.json +1 -1
  186. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js +2 -2
  187. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js.nft.json +1 -1
  188. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/next-font-manifest.json +3 -3
  189. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/server-reference-manifest.json +1 -1
  190. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  191. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  192. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/next-font-manifest.json +3 -3
  193. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/server-reference-manifest.json +12 -12
  194. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
  195. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  196. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js.nft.json +1 -1
  197. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/web/route.js.nft.json +1 -1
  198. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page/next-font-manifest.json +3 -3
  199. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page.js.nft.json +1 -1
  200. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page_client-reference-manifest.js +1 -1
  201. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/next-font-manifest.json +3 -3
  202. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/server-reference-manifest.json +12 -12
  203. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  204. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  205. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/next-font-manifest.json +3 -3
  206. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/server-reference-manifest.json +8 -8
  207. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
  208. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  209. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page/next-font-manifest.json +3 -3
  210. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  211. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  212. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page/next-font-manifest.json +3 -3
  213. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page.js.nft.json +1 -1
  214. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page_client-reference-manifest.js +1 -1
  215. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +1 -1
  216. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
  217. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  218. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  219. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  220. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  221. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  222. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  223. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  224. package/runtime/hub/apps/hub/.next/server/app/_not-found/page/next-font-manifest.json +3 -3
  225. package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  226. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-5e8ze._.js +3 -0
  227. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-di9rg._.js +3 -0
  228. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__008zqfx._.js → [root-of-the-server]__0-ovzfw._.js} +2 -2
  229. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-r5e8q._.js +3 -0
  230. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__007hogi._.js +3 -0
  231. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0-kl55b._.js → [root-of-the-server]__00bh9gb._.js} +2 -2
  232. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00dc6yl._.js +3 -0
  233. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00zpt4k._.js +3 -0
  234. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__017tfb_._.js +3 -0
  235. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01dlun3._.js +3 -0
  236. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01mhbng._.js +3 -0
  237. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03jx5m5._.js +3 -0
  238. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03l4evb._.js +3 -0
  239. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0126167._.js → [root-of-the-server]__03uelft._.js} +2 -2
  240. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03wt33b._.js +3 -0
  241. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03z-u4h._.js +3 -0
  242. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__02s5f9s._.js → [root-of-the-server]__048c4u3._.js} +2 -2
  243. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04glef0._.js +3 -0
  244. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04za-91._.js +3 -0
  245. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05cnibm._.js +3 -0
  246. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06e_no_._.js +3 -0
  247. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06g2ncr._.js +3 -0
  248. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06vmwu8._.js +3 -0
  249. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06wzlsi._.js +3 -0
  250. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07f11r9._.js +3 -0
  251. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07mtcs1._.js +3 -0
  252. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__084o93l._.js +3 -0
  253. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__085_re5._.js +3 -0
  254. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08kj50f._.js +3 -0
  255. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08txtdi._.js +3 -0
  256. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__092u79y._.js +3 -0
  257. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09j-kzo._.js +3 -0
  258. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09umuy8._.js +3 -0
  259. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09wu-6r._.js +3 -0
  260. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_60dmv._.js +3 -0
  261. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_f5r-w._.js +3 -0
  262. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ahciyb._.js +3 -0
  263. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ajp0a3._.js +3 -0
  264. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ao_4th._.js +3 -0
  265. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0aqoqhn._.js +3 -0
  266. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0b3_azq._.js +3 -0
  267. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cjjwg7._.js +3 -0
  268. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +1 -1
  269. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1wl4f._.js +3 -0
  270. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d2ce-o._.js +3 -0
  271. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dfklvw._.js +3 -0
  272. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dgkz7l._.js +3 -0
  273. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dlg6e7._.js +3 -0
  274. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dq5edp._.js +3 -0
  275. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0drzmcj._.js +3 -0
  276. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dvyt4d._.js +3 -0
  277. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dyqk31._.js +3 -0
  278. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0eliqqa._.js +3 -0
  279. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0eluwey._.js +3 -0
  280. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f5v0j5._.js +3 -0
  281. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f7g_na._.js +3 -0
  282. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fn2qow._.js +3 -0
  283. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0frnoss._.js +3 -0
  284. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0g0e1x-._.js +3 -0
  285. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gdwl-b._.js +3 -0
  286. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gfhbl7._.js +3 -0
  287. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gsie0d._.js +3 -0
  288. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0hg36y7._.js +3 -0
  289. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0hz77cq._.js +3 -0
  290. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0i501ph._.js +3 -0
  291. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0j5jaq9._.js +3 -0
  292. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0j7_6c5._.js +3 -0
  293. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jm5dx1._.js +3 -0
  294. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0k-t2mr._.js +3 -0
  295. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ktkk27._.js +3 -0
  296. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0kxp4k8._.js +3 -0
  297. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0l-mqzk._.js +3 -0
  298. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0l7rw-n._.js +3 -0
  299. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lb45m6._.js +3 -0
  300. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lvczy2._.js +3 -0
  301. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0m9zj9m._.js +3 -0
  302. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mg-juc._.js +3 -0
  303. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mriv1n._.js +3 -0
  304. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0n4gqir._.js +3 -0
  305. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0new-8d._.js +3 -0
  306. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nuc9du._.js +3 -0
  307. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nxnhun._.js +3 -0
  308. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0o42jfc._.js +3 -0
  309. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0o7zz8d._.js +3 -0
  310. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0omb75h._.js +3 -0
  311. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0p4ta6t._.js +3 -0
  312. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0p5_ap9._.js +3 -0
  313. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pan9yi._.js +3 -0
  314. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pr6h1j._.js +3 -0
  315. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pz23t_._.js +3 -0
  316. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qcvt0o._.js +3 -0
  317. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qn4mea._.js +3 -0
  318. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qp0txx._.js +3 -0
  319. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qsn9xm._.js +3 -0
  320. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qx8qwu._.js +3 -0
  321. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0r6p-ql._.js +3 -0
  322. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0r6tfw8._.js +3 -0
  323. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sgdrnp._.js +3 -0
  324. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ssn3y9._.js +1 -1
  325. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0te8u6u._.js +3 -0
  326. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ukg6s1._.js +3 -0
  327. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0up7ls4._.js +3 -0
  328. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0uvnrnf._.js +3 -0
  329. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0v2xw5s._.js +3 -0
  330. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0v5qu_p._.js +3 -0
  331. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__12p0ia1._.js → [root-of-the-server]__0vku_ep._.js} +2 -2
  332. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vuhl78._.js +3 -0
  333. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w52bth._.js +3 -0
  334. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wq5ukd._.js +3 -0
  335. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wx561s._.js +3 -0
  336. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wxo4bk._.js +3 -0
  337. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xfcui-._.js +3 -0
  338. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xm7z28._.js +3 -0
  339. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xqz1om._.js +3 -0
  340. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xur24w._.js +3 -0
  341. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xw3pee._.js +3 -0
  342. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xwht7v._.js +3 -0
  343. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0y20q9b._.js +3 -0
  344. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zfq7yk._.js +3 -0
  345. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zi_qda._.js +3 -0
  346. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zpm7wg._.js +3 -0
  347. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zxlzp1._.js +3 -0
  348. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-a4wnf._.js +3 -0
  349. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-fpw4q._.js +3 -0
  350. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-iro6m._.js +3 -0
  351. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-o35-u._.js +3 -0
  352. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1043gy8._.js +3 -0
  353. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10kehs5._.js +3 -0
  354. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10s1755._.js +3 -0
  355. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11d3dgq._.js +3 -0
  356. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__126lrtu._.js +3 -0
  357. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12n9728._.js +3 -0
  358. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13hluml._.js +3 -0
  359. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13hzwlv._.js +3 -0
  360. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__14c4h72._.js +3 -0
  361. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__14oho-o._.js +3 -0
  362. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__14zr9zt._.js +1 -1
  363. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__153axa9._.js +3 -0
  364. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1582-3i._.js +3 -0
  365. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__15v83nk._.js +3 -0
  366. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16e-k-w._.js +3 -0
  367. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16m0mie._.js +3 -0
  368. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16ta_9y._.js +3 -0
  369. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17a3r0z._.js +3 -0
  370. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17kg43w._.js +3 -0
  371. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18g18yc._.js +3 -0
  372. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18m4f3-._.js +3 -0
  373. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__190vthx._.js +3 -0
  374. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19vezsz._.js +3 -0
  375. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19vgyci._.js +3 -0
  376. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_ulp2r._.js +3 -0
  377. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1a6hiz5._.js +3 -0
  378. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1apqdye._.js +3 -0
  379. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1avjial._.js +3 -0
  380. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cicer7._.js +3 -0
  381. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1crkcf8._.js +3 -0
  382. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dra_qf._.js +3 -0
  383. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1eearvr._.js +3 -0
  384. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1eewe3-._.js +3 -0
  385. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1fd1yxa._.js +3 -0
  386. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1fyknn9._.js +3 -0
  387. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1g24h4v._.js +3 -0
  388. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1goi44d._.js +3 -0
  389. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hf8-7y._.js +3 -0
  390. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hn7h11._.js +3 -0
  391. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i9e2ly._.js +3 -0
  392. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1j6cxj7._.js +3 -0
  393. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1jwn6xy._.js +3 -0
  394. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1kw00ov._.js +3 -0
  395. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1l0xu4g._.js +3 -0
  396. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1laa5r-._.js +3 -0
  397. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lo6_vz._.js +3 -0
  398. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lzumk3._.js +3 -0
  399. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m1qnsg._.js +3 -0
  400. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m26y4h._.js +3 -0
  401. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m5qi0d._.js +3 -0
  402. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m7oktq._.js +3 -0
  403. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mq0v7p._.js +1 -1
  404. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1n29-mo._.js +3 -0
  405. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1n5aq-l._.js +3 -0
  406. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1nhwizo._.js +3 -0
  407. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1o2vpkc._.js +3 -0
  408. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1o9euia._.js +3 -0
  409. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1otvs-z._.js +3 -0
  410. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1p3nshl._.js +3 -0
  411. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pbl8am._.js +3 -0
  412. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q9a118._.js +3 -0
  413. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q9klny._.js +3 -0
  414. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qf5sar._.js +3 -0
  415. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qjpnlw._.js +3 -0
  416. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qpcmfu._.js +1 -1
  417. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1r8kqe3._.js +3 -0
  418. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ra-lry._.js +3 -0
  419. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rousb3._.js +3 -0
  420. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rvwwj8._.js +3 -0
  421. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rwfadw._.js +3 -0
  422. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sj1ox_._.js +3 -0
  423. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sq9444._.js +3 -0
  424. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sqteyf._.js +3 -0
  425. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1th4k80._.js +3 -0
  426. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1umt_5v._.js +3 -0
  427. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ux-zjb._.js +3 -0
  428. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v5fjky._.js +3 -0
  429. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1vspjdn._.js +3 -0
  430. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1w02nxp._.js +3 -0
  431. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1winv-x._.js +3 -0
  432. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wj9na5._.js +3 -0
  433. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1x-8rww._.js +3 -0
  434. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ybyads._.js +3 -0
  435. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1yzs5_p._.js +3 -0
  436. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1z3bc6x._.js +3 -0
  437. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zh-p_4._.js +3 -0
  438. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zj2l_d._.js +3 -0
  439. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zqt33m._.js +3 -0
  440. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zr57k3._.js +3 -0
  441. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zxsjfn._.js +3 -0
  442. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20ga3fy._.js +3 -0
  443. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20gp3bg._.js +3 -0
  444. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20k17-b._.js +3 -0
  445. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20o508x._.js +3 -0
  446. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20zx91s._.js +3 -0
  447. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__219zam7._.js +3 -0
  448. package/runtime/hub/apps/hub/.next/server/chunks/_03slv7y._.js +1 -1
  449. package/runtime/hub/apps/hub/.next/server/chunks/_03u-l9s._.js +1 -1
  450. package/runtime/hub/apps/hub/.next/server/chunks/_048yy7t._.js +1 -1
  451. package/runtime/hub/apps/hub/.next/server/chunks/_05_hmgg._.js +1 -1
  452. package/runtime/hub/apps/hub/.next/server/chunks/_08cr70o._.js +1 -1
  453. package/runtime/hub/apps/hub/.next/server/chunks/_0907rw0._.js +1 -1
  454. package/runtime/hub/apps/hub/.next/server/chunks/_09bu8dh._.js +1 -1
  455. package/runtime/hub/apps/hub/.next/server/chunks/_0_2z437._.js +1 -1
  456. package/runtime/hub/apps/hub/.next/server/chunks/_0_s1tx9._.js +1 -1
  457. package/runtime/hub/apps/hub/.next/server/chunks/_0_ue2iy._.js +1 -1
  458. package/runtime/hub/apps/hub/.next/server/chunks/_0b6vmhh._.js +1 -1
  459. package/runtime/hub/apps/hub/.next/server/chunks/_0bxg62j._.js +1 -1
  460. package/runtime/hub/apps/hub/.next/server/chunks/_0cc3kcz._.js +1 -1
  461. package/runtime/hub/apps/hub/.next/server/chunks/_0ccgezr._.js +1 -1
  462. package/runtime/hub/apps/hub/.next/server/chunks/_0e50cwx._.js +1 -1
  463. package/runtime/hub/apps/hub/.next/server/chunks/_0ek1dkx._.js +1 -1
  464. package/runtime/hub/apps/hub/.next/server/chunks/_0g94rtj._.js +1 -1
  465. package/runtime/hub/apps/hub/.next/server/chunks/_0hwl0oy._.js +1 -1
  466. package/runtime/hub/apps/hub/.next/server/chunks/_0ihch2c._.js +1 -1
  467. package/runtime/hub/apps/hub/.next/server/chunks/_0jal0nm._.js +1 -1
  468. package/runtime/hub/apps/hub/.next/server/chunks/_0jvwv07._.js +1 -1
  469. package/runtime/hub/apps/hub/.next/server/chunks/_0mpj2yt._.js +1 -1
  470. package/runtime/hub/apps/hub/.next/server/chunks/_0n22m88._.js +1 -1
  471. package/runtime/hub/apps/hub/.next/server/chunks/_0ndtf84._.js +1 -1
  472. package/runtime/hub/apps/hub/.next/server/chunks/_0o1r-if._.js +1 -1
  473. package/runtime/hub/apps/hub/.next/server/chunks/_0opn03l._.js +1 -1
  474. package/runtime/hub/apps/hub/.next/server/chunks/_0p-2n50._.js +1 -1
  475. package/runtime/hub/apps/hub/.next/server/chunks/_0qf4357._.js +1 -1
  476. package/runtime/hub/apps/hub/.next/server/chunks/_0tbb47v._.js +1 -1
  477. package/runtime/hub/apps/hub/.next/server/chunks/_0ubchhn._.js +1 -1
  478. package/runtime/hub/apps/hub/.next/server/chunks/_0ul-64a._.js +1 -1
  479. package/runtime/hub/apps/hub/.next/server/chunks/_0v--tpg._.js +1 -1
  480. package/runtime/hub/apps/hub/.next/server/chunks/_0v3xwi-._.js +1 -1
  481. package/runtime/hub/apps/hub/.next/server/chunks/_0vg6gvw._.js +42 -40
  482. package/runtime/hub/apps/hub/.next/server/chunks/_0y497n2._.js +1 -1
  483. package/runtime/hub/apps/hub/.next/server/chunks/_0zvfiwd._.js +1 -1
  484. package/runtime/hub/apps/hub/.next/server/chunks/_100tsj5._.js +1 -1
  485. package/runtime/hub/apps/hub/.next/server/chunks/_11-rqgb._.js +1 -1
  486. package/runtime/hub/apps/hub/.next/server/chunks/_113fejt._.js +1 -1
  487. package/runtime/hub/apps/hub/.next/server/chunks/_12juepz._.js +1 -1
  488. package/runtime/hub/apps/hub/.next/server/chunks/_12w22u2._.js +1 -1
  489. package/runtime/hub/apps/hub/.next/server/chunks/_134-gub._.js +1 -1
  490. package/runtime/hub/apps/hub/.next/server/chunks/_14kba0u._.js +1 -1
  491. package/runtime/hub/apps/hub/.next/server/chunks/_16ec74_._.js +1 -1
  492. package/runtime/hub/apps/hub/.next/server/chunks/_17ntgn8._.js +1 -1
  493. package/runtime/hub/apps/hub/.next/server/chunks/_1c27mjg._.js +1 -1
  494. package/runtime/hub/apps/hub/.next/server/chunks/_1c4zrlu._.js +1 -1
  495. package/runtime/hub/apps/hub/.next/server/chunks/_1cmknl6._.js +1 -1
  496. package/runtime/hub/apps/hub/.next/server/chunks/_1g8ctu7._.js +1 -1
  497. package/runtime/hub/apps/hub/.next/server/chunks/_1grz1bu._.js +1 -1
  498. package/runtime/hub/apps/hub/.next/server/chunks/_1itx6m_._.js +1 -1
  499. package/runtime/hub/apps/hub/.next/server/chunks/_1jaoh3w._.js +1 -1
  500. package/runtime/hub/apps/hub/.next/server/chunks/_1ktt212._.js +1 -1
  501. package/runtime/hub/apps/hub/.next/server/chunks/_1ldaou_._.js +1 -1
  502. package/runtime/hub/apps/hub/.next/server/chunks/_1n3e-p-._.js +1 -1
  503. package/runtime/hub/apps/hub/.next/server/chunks/_1onbxt8._.js +1 -1
  504. package/runtime/hub/apps/hub/.next/server/chunks/_1pudgbl._.js +1 -1
  505. package/runtime/hub/apps/hub/.next/server/chunks/_1qmsz02._.js +1 -1
  506. package/runtime/hub/apps/hub/.next/server/chunks/_1r3ah1o._.js +1 -1
  507. package/runtime/hub/apps/hub/.next/server/chunks/_1t24c_5._.js +1 -1
  508. package/runtime/hub/apps/hub/.next/server/chunks/_1vv20kp._.js +1 -1
  509. package/runtime/hub/apps/hub/.next/server/chunks/_1whgbe7._.js +1 -1
  510. package/runtime/hub/apps/hub/.next/server/chunks/_1wj2dpr._.js +1 -1
  511. package/runtime/hub/apps/hub/.next/server/chunks/_1wsllw4._.js +1 -1
  512. package/runtime/hub/apps/hub/.next/server/chunks/_1yk56nw._.js +1 -1
  513. package/runtime/hub/apps/hub/.next/server/chunks/_1yumxg7._.js +1 -1
  514. package/runtime/hub/apps/hub/.next/server/chunks/_1zlfubf._.js +1 -1
  515. package/runtime/hub/apps/hub/.next/server/chunks/_204rqiz._.js +1 -1
  516. package/runtime/hub/apps/hub/.next/server/chunks/_2056rpg._.js +1 -1
  517. package/runtime/hub/apps/hub/.next/server/chunks/_2056tby._.js +1 -1
  518. package/runtime/hub/apps/hub/.next/server/chunks/packages_agent-registry_dist_index_1ze3mqq.js +13 -13
  519. package/runtime/hub/apps/hub/.next/server/chunks/ssr/044u_hub__next-internal_server_app_(dashboard)_projects_[id]_page_actions_15f56np.js +1 -1
  520. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0515n2f._.js +1 -1
  521. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0h3qrm-._.js +3 -0
  522. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0o-fklw._.js +3 -0
  523. package/runtime/hub/apps/hub/.next/server/chunks/ssr/{[root-of-the-server]__0m1akem._.js → [root-of-the-server]__1jkmxi2._.js} +2 -2
  524. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0kpdmm-._.js +1 -1
  525. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0kzd494._.js +1 -1
  526. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ozyjt1._.js +1 -1
  527. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r2xlss._.js +1 -1
  528. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_14-qzbg._.js +33 -31
  529. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_1hrzkwr._.js +1 -1
  530. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0j5-o0f._.js +1 -1
  531. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_17myqp5._.js +1 -1
  532. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_approvals_page_actions_1mi0bpn.js +1 -1
  533. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_boxes_[id]_page_actions_0k7kgn2.js +1 -1
  534. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_page_actions_1t3u0xy.js +1 -1
  535. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
  536. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +1 -1
  537. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_page_tsx_0o2z21l._.js +1 -1
  538. package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_agent-registry_dist_index_0z476w4.js +1 -1
  539. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  540. package/runtime/hub/apps/hub/.next/server/next-font-manifest.js +1 -1
  541. package/runtime/hub/apps/hub/.next/server/next-font-manifest.json +27 -27
  542. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  543. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.js +1 -1
  544. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.json +19 -19
  545. package/runtime/hub/apps/hub/.next/static/chunks/{2hxatwkh8fha9.js → 02sqxeus8w0s0.js} +1 -1
  546. package/runtime/hub/apps/hub/.next/static/chunks/{0tmbn9jje8ulx.js → 03ceb0qh4s52a.js} +1 -1
  547. package/runtime/hub/apps/hub/.next/static/chunks/{03_fxfc3849ms.css → 0ofk3im5p6gn-.css} +2 -2
  548. package/runtime/hub/apps/hub/.next/static/chunks/{38dg0m6sbz8hx.js → 0qhuf1a_7byq-.js} +1 -1
  549. package/runtime/hub/apps/hub/.next/static/chunks/{05dzzanyo20wx.js → 0u50pq99k9z_4.js} +1 -1
  550. package/runtime/hub/apps/hub/.next/static/chunks/{27t0b0mja1zpt.js → 0x0l4io4rdmuq.js} +1 -1
  551. package/runtime/hub/apps/hub/.next/static/chunks/{1ct_kocalf1mw.js → 22rj-g4qe8jny.js} +1 -1
  552. package/runtime/hub/apps/hub/.next/static/chunks/{22fqc0ktzjo6x.js → 23kzsoacq647n.js} +1 -1
  553. package/runtime/hub/apps/hub/.next/static/media/02263ebadd758ea4-s.1iu7q7yw-zhgt.woff2 +0 -0
  554. package/runtime/hub/apps/hub/.next/static/media/1a69062cfe6f77f8-s.26axk51fv0nvx.woff2 +0 -0
  555. package/runtime/hub/apps/hub/.next/static/media/23b7a97ae3b5c134-s.p.17c61zbdzi3u-.woff2 +0 -0
  556. package/runtime/hub/apps/hub/.next/static/media/2e95a7d252b9825a-s.1at6z4kbofh3w.woff2 +0 -0
  557. package/runtime/hub/apps/hub/.next/static/media/2fe89d53234c61d4-s.1h7k3aqd68qji.woff2 +0 -0
  558. package/runtime/hub/apps/hub/.next/static/media/59b15b4bcd7b1eb5-s.0g4pmka8j2u20.woff2 +0 -0
  559. package/runtime/hub/apps/hub/.next/static/media/68757d6cddeff913-s.07-q_h5lq3omo.woff2 +0 -0
  560. package/runtime/hub/apps/hub/.next/static/media/77ce6907447ba740-s.1thpl3j71vtxe.woff2 +0 -0
  561. package/runtime/hub/apps/hub/.next/static/media/99e609270109b47d-s.p.30xqm3yldpj47.woff2 +0 -0
  562. package/runtime/hub/apps/hub/.next/static/media/9a4838fcda0d1bca-s.13qpbrx2rg1iz.woff2 +0 -0
  563. package/runtime/hub/apps/hub/.next/static/media/a7afbb44bec2bb18-s.42z9vm7u0i9n-.woff2 +0 -0
  564. package/runtime/hub/apps/hub/.next/static/media/bfc9b7e66b1caeca-s.3hdclex1x_th1.woff2 +0 -0
  565. package/runtime/hub/apps/hub/.next/static/media/e532fa1b9921e1cd-s.1v7x_qdpnbwoz.woff2 +0 -0
  566. package/runtime/hub/apps/hub/.next/static/media/effe91970fc4db64-s.p.27korwsf9c79u.woff2 +0 -0
  567. package/runtime/hub/apps/hub/.next/static/media/f7cb89c1bcef4d27-s.3ajilh452uwtx.woff2 +0 -0
  568. package/runtime/hub/apps/hub/{auth-3K7Z7LVZ.js → auth-475LXXJA.js} +2 -2
  569. package/runtime/hub/apps/hub/{auth-config-G23WLTGN.js → auth-config-SPDXLHDX.js} +2 -2
  570. package/runtime/hub/apps/hub/{chunk-GGYNXEOD.js → chunk-3WRZVFOY.js} +521 -189
  571. package/runtime/hub/apps/hub/{chunk-RNUUXV2X.js → chunk-67LASBXO.js} +107 -42
  572. package/runtime/hub/apps/hub/{chunk-VQUZQ5MH.js → chunk-6ND54VG2.js} +161 -7
  573. package/runtime/hub/apps/hub/{chunk-7B4VZTUH.js → chunk-7XCRB6GS.js} +96 -82
  574. package/runtime/hub/apps/hub/{chunk-BEK5SYX5.js → chunk-DAMV47HM.js} +6 -0
  575. package/runtime/hub/apps/hub/{chunk-RAIBV7TH.js → chunk-FPLCH64R.js} +1 -1
  576. package/runtime/hub/apps/hub/{chunk-64GCEGJK.js → chunk-KJHUOHQ5.js} +4 -4
  577. package/runtime/hub/apps/hub/{chunk-OWAJTG3G.js → chunk-XGNMYL3X.js} +11 -11
  578. package/runtime/hub/apps/hub/{chunk-FWMBOJTZ.js → chunk-YBYUNY5P.js} +7 -7
  579. package/runtime/hub/apps/hub/{chunk-L5XPW2AU.js → chunk-ZVLJG772.js} +24 -71
  580. package/runtime/hub/apps/hub/{dist-QXOLLT4Y.js → dist-2KUVFXS3.js} +19 -9
  581. package/runtime/hub/apps/hub/{dist-D4JO7PAL.js → dist-2PUSTW2W.js} +1 -1
  582. package/runtime/hub/apps/hub/{dist-I5V4YM32.js → dist-67P6KLUY.js} +2 -2
  583. package/runtime/hub/apps/hub/dist-7PN6FTJV.js +26176 -0
  584. package/runtime/hub/apps/hub/{dist-BX2OAELL.js → dist-O53WU2K6.js} +11 -3
  585. package/runtime/hub/apps/hub/{dist-4GYSUKN3.js → dist-ODKJZJI2.js} +7 -7
  586. package/runtime/hub/apps/hub/{dist-R7ZY7ZTV.js → dist-SUHXQDYN.js} +26 -6
  587. package/runtime/hub/apps/hub/{dist-IHHRC4JW.js → dist-UMA73Z3V.js} +7 -7
  588. package/runtime/hub/apps/hub/{dist-LZWGXCOQ.js → dist-VHXEBJX5.js} +9 -7
  589. package/runtime/hub/apps/hub/{dist-TWRKOELH.js → dist-XOMGXTMI.js} +26 -71
  590. package/runtime/hub/apps/hub/{dist-33UWJJFG.js → dist-ZSRBJAWL.js} +27 -10
  591. package/runtime/hub/apps/hub/{hub-token-EIS7FVL2.js → hub-token-VMKQH4IY.js} +2 -2
  592. package/runtime/hub/apps/hub/{hub-worker-2LVMIS5H.js → hub-worker-5WDNMFCP.js} +9 -9
  593. package/runtime/hub/apps/hub/{manager-pty-XCGH6AUC-VJSNM3A6.js → manager-pty-XCGH6AUC-ZYM2ENVR.js} +4 -4
  594. package/runtime/hub/apps/hub/package.json +2 -1
  595. package/runtime/hub/apps/hub/{prepared-state-FO74QUCP-LZNKUFC7.js → prepared-state-FO74QUCP-L5OKEU42.js} +4 -4
  596. package/runtime/hub/apps/hub/server.js +296 -123
  597. package/runtime/relay/bin.cjs +131 -33
  598. package/runtime/vercel/ctl.cjs +138 -40
  599. package/dist/_cloud-attach-F25HDXWB.js +0 -32
  600. package/dist/chunk-3HJQZQ76.js.map +0 -1
  601. package/dist/chunk-52OXHGKQ.js.map +0 -1
  602. package/dist/chunk-7AMMBUEW.js.map +0 -1
  603. package/dist/chunk-AXAMPAP3.js.map +0 -1
  604. package/dist/chunk-FM7PHYBD.js.map +0 -1
  605. package/dist/chunk-HS6B3CE4.js.map +0 -1
  606. package/dist/chunk-IJFP7N34.js.map +0 -1
  607. package/dist/chunk-KWDFEQO6.js.map +0 -1
  608. package/dist/chunk-OVLM2EZV.js.map +0 -1
  609. package/dist/chunk-R7J7WFM5.js.map +0 -1
  610. package/dist/chunk-U4Z5OOOD.js.map +0 -1
  611. package/dist/chunk-U7J7JT6R.js.map +0 -1
  612. package/dist/chunk-WJ4MZESJ.js.map +0 -1
  613. package/dist/chunk-YZZKWZO2.js.map +0 -1
  614. package/dist/chunk-Z6LK4P54.js.map +0 -1
  615. package/dist/custody-client-F3OAOAC7.js +0 -18
  616. package/dist/dist-XZXZSTTA.js.map +0 -1
  617. package/dist/hub-GHFEW3K2.js +0 -40
  618. package/dist/prepare-O4BUJIOQ.js +0 -48
  619. package/dist/prepared-custody-UTSSUTXF.js +0 -40
  620. package/dist/registry-IPDCZDNW.js +0 -18
  621. package/dist/relay-P5CXEGAZ.js +0 -23
  622. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-0scfb._.js +0 -3
  623. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00a4c3f._.js +0 -3
  624. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00tx9tm._.js +0 -3
  625. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02-rdq0._.js +0 -3
  626. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02kc2og._.js +0 -3
  627. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02sueng._.js +0 -3
  628. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02ywgcg._.js +0 -3
  629. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03_xi2c._.js +0 -3
  630. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03fxkqp._.js +0 -3
  631. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04-i6rm._.js +0 -3
  632. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04b75a4._.js +0 -3
  633. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04d3pe5._.js +0 -3
  634. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05_wgfq._.js +0 -3
  635. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__071c-t4._.js +0 -3
  636. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07fobp5._.js +0 -3
  637. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__081d104._.js +0 -3
  638. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08h5jgt._.js +0 -3
  639. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09grt_m._.js +0 -3
  640. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09jbqbh._.js +0 -3
  641. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09y4pdw._.js +0 -3
  642. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_t5f3m._.js +0 -3
  643. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_xcmfv._.js +0 -3
  644. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a6e0vs._.js +0 -3
  645. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a8ere2._.js +0 -3
  646. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0azx8z8._.js +0 -3
  647. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bok80z._.js +0 -3
  648. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bv_k0d._.js +0 -3
  649. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c1o4qr._.js +0 -3
  650. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c5mzbr._.js +0 -3
  651. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cc5lpl._.js +0 -3
  652. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ce13qa._.js +0 -3
  653. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cyy9az._.js +0 -3
  654. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d34880._.js +0 -3
  655. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dfvo5-._.js +0 -3
  656. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dtq9pr._.js +0 -3
  657. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dw7c0k._.js +0 -3
  658. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0e6_t-d._.js +0 -3
  659. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0edd68z._.js +0 -3
  660. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0engd-e._.js +0 -3
  661. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0eua3wn._.js +0 -3
  662. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ewh0df._.js +0 -3
  663. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f_4fiu._.js +0 -3
  664. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fkjz20._.js +0 -3
  665. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fknr6k._.js +0 -3
  666. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fxx69a._.js +0 -3
  667. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0g7gynv._.js +0 -3
  668. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gl-4ha._.js +0 -3
  669. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gr6v_i._.js +0 -3
  670. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0h181r5._.js +0 -3
  671. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0h668tm._.js +0 -3
  672. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0i65ptk._.js +0 -3
  673. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0iyr5bm._.js +0 -3
  674. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0j0vl7q._.js +0 -3
  675. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jvk7x8._.js +0 -3
  676. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jz3x26._.js +0 -3
  677. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0k_7aj_._.js +0 -3
  678. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lc-j_n._.js +0 -3
  679. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mid58_._.js +0 -3
  680. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mq5e3o._.js +0 -3
  681. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0n5hh_2._.js +0 -3
  682. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0neufba._.js +0 -3
  683. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nqggrc._.js +0 -3
  684. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nx6w0m._.js +0 -3
  685. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0o4rocd._.js +0 -3
  686. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0olhyt4._.js +0 -3
  687. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pe9g30._.js +0 -3
  688. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pik2ie._.js +0 -3
  689. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qkpqk7._.js +0 -3
  690. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qt_r6a._.js +0 -3
  691. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qudrhk._.js +0 -3
  692. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0r0v_c_._.js +0 -3
  693. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0r4qvs6._.js +0 -3
  694. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0rf4g7g._.js +0 -3
  695. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0s4vdow._.js +0 -3
  696. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0s5ck78._.js +0 -3
  697. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0scmgnp._.js +0 -3
  698. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sn7av8._.js +0 -3
  699. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0soiiqi._.js +0 -3
  700. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sz5p6g._.js +0 -3
  701. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0tl6p7k._.js +0 -3
  702. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0tv5sah._.js +0 -3
  703. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0usxinp._.js +0 -3
  704. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0v5krdd._.js +0 -3
  705. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vgxotx._.js +0 -3
  706. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vsn71u._.js +0 -3
  707. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0x5eodh._.js +0 -3
  708. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0x_rx1f._.js +0 -3
  709. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xo5ak-._.js +0 -3
  710. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xt0w30._.js +0 -3
  711. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0y-rry-._.js +0 -3
  712. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0y3snn7._.js +0 -3
  713. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ygnbei._.js +0 -3
  714. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yio_n7._.js +0 -3
  715. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yxeq50._.js +0 -3
  716. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0z2lkh_._.js +0 -3
  717. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zd42wf._.js +0 -3
  718. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zi14f-._.js +0 -3
  719. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zxv1ul._.js +0 -3
  720. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zyutsi._.js +0 -3
  721. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-90xgw._.js +0 -3
  722. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__106reiu._.js +0 -3
  723. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__112hqrh._.js +0 -3
  724. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__113ijth._.js +0 -3
  725. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11qbpq8._.js +0 -3
  726. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11xey3v._.js +0 -3
  727. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__121vdp5._.js +0 -3
  728. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12b40mo._.js +0 -3
  729. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12i61td._.js +0 -3
  730. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12tjfss._.js +0 -3
  731. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__139ha9-._.js +0 -3
  732. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13dk6en._.js +0 -3
  733. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13j6tof._.js +0 -3
  734. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13nfpq5._.js +0 -3
  735. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__14opl53._.js +0 -3
  736. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__14pxg1e._.js +0 -3
  737. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__15gc6-s._.js +0 -3
  738. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__15k2wx5._.js +0 -3
  739. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__15umca-._.js +0 -3
  740. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__162e1zj._.js +0 -3
  741. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__166_uek._.js +0 -3
  742. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16pmnr6._.js +0 -3
  743. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__174fgjv._.js +0 -3
  744. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17df14g._.js +0 -3
  745. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17jzikc._.js +0 -3
  746. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17y9pmx._.js +0 -3
  747. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18pwzaw._.js +0 -3
  748. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__192ppv6._.js +0 -3
  749. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__198-esg._.js +0 -3
  750. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19al998._.js +0 -3
  751. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19m88da._.js +0 -3
  752. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19nlcuf._.js +0 -3
  753. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_4v0mh._.js +0 -3
  754. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_dmv53._.js +0 -3
  755. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_xgm2e._.js +0 -3
  756. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_zs8b5._.js +0 -3
  757. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1abclgc._.js +0 -3
  758. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1aboxh4._.js +0 -3
  759. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bh1dxz._.js +0 -3
  760. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cb0_wq._.js +0 -3
  761. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cbn_et._.js +0 -3
  762. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cggpv7._.js +0 -3
  763. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cnhbta._.js +0 -3
  764. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cpqqag._.js +0 -3
  765. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cs6d52._.js +0 -3
  766. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d-v8kt._.js +0 -3
  767. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d-yop_._.js +0 -3
  768. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d60scp._.js +0 -3
  769. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dhzd1_._.js +0 -3
  770. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1diw0ei._.js +0 -3
  771. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dogvkr._.js +0 -3
  772. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ectuq4._.js +0 -3
  773. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ehcanu._.js +0 -3
  774. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1em476i._.js +0 -3
  775. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f9l4qz._.js +0 -3
  776. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4akof._.js +0 -3
  777. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i9bs12._.js +0 -3
  778. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1jbtokr._.js +0 -3
  779. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1jelopi._.js +0 -3
  780. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1jnfrsy._.js +0 -3
  781. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1k934r7._.js +0 -3
  782. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1kt9_sy._.js +0 -3
  783. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1kv_jgw._.js +0 -3
  784. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1l_uof1._.js +0 -3
  785. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lareew._.js +0 -3
  786. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lgn5_b._.js +0 -3
  787. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lnherq._.js +0 -3
  788. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lyqerb._.js +0 -3
  789. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1me3irq._.js +0 -3
  790. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mh1-lh._.js +0 -3
  791. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mk_lpu._.js +0 -3
  792. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1muxcy9._.js +0 -3
  793. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mx0_-f._.js +0 -3
  794. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1no5aw3._.js +0 -3
  795. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1noanyg._.js +0 -3
  796. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ntihlm._.js +0 -3
  797. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ob9yn9._.js +0 -3
  798. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1odu62n._.js +0 -3
  799. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1oy_ypa._.js +0 -3
  800. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1p6khix._.js +0 -3
  801. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pg2kzv._.js +0 -3
  802. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pk410t._.js +0 -3
  803. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pta31u._.js +0 -3
  804. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pz2967._.js +0 -3
  805. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q9ds80._.js +0 -3
  806. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qt1i63._.js +0 -3
  807. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rr4obb._.js +0 -3
  808. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rzg628._.js +0 -3
  809. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sdw2ls._.js +0 -3
  810. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1szemyb._.js +0 -3
  811. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1t88a94._.js +0 -3
  812. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1tfkm3m._.js +0 -3
  813. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1txvsbk._.js +0 -3
  814. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1uhiv-4._.js +0 -3
  815. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1utvnlp._.js +0 -3
  816. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1vc_bp9._.js +0 -3
  817. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1w25h0t._.js +0 -3
  818. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wc9zwl._.js +0 -3
  819. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ws4ucz._.js +0 -3
  820. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wx5ltv._.js +0 -3
  821. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xi8hyy._.js +0 -3
  822. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xl-uhz._.js +0 -3
  823. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xlddup._.js +0 -3
  824. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1y3gko6._.js +0 -3
  825. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1y9wbb2._.js +0 -3
  826. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ypmy86._.js +0 -3
  827. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ysubik._.js +0 -3
  828. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1yzmh_p._.js +0 -3
  829. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1z7mgd6._.js +0 -3
  830. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ztoaz1._.js +0 -3
  831. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__2019yzl._.js +0 -3
  832. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20opvks._.js +0 -3
  833. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20ygien._.js +0 -3
  834. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0bv8m80._.js +0 -3
  835. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1ay9-4x._.js +0 -3
  836. package/runtime/hub/apps/hub/.next/static/media/02263ebadd758ea4-s.29yke99gs9qpn.woff2 +0 -0
  837. package/runtime/hub/apps/hub/.next/static/media/1a69062cfe6f77f8-s.0o-3_g79811ob.woff2 +0 -0
  838. package/runtime/hub/apps/hub/.next/static/media/23b7a97ae3b5c134-s.p.226pwps5o-gq_.woff2 +0 -0
  839. package/runtime/hub/apps/hub/.next/static/media/2e95a7d252b9825a-s.15orukf5wyxb5.woff2 +0 -0
  840. package/runtime/hub/apps/hub/.next/static/media/2fe89d53234c61d4-s.1u30mmyq6lnsd.woff2 +0 -0
  841. package/runtime/hub/apps/hub/.next/static/media/59b15b4bcd7b1eb5-s.2vemzm0itqzfy.woff2 +0 -0
  842. package/runtime/hub/apps/hub/.next/static/media/68757d6cddeff913-s.1i-sca43-qwng.woff2 +0 -0
  843. package/runtime/hub/apps/hub/.next/static/media/99e609270109b47d-s.p.40sczeszzbjw1.woff2 +0 -0
  844. package/runtime/hub/apps/hub/.next/static/media/9a4838fcda0d1bca-s.0ngr-xkgqz1kf.woff2 +0 -0
  845. package/runtime/hub/apps/hub/.next/static/media/a7afbb44bec2bb18-s.1qc6dx89jd2qv.woff2 +0 -0
  846. package/runtime/hub/apps/hub/.next/static/media/e532fa1b9921e1cd-s.3cb5lpr2l6xud.woff2 +0 -0
  847. package/runtime/hub/apps/hub/.next/static/media/effe91970fc4db64-s.p.0oace-s_gkfks.woff2 +0 -0
  848. package/runtime/hub/apps/hub/dist-25JLZKGB.js +0 -1278
  849. /package/dist/{_cloud-attach-F25HDXWB.js.map → _cloud-attach-KEFEQ2YH.js.map} +0 -0
  850. /package/dist/{chunk-L55DASHB.js.map → chunk-2SKTXZGX.js.map} +0 -0
  851. /package/dist/{chunk-BKOKMZNK.js.map → chunk-3QTWB66F.js.map} +0 -0
  852. /package/dist/{chunk-VSWIJHCH.js.map → chunk-5ZBNVZSU.js.map} +0 -0
  853. /package/dist/{chunk-IX7S6NJR.js.map → chunk-72LKKHPI.js.map} +0 -0
  854. /package/dist/{chunk-7TPGIQOP.js.map → chunk-BORN6FJK.js.map} +0 -0
  855. /package/dist/{chunk-77IAHAQY.js.map → chunk-FBQC6TKM.js.map} +0 -0
  856. /package/dist/{chunk-JUTAYI2N.js.map → chunk-GCUJUUNE.js.map} +0 -0
  857. /package/dist/{chunk-S77B5POZ.js.map → chunk-GKBAEX2P.js.map} +0 -0
  858. /package/dist/{chunk-XKUF67M6.js.map → chunk-GT7VDGNV.js.map} +0 -0
  859. /package/dist/{chunk-AGHR7XOJ.js.map → chunk-HOJKUVH6.js.map} +0 -0
  860. /package/dist/{chunk-PENAXZMR.js.map → chunk-INJIW6PP.js.map} +0 -0
  861. /package/dist/{chunk-OYWP4SII.js.map → chunk-IZPNDZXI.js.map} +0 -0
  862. /package/dist/{chunk-U3BCLGTH.js.map → chunk-JHS4ROJH.js.map} +0 -0
  863. /package/dist/{chunk-CWN4DJYI.js.map → chunk-JVZZPJ2C.js.map} +0 -0
  864. /package/dist/{chunk-KOGQNHV3.js.map → chunk-KA67IGEG.js.map} +0 -0
  865. /package/dist/{chunk-OTAYAFYF.js.map → chunk-KRF2JODE.js.map} +0 -0
  866. /package/dist/{chunk-SDWKZLGP.js.map → chunk-LFMJXQDL.js.map} +0 -0
  867. /package/dist/{chunk-2U4HKKM7.js.map → chunk-NSYCXUN5.js.map} +0 -0
  868. /package/dist/{chunk-5JDGKHWH.js.map → chunk-QALBGVPR.js.map} +0 -0
  869. /package/dist/{chunk-JCDC5S32.js.map → chunk-QDBDDJKT.js.map} +0 -0
  870. /package/dist/{chunk-ZPFTFIKP.js.map → chunk-S5WFZHC5.js.map} +0 -0
  871. /package/dist/{chunk-PVZUQTLW.js.map → chunk-VUTEVIYG.js.map} +0 -0
  872. /package/dist/{chunk-OWCTDO67.js.map → chunk-WVBTRK6R.js.map} +0 -0
  873. /package/dist/{chunk-4IQGL4KD.js.map → chunk-ZMKRUD6J.js.map} +0 -0
  874. /package/dist/{chunk-J2AD7MLR.js.map → chunk-ZQWOZ5BL.js.map} +0 -0
  875. /package/dist/{cli-3WZP5JHA.js.map → cli-B4VVKKYV.js.map} +0 -0
  876. /package/dist/{cli-6IPZVUXF.js.map → cli-ENMWXMKO.js.map} +0 -0
  877. /package/dist/{cli-E2ZC5S4U.js.map → cli-F2UBHH7H.js.map} +0 -0
  878. /package/dist/{cli-QIBPY2HQ.js.map → cli-JKSQBGRO.js.map} +0 -0
  879. /package/dist/{cli-QSV6K33P.js.map → cli-MIIWRJDK.js.map} +0 -0
  880. /package/dist/{control-plane-I2QKMHPK.js.map → control-plane-R4ELXZHL.js.map} +0 -0
  881. /package/dist/{cp-hub-upload-GW566DGZ.js.map → cp-hub-upload-IUQVJGOW.js.map} +0 -0
  882. /package/dist/{custody-client-F3OAOAC7.js.map → custody-client-PVDBOT7Y.js.map} +0 -0
  883. /package/dist/{deploy-hetzner-IIAXES7B.js.map → deploy-hetzner-KY6KWN4M.js.map} +0 -0
  884. /package/dist/{dist-3EZQDIOD.js.map → dist-2QGMP2UI.js.map} +0 -0
  885. /package/dist/{dist-44RSFOGQ.js.map → dist-5MCQFGLX.js.map} +0 -0
  886. /package/dist/{dist-4K66F4UR.js.map → dist-EIVYC2MR.js.map} +0 -0
  887. /package/dist/{dist-VKKHIHCZ.js.map → dist-JWXPKGPZ.js.map} +0 -0
  888. /package/dist/{dist-5RMJLMYG.js.map → dist-ONAAPVBD.js.map} +0 -0
  889. /package/dist/{dist-HIQCE4H2.js.map → dist-OXLTCVA2.js.map} +0 -0
  890. /package/dist/{dist-IXPKVU3R.js.map → dist-PBO4UHJK.js.map} +0 -0
  891. /package/dist/{dist-SZTW3RMB.js.map → dist-RCBMUPVR.js.map} +0 -0
  892. /package/dist/{dist-WR2HYACA.js.map → dist-TD74GXLP.js.map} +0 -0
  893. /package/dist/{dist-WTPYXNRH.js.map → dist-VCZ3LZPJ.js.map} +0 -0
  894. /package/dist/{dist-YED5YJQN.js.map → dist-WGV7LRDC.js.map} +0 -0
  895. /package/dist/{host-reach-drainer-A4ZO6UKT.js.map → host-reach-drainer-AZYC6UIB.js.map} +0 -0
  896. /package/dist/{host-session-POJP4WO6.js.map → host-session-EGUDGE4R.js.map} +0 -0
  897. /package/dist/{hub-GHFEW3K2.js.map → hub-76RHPA7X.js.map} +0 -0
  898. /package/dist/{hub-adopt-YR7S5TNB.js.map → hub-adopt-5G7SKI2E.js.map} +0 -0
  899. /package/dist/{hub-api-client-BUQDTSQ3.js.map → hub-api-client-WPZTG5AT.js.map} +0 -0
  900. /package/dist/{hub-docker-target-XA5U2ZU5.js.map → hub-docker-target-CNJHYH4B.js.map} +0 -0
  901. /package/dist/{manager-pty-XCGH6AUC-EZML75UO.js.map → manager-pty-XCGH6AUC-O3UNISN2.js.map} +0 -0
  902. /package/dist/{plugin-update-BIPJZA24.js.map → plugin-update-UZYPWL4N.js.map} +0 -0
  903. /package/dist/{prepare-O4BUJIOQ.js.map → prepare-4GOTJXQL.js.map} +0 -0
  904. /package/dist/{prepared-custody-UTSSUTXF.js.map → prepared-custody-4YJ4ZT7J.js.map} +0 -0
  905. /package/dist/{prepared-state-FO74QUCP-4WLAYPEO.js.map → prepared-state-FO74QUCP-GUIPQORN.js.map} +0 -0
  906. /package/dist/{publish-credentials-N2JD2D3A.js.map → publish-credentials-RLRLNL33.js.map} +0 -0
  907. /package/dist/{registry-IPDCZDNW.js.map → registry-QMHCNR5X.js.map} +0 -0
  908. /package/dist/{relay-P5CXEGAZ.js.map → relay-VBWFCWKK.js.map} +0 -0
  909. /package/dist/{remote-docker-share-GIH6JNKY.js.map → remote-docker-share-TKG7SXHX.js.map} +0 -0
  910. /package/dist/{tool-grant-push-7K765QKW.js.map → tool-grant-push-V7E3Y2W6.js.map} +0 -0
  911. /package/runtime/hub/apps/hub/.next/static/{TMo35nbBXDtyGUs4P3Q_H → 2QUBvK0xJqbyGzVe1RBzl}/_buildManifest.js +0 -0
  912. /package/runtime/hub/apps/hub/.next/static/{TMo35nbBXDtyGUs4P3Q_H → 2QUBvK0xJqbyGzVe1RBzl}/_clientMiddlewareManifest.js +0 -0
  913. /package/runtime/hub/apps/hub/.next/static/{TMo35nbBXDtyGUs4P3Q_H → 2QUBvK0xJqbyGzVe1RBzl}/_ssgManifest.js +0 -0
@@ -1,15 +1,15 @@
1
- module.exports=[82588,(e,t,r)=>{t.exports=i,i.sync=function(e,t){return o(n.statSync(e),t)};var n=e.r(22734);function i(e,t,r){n.stat(e,function(e,n){r(e,!e&&o(n,t))})}function o(e,t){var r,n,i,o,a,s,l,c,u;return e.isFile()&&(r=e,n=t,i=r.mode,o=r.uid,a=r.gid,s=void 0!==n.uid?n.uid:process.getuid&&process.getuid(),l=void 0!==n.gid?n.gid:process.getgid&&process.getgid(),c=parseInt("100",8),u=parseInt("010",8),i&parseInt("001",8)||i&u&&a===l||i&c&&o===s||i&(c|u)&&0===s)}},35707,(e,t,r)=>{t.exports=o,o.sync=function(e,t){return i(n.statSync(e),e,t)};var n=e.r(22734);function i(e,t,r){if(!e.isSymbolicLink()&&!e.isFile())return!1;var n=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!n||-1!==(n=n.split(";")).indexOf(""))return!0;for(var i=0;i<n.length;i++){var o=n[i].toLowerCase();if(o&&t.substr(-o.length).toLowerCase()===o)return!0}return!1}function o(e,t,r){n.stat(e,function(n,o){r(n,!n&&i(o,e,t))})}},24246,(e,t,r)=>{var n;function i(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,n){i(e,t||{},function(e,t){e?n(e):r(t)})})}n(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)})}e.r(22734),n="win32"===process.platform||e.g.TESTING_WINDOWS?e.r(35707):e.r(82588),t.exports=i,i.sync=function(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},80192,(e,t,r)=>{let n="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=e.r(14747),o=n?";":":",a=e.r(24246),s=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),l=(e,t)=>{let r=t.colon||o,i=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],a=n?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=n?a.split(r):[""];return n&&-1!==e.indexOf(".")&&""!==s[0]&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:a}},c=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:c}=l(e,t),u=[],d=r=>new Promise((o,a)=>{if(r===n.length)return t.all&&u.length?o(u):a(s(e));let l=n[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,d=i.join(c,e);o(f(!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,r,0))}),f=(e,r,n)=>new Promise((i,s)=>{if(n===o.length)return i(d(r+1));let l=o[n];a(e+l,{pathExt:c},(o,a)=>{if(!o&&a)if(!t.all)return i(e+l);else u.push(e+l);return i(f(e,r,n+1))})});return r?d(0).then(e=>r(null,e),r):d(0)};t.exports=c,c.sync=(e,t)=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=l(e,t=t||{}),c=[];for(let s=0;s<r.length;s++){let l=r[s],u=/^".*"$/.test(l)?l.slice(1,-1):l,d=i.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<n.length;e++){let r=f+n[e];try{if(a.sync(r,{pathExt:o}))if(!t.all)return r;else c.push(r)}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw s(e)}},80808,(e,t,r)=>{"use strict";let n=(e={})=>{let t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};t.exports=n,t.exports.default=n},23042,(e,t,r)=>{"use strict";let n=e.r(14747),i=e.r(80192),o=e.r(80808);function a(e,t){let r,a=e.options.env||process.env,s=process.cwd(),l=null!=e.options.cwd,c=l&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}try{r=i.sync(e.command,{path:a[o({env:a})],pathExt:t?n.delimiter:void 0})}catch(e){}finally{c&&process.chdir(s)}return r&&(r=n.resolve(l?e.options.cwd:"",r)),r}t.exports=function(e){return a(e)||a(e,!0)}},43082,(e,t,r)=>{"use strict";let n=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(e){return e.replace(n,"^$1")},t.exports.argument=function(e,t){return e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),e=(e=`"${e}"`).replace(n,"^$1"),t&&(e=e.replace(n,"^$1")),e}},19434,(e,t,r)=>{"use strict";t.exports=/^#!(.*)/},33965,(e,t,r)=>{"use strict";let n=e.r(19434);t.exports=(e="")=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return"env"===o?i:i?`${o} ${i}`:o}},37401,(e,t,r)=>{"use strict";let n=e.r(22734),i=e.r(33965);t.exports=function(e){let t,r=Buffer.alloc(150);try{t=n.openSync(e,"r"),n.readSync(t,r,0,150,0),n.closeSync(t)}catch(e){}return i(r.toString())}},75647,(e,t,r)=>{"use strict";e.r(14747),e.r(23042),e.r(43082),e.r(37401),process.platform,t.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);let n={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell,n}},47163,(e,t,r)=>{"use strict";process.platform,t.exports={hookChildProcess:function(e,t){},verifyENOENT:function(e,t){return null},verifyENOENTSync:function(e,t){return null},notFoundError:function(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}}},32227,(e,t,r)=>{"use strict";let n=e.r(33405),i=e.r(75647),o=e.r(47163);function a(e,t,r){let a=i(e,t,r),s=n.spawn(a.command,a.args,a.options);return o.hookChildProcess(s,a),s}t.exports=a,t.exports.spawn=a,t.exports.sync=function(e,t,r){let a=i(e,t,r),s=n.spawnSync(a.command,a.args,a.options);return s.error=s.error||o.verifyENOENTSync(s.status,a),s},t.exports._parse=i,t.exports._enoent=o},25206,18908,e=>{"use strict";let t,r,n,i;var o,a,s,l,c=e.i(24868),u=e.i(46786),d=e.i(14747),f=e.i(29220);function p(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var h=e.i(57764);let m=(e,t)=>{let r=w(g(e));if("string"!=typeof r)throw TypeError(`${t} must be a string or a file URL: ${r}.`);return r},g=e=>y(e)?e.toString():e,y=e=>"string"!=typeof e&&e&&Object.getPrototypeOf(e)===String.prototype,w=e=>e instanceof URL?(0,h.fileURLToPath)(e):e,b=(e,t=[],r={})=>{let n=m(e,"First argument"),[i,o]=p(t)?[[],t]:[t,r];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>"object"==typeof e&&null!==e))throw TypeError(`Second argument must be an array of strings: ${i}`);let a=i.map(String),s=a.find(e=>e.includes("\0"));if(void 0!==s)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!p(o))throw TypeError(`Last argument must be an options object: ${o}`);return[n,a,o]};var v=e.i(74533),x=e.i(99871);let{toString:$}=Object.prototype,S=e=>"[object Uint8Array]"===$.call(e),E=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),k=new TextEncoder,T=new TextDecoder,D=e=>1===e.length&&S(e[0])?e[0]:O(A(e)),A=e=>e.map(e=>"string"==typeof e?k.encode(e):e),O=e=>{let t=new Uint8Array(C(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},C=e=>{let t=0;for(let r of e)t+=r.length;return t},j=({templates:e,expressions:t,tokens:r,index:n,template:i})=>{if(void 0===i)throw TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:o,leadingWhitespaces:a,trailingWhitespaces:s}=P(i,e.raw[n]),l=B(r,o,a);if(n===t.length)return l;let c=t[n];return B(l,Array.isArray(c)?c.map(e=>N(e)):[N(c)],s)},P=(e,t)=>{if(0===t.length)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=I.has(t[0]);for(let i=0,o=0;i<e.length;i+=1,o+=1){let a=t[o];if(I.has(a))n!==i&&r.push(e.slice(n,i)),n=i+1;else if("\\"===a){let e=t[o+1];"\n"===e?(i-=1,o+=1):"u"===e&&"{"===t[o+2]?o=t.indexOf("}",o+3):o+=R[e]??1}}let o=n===e.length;return o||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:i,trailingWhitespaces:o}},I=new Set([" "," ","\r","\n"]),R={x:3,u:5},B=(e,t,r)=>r||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],N=e=>{let t=typeof e;if("string"===t)return e;if("number"===t)return String(e);if(p(e)&&("stdout"in e||"isMaxBuffer"in e))return _(e);if(e instanceof v.ChildProcess||"[object Promise]"===Object.prototype.toString.call(e))throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${t}" in template expression`)},_=({stdout:e})=>{if("string"==typeof e)return e;if(S(e))return T.decode(e);if(void 0===e)throw TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.');throw TypeError(`Unexpected "${typeof e}" stdout in template expression`)};var L=e.i(12057),U=e.i(59639);let M=e=>F.includes(e),F=[U.default.stdin,U.default.stdout,U.default.stderr],G=["stdin","stdout","stderr"],H=e=>G[e]??`stdio[${e}]`,W=(e,t)=>{let r=Array.from({length:V(e)+1});return Q(X(e[t],r,t),t)},V=({stdio:e})=>Array.isArray(e)?Math.max(e.length,G.length):G.length,X=(e,t,r)=>p(e)?K(e,t,r):t.fill(e),K=(e,t,r)=>{for(let n of Object.keys(e).sort(z))for(let i of q(n,r,t))t[i]=e[n];return t},z=(e,t)=>J(e)<J(t)?1:-1,J=e=>"stdout"===e||"stderr"===e?0:"all"===e?2:1,q=(e,t,r)=>{if("ipc"===e)return[r.length-1];let n=Y(e);if(void 0===n||0===n)throw TypeError(`"${t}.${e}" is invalid.
1
+ module.exports=[82588,(e,t,r)=>{t.exports=i,i.sync=function(e,t){return o(n.statSync(e),t)};var n=e.r(22734);function i(e,t,r){n.stat(e,function(e,n){r(e,!e&&o(n,t))})}function o(e,t){var r,n,i,o,a,s,l,c,u;return e.isFile()&&(r=e,n=t,i=r.mode,o=r.uid,a=r.gid,s=void 0!==n.uid?n.uid:process.getuid&&process.getuid(),l=void 0!==n.gid?n.gid:process.getgid&&process.getgid(),c=parseInt("100",8),u=parseInt("010",8),i&parseInt("001",8)||i&u&&a===l||i&c&&o===s||i&(c|u)&&0===s)}},35707,(e,t,r)=>{t.exports=o,o.sync=function(e,t){return i(n.statSync(e),e,t)};var n=e.r(22734);function i(e,t,r){if(!e.isSymbolicLink()&&!e.isFile())return!1;var n=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!n||-1!==(n=n.split(";")).indexOf(""))return!0;for(var i=0;i<n.length;i++){var o=n[i].toLowerCase();if(o&&t.substr(-o.length).toLowerCase()===o)return!0}return!1}function o(e,t,r){n.stat(e,function(n,o){r(n,!n&&i(o,e,t))})}},24246,(e,t,r)=>{var n;function i(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,n){i(e,t||{},function(e,t){e?n(e):r(t)})})}n(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)})}e.r(22734),n="win32"===process.platform||e.g.TESTING_WINDOWS?e.r(35707):e.r(82588),t.exports=i,i.sync=function(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},80192,(e,t,r)=>{let n="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=e.r(14747),o=n?";":":",a=e.r(24246),s=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),l=(e,t)=>{let r=t.colon||o,i=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],a=n?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=n?a.split(r):[""];return n&&-1!==e.indexOf(".")&&""!==s[0]&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:a}},c=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:c}=l(e,t),u=[],d=r=>new Promise((o,a)=>{if(r===n.length)return t.all&&u.length?o(u):a(s(e));let l=n[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,d=i.join(c,e);o(f(!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,r,0))}),f=(e,r,n)=>new Promise((i,s)=>{if(n===o.length)return i(d(r+1));let l=o[n];a(e+l,{pathExt:c},(o,a)=>{if(!o&&a)if(!t.all)return i(e+l);else u.push(e+l);return i(f(e,r,n+1))})});return r?d(0).then(e=>r(null,e),r):d(0)};t.exports=c,c.sync=(e,t)=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=l(e,t=t||{}),c=[];for(let s=0;s<r.length;s++){let l=r[s],u=/^".*"$/.test(l)?l.slice(1,-1):l,d=i.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<n.length;e++){let r=f+n[e];try{if(a.sync(r,{pathExt:o}))if(!t.all)return r;else c.push(r)}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw s(e)}},80808,(e,t,r)=>{"use strict";let n=(e={})=>{let t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};t.exports=n,t.exports.default=n},23042,(e,t,r)=>{"use strict";let n=e.r(14747),i=e.r(80192),o=e.r(80808);function a(e,t){let r,a=e.options.env||process.env,s=process.cwd(),l=null!=e.options.cwd,c=l&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}try{r=i.sync(e.command,{path:a[o({env:a})],pathExt:t?n.delimiter:void 0})}catch(e){}finally{c&&process.chdir(s)}return r&&(r=n.resolve(l?e.options.cwd:"",r)),r}t.exports=function(e){return a(e)||a(e,!0)}},43082,(e,t,r)=>{"use strict";let n=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(e){return e.replace(n,"^$1")},t.exports.argument=function(e,t){return e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),e=(e=`"${e}"`).replace(n,"^$1"),t&&(e=e.replace(n,"^$1")),e}},19434,(e,t,r)=>{"use strict";t.exports=/^#!(.*)/},33965,(e,t,r)=>{"use strict";let n=e.r(19434);t.exports=(e="")=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return"env"===o?i:i?`${o} ${i}`:o}},37401,(e,t,r)=>{"use strict";let n=e.r(22734),i=e.r(33965);t.exports=function(e){let t,r=Buffer.alloc(150);try{t=n.openSync(e,"r"),n.readSync(t,r,0,150,0),n.closeSync(t)}catch(e){}return i(r.toString())}},75647,(e,t,r)=>{"use strict";e.r(14747),e.r(23042),e.r(43082),e.r(37401),process.platform,t.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);let n={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell,n}},47163,(e,t,r)=>{"use strict";process.platform,t.exports={hookChildProcess:function(e,t){},verifyENOENT:function(e,t){return null},verifyENOENTSync:function(e,t){return null},notFoundError:function(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}}},32227,(e,t,r)=>{"use strict";let n=e.r(33405),i=e.r(75647),o=e.r(47163);function a(e,t,r){let a=i(e,t,r),s=n.spawn(a.command,a.args,a.options);return o.hookChildProcess(s,a),s}t.exports=a,t.exports.spawn=a,t.exports.sync=function(e,t,r){let a=i(e,t,r),s=n.spawnSync(a.command,a.args,a.options);return s.error=s.error||o.verifyENOENTSync(s.status,a),s},t.exports._parse=i,t.exports._enoent=o},25206,18908,e=>{"use strict";let t,r,n,i;var o,a,s,l,c=e.i(24868),u=e.i(46786),d=e.i(14747),f=e.i(29220);function p(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var h=e.i(57764);let m=(e,t)=>{let r=w(g(e));if("string"!=typeof r)throw TypeError(`${t} must be a string or a file URL: ${r}.`);return r},g=e=>y(e)?e.toString():e,y=e=>"string"!=typeof e&&e&&Object.getPrototypeOf(e)===String.prototype,w=e=>e instanceof URL?(0,h.fileURLToPath)(e):e,b=(e,t=[],r={})=>{let n=m(e,"First argument"),[i,o]=p(t)?[[],t]:[t,r];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>"object"==typeof e&&null!==e))throw TypeError(`Second argument must be an array of strings: ${i}`);let a=i.map(String),s=a.find(e=>e.includes("\0"));if(void 0!==s)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!p(o))throw TypeError(`Last argument must be an options object: ${o}`);return[n,a,o]};var v=e.i(74533),x=e.i(99871);let{toString:$}=Object.prototype,S=e=>"[object Uint8Array]"===$.call(e),E=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),k=new TextEncoder,T=new TextDecoder,D=e=>1===e.length&&S(e[0])?e[0]:O(A(e)),A=e=>e.map(e=>"string"==typeof e?k.encode(e):e),O=e=>{let t=new Uint8Array(P(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},P=e=>{let t=0;for(let r of e)t+=r.length;return t},C=({templates:e,expressions:t,tokens:r,index:n,template:i})=>{if(void 0===i)throw TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:o,leadingWhitespaces:a,trailingWhitespaces:s}=j(i,e.raw[n]),l=B(r,o,a);if(n===t.length)return l;let c=t[n];return B(l,Array.isArray(c)?c.map(e=>N(e)):[N(c)],s)},j=(e,t)=>{if(0===t.length)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=I.has(t[0]);for(let i=0,o=0;i<e.length;i+=1,o+=1){let a=t[o];if(I.has(a))n!==i&&r.push(e.slice(n,i)),n=i+1;else if("\\"===a){let e=t[o+1];"\n"===e?(i-=1,o+=1):"u"===e&&"{"===t[o+2]?o=t.indexOf("}",o+3):o+=R[e]??1}}let o=n===e.length;return o||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:i,trailingWhitespaces:o}},I=new Set([" "," ","\r","\n"]),R={x:3,u:5},B=(e,t,r)=>r||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],N=e=>{let t=typeof e;if("string"===t)return e;if("number"===t)return String(e);if(p(e)&&("stdout"in e||"isMaxBuffer"in e))return _(e);if(e instanceof v.ChildProcess||"[object Promise]"===Object.prototype.toString.call(e))throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${t}" in template expression`)},_=({stdout:e})=>{if("string"==typeof e)return e;if(S(e))return T.decode(e);if(void 0===e)throw TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.');throw TypeError(`Unexpected "${typeof e}" stdout in template expression`)};var L=e.i(12057),U=e.i(59639);let M=e=>F.includes(e),F=[U.default.stdin,U.default.stdout,U.default.stderr],G=["stdin","stdout","stderr"],H=e=>G[e]??`stdio[${e}]`,W=(e,t)=>{let r=Array.from({length:V(e)+1});return Q(X(e[t],r,t),t)},V=({stdio:e})=>Array.isArray(e)?Math.max(e.length,G.length):G.length,X=(e,t,r)=>p(e)?K(e,t,r):t.fill(e),K=(e,t,r)=>{for(let n of Object.keys(e).sort(z))for(let i of q(n,r,t))t[i]=e[n];return t},z=(e,t)=>J(e)<J(t)?1:-1,J=e=>"stdout"===e||"stderr"===e?0:"all"===e?2:1,q=(e,t,r)=>{if("ipc"===e)return[r.length-1];let n=Y(e);if(void 0===n||0===n)throw TypeError(`"${t}.${e}" is invalid.
2
2
  It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(n>=r.length)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
3
- Please set the "stdio" option to ensure that file descriptor exists.`);return"all"===n?[1,2]:[n]},Y=e=>{if("all"===e)return e;if(G.includes(e))return G.indexOf(e);let t=Z.exec(e);if(null!==t)return Number(t[1])},Z=/^fd(\d+)$/,Q=(e,t)=>e.map(e=>void 0===e?ee[t]:e),ee={lines:!1,buffer:!0,maxBuffer:1e8,verbose:(0,L.debuglog)("execa").enabled?"full":"none",stripFinalNewline:!0},et=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],er=(e,t)=>"ipc"===t?e.at(-1):e[t],en=({verbose:e},t)=>!["none","short"].includes(ei(e,t)),ei=(e,t)=>void 0===t?eo(e):er(e,t),eo=e=>e.find(e=>ea(e))??es.findLast(t=>e.includes(t)),ea=e=>"function"==typeof e,es=["none","short","full"],el=e=>(0,L.stripVTControlCharacters)(e).split("\n").map(e=>ec(e)).join("\n"),ec=e=>e.replaceAll(ed,e=>eu(e)),eu=e=>{let t=ef[e];if(void 0!==t)return t;let r=e.codePointAt(0),n=r.toString(16);return r<=ep?`\\u${n.padStart(4,"0")}`:`\\U${n}`},ed=(()=>{try{return RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),ef={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},ep=65535,eh=/^[\w./-]+$/,em={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},eg={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},ey={...em,...eg},ew={...em,tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},eb=function(){let{env:e}=U.default,{TERM:t,TERM_PROGRAM:r}=e;return"win32"!==U.default.platform?"linux"!==t:!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===r||"vscode"===r||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}()?ey:ew;Object.entries(eg);var ev=e.i(9656);let ex=ev.default?.WriteStream?.prototype?.hasColors?.()??!1,e$=(e,t)=>{if(!ex)return e=>e;let r=`\u001B[${e}m`,n=`\u001B[${t}m`;return e=>{let i=e+"",o=i.indexOf(n);if(-1===o)return r+i+n;let a=r,s=0,l=(22===t?n:"")+r;for(;-1!==o;)a+=i.slice(s,o)+l,s=o+n.length,o=i.indexOf(n,s);return a+(i.slice(s)+n)}};e$(0,0);let eS=e$(1,22);e$(2,22),e$(3,23),e$(4,24),e$(53,55),e$(7,27),e$(8,28),e$(9,29),e$(30,39),e$(31,39),e$(32,39),e$(33,39),e$(34,39),e$(35,39),e$(36,39),e$(37,39);let eE=e$(90,39);e$(40,49),e$(41,49),e$(42,49),e$(43,49),e$(44,49),e$(45,49),e$(46,49),e$(47,49),e$(100,49);let ek=e$(91,39);e$(92,39);let eT=e$(93,39);e$(94,39),e$(95,39),e$(96,39),e$(97,39),e$(101,49),e$(102,49),e$(103,49),e$(104,49),e$(105,49),e$(106,49),e$(107,49);let eD=(e,t)=>String(e).padStart(t,"0"),eA=({failed:e,reject:t})=>e?t?eb.cross:eb.warning:eb.tick,eO={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:eA,duration:eA},eC=e=>e,ej={command:()=>eS,output:()=>eC,ipc:()=>eC,error:({reject:e})=>e?ek:eT,duration:()=>eE},eP=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:i})=>{var o;let a,s=(o=eR(t,eI({type:e,result:i,verboseInfo:n})),a=(({verbose:e},t)=>{let r=ei(e,t);return ea(r)?r:void 0})(n,r),o.map(({verboseLine:e,verboseObject:t})=>((e,t,r)=>{if(void 0===r)return e;let n=r(e,t);if("string"==typeof n)return n})(e,t,a)).filter(e=>void 0!==e).map(e=>{let t;return(t=e).endsWith("\n")?t:`${t}
4
- `}).join(""));""!==s&&console.warn(s.slice(0,-1))},eI=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:e,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:t,options:o}),eR=(e,t)=>e.split("\n").map(e=>eB({...t,message:e})),eB=e=>({verboseLine:(({type:e,message:t,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:a=!0}})=>{let s,l=(s=r,`${eD(s.getHours(),2)}:${eD(s.getMinutes(),2)}:${eD(s.getSeconds(),2)}.${eD(s.getMilliseconds(),3)}`),c=eO[e]({failed:o,reject:a,piped:n}),u=ej[e]({reject:a});return`${eE(`[${l}]`)} ${eE(`[${i}]`)} ${u(c)} ${u(t)}`})(e),verboseObject:e}),eN=e=>el("string"==typeof e?e:(0,L.inspect)(e)).replaceAll(" "," ".repeat(e_)),e_=2,eL=0n,eU=e=>Number(U.hrtime.bigint()-e)/1e6,eM=(e,t,r)=>{var n,i;let o,a,s=U.hrtime.bigint(),{command:l,escapedCommand:c}={command:(o=[e,...t]).join(" "),escapedCommand:o.map(e=>{let t;return eh.test(t=ec(e))?t:`'${t.replaceAll("'","'\\''")}'`}).join(" ")},u=(n=W(r,"verbose"),i={...r},(e=>{for(let t of e){if(!1===t)throw TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".');if(!0===t)throw TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".');if(!es.includes(t)&&!ea(t)){let e=es.map(e=>`'${e}'`).join(", ");throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}})(n),a=(({verbose:e})=>"none"!==ei(e,void 0))({verbose:n})?eL++:void 0,{verbose:n,escapedCommand:c,commandId:a,rawOptions:i});return(({verbose:e})=>"none"!==ei(e,void 0))(u)&&eP({type:"command",verboseMessage:c,verboseInfo:u}),{command:l,escapedCommand:c,startTime:s,verboseInfo:u}};var eF=e.i(50227),eG=e.i(32227),eH=U;function eW(e={}){let{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"}function eV(e){return e instanceof URL?(0,h.fileURLToPath)(e):e}(0,L.promisify)(v.execFile);var eX=e.i(36340);class eK extends Error{}let ez=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,eJ,{value:!0,writable:!1,enumerable:!1,configurable:!1})},eJ=Symbol("isExecaError"),eq=e=>"[object Error]"===Object.prototype.toString.call(e);class eY extends Error{}ez(eY,eY.name);class eZ extends Error{}ez(eZ,eZ.name);var eQ=e.i(60526);let e0=(e,t)=>({name:`SIGRT${t+1}`,number:e1+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),e1=34,e2=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],e4=()=>[...e2,...Array.from({length:64-e1+1},e0)].map(e3),e3=({name:e,number:t,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[e]:a}}=eQ.constants,s=void 0!==a;return{name:e,number:s?a:t,description:r,supported:s,action:n,forced:i,standard:o}},e8=Object.fromEntries(e4().map(({name:e,number:t,description:r,supported:n,action:i,forced:o,standard:a})=>[e,{name:e,number:t,description:r,supported:n,action:i,forced:o,standard:a}])),e6=(e,t)=>{let r=t.find(({name:t})=>eQ.constants.signals[t]===e);return void 0!==r?r:t.find(t=>t.number===e)};t=e4(),Object.assign({},...Array.from({length:65},(e,r)=>((e,t)=>{let r=e6(e,t);if(void 0===r)return{};let{name:n,description:i,supported:o,action:a,forced:s,standard:l}=r;return{[e]:{name:n,number:e,description:i,supported:o,action:a,forced:s,standard:l}}})(r,t)));let e5=(e,t)=>{if(Number.isInteger(e))return e9(e,t);if("string"==typeof e)return te(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
3
+ Please set the "stdio" option to ensure that file descriptor exists.`);return"all"===n?[1,2]:[n]},Y=e=>{if("all"===e)return e;if(G.includes(e))return G.indexOf(e);let t=Z.exec(e);if(null!==t)return Number(t[1])},Z=/^fd(\d+)$/,Q=(e,t)=>e.map(e=>void 0===e?ee[t]:e),ee={lines:!1,buffer:!0,maxBuffer:1e8,verbose:(0,L.debuglog)("execa").enabled?"full":"none",stripFinalNewline:!0},et=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],er=(e,t)=>"ipc"===t?e.at(-1):e[t],en=({verbose:e},t)=>!["none","short"].includes(ei(e,t)),ei=(e,t)=>void 0===t?eo(e):er(e,t),eo=e=>e.find(e=>ea(e))??es.findLast(t=>e.includes(t)),ea=e=>"function"==typeof e,es=["none","short","full"],el=e=>(0,L.stripVTControlCharacters)(e).split("\n").map(e=>ec(e)).join("\n"),ec=e=>e.replaceAll(ed,e=>eu(e)),eu=e=>{let t=ef[e];if(void 0!==t)return t;let r=e.codePointAt(0),n=r.toString(16);return r<=ep?`\\u${n.padStart(4,"0")}`:`\\U${n}`},ed=(()=>{try{return RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),ef={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},ep=65535,eh=/^[\w./-]+$/,em={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},eg={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},ey={...em,...eg},ew={...em,tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},eb=function(){let{env:e}=U.default,{TERM:t,TERM_PROGRAM:r}=e;return"win32"!==U.default.platform?"linux"!==t:!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===r||"vscode"===r||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}()?ey:ew;Object.entries(eg);var ev=e.i(9656);let ex=ev.default?.WriteStream?.prototype?.hasColors?.()??!1,e$=(e,t)=>{if(!ex)return e=>e;let r=`\u001B[${e}m`,n=`\u001B[${t}m`;return e=>{let i=e+"",o=i.indexOf(n);if(-1===o)return r+i+n;let a=r,s=0,l=(22===t?n:"")+r;for(;-1!==o;)a+=i.slice(s,o)+l,s=o+n.length,o=i.indexOf(n,s);return a+(i.slice(s)+n)}};e$(0,0);let eS=e$(1,22);e$(2,22),e$(3,23),e$(4,24),e$(53,55),e$(7,27),e$(8,28),e$(9,29),e$(30,39),e$(31,39),e$(32,39),e$(33,39),e$(34,39),e$(35,39),e$(36,39),e$(37,39);let eE=e$(90,39);e$(40,49),e$(41,49),e$(42,49),e$(43,49),e$(44,49),e$(45,49),e$(46,49),e$(47,49),e$(100,49);let ek=e$(91,39);e$(92,39);let eT=e$(93,39);e$(94,39),e$(95,39),e$(96,39),e$(97,39),e$(101,49),e$(102,49),e$(103,49),e$(104,49),e$(105,49),e$(106,49),e$(107,49);let eD=(e,t)=>String(e).padStart(t,"0"),eA=({failed:e,reject:t})=>e?t?eb.cross:eb.warning:eb.tick,eO={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:eA,duration:eA},eP=e=>e,eC={command:()=>eS,output:()=>eP,ipc:()=>eP,error:({reject:e})=>e?ek:eT,duration:()=>eE},ej=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:i})=>{var o;let a,s=(o=eR(t,eI({type:e,result:i,verboseInfo:n})),a=(({verbose:e},t)=>{let r=ei(e,t);return ea(r)?r:void 0})(n,r),o.map(({verboseLine:e,verboseObject:t})=>((e,t,r)=>{if(void 0===r)return e;let n=r(e,t);if("string"==typeof n)return n})(e,t,a)).filter(e=>void 0!==e).map(e=>{let t;return(t=e).endsWith("\n")?t:`${t}
4
+ `}).join(""));""!==s&&console.warn(s.slice(0,-1))},eI=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:e,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:t,options:o}),eR=(e,t)=>e.split("\n").map(e=>eB({...t,message:e})),eB=e=>({verboseLine:(({type:e,message:t,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:a=!0}})=>{let s,l=(s=r,`${eD(s.getHours(),2)}:${eD(s.getMinutes(),2)}:${eD(s.getSeconds(),2)}.${eD(s.getMilliseconds(),3)}`),c=eO[e]({failed:o,reject:a,piped:n}),u=eC[e]({reject:a});return`${eE(`[${l}]`)} ${eE(`[${i}]`)} ${u(c)} ${u(t)}`})(e),verboseObject:e}),eN=e=>el("string"==typeof e?e:(0,L.inspect)(e)).replaceAll(" "," ".repeat(e_)),e_=2,eL=0n,eU=e=>Number(U.hrtime.bigint()-e)/1e6,eM=(e,t,r)=>{var n,i;let o,a,s=U.hrtime.bigint(),{command:l,escapedCommand:c}={command:(o=[e,...t]).join(" "),escapedCommand:o.map(e=>{let t;return eh.test(t=ec(e))?t:`'${t.replaceAll("'","'\\''")}'`}).join(" ")},u=(n=W(r,"verbose"),i={...r},(e=>{for(let t of e){if(!1===t)throw TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".');if(!0===t)throw TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".');if(!es.includes(t)&&!ea(t)){let e=es.map(e=>`'${e}'`).join(", ");throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}})(n),a=(({verbose:e})=>"none"!==ei(e,void 0))({verbose:n})?eL++:void 0,{verbose:n,escapedCommand:c,commandId:a,rawOptions:i});return(({verbose:e})=>"none"!==ei(e,void 0))(u)&&ej({type:"command",verboseMessage:c,verboseInfo:u}),{command:l,escapedCommand:c,startTime:s,verboseInfo:u}};var eF=e.i(50227),eG=e.i(32227),eH=U;function eW(e={}){let{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"}function eV(e){return e instanceof URL?(0,h.fileURLToPath)(e):e}(0,L.promisify)(v.execFile);var eX=e.i(36340);class eK extends Error{}let ez=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,eJ,{value:!0,writable:!1,enumerable:!1,configurable:!1})},eJ=Symbol("isExecaError"),eq=e=>"[object Error]"===Object.prototype.toString.call(e);class eY extends Error{}ez(eY,eY.name);class eZ extends Error{}ez(eZ,eZ.name);var eQ=e.i(60526);let e0=(e,t)=>({name:`SIGRT${t+1}`,number:e1+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),e1=34,e2=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],e4=()=>[...e2,...Array.from({length:64-e1+1},e0)].map(e3),e3=({name:e,number:t,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[e]:a}}=eQ.constants,s=void 0!==a;return{name:e,number:s?a:t,description:r,supported:s,action:n,forced:i,standard:o}},e8=Object.fromEntries(e4().map(({name:e,number:t,description:r,supported:n,action:i,forced:o,standard:a})=>[e,{name:e,number:t,description:r,supported:n,action:i,forced:o,standard:a}])),e6=(e,t)=>{let r=t.find(({name:t})=>eQ.constants.signals[t]===e);return void 0!==r?r:t.find(t=>t.number===e)};t=e4(),Object.assign({},...Array.from({length:65},(e,r)=>((e,t)=>{let r=e6(e,t);if(void 0===r)return{};let{name:n,description:i,supported:o,action:a,forced:s,standard:l}=r;return{[e]:{name:n,number:e,description:i,supported:o,action:a,forced:s,standard:l}}})(r,t)));let e5=(e,t)=>{if(Number.isInteger(e))return e9(e,t);if("string"==typeof e)return te(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
5
5
  ${tt()}`)},e9=(e,t)=>{if(e7.has(e))return e7.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
6
6
  ${tt()}`)},e7=new Map(Object.entries(eQ.constants.signals).reverse().map(([e,t])=>[t,e])),te=(e,t)=>{if(e in eQ.constants.signals)return e;if(e.toUpperCase()in eQ.constants.signals)throw TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`);throw TypeError(`Invalid ${t} '${e}': this signal name does not exist.
7
7
  ${tt()}`)},tt=()=>`Available signal names: ${tr()}.
8
- Available signal numbers: ${tn()}.`,tr=()=>Object.keys(eQ.constants.signals).sort().map(e=>`'${e}'`).join(", "),tn=()=>[...new Set(Object.values(eQ.constants.signals).sort((e,t)=>e-t))].join(", "),ti=e=>e8[e].description,to=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:i,controller:o},a,s)=>{let{signal:l,error:c}=ta(a,s,r);ts(c,n);let u=e(l);return tl({kill:e,signal:l,forceKillAfterDelay:t,killSignal:r,killResult:u,context:i,controller:o}),u},ta=(e,t,r)=>{let[n=r,i]=eq(e)?[void 0,e]:[e,t];if("string"!=typeof n&&!Number.isInteger(n))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(void 0!==i&&!eq(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:0===n?n:e5(n,"`subprocess.kill()`'s argument"),error:i}},ts=(e,t)=>{void 0!==e&&t.reject(e)},tl=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:a})=>{t===n&&i&&tc({kill:e,forceKillAfterDelay:r,context:o,controllerSignal:a.signal})},tc=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(!1!==t)try{await (0,eX.setTimeout)(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};var tu=e.i(87769);let td=async(e,t)=>{e.aborted||await (0,tu.once)(e,"abort",{signal:t})},tf=async(e,t,r,{signal:n})=>{throw await td(t,n),r.terminationReason??="cancel",e.kill(),t.reason},tp=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{th(e,t,r),tm(e,t,n)},th=(e,t,r)=>{if(!r)throw Error(`${tb(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},tm=(e,t,r)=>{if(!r)throw Error(`${tb(e,t)} cannot be used: the ${tx(t)} has already exited or disconnected.`)},tg=(e,t)=>Error(`${tb("sendMessage",t)} failed when sending an acknowledgment response to the ${tx(t)}.`,{cause:e}),ty=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),tw=["could not be cloned","circular structure","call stack size exceeded"],tb=(e,t,r="")=>"cancelSignal"===e?"`cancelSignal`'s `controller.abort()`":`${tv(t)}${e}(${r})`,tv=e=>e?"":"subprocess.",tx=e=>e?"parent process":"subprocess",t$=e=>{e.connected&&e.disconnect()},tS=()=>{let e={};return Object.assign(new Promise((t,r)=>{Object.assign(e,{resolve:t,reject:r})}),e)},tE=(e,t="stdin")=>{let{options:r,fileDescriptors:n}=tT.get(e),i=tD(n,t,!0),o=e.stdio[i];if(null===o)throw TypeError(tC(i,t,r,!0));return o},tk=(e,t="stdout")=>{let{options:r,fileDescriptors:n}=tT.get(e),i=tD(n,t,!1),o="all"===i?e.all:e.stdio[i];if(null==o)throw TypeError(tC(i,t,r,!1));return o},tT=new WeakMap,tD=(e,t,r)=>{let n=tA(t,r);return tO(n,t,r,e),n},tA=(e,t)=>{let r=Y(e);if(void 0!==r)return r;let{validOptions:n,defaultValue:i}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${tI(t)}" must not be "${e}".
8
+ Available signal numbers: ${tn()}.`,tr=()=>Object.keys(eQ.constants.signals).sort().map(e=>`'${e}'`).join(", "),tn=()=>[...new Set(Object.values(eQ.constants.signals).sort((e,t)=>e-t))].join(", "),ti=e=>e8[e].description,to=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:i,controller:o},a,s)=>{let{signal:l,error:c}=ta(a,s,r);ts(c,n);let u=e(l);return tl({kill:e,signal:l,forceKillAfterDelay:t,killSignal:r,killResult:u,context:i,controller:o}),u},ta=(e,t,r)=>{let[n=r,i]=eq(e)?[void 0,e]:[e,t];if("string"!=typeof n&&!Number.isInteger(n))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(void 0!==i&&!eq(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:0===n?n:e5(n,"`subprocess.kill()`'s argument"),error:i}},ts=(e,t)=>{void 0!==e&&t.reject(e)},tl=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:a})=>{t===n&&i&&tc({kill:e,forceKillAfterDelay:r,context:o,controllerSignal:a.signal})},tc=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(!1!==t)try{await (0,eX.setTimeout)(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};var tu=e.i(87769);let td=async(e,t)=>{e.aborted||await (0,tu.once)(e,"abort",{signal:t})},tf=async(e,t,r,{signal:n})=>{throw await td(t,n),r.terminationReason??="cancel",e.kill(),t.reason},tp=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{th(e,t,r),tm(e,t,n)},th=(e,t,r)=>{if(!r)throw Error(`${tb(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},tm=(e,t,r)=>{if(!r)throw Error(`${tb(e,t)} cannot be used: the ${tx(t)} has already exited or disconnected.`)},tg=(e,t)=>Error(`${tb("sendMessage",t)} failed when sending an acknowledgment response to the ${tx(t)}.`,{cause:e}),ty=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),tw=["could not be cloned","circular structure","call stack size exceeded"],tb=(e,t,r="")=>"cancelSignal"===e?"`cancelSignal`'s `controller.abort()`":`${tv(t)}${e}(${r})`,tv=e=>e?"":"subprocess.",tx=e=>e?"parent process":"subprocess",t$=e=>{e.connected&&e.disconnect()},tS=()=>{let e={};return Object.assign(new Promise((t,r)=>{Object.assign(e,{resolve:t,reject:r})}),e)},tE=(e,t="stdin")=>{let{options:r,fileDescriptors:n}=tT.get(e),i=tD(n,t,!0),o=e.stdio[i];if(null===o)throw TypeError(tP(i,t,r,!0));return o},tk=(e,t="stdout")=>{let{options:r,fileDescriptors:n}=tT.get(e),i=tD(n,t,!1),o="all"===i?e.all:e.stdio[i];if(null==o)throw TypeError(tP(i,t,r,!1));return o},tT=new WeakMap,tD=(e,t,r)=>{let n=tA(t,r);return tO(n,t,r,e),n},tA=(e,t)=>{let r=Y(e);if(void 0!==r)return r;let{validOptions:n,defaultValue:i}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${tI(t)}" must not be "${e}".
9
9
  It must be ${n} or "fd3", "fd4" (and so on).
10
- It is optional and defaults to "${i}".`)},tO=(e,t,r,n)=>{let i=n[tP(e)];if(void 0===i)throw TypeError(`"${tI(r)}" must not be ${t}. That file descriptor does not exist.
11
- Please set the "stdio" option to ensure that file descriptor exists.`);if("input"===i.direction&&!r)throw TypeError(`"${tI(r)}" must not be ${t}. It must be a readable stream, not writable.`);if("input"!==i.direction&&r)throw TypeError(`"${tI(r)}" must not be ${t}. It must be a writable stream, not readable.`)},tC=(e,t,r,n)=>{if("all"===e&&!r.all)return'The "all" option must be true to use "from: \'all\'".';let{optionName:i,optionValue:o}=tj(e,r);return`The "${i}: ${tR(o)}" option is incompatible with using "${tI(n)}: ${tR(t)}".
12
- Please set this option with "pipe" instead.`},tj=(e,{stdin:t,stdout:r,stderr:n,stdio:i})=>{let o=tP(e);return 0===o&&void 0!==t?{optionName:"stdin",optionValue:t}:1===o&&void 0!==r?{optionName:"stdout",optionValue:r}:2===o&&void 0!==n?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},tP=e=>"all"===e?1:e,tI=e=>e?"to":"from",tR=e=>"string"==typeof e?`'${e}'`:"number"==typeof e?`${e}`:"Stream",tB=(e,t,r)=>{let n=e.getMaxListeners();0!==n&&n!==1/0&&(e.setMaxListeners(n+t),(0,tu.addAbortListener)(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},tN=(e,t)=>{t&&t_(e)},t_=e=>{e.refCounted()},tL=(e,t)=>{t&&tU(e)},tU=e=>{e.unrefCounted()},tM=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},i)=>{if(tq(i)||ri(i))return;tG.has(e)||tG.set(e,[]);let o=tG.get(e);if(o.push(i),!(o.length>1))for(;o.length>0;){await t2(e,n,i),await eX.scheduler.yield();let a=await tJ({wrappedMessage:o[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",a),n.emit("message:done")}},tF=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{ra();let o=tG.get(e);for(;o?.length>0;)await (0,tu.once)(n,"message:done");e.removeListener("message",i),r&&(t_(t),t_(t)),n.connected=!1,n.emit("disconnect")},tG=new WeakMap,tH=(e,t,r)=>{if(tW.has(e))return tW.get(e);let n=new tu.EventEmitter;return n.connected=!0,tW.set(e,n),tV({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},tW=new WeakMap,tV=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{let i=tM.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",i),t.once("disconnect",tF.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:i})),n&&(tU(r),tU(r))},tX=e=>{let t=tW.get(e);return void 0===t?null!==e.channel:t.connected},tK=0n,tz=(e,t)=>{if(t?.type===t0&&!t.hasListeners)for(let{id:t}of e)void 0!==t&&tZ[t].resolve({isDeadlock:!0,hasListeners:!1})},tJ=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(e?.type!==t0||!t.connected)return e;let{id:o,message:a}=e,s={id:o,type:t1,message:t3(t,i)};try{await t6({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},s)}catch(e){i.emit("strict:error",e)}return a},tq=e=>{if(e?.type!==t1)return!1;let{id:t,message:r}=e;return tZ[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},tY=async(e,t,r)=>{if(e?.type!==t0)return;let n=tS();tZ[e.id]=n;let i=new AbortController;try{let{isDeadlock:e,hasListeners:o}=await Promise.race([n,tQ(t,r,i)]);e&&(e=>{throw Error(`${tb("sendMessage",e)} failed: the ${tx(e)} is sending a message too, instead of listening to incoming messages.
10
+ It is optional and defaults to "${i}".`)},tO=(e,t,r,n)=>{let i=n[tj(e)];if(void 0===i)throw TypeError(`"${tI(r)}" must not be ${t}. That file descriptor does not exist.
11
+ Please set the "stdio" option to ensure that file descriptor exists.`);if("input"===i.direction&&!r)throw TypeError(`"${tI(r)}" must not be ${t}. It must be a readable stream, not writable.`);if("input"!==i.direction&&r)throw TypeError(`"${tI(r)}" must not be ${t}. It must be a writable stream, not readable.`)},tP=(e,t,r,n)=>{if("all"===e&&!r.all)return'The "all" option must be true to use "from: \'all\'".';let{optionName:i,optionValue:o}=tC(e,r);return`The "${i}: ${tR(o)}" option is incompatible with using "${tI(n)}: ${tR(t)}".
12
+ Please set this option with "pipe" instead.`},tC=(e,{stdin:t,stdout:r,stderr:n,stdio:i})=>{let o=tj(e);return 0===o&&void 0!==t?{optionName:"stdin",optionValue:t}:1===o&&void 0!==r?{optionName:"stdout",optionValue:r}:2===o&&void 0!==n?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},tj=e=>"all"===e?1:e,tI=e=>e?"to":"from",tR=e=>"string"==typeof e?`'${e}'`:"number"==typeof e?`${e}`:"Stream",tB=(e,t,r)=>{let n=e.getMaxListeners();0!==n&&n!==1/0&&(e.setMaxListeners(n+t),(0,tu.addAbortListener)(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},tN=(e,t)=>{t&&t_(e)},t_=e=>{e.refCounted()},tL=(e,t)=>{t&&tU(e)},tU=e=>{e.unrefCounted()},tM=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},i)=>{if(tq(i)||ri(i))return;tG.has(e)||tG.set(e,[]);let o=tG.get(e);if(o.push(i),!(o.length>1))for(;o.length>0;){await t2(e,n,i),await eX.scheduler.yield();let a=await tJ({wrappedMessage:o[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",a),n.emit("message:done")}},tF=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{ra();let o=tG.get(e);for(;o?.length>0;)await (0,tu.once)(n,"message:done");e.removeListener("message",i),r&&(t_(t),t_(t)),n.connected=!1,n.emit("disconnect")},tG=new WeakMap,tH=(e,t,r)=>{if(tW.has(e))return tW.get(e);let n=new tu.EventEmitter;return n.connected=!0,tW.set(e,n),tV({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},tW=new WeakMap,tV=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{let i=tM.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",i),t.once("disconnect",tF.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:i})),n&&(tU(r),tU(r))},tX=e=>{let t=tW.get(e);return void 0===t?null!==e.channel:t.connected},tK=0n,tz=(e,t)=>{if(t?.type===t0&&!t.hasListeners)for(let{id:t}of e)void 0!==t&&tZ[t].resolve({isDeadlock:!0,hasListeners:!1})},tJ=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(e?.type!==t0||!t.connected)return e;let{id:o,message:a}=e,s={id:o,type:t1,message:t3(t,i)};try{await t6({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},s)}catch(e){i.emit("strict:error",e)}return a},tq=e=>{if(e?.type!==t1)return!1;let{id:t,message:r}=e;return tZ[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},tY=async(e,t,r)=>{if(e?.type!==t0)return;let n=tS();tZ[e.id]=n;let i=new AbortController;try{let{isDeadlock:e,hasListeners:o}=await Promise.race([n,tQ(t,r,i)]);e&&(e=>{throw Error(`${tb("sendMessage",e)} failed: the ${tx(e)} is sending a message too, instead of listening to incoming messages.
13
13
  This can be fixed by both sending a message and listening to incoming messages at the same time:
14
14
 
15
15
  const [receivedMessage] = await Promise.all([
@@ -18,46 +18,48 @@ const [receivedMessage] = await Promise.all([
18
18
  ]);`)})(r),o||(e=>{throw Error(`${tb("sendMessage",e)} failed: the ${tx(e)} is not listening to incoming messages.`)})(r)}finally{i.abort(),delete tZ[e.id]}},tZ={},tQ=async(e,t,{signal:r})=>{tB(e,1,r),await (0,tu.once)(e,"disconnect",{signal:r});throw Error(`${tb("sendMessage",t)} failed: the ${tx(t)} exited without listening to incoming messages.`)},t0="execa:ipc:request",t1="execa:ipc:response",t2=async(e,t,r)=>{for(;!t3(e,t)&&t4.get(e)?.size>0;){let t=[...t4.get(e)];tz(t,r),await Promise.all(t.map(({onMessageSent:e})=>e))}},t4=new WeakMap,t3=(e,t)=>t.listenerCount("message")>t8(e),t8=e=>tT.has(e)&&!er(tT.get(e).options.buffer,"ipc")?1:0,t6=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let a="sendMessage";return tp({methodName:a,isSubprocess:r,ipc:n,isConnected:e.connected}),t5({anyProcess:e,channel:t,methodName:a,isSubprocess:r,message:i,strict:o})},t5=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:i,strict:o})=>{let a,s,l=(({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=tH(e,t,r),a=t3(e,o);return{id:tK++,type:t0,message:n,hasListeners:a}})({anyProcess:e,channel:t,isSubprocess:n,message:i,strict:o}),c=(t4.has(e)||t4.set(e,new Set),a=t4.get(e),s={onMessageSent:tS(),id:o?l.id:void 0},a.add(s),{outgoingMessages:a,outgoingMessage:s});try{await t9({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:l,message:i})}catch(t){throw t$(e),t}finally{(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()})(c)}},t9=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=t7(e);try{await Promise.all([tY(n,e,r),o(n)])}catch(e){throw(({error:e,methodName:t,isSubprocess:r})=>{if("EPIPE"===e.code)throw Error(`${tb(t,r)} cannot be used: the ${tx(r)} is disconnecting.`,{cause:e})})({error:e,methodName:t,isSubprocess:r}),(({error:e,methodName:t,isSubprocess:r,message:n})=>{if((({code:e,message:t})=>ty.has(e)||tw.some(e=>t.includes(e)))(e))throw Error(`${tb(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:e})})({error:e,methodName:t,isSubprocess:r,message:i}),e}},t7=e=>{if(re.has(e))return re.get(e);let t=(0,L.promisify)(e.send.bind(e));return re.set(e,t),t},re=new WeakMap,rt=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await rr({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),rs.signal),rr=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{if(!rn){if(rn=!0,!n)return void(()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")})();if(null===t)return void ra();tH(e,t,r),await eX.scheduler.yield()}},rn=!1,ri=e=>e?.type===ro&&(rs.abort(e.message),!0),ro="execa:ipc:cancel",ra=()=>{rs.abort(Error(`\`cancelSignal\` aborted: the ${tx(!0)} disconnected.`))},rs=new AbortController,rl=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{let o;await td(t,i);let a=rc(t);throw await (tm(o="cancelSignal",!1,e.connected),t9({anyProcess:e,methodName:o,isSubprocess:!1,wrappedMessage:{type:ro,message:a},message:a})),tc({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",t.reason},rc=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},ru=async(e,t,r,{signal:n})=>{throw await (0,eX.setTimeout)(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new eK};var rd=U,rf=e.i(44385);let rp={advanced:e=>{try{(0,rf.serialize)(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},rh=async(e,t)=>{void 0!==t&&await e.sendMessage(t)},rm=new Set(["utf8","utf16le"]),rg=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),ry=new Set([...rm,...rg]),rw={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},rb=e=>"string"==typeof e?`"${e}"`:String(e);var rv=e.i(2157);let rx=()=>{try{return U.default.cwd()}catch(e){throw e.message=`The current directory does not exist.
19
19
  ${e.message}`,e}},r$=(e,t,r)=>{r.cwd=((e=rx())=>{let t=m(e,'The "cwd" option');return eF.default.resolve(t)})(r.cwd);let[n,i,o]=((e,t,{node:r=!1,nodePath:n=rd.execPath,nodeOptions:i=rd.execArgv.filter(e=>!e.startsWith("--inspect")),cwd:o,execPath:a,...s})=>{if(void 0!==a)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let l=m(n,'The "nodePath" option'),c=eF.default.resolve(o,l),u={...s,nodePath:c,node:r,cwd:o};if(!r)return[e,t,u];if("node"===eF.default.basename(e,".exe"))throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[c,[...i,e,...t],{ipc:!0,...u,shell:!1}]})(e,t,r),{command:a,args:s,options:l}=eG.default._parse(n,i,o),c=rS((e=>{let t={...e};for(let r of et)t[r]=W(e,r);return t})(l));return(({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)})(c),(({encoding:e})=>{if(ry.has(e))return;let t=(e=>{if(null===e)return"buffer";if("string"!=typeof e)return;let t=e.toLowerCase();return t in rw?rw[t]:ry.has(t)?t:void 0})(e);if(void 0!==t)throw TypeError(`Invalid option \`encoding: ${rb(e)}\`.
20
20
  Please rename it to ${rb(t)}.`);let r=[...ry].map(e=>rb(e)).join(", ");throw TypeError(`Invalid option \`encoding: ${rb(e)}\`.
21
- Please rename it to one of: ${r}.`)})(c),(({ipcInput:e,ipc:t,serialization:r})=>{if(void 0!==e){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");rp[r](e)}})(c),(({cancelSignal:e})=>{if(void 0!==e&&"[object AbortSignal]"!==Object.prototype.toString.call(e))throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)})(c),(({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(e){if(void 0===t)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if("json"===n)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}})(c),c.shell=w(c.shell),c.env=rE(c),c.killSignal=(e=>{let t="option `killSignal`";if(0===e)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return e5(e,t)})(c.killSignal),c.forceKillAfterDelay=(e=>{if(!1===e)return e;if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e})(c.forceKillAfterDelay),c.lines=c.lines.map((e,t)=>e&&!rg.has(c.encoding)&&c.buffer[t]),"win32"===U.default.platform&&"cmd"===eF.default.basename(a,".exe")&&s.unshift("/q"),{file:a,commandArguments:s,options:c}},rS=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:a=!0,all:s=!1,windowsHide:l=!0,killSignal:c="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=void 0!==f||d,serialization:h="advanced",...m})=>({...m,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:a,all:s,windowsHide:l,killSignal:c,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:h}),rE=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let a=t?{...U.default.env,...e}:e;return r||n?(({env:e=eH.default.env,...t}={})=>{let r=eW({env:e={...e}});return t.path=e[r],e[r]=(({cwd:e=eH.default.cwd(),path:t=eH.default.env[eW()],preferLocal:r=!0,execPath:n=eH.default.execPath,addExecPath:i=!0}={})=>{var o,a,s,l;let c,u=eF.default.resolve(eV(e)),d=[],f=t.split(eF.default.delimiter);return r&&((e,t,r)=>{for(let n of{*[Symbol.iterator](){let e,t=eF.default.resolve(eV(r));for(;e!==t;)yield t,e=t,t=eF.default.resolve(t,"..")}}){let r=eF.default.join(n,"node_modules/.bin");t.includes(r)||e.push(r)}})(d,f,u),i&&(o=d,a=f,s=n,l=u,c=eF.default.resolve(l,eV(s),".."),a.includes(c)||o.push(c)),""===t||t===eF.default.delimiter?`${d.join(eF.default.delimiter)}${t}`:[...d,t].join(eF.default.delimiter)})(t),e})({env:a,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):a},rk=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];function rT(e){if("string"==typeof e)return rD(e);if(!(ArrayBuffer.isView(e)&&1===e.BYTES_PER_ELEMENT))throw Error("Input must be a string or a Uint8Array");return rA(e)}let rD=e=>e.at(-1)===rO?e.slice(0,e.at(-2)===rj?-2:-1):e,rA=e=>e.at(-1)===rC?e.subarray(0,e.at(-2)===rP?-2:-1):e,rO="\n",rC=rO.codePointAt(0),rj="\r",rP=rj.codePointAt(0);function rI(e,{checkOpen:t=!0}={}){return null!==e&&"object"==typeof e&&(e.writable||e.readable||!t||void 0===e.writable&&void 0===e.readable)&&"function"==typeof e.pipe}function rR(e,{checkOpen:t=!0}={}){return rI(e,{checkOpen:t})&&(e.writable||!t)&&"function"==typeof e.write&&"function"==typeof e.end&&"boolean"==typeof e.writable&&"boolean"==typeof e.writableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function rB(e,{checkOpen:t=!0}={}){return rI(e,{checkOpen:t})&&(e.readable||!t)&&"function"==typeof e.read&&"boolean"==typeof e.readable&&"boolean"==typeof e.readableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function rN(e,t){return rR(e,t)&&rB(e,t)}let r_=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class rL{#e;#t;#r=!1;#n=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let t=()=>this.#o(e);return this.#n?this.#n.then(t,t):t()}async #i(){let e;if(this.#r)return{done:!0,value:void 0};try{e=await this.#e.read()}catch(e){throw this.#n=void 0,this.#r=!0,this.#e.releaseLock(),e}return e.done&&(this.#n=void 0,this.#r=!0,this.#e.releaseLock()),e}async #o(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}}let rU=Symbol();function rM(){return this[rU].next()}function rF(e){return this[rU].return(e)}Object.defineProperty(rM,"name",{value:"next"}),Object.defineProperty(rF,"name",{value:"return"});let rG=Object.create(r_,{next:{enumerable:!0,configurable:!0,writable:!0,value:rM},return:{enumerable:!0,configurable:!0,writable:!0,value:rF}});function rH({preventCancel:e=!1}={}){let t=new rL(this.getReader(),e),r=Object.create(rG);return r[rU]=t,r}let{toString:rW}=Object.prototype,rV=async function*(e){let t=new AbortController,r={};rX(e,t,r);try{for await(let[r]of rK.on(e,"data",{signal:t.signal}))yield r}catch(e){if(void 0!==r.error)throw r.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},rX=async(e,t,r)=>{try{await rK.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){r.error=e}finally{t.abort()}},rK={},rz=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:a,finalize:s},{maxBuffer:l=1/0}={})=>{let c=(e=>{if(rB(e,{checkOpen:!1})&&void 0!==rK.on)return rV(e);if("function"==typeof e?.[Symbol.asyncIterator])return e;if("[object ReadableStream]"===rW.call(e))return rH.call(e);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")})(e),u=t();u.length=0;try{for await(let e of c){let t=r[rZ(e)](e,u);rq({convertedChunk:t,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:l})}return rJ({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:a,maxBuffer:l}),s(u)}catch(t){let e="object"==typeof t&&null!==t?t:Error(t);throw e.bufferedData=s(u),e}},rJ=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let a=i(e);void 0!==a&&rq({convertedChunk:a,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:o})},rq=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let a=r(e),s=t.length+a;if(s<=o)return void rY(e,t,i,s);let l=n(e,o-t.length);throw void 0!==l&&rY(l,t,i,o),new r0},rY=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},rZ=e=>{let t=typeof e;if("string"===t)return"string";if("object"!==t||null===e)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=rQ.call(e);return"[object ArrayBuffer]"===r?"arrayBuffer":"[object DataView]"===r?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===rQ.call(e.buffer)?"typedArray":"others"},{toString:rQ}=Object.prototype;class r0 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}let r1=(e,t,r)=>{if(t.length!==r)return;let n=new r0;throw n.maxBufferInfo={fdNumber:"ipc"},n},r2=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",r4=e=>{if("string"==typeof e)return e;if(S(e))return T.decode(e);return""},r3=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:a})=>r9({command:e,escapedCommand:t,cwd:o,durationMs:eU(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),r8=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:a})=>r6({error:e,command:t,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:a}),r6=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:a,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:c,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:h,timeout:m=h,forceKillAfterDelay:g,killSignal:y,cwd:w,maxBuffer:b},isSync:v})=>{let{exitCode:x,signal:$,signalDescription:S}=r7(c,u),{originalMessage:E,shortMessage:k,message:T}=(({stdio:e,all:t,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:a,escapedCommand:s,timedOut:l,isCanceled:c,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h,maxBuffer:m,timeout:g,cwd:y})=>{let w=n?.code,b=(({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:a,signalDescription:s,exitCode:l,isCanceled:c,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let h=r2(d,f);return t?`Command timed out after ${r} milliseconds${h}`:u?void 0===a?`Command was gracefully canceled with exit code ${l}`:d?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${a} (${s})`:c?`Command was canceled${h}`:n?`${((e,t)=>{let{streamName:r,threshold:n,unit:i}=((e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;let i=er(t,r);return"ipc"===r?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:H(r),threshold:i,unit:n}})(e,t);return`Command's ${r} was larger than ${n} ${i}`})(e,i)}${h}`:void 0!==o?`Command failed with ${o}${h}`:d?`Command was killed with ${p} (${ti(p)})${h}`:void 0!==a?`Command was killed with ${a} (${s})`:void 0!==l?`Command failed with exit code ${l}`:"Command failed"})({originalError:n,timedOut:l,timeout:g,isMaxBuffer:d,maxBuffer:m,errorCode:w,signal:i,signalDescription:o,exitCode:a,isCanceled:c,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h}),v=((e,t)=>{if(e instanceof eK)return;let r=el(((e,t)=>{let r;if(t===rx())return e;try{r=(0,rv.statSync)(t)}catch(r){return`The "cwd" option is invalid: ${t}.
21
+ Please rename it to one of: ${r}.`)})(c),(({ipcInput:e,ipc:t,serialization:r})=>{if(void 0!==e){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");rp[r](e)}})(c),(({cancelSignal:e})=>{if(void 0!==e&&"[object AbortSignal]"!==Object.prototype.toString.call(e))throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)})(c),(({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(e){if(void 0===t)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if("json"===n)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}})(c),c.shell=w(c.shell),c.env=rE(c),c.killSignal=(e=>{let t="option `killSignal`";if(0===e)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return e5(e,t)})(c.killSignal),c.forceKillAfterDelay=(e=>{if(!1===e)return e;if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e})(c.forceKillAfterDelay),c.lines=c.lines.map((e,t)=>e&&!rg.has(c.encoding)&&c.buffer[t]),"win32"===U.default.platform&&"cmd"===eF.default.basename(a,".exe")&&s.unshift("/q"),{file:a,commandArguments:s,options:c}},rS=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:a=!0,all:s=!1,windowsHide:l=!0,killSignal:c="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=void 0!==f||d,serialization:h="advanced",...m})=>({...m,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:a,all:s,windowsHide:l,killSignal:c,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:h}),rE=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let a=t?{...U.default.env,...e}:e;return r||n?(({env:e=eH.default.env,...t}={})=>{let r=eW({env:e={...e}});return t.path=e[r],e[r]=(({cwd:e=eH.default.cwd(),path:t=eH.default.env[eW()],preferLocal:r=!0,execPath:n=eH.default.execPath,addExecPath:i=!0}={})=>{var o,a,s,l;let c,u=eF.default.resolve(eV(e)),d=[],f=t.split(eF.default.delimiter);return r&&((e,t,r)=>{for(let n of{*[Symbol.iterator](){let e,t=eF.default.resolve(eV(r));for(;e!==t;)yield t,e=t,t=eF.default.resolve(t,"..")}}){let r=eF.default.join(n,"node_modules/.bin");t.includes(r)||e.push(r)}})(d,f,u),i&&(o=d,a=f,s=n,l=u,c=eF.default.resolve(l,eV(s),".."),a.includes(c)||o.push(c)),""===t||t===eF.default.delimiter?`${d.join(eF.default.delimiter)}${t}`:[...d,t].join(eF.default.delimiter)})(t),e})({env:a,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):a},rk=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];function rT(e){if("string"==typeof e)return rD(e);if(!(ArrayBuffer.isView(e)&&1===e.BYTES_PER_ELEMENT))throw Error("Input must be a string or a Uint8Array");return rA(e)}let rD=e=>e.at(-1)===rO?e.slice(0,e.at(-2)===rC?-2:-1):e,rA=e=>e.at(-1)===rP?e.subarray(0,e.at(-2)===rj?-2:-1):e,rO="\n",rP=rO.codePointAt(0),rC="\r",rj=rC.codePointAt(0);function rI(e,{checkOpen:t=!0}={}){return null!==e&&"object"==typeof e&&(e.writable||e.readable||!t||void 0===e.writable&&void 0===e.readable)&&"function"==typeof e.pipe}function rR(e,{checkOpen:t=!0}={}){return rI(e,{checkOpen:t})&&(e.writable||!t)&&"function"==typeof e.write&&"function"==typeof e.end&&"boolean"==typeof e.writable&&"boolean"==typeof e.writableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function rB(e,{checkOpen:t=!0}={}){return rI(e,{checkOpen:t})&&(e.readable||!t)&&"function"==typeof e.read&&"boolean"==typeof e.readable&&"boolean"==typeof e.readableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function rN(e,t){return rR(e,t)&&rB(e,t)}let r_=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class rL{#e;#t;#r=!1;#n=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let t=()=>this.#o(e);return this.#n?this.#n.then(t,t):t()}async #i(){let e;if(this.#r)return{done:!0,value:void 0};try{e=await this.#e.read()}catch(e){throw this.#n=void 0,this.#r=!0,this.#e.releaseLock(),e}return e.done&&(this.#n=void 0,this.#r=!0,this.#e.releaseLock()),e}async #o(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}}let rU=Symbol();function rM(){return this[rU].next()}function rF(e){return this[rU].return(e)}Object.defineProperty(rM,"name",{value:"next"}),Object.defineProperty(rF,"name",{value:"return"});let rG=Object.create(r_,{next:{enumerable:!0,configurable:!0,writable:!0,value:rM},return:{enumerable:!0,configurable:!0,writable:!0,value:rF}});function rH({preventCancel:e=!1}={}){let t=new rL(this.getReader(),e),r=Object.create(rG);return r[rU]=t,r}let{toString:rW}=Object.prototype,rV=async function*(e){let t=new AbortController,r={};rX(e,t,r);try{for await(let[r]of rK.on(e,"data",{signal:t.signal}))yield r}catch(e){if(void 0!==r.error)throw r.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},rX=async(e,t,r)=>{try{await rK.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){r.error=e}finally{t.abort()}},rK={},rz=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:a,finalize:s},{maxBuffer:l=1/0}={})=>{let c=(e=>{if(rB(e,{checkOpen:!1})&&void 0!==rK.on)return rV(e);if("function"==typeof e?.[Symbol.asyncIterator])return e;if("[object ReadableStream]"===rW.call(e))return rH.call(e);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")})(e),u=t();u.length=0;try{for await(let e of c){let t=r[rZ(e)](e,u);rq({convertedChunk:t,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:l})}return rJ({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:a,maxBuffer:l}),s(u)}catch(t){let e="object"==typeof t&&null!==t?t:Error(t);throw e.bufferedData=s(u),e}},rJ=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let a=i(e);void 0!==a&&rq({convertedChunk:a,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:o})},rq=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let a=r(e),s=t.length+a;if(s<=o)return void rY(e,t,i,s);let l=n(e,o-t.length);throw void 0!==l&&rY(l,t,i,o),new r0},rY=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},rZ=e=>{let t=typeof e;if("string"===t)return"string";if("object"!==t||null===e)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=rQ.call(e);return"[object ArrayBuffer]"===r?"arrayBuffer":"[object DataView]"===r?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===rQ.call(e.buffer)?"typedArray":"others"},{toString:rQ}=Object.prototype;class r0 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}let r1=(e,t,r)=>{if(t.length!==r)return;let n=new r0;throw n.maxBufferInfo={fdNumber:"ipc"},n},r2=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",r4=e=>{if("string"==typeof e)return e;if(S(e))return T.decode(e);return""},r3=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:a})=>r9({command:e,escapedCommand:t,cwd:o,durationMs:eU(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),r8=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:a})=>r6({error:e,command:t,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:a}),r6=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:a,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:c,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:h,timeout:m=h,forceKillAfterDelay:g,killSignal:y,cwd:w,maxBuffer:b},isSync:v})=>{let{exitCode:x,signal:$,signalDescription:S}=r7(c,u),{originalMessage:E,shortMessage:k,message:T}=(({stdio:e,all:t,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:a,escapedCommand:s,timedOut:l,isCanceled:c,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h,maxBuffer:m,timeout:g,cwd:y})=>{let w=n?.code,b=(({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:a,signalDescription:s,exitCode:l,isCanceled:c,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let h=r2(d,f);return t?`Command timed out after ${r} milliseconds${h}`:u?void 0===a?`Command was gracefully canceled with exit code ${l}`:d?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${a} (${s})`:c?`Command was canceled${h}`:n?`${((e,t)=>{let{streamName:r,threshold:n,unit:i}=((e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;let i=er(t,r);return"ipc"===r?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:H(r),threshold:i,unit:n}})(e,t);return`Command's ${r} was larger than ${n} ${i}`})(e,i)}${h}`:void 0!==o?`Command failed with ${o}${h}`:d?`Command was killed with ${p} (${ti(p)})${h}`:void 0!==a?`Command was killed with ${a} (${s})`:void 0!==l?`Command failed with exit code ${l}`:"Command failed"})({originalError:n,timedOut:l,timeout:g,isMaxBuffer:d,maxBuffer:m,errorCode:w,signal:i,signalDescription:o,exitCode:a,isCanceled:c,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h}),v=((e,t)=>{if(e instanceof eK)return;let r=el(((e,t)=>{let r;if(t===rx())return e;try{r=(0,rv.statSync)(t)}catch(r){return`The "cwd" option is invalid: ${t}.
22
22
  ${r.message}
23
23
  ${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
24
24
  ${e}`})(eq(e)&&eJ in e?e.originalMessage:String(e?.message??e),t));return""===r?void 0:r})(n,y),x=void 0===v?"":`
25
- ${v}`,$=`${b}: ${s}${x}`,S=[$,...void 0===t?[e[2],e[1]]:[t],...e.slice(3),r.map(e=>{let t;return"string"==typeof(t=e)?t:(0,L.inspect)(t)}).join("\n")].map(e=>{let t;return el(rT(Array.isArray(t=e)?t.map(e=>rT(r4(e))).filter(Boolean).join("\n"):r4(t)))}).filter(Boolean).join("\n\n");return{originalMessage:v,shortMessage:$,message:S}})({stdio:d,all:f,ipcOutput:p,originalError:e,signal:$,signalDescription:S,exitCode:x,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:a,isMaxBuffer:s,isForcefullyTerminated:l,forceKillAfterDelay:g,killSignal:y,maxBuffer:b,timeout:m,cwd:w}),D=new(v?eZ:eY)(T,e instanceof eK?{}:{cause:e});return Object.assign(D,r5({error:D,command:t,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:a,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:x,signal:$,signalDescription:S,stdio:d,all:f,ipcOutput:p,cwd:w,originalMessage:E,shortMessage:k})),D},r5=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:a,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:c,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:h,cwd:m,originalMessage:g,shortMessage:y})=>r9({shortMessage:y,originalMessage:g,command:t,escapedCommand:r,cwd:m,durationMs:eU(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:a,isTerminated:void 0!==u,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:c,signal:u,signalDescription:d,code:e.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:h,pipedFrom:[]}),r9=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e)),r7=(e,t)=>{let r=null===t?void 0:t,n=void 0===r?void 0:ti(t);return{exitCode:null===e?void 0:e,signal:r,signalDescription:n}},ne=e=>Number.isFinite(e)?e:0,nt=24n*60n*60n*1000n,nr=(e,t,{reject:r})=>{if((({verbose:e})=>"none"!==ei(e,void 0))(t)){var n,i;e.failed&&eP({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e}),n=e,i=t,eP({type:"duration",verboseMessage:`(done in ${function(e,t){let r="bigint"==typeof e;if(!r&&!Number.isFinite(e))throw TypeError("Expected a finite number or bigint");t={...t};let n=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],o=(e,r,n,o)=>{if(!((0===i.length||!t.colonNotation)&&(0===e||0n===e))||t.colonNotation&&"m"===n){if(o??=String(e),t.colonNotation){let e=o.includes(".")?o.split(".")[0].length:o.length,t=i.length>0?2:1;o="0".repeat(Math.max(0,t-e))+o}else o+=t.verbose?" "+(1===e||1n===e?r:`${r}s`):n;i.push(o)}},a=function(e){switch(typeof e){case"number":if(Number.isFinite(e))return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(ne(1e3*e)%1e3),nanoseconds:Math.trunc(ne(1e6*e)%1e3)};break;case"bigint":return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}throw TypeError("Expected a finite number or bigint")}(e),s=BigInt(a.days);if(t.hideYearAndDays?o(24n*BigInt(s)+BigInt(a.hours),"hour","h"):(t.hideYear?o(s,"day","d"):(o(s/365n,"year","y"),o(s%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(a.seconds),r=Number(a.milliseconds),n=Number(a.microseconds),i=Number(a.nanoseconds);if(o(e,"second","s"),t.formatSubMilliseconds)o(r,"millisecond","ms"),o(n,"microsecond","µs"),o(i,"nanosecond","ns");else{let e=r+n/1e3+i/1e6,a="number"==typeof t.millisecondsDecimalDigits?t.millisecondsDecimalDigits:0,s=e>=1?Math.round(e):Math.ceil(e),l=a?e.toFixed(a):s;o(Number.parseFloat(l),"millisecond","ms",l)}}else{let n=(r?Number(e%nt):e)/1e3%60,i="number"==typeof t.secondsDecimalDigits?t.secondsDecimalDigits:1,a=(Math.round(Math.floor(n*10**i+1e-7))/10**i).toFixed(i),s=t.keepDecimalsOnWholeSeconds?a:a.replace(/\.0+$/,"");o(Number.parseFloat(s),"second","s",s)}if(0===i.length)return n+"0"+(t.verbose?" milliseconds":"ms");let l=t.colonNotation?":":" ";return"number"==typeof t.unitCount&&(i=i.slice(0,Math.max(t.unitCount,1))),n+i.join(l)}(n.durationMs)})`,verboseInfo:i,result:n})}if(e.failed&&r)throw e;return e},nn=(e,t)=>(no(e,t,"Duplex stream"),"duplex"),ni=(e,t)=>(no(e,t,"web TransformStream"),"webTransform"),no=({final:e,binary:t,objectMode:r},n,i)=>{na(e,`${n}.final`,i),na(t,`${n}.binary`,i),nl(r,`${n}.objectMode`)},na=(e,t,r)=>{if(void 0!==e)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},ns=({transform:e,final:t,binary:r,objectMode:n},i)=>{if(void 0!==e&&!nc(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(rN(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(nw(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(void 0!==t&&!nc(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return nl(r,`${i}.binary`),nl(n,`${i}.objectMode`),nu(e)||nu(t)?"asyncGenerator":"generator"},nl=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw TypeError(`The \`${t}\` option must use a boolean.`)},nc=e=>nu(e)||nd(e),nu=e=>"[object AsyncGeneratorFunction]"===Object.prototype.toString.call(e),nd=e=>"[object GeneratorFunction]"===Object.prototype.toString.call(e),nf=e=>"[object URL]"===Object.prototype.toString.call(e),np=new Set(["file","append"]),nh=e=>"string"==typeof e,nm=new Set(["ipc","ignore","inherit","overlapped","pipe"]),ng=e=>"[object ReadableStream]"===Object.prototype.toString.call(e),ny=e=>"[object WritableStream]"===Object.prototype.toString.call(e),nw=e=>ng(e?.readable)&&ny(e?.writable),nb=e=>"object"==typeof e&&null!==e,nv=new Set(["generator","asyncGenerator","duplex","webTransform"]),nx=new Set(["fileUrl","filePath","fileNumber"]),n$=new Set(["fileUrl","filePath"]),nS=new Set([...n$,"webStream","nodeStream"]),nE=new Set(["webTransform","duplex"]),nk={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},nT=(e,t,r,n)=>"output"===n?nD(e,t,r):nA(e,t,r),nD=(e,t,r)=>{let n=0!==t&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},nA=(e,t,r)=>{let n=0===t?!0===e:r[t-1].value.readableObjectMode,i=t!==r.length-1&&(e??n);return{writableObjectMode:n,readableObjectMode:i}},nO=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:i,direction:o,encoding:a})=>"duplex"===t?nC({stdioItem:e,optionName:i}):"webTransform"===t?nj({stdioItem:e,index:r,newTransforms:n,direction:o}):nP({stdioItem:e,index:r,newTransforms:n,direction:o,encoding:a}),nC=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:n}}},nj=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:a}=p(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:l}=nT(a,r,n,i);return{...e,value:{transform:o,writableObjectMode:s,readableObjectMode:l}}},nP=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:a,final:s,binary:l=!1,preserveNewlines:c=!1,objectMode:u}=p(t)?t:{transform:t},d=l||rg.has(o),{writableObjectMode:f,readableObjectMode:h}=nT(u,r,n,i);return{...e,value:{transform:a,final:s,binary:d,preserveNewlines:c,writableObjectMode:f,readableObjectMode:h}}},nI=(e,t)=>"input"===t?e.reverse():e,nR=["input","output","output"],nB=()=>void 0,nN=()=>"input",n_={generator:nB,asyncGenerator:nB,fileUrl:nB,filePath:nB,iterable:nN,asyncIterable:nN,uint8Array:nN,webStream:e=>ny(e)?"output":"input",nodeStream:e=>rB(e,{checkOpen:!1})?rR(e,{checkOpen:!1})?void 0:"input":"output",webTransform:nB,duplex:nB,native(e){let t=nL(e);return void 0!==t?t:rI(e,{checkOpen:!1})?n_.nodeStream(e):void 0}},nL=e=>[0,U.default.stdin].includes(e)?"input":[1,2,U.default.stdout,U.default.stderr].includes(e)?"output":void 0,nU=e=>G.some(t=>void 0!==e[t]),nM=(e,t)=>Array.isArray(e)?e.map(e=>nM(e,t)):null==e?t>=G.length?"ignore":"pipe":e,nF=e=>"pipe"===e||Array.isArray(e)&&e.every(e=>"pipe"===e),nG=({value:e,optionName:t,fdNumber:r,direction:n})=>{let i=nH(e,r);if(void 0!==i){if("output"===n)return{type:"fileNumber",value:i,optionName:t};if(ev.default.isatty(i))throw TypeError(`The \`${t}: ${tR(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:E((0,rv.readFileSync)(i)),optionName:t}}},nH=(e,t)=>{if("inherit"===e)return t;if("number"==typeof e)return e;let r=F.indexOf(e);if(-1!==r)return r},nW=(e,t,r)=>{let n=F[e];if(void 0===n)throw TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n},nV=e=>{if(rB(e,{checkOpen:!1}))return"nodeStream";if("string"==typeof e)return"string";if(S(e))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},nX=e=>{if(nf(e))return{type:"fileUrl",value:e};if(nh(e))return{type:"filePath",value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},nK=({otherStdioItems:e,type:t,value:r,optionName:n,direction:i})=>{let o=e.filter(e=>nz(e,r));if(0!==o.length)return nJ(o.find(e=>e.direction!==i),n,t),"output"===i?o[0].stream:void 0},nz=({type:e,value:t},r)=>"filePath"===e?t.file===r.file:"fileUrl"===e?t.href===r.href:t===r,nJ=(e,t,r)=>{if(void 0!==e)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${nk[r]} that is the same.`)},nq=(e,t,r,n)=>{let i=n8({initialFileDescriptors:(({stdio:e,ipc:t,buffer:r,...n},i,o)=>{let a,s,l,c=((e,t)=>{if(void 0===e)return G.map(e=>t[e]);if(nU(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${G.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof e)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);return Array.from({length:Math.max(e.length,G.length)},(t,r)=>e[r])})(e,n).map((e,t)=>nM(e,t));return o?(a=c,s=r,l=i,a.map((e,t)=>!s[t]&&0!==t&&!en(l,t)&&nF(e)?"ignore":e)):t&&!c.includes("ipc")?[...c,"ipc"]:c})(t,r,n).map((e,r)=>nY({stdioOption:e,fdNumber:r,options:t,isSync:n})),addProperties:e,options:t,isSync:n});return t.stdio=i.map(({stdioItems:e})=>n7(e)),i},nY=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{let i,o,a=H(t),{stdioItems:s,isStdioArray:l}=nZ({stdioOption:e,fdNumber:t,options:r,optionName:a}),c=((e,t,r)=>{let n=e.map(e=>(({type:e,value:t},r)=>nR[r]??n_[e](t))(e,t));if(n.includes("input")&&n.includes("output"))throw TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??"output"})(s,t,a),u=(i=s.map(e=>(({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>r&&"native"===t?o?(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:i})=>{let o=nG({value:t,optionName:r,fdNumber:n,direction:i});if(void 0!==o)return o;if(rI(t,{checkOpen:!1}))throw TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e})({stdioItem:e,fdNumber:n,direction:i}):(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>"inherit"===t?{type:"nodeStream",value:nW(n,t,r),optionName:r}:"number"==typeof t?{type:"nodeStream",value:nW(t,t,r),optionName:r}:rI(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e)({stdioItem:e,fdNumber:n}):e)({stdioItem:e,isStdioArray:l,fdNumber:t,direction:c,isSync:n})),[...i.filter(({type:e})=>!nv.has(e)),...((e,t,r,{encoding:n})=>{let i=e.filter(({type:e})=>nv.has(e)),o=Array.from({length:i.length});for(let[e,a]of Object.entries(i))o[e]=nO({stdioItem:a,index:Number(e),newTransforms:o,optionName:t,direction:r,encoding:n});return nI(o,r)})(i,a,c,r)]),d=void 0!==(o=u.findLast(({type:e})=>nv.has(e)))&&("input"===c?o.value.writableObjectMode:o.value.readableObjectMode);return n3(u,d),{direction:c,objectMode:d,stdioItems:u}},nZ=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{let i,o=(i=[...(Array.isArray(e)?e:[e]).map(e=>nQ(e,n)),...(({input:e,inputFile:t},r)=>{let n,i;return 0===r?[...void 0===(n=e)?[]:[{type:nV(n),value:n,optionName:"input"}],...void 0===(i=t)?[]:[{...nX(i),optionName:"inputFile"}]]:[]})(r,t)]).filter((e,t)=>i.every((r,n)=>e.value!==r.value||t>=n||"generator"===e.type||"asyncGenerator"===e.type)),a=o.length>1;return n0(o,a,n),n2(o),{stdioItems:o,isStdioArray:a}},nQ=(e,t)=>{let r,n,i,o,a,s,l;return{type:nu(e)?"asyncGenerator":nd(e)?"generator":nf(e)?"fileUrl":p(r=e)&&Object.keys(r).length>0&&Object.keys(r).every(e=>np.has(e))&&nh(r.file)?"filePath":ng(n=e)||ny(n)?"webStream":rI(e,{checkOpen:!1})?"native":S(e)?"uint8Array":nb(i=e)&&"function"==typeof i[Symbol.asyncIterator]?"asyncIterable":nb(o=e)&&"function"==typeof o[Symbol.iterator]?"iterable":nw(e)?ni({transform:e},t):p(a=e)&&(void 0!==a.transform||void 0!==a.final)?(s=e,l=t,rN(s.transform,{checkOpen:!1})?nn(s,l):nw(s.transform)?ni(s,l):ns(s,l)):"native",value:e,optionName:t}},n0=(e,t,r)=>{if(0===e.length)throw TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:t,optionName:r}of e)if(n1.has(t))throw Error(`The \`${r}\` option must not include \`${t}\`.`)}},n1=new Set(["ignore","ipc"]),n2=e=>{for(let t of e)n4(t)},n4=({type:e,value:t,optionName:r})=>{if(nf(t)&&"file:"!==t.protocol)throw TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
25
+ ${v}`,$=`${b}: ${s}${x}`,S=[$,...void 0===t?[e[2],e[1]]:[t],...e.slice(3),r.map(e=>{let t;return"string"==typeof(t=e)?t:(0,L.inspect)(t)}).join("\n")].map(e=>{let t;return el(rT(Array.isArray(t=e)?t.map(e=>rT(r4(e))).filter(Boolean).join("\n"):r4(t)))}).filter(Boolean).join("\n\n");return{originalMessage:v,shortMessage:$,message:S}})({stdio:d,all:f,ipcOutput:p,originalError:e,signal:$,signalDescription:S,exitCode:x,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:a,isMaxBuffer:s,isForcefullyTerminated:l,forceKillAfterDelay:g,killSignal:y,maxBuffer:b,timeout:m,cwd:w}),D=new(v?eZ:eY)(T,e instanceof eK?{}:{cause:e});return Object.assign(D,r5({error:D,command:t,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:a,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:x,signal:$,signalDescription:S,stdio:d,all:f,ipcOutput:p,cwd:w,originalMessage:E,shortMessage:k})),D},r5=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:a,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:c,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:h,cwd:m,originalMessage:g,shortMessage:y})=>r9({shortMessage:y,originalMessage:g,command:t,escapedCommand:r,cwd:m,durationMs:eU(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:a,isTerminated:void 0!==u,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:c,signal:u,signalDescription:d,code:e.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:h,pipedFrom:[]}),r9=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e)),r7=(e,t)=>{let r=null===t?void 0:t,n=void 0===r?void 0:ti(t);return{exitCode:null===e?void 0:e,signal:r,signalDescription:n}},ne=e=>Number.isFinite(e)?e:0,nt=24n*60n*60n*1000n,nr=(e,t,{reject:r})=>{if((({verbose:e})=>"none"!==ei(e,void 0))(t)){var n,i;e.failed&&ej({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e}),n=e,i=t,ej({type:"duration",verboseMessage:`(done in ${function(e,t){let r="bigint"==typeof e;if(!r&&!Number.isFinite(e))throw TypeError("Expected a finite number or bigint");t={...t};let n=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],o=(e,r,n,o)=>{if(!((0===i.length||!t.colonNotation)&&(0===e||0n===e))||t.colonNotation&&"m"===n){if(o??=String(e),t.colonNotation){let e=o.includes(".")?o.split(".")[0].length:o.length,t=i.length>0?2:1;o="0".repeat(Math.max(0,t-e))+o}else o+=t.verbose?" "+(1===e||1n===e?r:`${r}s`):n;i.push(o)}},a=function(e){switch(typeof e){case"number":if(Number.isFinite(e))return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(ne(1e3*e)%1e3),nanoseconds:Math.trunc(ne(1e6*e)%1e3)};break;case"bigint":return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}throw TypeError("Expected a finite number or bigint")}(e),s=BigInt(a.days);if(t.hideYearAndDays?o(24n*BigInt(s)+BigInt(a.hours),"hour","h"):(t.hideYear?o(s,"day","d"):(o(s/365n,"year","y"),o(s%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(a.seconds),r=Number(a.milliseconds),n=Number(a.microseconds),i=Number(a.nanoseconds);if(o(e,"second","s"),t.formatSubMilliseconds)o(r,"millisecond","ms"),o(n,"microsecond","µs"),o(i,"nanosecond","ns");else{let e=r+n/1e3+i/1e6,a="number"==typeof t.millisecondsDecimalDigits?t.millisecondsDecimalDigits:0,s=e>=1?Math.round(e):Math.ceil(e),l=a?e.toFixed(a):s;o(Number.parseFloat(l),"millisecond","ms",l)}}else{let n=(r?Number(e%nt):e)/1e3%60,i="number"==typeof t.secondsDecimalDigits?t.secondsDecimalDigits:1,a=(Math.round(Math.floor(n*10**i+1e-7))/10**i).toFixed(i),s=t.keepDecimalsOnWholeSeconds?a:a.replace(/\.0+$/,"");o(Number.parseFloat(s),"second","s",s)}if(0===i.length)return n+"0"+(t.verbose?" milliseconds":"ms");let l=t.colonNotation?":":" ";return"number"==typeof t.unitCount&&(i=i.slice(0,Math.max(t.unitCount,1))),n+i.join(l)}(n.durationMs)})`,verboseInfo:i,result:n})}if(e.failed&&r)throw e;return e},nn=(e,t)=>(no(e,t,"Duplex stream"),"duplex"),ni=(e,t)=>(no(e,t,"web TransformStream"),"webTransform"),no=({final:e,binary:t,objectMode:r},n,i)=>{na(e,`${n}.final`,i),na(t,`${n}.binary`,i),nl(r,`${n}.objectMode`)},na=(e,t,r)=>{if(void 0!==e)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},ns=({transform:e,final:t,binary:r,objectMode:n},i)=>{if(void 0!==e&&!nc(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(rN(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(nw(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(void 0!==t&&!nc(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return nl(r,`${i}.binary`),nl(n,`${i}.objectMode`),nu(e)||nu(t)?"asyncGenerator":"generator"},nl=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw TypeError(`The \`${t}\` option must use a boolean.`)},nc=e=>nu(e)||nd(e),nu=e=>"[object AsyncGeneratorFunction]"===Object.prototype.toString.call(e),nd=e=>"[object GeneratorFunction]"===Object.prototype.toString.call(e),nf=e=>"[object URL]"===Object.prototype.toString.call(e),np=new Set(["file","append"]),nh=e=>"string"==typeof e,nm=new Set(["ipc","ignore","inherit","overlapped","pipe"]),ng=e=>"[object ReadableStream]"===Object.prototype.toString.call(e),ny=e=>"[object WritableStream]"===Object.prototype.toString.call(e),nw=e=>ng(e?.readable)&&ny(e?.writable),nb=e=>"object"==typeof e&&null!==e,nv=new Set(["generator","asyncGenerator","duplex","webTransform"]),nx=new Set(["fileUrl","filePath","fileNumber"]),n$=new Set(["fileUrl","filePath"]),nS=new Set([...n$,"webStream","nodeStream"]),nE=new Set(["webTransform","duplex"]),nk={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},nT=(e,t,r,n)=>"output"===n?nD(e,t,r):nA(e,t,r),nD=(e,t,r)=>{let n=0!==t&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},nA=(e,t,r)=>{let n=0===t?!0===e:r[t-1].value.readableObjectMode,i=t!==r.length-1&&(e??n);return{writableObjectMode:n,readableObjectMode:i}},nO=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:i,direction:o,encoding:a})=>"duplex"===t?nP({stdioItem:e,optionName:i}):"webTransform"===t?nC({stdioItem:e,index:r,newTransforms:n,direction:o}):nj({stdioItem:e,index:r,newTransforms:n,direction:o,encoding:a}),nP=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:n}}},nC=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:a}=p(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:l}=nT(a,r,n,i);return{...e,value:{transform:o,writableObjectMode:s,readableObjectMode:l}}},nj=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:a,final:s,binary:l=!1,preserveNewlines:c=!1,objectMode:u}=p(t)?t:{transform:t},d=l||rg.has(o),{writableObjectMode:f,readableObjectMode:h}=nT(u,r,n,i);return{...e,value:{transform:a,final:s,binary:d,preserveNewlines:c,writableObjectMode:f,readableObjectMode:h}}},nI=(e,t)=>"input"===t?e.reverse():e,nR=["input","output","output"],nB=()=>void 0,nN=()=>"input",n_={generator:nB,asyncGenerator:nB,fileUrl:nB,filePath:nB,iterable:nN,asyncIterable:nN,uint8Array:nN,webStream:e=>ny(e)?"output":"input",nodeStream:e=>rB(e,{checkOpen:!1})?rR(e,{checkOpen:!1})?void 0:"input":"output",webTransform:nB,duplex:nB,native(e){let t=nL(e);return void 0!==t?t:rI(e,{checkOpen:!1})?n_.nodeStream(e):void 0}},nL=e=>[0,U.default.stdin].includes(e)?"input":[1,2,U.default.stdout,U.default.stderr].includes(e)?"output":void 0,nU=e=>G.some(t=>void 0!==e[t]),nM=(e,t)=>Array.isArray(e)?e.map(e=>nM(e,t)):null==e?t>=G.length?"ignore":"pipe":e,nF=e=>"pipe"===e||Array.isArray(e)&&e.every(e=>"pipe"===e),nG=({value:e,optionName:t,fdNumber:r,direction:n})=>{let i=nH(e,r);if(void 0!==i){if("output"===n)return{type:"fileNumber",value:i,optionName:t};if(ev.default.isatty(i))throw TypeError(`The \`${t}: ${tR(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:E((0,rv.readFileSync)(i)),optionName:t}}},nH=(e,t)=>{if("inherit"===e)return t;if("number"==typeof e)return e;let r=F.indexOf(e);if(-1!==r)return r},nW=(e,t,r)=>{let n=F[e];if(void 0===n)throw TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n},nV=e=>{if(rB(e,{checkOpen:!1}))return"nodeStream";if("string"==typeof e)return"string";if(S(e))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},nX=e=>{if(nf(e))return{type:"fileUrl",value:e};if(nh(e))return{type:"filePath",value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},nK=({otherStdioItems:e,type:t,value:r,optionName:n,direction:i})=>{let o=e.filter(e=>nz(e,r));if(0!==o.length)return nJ(o.find(e=>e.direction!==i),n,t),"output"===i?o[0].stream:void 0},nz=({type:e,value:t},r)=>"filePath"===e?t.file===r.file:"fileUrl"===e?t.href===r.href:t===r,nJ=(e,t,r)=>{if(void 0!==e)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${nk[r]} that is the same.`)},nq=(e,t,r,n)=>{let i=n8({initialFileDescriptors:(({stdio:e,ipc:t,buffer:r,...n},i,o)=>{let a,s,l,c=((e,t)=>{if(void 0===e)return G.map(e=>t[e]);if(nU(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${G.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof e)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);return Array.from({length:Math.max(e.length,G.length)},(t,r)=>e[r])})(e,n).map((e,t)=>nM(e,t));return o?(a=c,s=r,l=i,a.map((e,t)=>!s[t]&&0!==t&&!en(l,t)&&nF(e)?"ignore":e)):t&&!c.includes("ipc")?[...c,"ipc"]:c})(t,r,n).map((e,r)=>nY({stdioOption:e,fdNumber:r,options:t,isSync:n})),addProperties:e,options:t,isSync:n});return t.stdio=i.map(({stdioItems:e})=>n7(e)),i},nY=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{let i,o,a=H(t),{stdioItems:s,isStdioArray:l}=nZ({stdioOption:e,fdNumber:t,options:r,optionName:a}),c=((e,t,r)=>{let n=e.map(e=>(({type:e,value:t},r)=>nR[r]??n_[e](t))(e,t));if(n.includes("input")&&n.includes("output"))throw TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??"output"})(s,t,a),u=(i=s.map(e=>(({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>r&&"native"===t?o?(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:i})=>{let o=nG({value:t,optionName:r,fdNumber:n,direction:i});if(void 0!==o)return o;if(rI(t,{checkOpen:!1}))throw TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e})({stdioItem:e,fdNumber:n,direction:i}):(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>"inherit"===t?{type:"nodeStream",value:nW(n,t,r),optionName:r}:"number"==typeof t?{type:"nodeStream",value:nW(t,t,r),optionName:r}:rI(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e)({stdioItem:e,fdNumber:n}):e)({stdioItem:e,isStdioArray:l,fdNumber:t,direction:c,isSync:n})),[...i.filter(({type:e})=>!nv.has(e)),...((e,t,r,{encoding:n})=>{let i=e.filter(({type:e})=>nv.has(e)),o=Array.from({length:i.length});for(let[e,a]of Object.entries(i))o[e]=nO({stdioItem:a,index:Number(e),newTransforms:o,optionName:t,direction:r,encoding:n});return nI(o,r)})(i,a,c,r)]),d=void 0!==(o=u.findLast(({type:e})=>nv.has(e)))&&("input"===c?o.value.writableObjectMode:o.value.readableObjectMode);return n3(u,d),{direction:c,objectMode:d,stdioItems:u}},nZ=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{let i,o=(i=[...(Array.isArray(e)?e:[e]).map(e=>nQ(e,n)),...(({input:e,inputFile:t},r)=>{let n,i;return 0===r?[...void 0===(n=e)?[]:[{type:nV(n),value:n,optionName:"input"}],...void 0===(i=t)?[]:[{...nX(i),optionName:"inputFile"}]]:[]})(r,t)]).filter((e,t)=>i.every((r,n)=>e.value!==r.value||t>=n||"generator"===e.type||"asyncGenerator"===e.type)),a=o.length>1;return n0(o,a,n),n2(o),{stdioItems:o,isStdioArray:a}},nQ=(e,t)=>{let r,n,i,o,a,s,l;return{type:nu(e)?"asyncGenerator":nd(e)?"generator":nf(e)?"fileUrl":p(r=e)&&Object.keys(r).length>0&&Object.keys(r).every(e=>np.has(e))&&nh(r.file)?"filePath":ng(n=e)||ny(n)?"webStream":rI(e,{checkOpen:!1})?"native":S(e)?"uint8Array":nb(i=e)&&"function"==typeof i[Symbol.asyncIterator]?"asyncIterable":nb(o=e)&&"function"==typeof o[Symbol.iterator]?"iterable":nw(e)?ni({transform:e},t):p(a=e)&&(void 0!==a.transform||void 0!==a.final)?(s=e,l=t,rN(s.transform,{checkOpen:!1})?nn(s,l):nw(s.transform)?ni(s,l):ns(s,l)):"native",value:e,optionName:t}},n0=(e,t,r)=>{if(0===e.length)throw TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:t,optionName:r}of e)if(n1.has(t))throw Error(`The \`${r}\` option must not include \`${t}\`.`)}},n1=new Set(["ignore","ipc"]),n2=e=>{for(let t of e)n4(t)},n4=({type:e,value:t,optionName:r})=>{if(nf(t)&&"file:"!==t.protocol)throw TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
26
26
  For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if("native"===e&&"string"==typeof t&&!nm.has(t))throw TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},n3=(e,t)=>{if(!t)return;let r=e.find(({type:e})=>nx.has(e));if(void 0!==r)throw TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},n8=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{let i=[];try{for(let o of e)i.push(n6({fileDescriptor:o,fileDescriptors:i,addProperties:t,options:r,isSync:n}));return i}catch(e){throw n9(i),e}},n6=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:a})=>{let s=r.map(t=>n5({stdioItem:t,addProperties:i,direction:e,options:o,fileDescriptors:n,isSync:a}));return{direction:e,objectMode:t,stdioItems:s}},n5=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let a=(({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let a,s,l=(a=i,s=e,a.flatMap(({direction:e,stdioItems:t})=>t.filter(e=>e.type===s).map(t=>({...t,direction:e}))));if(0!==l.length){if(o)return void(({otherStdioItems:e,type:t,value:r,optionName:n,direction:i})=>{n$.has(t)&&nK({otherStdioItems:e,type:t,value:r,optionName:n,direction:i})})({otherStdioItems:l,type:e,value:t,optionName:r,direction:n});if(nS.has(e))return nK({otherStdioItems:l,type:e,value:t,optionName:r,direction:n});nE.has(e)&&(({otherStdioItems:e,type:t,value:r,optionName:n})=>{nJ(e.find(({value:{transform:e}})=>e===r.transform),n,t)})({otherStdioItems:l,type:e,value:t,optionName:r})}})({stdioItem:e,direction:r,fileDescriptors:i,isSync:o});return void 0!==a?{...e,stream:a}:{...e,...t[r][e.type](e,n)}},n9=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)void 0===e||M(e)||e.destroy()},n7=e=>{if(e.length>1)return e.some(({value:e})=>"overlapped"===e)?"overlapped":"pipe";let[{type:t,value:r}]=e;return"native"===t?r:"pipe"},ie=({type:e,optionName:t})=>{it(t,nk[e])},it=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},ir={generator(){},asyncGenerator:ie,webStream:ie,nodeStream:ie,webTransform:ie,duplex:ie,asyncIterable:ie,native:({optionName:e,value:t})=>(("ipc"===t||"overlapped"===t)&&it(e,`"${t}"`),{})},ii={input:{...ir,fileUrl:({value:e})=>({contents:[E((0,rv.readFileSync)(e))]}),filePath:({value:{file:e}})=>({contents:[E((0,rv.readFileSync)(e))]}),fileNumber:ie,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...ir,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:ie,string:ie,uint8Array:ie}},io=(e,{stripFinalNewline:t},r)=>ia(t,r)&&void 0!==e&&!Array.isArray(e)?rT(e):e,ia=(e,t)=>"all"===t?e[1]||e[2]:e[t];var is=e.i(81111);let il=(e,t,r,n)=>e||r?void 0:id(t,n),ic=(e,t,r)=>r?e.flatMap(e=>iu(e,t)):iu(e,t),iu=(e,t)=>{let{transform:r,final:n}=id(t,{});return[...r(e),...n()]},id=(e,t)=>(t.previousChunks="",{transform:ip.bind(void 0,t,e),final:im.bind(void 0,t)}),ip=function*(e,t,r){if("string"!=typeof r)return void(yield r);let{previousChunks:n}=e,i=-1;for(let o=0;o<r.length;o+=1)if("\n"===r[o]){let a=ih(r,o,t,e),s=r.slice(i+1,o+1-a);n.length>0&&(s=iy(n,s),n=""),yield s,i=o}i!==r.length-1&&(n=iy(n,r.slice(i+1))),e.previousChunks=n},ih=(e,t,r,n)=>r?0:(n.isWindowsNewline=0!==t&&"\r"===e[t-1],n.isWindowsNewline?2:1),im=function*({previousChunks:e}){e.length>0&&(yield e)},ig=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}="string"==typeof t?iw:ib;t.at(-1)===i?yield t:yield o(t,e?n:r)},iy=(e,t)=>`${e}${t}`,iw={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:iy},ib={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}};var iv=e.i(51615);let ix=function*(e,t){if("string"!=typeof t&&!S(t)&&!iv.Buffer.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},i$=function*(e,t){iE(e,t),yield t},iS=function*(e,t){if(iE(e,t),"string"!=typeof t&&!S(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},iE=(e,t)=>{if(null==t)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
27
27
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
28
- if (condition) { yield value; }`)},ik=(e,t,r)=>{if(r)return;if(e)return{transform:iT.bind(void 0,new TextEncoder)};let n=new x.StringDecoder(t);return{transform:iD.bind(void 0,n),final:iA.bind(void 0,n)}},iT=function*(e,t){iv.Buffer.isBuffer(t)?yield E(t):"string"==typeof t?yield e.encode(t):yield t},iD=function*(e,t){yield S(t)?e.write(t):t},iA=function*(e){let t=e.end();""!==t&&(yield t)},iO=(0,L.callbackify)(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let e of t.currentIterable)n.push(e)}finally{delete t.currentIterable}}),iC=async function*(e,t,r){if(r===t.length)return void(yield e);let{transform:n=iR}=t[r];for await(let i of n(e))yield*iC(i,t,r+1)},ij=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*iP(r,Number(t),e)},iP=async function*(e,t,r){if(void 0!==e)for await(let n of e())yield*iC(n,r,t+1)},iI=(0,L.callbackify)(async({currentIterable:e},t)=>{if(void 0!==e)return void await (t?e.throw(t):e.return());if(t)throw t}),iR=function*(e){yield e},iB=(e,t,r,n)=>{try{for(let n of e(...t))r.push(n);n()}catch(e){n(e)}},iN=(e,t)=>[...t.flatMap(t=>[...i_(t,e,0)]),...iL(e)],i_=function*(e,t,r){if(r===t.length)return void(yield e);let{transform:n=iM}=t[r];for(let i of n(e))yield*i_(i,t,r+1)},iL=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*iU(r,Number(t),e)},iU=function*(e,t,r){if(void 0!==e)for(let n of e())yield*i_(n,r,t+1)},iM=function*(e){yield e},iF=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:a})=>{let s={},l=iH(e,a,o),c=nu(t),u=nu(r),d=c?iO.bind(void 0,iC,s):iB.bind(void 0,i_),f=c||u?iO.bind(void 0,ij,s):iB.bind(void 0,iL),p=c||u?iI.bind(void 0,s):void 0;return{stream:new is.Transform({writableObjectMode:n,writableHighWaterMark:(0,is.getDefaultHighWaterMark)(n),readableObjectMode:i,readableHighWaterMark:(0,is.getDefaultHighWaterMark)(i),transform(e,t,r){d([e,l,0],this,r)},flush(e){f([l],this,e)},destroy:p})}},iG=(e,t,r,n)=>{let i=t.filter(({type:e})=>"generator"===e);for(let{value:t,optionName:o}of n?i.reverse():i)e=iN(iH(t,r,o),e);return e},iH=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},a,s)=>{let l={};return[{transform:n?void 0:ix.bind(void 0,s)},ik(r,a,n),il(r,o,n,l),{transform:e,final:t},{transform:i?i$.bind(void 0,s):iS.bind(void 0,s)},(({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:ig.bind(void 0,n)})({binary:r,preserveNewlines:o,readableObjectMode:i,state:l})].filter(Boolean)},iW=(e,t,r)=>{let{stdioItems:n}=e[t],i=n.filter(({contents:e})=>void 0!==e);if(0!==i.length){if(0!==t){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${nk[e]} with synchronous methods.`)}r.input=D(i.map(({contents:e})=>e).map(e=>iV(e,n)))}},iV=(e,t)=>{let r=iG(e,t,"utf8",!0);return iX(r),D(r)},iX=e=>{let t=e.find(e=>"string"!=typeof e&&!S(e));if(void 0!==t)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},iK=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>"all"!==n&&en(r,n)&&!rg.has(t)&&iz(n)&&(e.some(({type:e,value:t})=>"native"===e&&iJ.has(t))||e.every(({type:e})=>nv.has(e))),iz=e=>1===e||2===e,iJ=new Set(["pipe","overlapped"]),iq=async(e,t,r,n)=>{for await(let i of e)iY(t)||iZ(i,r,n)},iY=e=>e._readableState.pipes.length>0,iZ=(e,t,r)=>{eP({type:"output",verboseMessage:eN(e),fdNumber:t,verboseInfo:r})},iQ=(e,t,r,n)=>{try{return iG(e,t,r,!1)}catch(t){return n.error=t,e}},i0=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(t)return{serializedResult:e};if("buffer"===r)return{serializedResult:D(e)};let a=((e,t)=>{if("utf8"===t&&e.every(e=>"string"==typeof e))return e;let r=new x.StringDecoder(t),n=e.map(e=>"string"==typeof e?k.encode(e):e).map(e=>r.write(e)),i=r.end();return""===i?n:[...n,i]})(e,r).join("");return n[o]?{serializedResult:a,finalResult:ic(a,!i[o],t)}:{serializedResult:a}},i1=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:a})=>{if(!iK({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:t}))return;let s=ic(e,!1,a);try{for(let e of s)iZ(e,t,n)}catch(e){r.error??=e}},i2=(e,t,r)=>{for(let{path:n,append:i}of t.filter(({type:e})=>nx.has(e))){let t="string"==typeof n?n:n.toString();i||r.has(t)?(0,rv.appendFileSync)(n,e):(r.add(t),(0,rv.writeFileSync)(n,e))}},i4=async(e,t)=>{let[r,n]=await i3(e);return t.isForcefullyTerminated??=!1,[r,n]},i3=async e=>{let[t,r]=await Promise.allSettled([(0,tu.once)(e,"spawn"),(0,tu.once)(e,"exit")]);return"rejected"===t.status?[]:"rejected"===r.status?i8(e):r.value},i8=async e=>{try{return await (0,tu.once)(e,"exit")}catch{return i8(e)}},i6=async e=>{let[t,r]=await e;if(!i5(t,r)&&i9(t,r))throw new eK;return[t,r]},i5=(e,t)=>void 0===e&&void 0===t,i9=(e,t)=>0!==e||null!==t,i7=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,oe=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&ot("ipcInput"),e&&ot("ipc: true"),r&&ot("detached: true"),n&&ot("cancelSignal")},ot=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},or=({file:e,commandArguments:t,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:a})=>{try{let n;for(let e of(n=o,new Set(Object.entries(n).filter(([,{direction:e}])=>"input"===e).map(([e])=>Number(e)))))iW(o,e,r);let i=on(r);return(0,v.spawnSync)(...rk(e,t,i))}catch(e){return r8({error:e,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:a,isSync:!0})}},on=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:(([,e])=>e)(t)}),oi=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:a,options:s,command:l,escapedCommand:c,startTime:u})=>void 0===e?r3({command:l,escapedCommand:c,stdio:o,all:a,ipcOutput:[],options:s,startTime:u}):r6({error:e,command:l,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:o,all:a,ipcOutput:[],options:s,startTime:u,isSync:!0}),oo=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(tp({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:tX(e)}),oa({anyProcess:e,channel:t,isSubprocess:r,filter:o,reference:i})),oa=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:i})=>{tN(t,i);let o=tH(e,t,r),a=new AbortController;try{return await Promise.race([os(o,n,a),ol(o,r,a),oc(o,r,a)])}catch(t){throw t$(e),t}finally{a.abort(),tL(t,i)}},os=async(e,t,{signal:r})=>{if(void 0===t){let[t]=await (0,tu.once)(e,"message",{signal:r});return t}for await(let[n]of(0,tu.on)(e,"message",{signal:r}))if(t(n))return n},ol=async(e,t,{signal:r})=>{await (0,tu.once)(e,"disconnect",{signal:r});throw Error(`${tb("getOneMessage",t)} could not complete: the ${tx(t)} exited or disconnected.`)},oc=async(e,t,{signal:r})=>{let[n]=await (0,tu.once)(e,"strict:error",{signal:r});throw tg(n,t)},ou=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:i=!0}={})=>od({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),od=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{tp({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:tX(e)}),tN(t,o);let a=tH(e,t,r),s=new AbortController,l={};return of(e,a,s),op({ipcEmitter:a,isSubprocess:r,controller:s,state:l}),oh({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:r,shouldAwait:i,controller:s,state:l,reference:o})},of=async(e,t,r)=>{try{await (0,tu.once)(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},op=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[i]=await (0,tu.once)(e,"strict:error",{signal:r.signal});n.error=tg(i,t),r.abort()}catch{}},oh=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:a,reference:s}){try{for await(let[e]of(0,tu.on)(r,"message",{signal:o.signal}))om(a),yield e}catch{om(a)}finally{o.abort(),tL(t,s),n||t$(e),i&&await e}},om=({error:e})=>{if(e)throw e},og=(e,t,r)=>({sendMessage:t6.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:oo.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:ou.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}),oy=()=>{let e=new is.PassThrough;return e.end(),e},ow=()=>new is.Readable({read(){}}),ob=()=>new is.Writable({write(){}}),ov=()=>new is.Duplex({read(){},write(){}}),ox=async(e,t,r)=>nr(e,t,r),o$=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${nk[e]}.`)},oS={fileNumber:o$,generator:iF,asyncGenerator:iF,nodeStream:({value:e})=>({stream:e}),webTransform:({value:{transform:e,writableObjectMode:t,readableObjectMode:r}})=>({stream:is.Duplex.fromWeb(e,{objectMode:t||r})}),duplex:({value:{transform:e}})=>({stream:e}),native(){}},oE={input:{...oS,fileUrl:({value:e})=>({stream:(0,rv.createReadStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,rv.createReadStream)(e)}),webStream:({value:e})=>({stream:is.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:is.Readable.from(e)}),asyncIterable:({value:e})=>({stream:is.Readable.from(e)}),string:({value:e})=>({stream:is.Readable.from(e)}),uint8Array:({value:e})=>({stream:is.Readable.from(iv.Buffer.from(e))})},output:{...oS,fileUrl:({value:e})=>({stream:(0,rv.createWriteStream)(e)}),filePath:({value:{file:e,append:t}})=>({stream:(0,rv.createWriteStream)(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:is.Writable.fromWeb(e)}),iterable:o$,asyncIterable:o$,string:o$,uint8Array:o$}};var ok=is,oT=e.i(88646);function oD(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)oI(t);let t=e.some(({readableObjectMode:e})=>e),r=oA(e,t),n=new oO({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let t of e)n.add(t);return n}let oA=(e,t)=>0===e.length?(0,ok.getDefaultHighWaterMark)(t):Math.max(...e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e));class oO extends ok.PassThrough{#a=new Set([]);#s=new Set([]);#l=new Set([]);#c;#u=Symbol("unpipe");#d=new WeakMap;add(e){if(oI(e),this.#a.has(e))return;this.#a.add(e),this.#c??=oC(this,this.#a,this.#u);let t=oR({passThroughStream:this,stream:e,streams:this.#a,ended:this.#s,aborted:this.#l,onFinished:this.#c,unpipeEvent:this.#u});this.#d.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(oI(e),!this.#a.has(e))return!1;let t=this.#d.get(e);return void 0!==t&&(this.#d.delete(e),e.unpipe(this),await t,!0)}}let oC=async(e,t,r)=>{oW(e,oV);let n=new AbortController;try{await Promise.race([oj(e,n),oP(e,t,r,n)])}finally{n.abort(),oW(e,-oV)}},oj=async(e,{signal:t})=>{try{await (0,oT.finished)(e,{signal:t,cleanup:!0})}catch(t){throw oU(e,t),t}},oP=async(e,t,r,{signal:n})=>{for await(let[i]of(0,tu.on)(e,"unpipe",{signal:n}))t.has(i)&&i.emit(r)},oI=e=>{if("function"!=typeof e?.pipe)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},oR=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:a})=>{oW(e,oX);let s=new AbortController;try{await Promise.race([oB(o,t,s),oN({passThroughStream:e,stream:t,streams:r,ended:n,aborted:i,controller:s}),o_({stream:t,streams:r,ended:n,aborted:i,unpipeEvent:a,controller:s})])}finally{s.abort(),oW(e,-oX)}r.size>0&&r.size===n.size+i.size&&(0===n.size&&i.size>0?oF(e):oL(e))},oB=async(e,t,{signal:r})=>{try{await e,r.aborted||oF(t)}catch(e){r.aborted||oU(t,e)}},oN=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await (0,oT.finished)(t,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(n){if(o.aborted||!r.has(t))return;oM(n)?i.add(t):oG(e,n)}},o_=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await (0,tu.once)(e,i,{signal:o}),!e.readable)return(0,tu.once)(o,"abort",{signal:o});t.delete(e),r.delete(e),n.delete(e)},oL=e=>{e.writable&&e.end()},oU=(e,t)=>{oM(t)?oF(e):oG(e,t)},oM=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",oF=e=>{(e.readable||e.writable)&&e.destroy()},oG=(e,t)=>{e.destroyed||(e.once("error",oH),e.destroy(t))},oH=()=>{},oW=(e,t)=>{let r=e.getMaxListeners();0!==r&&r!==1/0&&e.setMaxListeners(r+t)},oV=2,oX=1,oK=(e,t)=>{e.pipe(t),oz(e,t),oq(e,t)},oz=async(e,t)=>{if(!(M(e)||M(t))){try{await (0,oT.finished)(e,{cleanup:!0,readable:!0,writable:!1})}catch{}oJ(t)}},oJ=e=>{e.writable&&e.end()},oq=async(e,t)=>{if(!(M(e)||M(t))){try{await (0,oT.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}oY(e)}},oY=e=>{e.readable&&e.destroy()},oZ=(e,t,r,n)=>{"output"===r?oK(e.stdio[n],t):oK(t,e.stdio[n]);let i=oQ[n];void 0!==i&&(e[i]=t),e.stdio[n]=t},oQ=["stdin","stdout","stderr"],o0=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(void 0===t)return;o1(t,o);let[a,s]="output"===r?[t,e.stdio[n]]:[e.stdio[n],t],l=i.get(a)??[];i.set(a,[...l,s])},o1=(e,{signal:t})=>{M(e)&&tB(e,o2,t)},o2=2,o4=[];o4.push("SIGHUP","SIGINT","SIGTERM"),o4.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");let o3=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,o8=Symbol.for("signal-exit emitter"),o6=globalThis,o5=Object.defineProperty.bind(Object);class o9{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(o6[o8])return o6[o8];o5(o6,o8,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let r=this.listeners[e],n=r.indexOf(t);-1!==n&&(0===n&&1===r.length?r.length=0:r.splice(n,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(let i of this.listeners[e])n=!0===i(t,r)||n;return"exit"===e&&(n=this.emit("afterExit",t,r)||n),n}}class o7{}class ae extends o7{#f="win32"===at.platform?"SIGINT":"SIGHUP";#p=new o9;#h;#m;#g;#y={};#w=!1;constructor(e){for(const t of(super(),this.#h=e,this.#y={},o4))this.#y[t]=()=>{let r=this.#h.listeners(t),{count:n}=this.#p;if("object"==typeof e.__signal_exit_emitter__&&"number"==typeof e.__signal_exit_emitter__.count&&(n+=e.__signal_exit_emitter__.count),r.length===n){this.unload();let r=this.#p.emit("exit",null,t),n="SIGHUP"===t?this.#f:t;r||e.kill(e.pid,n)}};this.#g=e.reallyExit,this.#m=e.emit}onExit(e,t){if(!o3(this.#h))return()=>{};!1===this.#w&&this.load();let r=t?.alwaysLast?"afterExit":"exit";return this.#p.on(r,e),()=>{this.#p.removeListener(r,e),0===this.#p.listeners.exit.length&&0===this.#p.listeners.afterExit.length&&this.unload()}}load(){if(!this.#w){for(let e of(this.#w=!0,this.#p.count+=1,o4))try{let t=this.#y[e];t&&this.#h.on(e,t)}catch(e){}this.#h.emit=(e,...t)=>this.#b(e,...t),this.#h.reallyExit=e=>this.#v(e)}}unload(){this.#w&&(this.#w=!1,o4.forEach(e=>{let t=this.#y[e];if(!t)throw Error("Listener not defined for signal: "+e);try{this.#h.removeListener(e,t)}catch(e){}}),this.#h.emit=this.#m,this.#h.reallyExit=this.#g,this.#p.count-=1)}#v(e){return o3(this.#h)?(this.#h.exitCode=e||0,this.#p.emit("exit",this.#h.exitCode,null),this.#g.call(this.#h,this.#h.exitCode)):0}#b(e,...t){let r=this.#m;if(!("exit"===e&&o3(this.#h)))return r.call(this.#h,e,...t);{"number"==typeof t[0]&&(this.#h.exitCode=t[0]);let n=r.call(this.#h,e,...t);return this.#p.emit("exit",this.#h.exitCode,null),n}}}let at=globalThis.process,{onExit:ar,load:an,unload:ai}=(r=o3(at)?new ae(at):new class extends o7{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>r.onExit(e,t),load:()=>r.load(),unload:()=>r.unload()}),ao=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(aa,e)(r,...n),pipeOptions:e};if("string"==typeof r||r instanceof URL||y(r)){if(Object.keys(e).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,a]=b(r,...n);return{destination:t(aa)(i,o,a),pipeOptions:a}}if(tT.has(r)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},aa=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),as=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>r8({error:e,command:al,escapedCommand:al,fileDescriptors:t,options:r,startTime:n,isSync:!1}),al="source.pipe(destination)",ac=async e=>{let[{status:t,reason:r,value:n=r},{status:i,reason:o,value:a=o}]=await e;if(a.pipedFrom.includes(n)||a.pipedFrom.push(n),"rejected"===i)throw a;if("rejected"===t)throw n;return a},au=async e=>{try{await (0,oT.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}ad.delete(e)},ad=new WeakMap,af=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{throw await (0,L.aborted)(e,t),await r.remove(t),as({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:n,sourceOptions:i,startTime:o})},ap=(e,...t)=>{if(p(t[0]))return ap.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=(({source:e,sourcePromise:t,boundOptions:r,createNested:n},...i)=>{let o=U.hrtime.bigint(),{destination:a,destinationStream:s,destinationError:l,from:c,unpipeSignal:u}=((e,t,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:a}={}}=ao(e,t,...r),s=tE(n,o);return{destination:n,destinationStream:s,from:i,unpipeSignal:a}}catch(e){return{destinationError:e}}})(r,n,i),{sourceStream:d,sourceError:f}=((e,t)=>{try{return{sourceStream:tk(e,t)}}catch(e){return{sourceError:e}}})(e,c),{options:p,fileDescriptors:h}=tT.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:a,destinationStream:s,destinationError:l,unpipeSignal:u,fileDescriptors:h,startTime:o}})(e,...t),i=ah({...n,destination:r});return i.pipe=ap.bind(void 0,{...e,source:r,sourcePromise:i,boundOptions:{}}),i},ah=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:a,unpipeSignal:s,fileDescriptors:l,startTime:c})=>{let u=am(e,i);(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:a})=>{let s=(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>void 0!==t&&void 0!==n?n:void 0!==n?(oY(e),n):void 0!==t?(oJ(r),t):void 0)({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(void 0!==s)throw as({error:s,fileDescriptors:i,sourceOptions:o,startTime:a})})({sourceStream:t,sourceError:n,destinationStream:o,destinationError:a,fileDescriptors:l,sourceOptions:r,startTime:c});let d=new AbortController;try{var f,p,h,m;let e,n,i,a,g=(i=ad.has(o)?(f=t,p=o,(e=ad.get(p)).add(f),e):(h=t,m=o,n=oD([h]),oK(n,m),ad.set(m,n),n),tB(t,2,d.signal),tB(o,1,d.signal),au(o),i);return await Promise.race([ac(u),...(a={sourceStream:t,mergedStream:g,sourceOptions:r,fileDescriptors:l,startTime:c},void 0===s?[]:[af(s,a)])])}finally{d.abort()}},am=(e,t)=>Promise.allSettled([e,t]),ag=e=>e,ay=()=>void 0,aw=({contents:e})=>e,ab=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},av=e=>e.length;async function ax(e,t){return rz(e,aS,t)}let a$=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),aS={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:ag,buffer:a$,arrayBuffer:a$,dataView:a$,typedArray:a$,others:ab},getSize:av,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return""===t?void 0:t},finalize:aw};async function aE(e,t){return rz(e,aC,t)}let ak=new TextEncoder,aT=e=>new Uint8Array(e),aD=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),aA=e=>aO**Math.ceil(Math.log(e)/Math.log(aO)),aO=2,aC={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>ak.encode(e),buffer:aT,arrayBuffer:aT,dataView:aD,typedArray:aD,others:ab},getSize:av,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:r},n)=>{let i="resize"in ArrayBuffer.prototype?((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:aA(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n):((e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(aA(t));return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n);return new Uint8Array(i).set(e,r),i},getFinalChunk:ay,finalize:({contents:e,length:t})=>"resize"in ArrayBuffer.prototype?e:e.slice(0,t)};async function aj(e,t){return rz(e,aP,t)}let aP={init:()=>({contents:[]}),convertChunk:{string:ag,buffer:ag,arrayBuffer:ag,dataView:ag,typedArray:ag,others:ag},getSize:()=>1,truncateChunk:ay,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:ay,finalize:aw},aI=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let a=new AbortController;return aR(t,a),a_({stream:e,controller:a,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:o})},aR=async(e,t)=>{try{await e}catch{}finally{t.abort()}},aB=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let a=new AbortController;aN(t,a,e);let s=e.readableObjectMode&&!o;return a_({stream:e,controller:a,binary:"buffer"===n,shouldEncode:!s,encoding:n,shouldSplit:!s&&r,preserveNewlines:!i})},aN=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},a_=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:a})=>aM({onStdoutChunk:(0,tu.on)(e,"data",{signal:t.signal,highWaterMark:aU,highWatermark:aU}),controller:t,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:a}),aL=(0,is.getDefaultHighWaterMark)(!0),aU=aL,aM=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:a}){let s=aF({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:a});try{for await(let[t]of e)yield*i_(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*iL(s)}},aF=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:i})=>[ik(e,r,!t),il(e,i,!n,{})].filter(Boolean),aG=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:a,allMixed:s,stripFinalNewline:l,verboseInfo:c,streamInfo:u})=>{let d=aH({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:s,verboseInfo:c,streamInfo:u});if(!i)return void await Promise.all([aW(e),d]);let f=aB({stream:e,onStreamEnd:t,lines:a,encoding:n,stripFinalNewline:ia(l,r),allMixed:s}),[p]=await Promise.all([aV({stream:e,iterable:f,fdNumber:r,encoding:n,maxBuffer:o,lines:a}),d]);return p},aH=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:a}})=>{if(!iK({stdioItems:a[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let s=aB({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await iq(s,e,r,o)},aW=async e=>{await (0,eX.setImmediate)(),null===e.readableFlowing&&e.resume()},aV=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:a})=>{try{if(t||a)return await aj(r,{maxBuffer:o});if("buffer"===i)return new Uint8Array(await aE(r,{maxBuffer:o}));return await ax(r,{maxBuffer:o})}catch(r){return aK((({error:e,stream:t,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{let a,s,l;if(!(e instanceof r0))throw e;if("all"===o)return e;throw e.maxBufferInfo={fdNumber:o,unit:(a=r,s=n,l=i,a?"objects":s?"lines":"buffer"===l?"bytes":"characters")},t.destroy(),e})({error:r,stream:e,readableObjectMode:t,lines:a,encoding:i,fdNumber:n}))}},aX=async e=>{try{return await e}catch(e){return aK(e)}},aK=({bufferedData:e})=>"[object ArrayBuffer]"===$.call(e)?new Uint8Array(e):e,az=async(e,t,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=aJ(e,r),a=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],(0,oT.finished)(e,{cleanup:!0,signal:a.signal})])}catch(e){o.stdinCleanedUp||aZ(e,t,r,n)}finally{a.abort()}},aJ=(e,{originalStreams:[t],subprocess:r})=>{let n={stdinCleanedUp:!1};return e===t&&aq(e,r,n),n},aq=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...i)=>{aY(t,r),n.call(e,...i)}},aY=({exitCode:e,signalCode:t},r)=>{(null!==e||null!==t)&&(r.stdinCleanedUp=!0)},aZ=(e,t,r,n)=>{if(!aQ(e,t,r,n))throw e},aQ=(e,t,r,n=!0)=>r.propagating?a2(e)||a1(e):(r.propagating=!0,a0(r,t)===n?a2(e):a1(e)),a0=({fileDescriptors:e},t)=>"all"!==t&&"input"===e[t].direction,a1=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",a2=e=>e?.code==="EPIPE",a4=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:a,stripFinalNewline:s,verboseInfo:l,streamInfo:c})=>{if(!e)return;let u=az(e,t,c);if(a0(c,t))return void await u;let[d]=await Promise.all([aG({stream:e,onStreamEnd:u,fdNumber:t,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:a,stripFinalNewline:s,verboseInfo:l,streamInfo:c}),u]);return d},a3=(e,t)=>{eP({type:"ipc",verboseMessage:eN(e),fdNumber:"ipc",verboseInfo:t})},a8=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let a=en(o,"ipc"),s=er(t,"ipc"),l=er(r,"ipc");for await(let t of od({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))s&&(r1(e,i,l),i.push(t)),a&&a3(t,o);return i},a6=async(e,t)=>(await Promise.allSettled([e]),t),a5=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:a,gracefulCancel:s,forceKillAfterDelay:l,stripFinalNewline:c,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:m,onInternalError:g,controller:y})=>{let w=i4(e,f),b={originalStreams:m,fileDescriptors:h,subprocess:e,exitPromise:w,propagating:!1},v=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:a,streamInfo:s})=>e.stdio.map((e,l)=>a4({stream:e,fdNumber:l,encoding:t,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:a,streamInfo:s})))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:c,verboseInfo:p,streamInfo:b}),x=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:a,streamInfo:s})=>a4({...(({stdout:e,stderr:t,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:e,buffer:o}:{stream:t,buffer:o}:{stream:r,buffer:o}})(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:(({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode)(e),stripFinalNewline:o,verboseInfo:a,streamInfo:s}))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:c,verboseInfo:p,streamInfo:b}),$=[],S=a8({subprocess:e,buffer:r,maxBuffer:n,ipc:u,ipcOutput:$,verboseInfo:p}),E=a9(m,e,b),k=a7(h,b);try{return await Promise.race([Promise.all([{},i6(w),Promise.all(v),x,S,rh(e,d),...E,...k]),g,se(e,y),...0===o||void 0===o?[]:[ru(e,o,f,y)],...(({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:i})=>void 0===t||r?[]:[tf(e,t,n,i)])({subprocess:e,cancelSignal:a,gracefulCancel:s,context:f,controller:y}),...(({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[rl({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:i,controller:o})]:[])({subprocess:e,cancelSignal:a,gracefulCancel:s,forceKillAfterDelay:l,context:f,controller:y})])}catch(e){return f.terminationReason??="other",Promise.all([{error:e},w,Promise.all(v.map(e=>aX(e))),aX(x),a6(S,$),Promise.allSettled(E),Promise.allSettled(k)])}},a9=(e,t,r)=>e.map((e,n)=>e===t.stdio[n]?void 0:az(e,n,r)),a7=(e,t)=>e.flatMap(({stdioItems:e},r)=>e.filter(({value:e,stream:t=e})=>rI(t,{checkOpen:!1})&&!M(t)).map(({type:e,value:n,stream:i=n})=>az(i,r,t,{isSameDirection:nv.has(e),stopOnExit:"native"===e}))),se=async(e,{signal:t})=>{let[r]=await (0,tu.once)(e,"error",{signal:t});throw r},st=(e,t,r)=>{let n=e[r];n.has(t)||n.set(t,[]);let i=n.get(t),o=tS();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},sr=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n},sn=async e=>{if(void 0!==e)try{await so(e)}catch{}},si=async e=>{if(void 0!==e)try{await sa(e)}catch{}},so=async e=>{await (0,oT.finished)(e,{cleanup:!0,readable:!1,writable:!0})},sa=async e=>{await (0,oT.finished)(e,{cleanup:!0,readable:!0,writable:!1})},ss=async(e,t)=>{if(await e,t)throw t},sl=(e,t,r)=>{r&&!a1(r)?e.destroy(r):t&&e.destroy()},sc=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let a=i||rg.has(r),{subprocessStdout:s,waitReadableDestroy:l}=su(e,n,t),{readableEncoding:c,readableObjectMode:u,readableHighWaterMark:d}=sd(s,a),{read:f,onStdoutDataDone:p}=sf({subprocessStdout:s,subprocess:e,binary:a,encoding:r,preserveNewlines:o}),h=new is.Readable({read:f,destroy:(0,L.callbackify)(sm.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:l})),highWaterMark:d,objectMode:u,encoding:c});return sh({subprocessStdout:s,onStdoutDataDone:p,readable:h,subprocess:e}),h},su=(e,t,r)=>{let n=tk(e,t),i=st(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},sd=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:aL},sf=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:i})=>{let o=tS(),a=aI({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){sp(this,a,o)},onStdoutDataDone:o}},sp=async(e,t,r)=>{try{let{value:n,done:i}=await t.next();i?r.resolve():e.push(n)}catch{}},sh=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:i})=>{try{await sa(e),await n,await sn(i),await t,r.readable&&r.push(null)}catch(e){await sn(i),sg(r,e)}},sm=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await sr(r,t)&&(sg(e,n),await ss(t,n))},sg=(e,t)=>{sl(e,e.readable,t)},sy=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=sw(e,r,t),a=new is.Writable({...sb(n,e,i),destroy:(0,L.callbackify)(sS.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return s$(n,a),a},sw=(e,t,r)=>{let n=tE(e,t),i=st(r,n,"writableFinal"),o=st(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},sb=(e,t,r)=>({write:sv.bind(void 0,e),final:(0,L.callbackify)(sx.bind(void 0,e,t,r))}),sv=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},sx=async(e,t,r)=>{await sr(r,t)&&(e.writable&&e.end(),await t)},s$=async(e,t,r)=>{try{await so(e),t.writable&&t.end()}catch(e){await si(r),sE(t,e)}},sS=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await sr(r,t),await sr(n,t)&&(sE(e,i),await ss(t,i))},sE=(e,t)=>{sl(e,e.writable,t)},sk=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:a=!0}={})=>{let s=o||rg.has(r),{subprocessStdout:l,waitReadableDestroy:c}=su(e,n,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=sw(e,i,t),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:m}=sd(l,s),{read:g,onStdoutDataDone:y}=sf({subprocessStdout:l,subprocess:e,binary:s,encoding:r,preserveNewlines:a}),w=new is.Duplex({read:g,...sb(u,e,d),destroy:(0,L.callbackify)(sT.bind(void 0,{subprocessStdout:l,subprocessStdin:u,subprocess:e,waitReadableDestroy:c,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:m,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:p});return sh({subprocessStdout:l,onStdoutDataDone:y,readable:w,subprocess:e,subprocessStdin:u}),s$(u,w,l),w},sT=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},a)=>{await Promise.all([sm({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},a),sS({subprocessStdin:t,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},a)])},sD=(e,t,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||rg.has(t),a=tk(e,r);return sA(aI({subprocessStdout:a,subprocess:e,binary:o,shouldEncode:!0,encoding:t,preserveNewlines:i}),a,e)},sA=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}},sO=(async()=>{})().constructor.prototype,sC=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(sO,e)]),sj=({timeout:e,signal:t,...r})=>{if(void 0!==t)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},sP=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:a,escapedCommand:s,context:l,onInternalError:c,controller:u})=>{let[d,[f,p],h,m,g]=await a5({subprocess:e,options:t,context:l,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:c,controller:u});u.abort(),c.resolve();let y=sI({errorInfo:d,exitCode:f,signal:p,stdio:h.map((e,r)=>io(e,t,r)),all:io(m,t,"all"),ipcOutput:g,context:l,options:t,command:a,escapedCommand:s,startTime:r});return nr(y,n,t)},sI=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:i,ipcOutput:o,context:a,options:s,command:l,escapedCommand:c,startTime:u})=>"error"in e?r6({error:e.error,command:l,escapedCommand:c,timedOut:"timeout"===a.terminationReason,isCanceled:"cancel"===a.terminationReason||"gracefulCancel"===a.terminationReason,isGracefullyCanceled:"gracefulCancel"===a.terminationReason,isMaxBuffer:e.error instanceof r0,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:i,ipcOutput:o,options:s,startTime:u,isSync:!1}):r3({command:l,escapedCommand:c,stdio:n,all:i,ipcOutput:o,options:s,startTime:u}),sR=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([t,r])=>[t,sB(t,e[t],r)]));return{...e,...r}},sB=(e,t,r)=>sN.has(e)&&p(t)&&p(r)?{...t,...r}:r,sN=new Set(["env",...et]),s_=(e,t,r,n)=>{let i=(e,t,n)=>s_(e,t,r,n),o=(...o)=>sL({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:i},...o);return void 0!==n&&n(o,i,t),o},sL=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...a)=>{if(p(o))return i(e,sR(r,o),n);let{file:s,commandArguments:l,options:c,isSync:u}=sU({mapArguments:e,firstArgument:o,nextArguments:a,deepOptions:t,boundOptions:r});return u?((e,t,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:a,startTime:s,verboseInfo:l,options:c,fileDescriptors:u}=((e,t,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:a}=eM(e,t,r),{file:s,commandArguments:l,options:c}=r$(e,t,i7(r));oe(c);let u=nq(ii,c,a,!0);return{file:s,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:a,options:c,fileDescriptors:u}})(e,t,r);return nr((({file:e,commandArguments:t,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:a,startTime:s})=>{let l=or({file:e,commandArguments:t,options:r,command:n,escapedCommand:i,fileDescriptors:a,startTime:s});if(l.failed)return l;let{resultError:c,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=(({error:e,status:t,signal:r,output:n},{maxBuffer:i})=>{let o,a,s,l=(o=e,a=t,s=r,void 0!==o?o:i9(a,s)?new eK:void 0),c=l?.code==="ETIMEDOUT",u=l?.code==="ENOBUFS"&&null!==n&&n.some(e=>null!==e&&e.length>(([,e])=>e)(i));return{resultError:l,exitCode:t,signal:r,timedOut:c,isMaxBuffer:u}})(l,r),{output:h,error:m=c}=(({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(null===t)return{output:Array.from({length:3})};let o={},a=new Set([]);return{output:t.map((t,s)=>(({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:a},{buffer:s,encoding:l,lines:c,stripFinalNewline:u,maxBuffer:d})=>{if(null===e)return;let f=E(((e,t,r)=>{if(!t)return e;let n=(([,e])=>e)(r);return e.length>n?e.slice(0,n):e})(e,o,d)),{stdioItems:p,objectMode:h}=t[r],{serializedResult:m,finalResult:g=m}=i0({chunks:iQ([f],p,l,n),objectMode:h,encoding:l,lines:c,stripFinalNewline:u,fdNumber:r});i1({serializedResult:m,fdNumber:r,state:n,verboseInfo:a,encoding:l,stdioItems:p,objectMode:h});let y=s[r]?g:void 0;try{return void 0===n.error&&i2(m,p,i),y}catch(e){return n.error=e,y}})({result:t,fileDescriptors:e,fdNumber:s,state:o,outputFiles:a,isMaxBuffer:n,verboseInfo:i},r)),...o}})({fileDescriptors:a,syncResult:l,options:r,isMaxBuffer:p,verboseInfo:o});return oi({error:m,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:h.map((e,t)=>io(e,r,t)),all:io((([,e,t],r)=>{if(r.all)return void 0===e?t:void 0===t?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,io(t,r,"all")]:Array.isArray(t)?[io(e,r,"all"),...t]:S(e)&&S(t)?O([e,t]):`${e}${t}`})(h,r),r,"all"),options:r,command:n,escapedCommand:i,startTime:s})})({file:n,commandArguments:i,options:c,command:o,escapedCommand:a,verboseInfo:l,fileDescriptors:u,startTime:s}),l,c)})(s,l,c):((e,t,r,n)=>{let{file:i,commandArguments:o,command:a,escapedCommand:s,startTime:l,verboseInfo:c,options:u,fileDescriptors:d}=((e,t,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:a}=eM(e,t,r),{file:s,commandArguments:l,options:c}=r$(e,t,r),u=sj(c),d=nq(oE,u,a,!1);return{file:s,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:a,options:u,fileDescriptors:d}})(e,t,r),{subprocess:f,promise:p}=(({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:a,fileDescriptors:s})=>{let l;try{l=(0,v.spawn)(...rk(e,t,r))}catch(e){return(({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:a})=>{var s,l;let c,u,d,f,p,h;n9(n);let m=new v.ChildProcess;return s=m,l=n,c=oy(),u=oy(),d=oy(),f=Array.from({length:l.length-3},oy),p=oy(),h=[c,u,d,...f],Object.assign(s,{stdin:c,stdout:u,stderr:d,all:p,stdio:h}),Object.assign(m,{readable:ow,writable:ob,duplex:ov}),{subprocess:m,promise:ox(r8({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),a,i)}})({error:e,command:o,escapedCommand:a,fileDescriptors:s,options:r,startTime:n,verboseInfo:i})}let c=new AbortController;(0,tu.setMaxListeners)(1/0,c.signal);let u=[...l.stdio];var d=l;let f=new Map;for(let[e,{stdioItems:t,direction:r}]of Object.entries(s)){for(let{stream:n}of t.filter(({type:e})=>nv.has(e)))oZ(d,n,r,e);for(let{stream:n}of t.filter(({type:e})=>!nv.has(e)))o0({subprocess:d,stream:n,direction:r,fdNumber:e,pipeGroups:f,controller:c})}for(let[e,t]of f.entries())oK(1===t.length?t[0]:oD(t),e);((e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let i=ar(()=>{e.kill()});(0,tu.addAbortListener)(n,()=>{i()})})(l,r,c);let p={},h=tS();l.kill=to.bind(void 0,{kill:l.kill.bind(l),options:r,onInternalError:h,context:p,controller:c}),l.all=(({stdout:e,stderr:t},{all:r})=>r&&(e||t)?oD([e,t].filter(Boolean)):void 0)(l,r),((e,{encoding:t})=>{let r={readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap};e.readable=sc.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=sy.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=sk.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=sD.bind(void 0,e,t),e[Symbol.asyncIterator]=sD.bind(void 0,e,t,{})})(l,r),((e,{ipc:t})=>{Object.assign(e,og(e,!1,t))})(l,r);let m=sP({subprocess:l,options:r,startTime:n,verboseInfo:i,fileDescriptors:s,originalStreams:u,command:o,escapedCommand:a,context:p,onInternalError:h,controller:c});return{subprocess:l,promise:m}})({file:i,commandArguments:o,options:u,startTime:l,verboseInfo:c,command:a,escapedCommand:s,fileDescriptors:d});f.pipe=ap.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n});for(let[e,t]of sC){let r=t.value.bind(p);Reflect.defineProperty(f,e,{...t,value:r})}return tT.set(f,{options:u,fileDescriptors:d}),f})(s,l,c,i)},sU=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:i})=>{let[o,a,s]=b(...Array.isArray(t)&&Array.isArray(t.raw)?((e,t)=>{let r=[];for(let[n,i]of e.entries())r=j({templates:e,expressions:t,tokens:r,index:n,template:i});if(0===r.length)throw TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]})(t,r):[t,...r]),l=sR(sR(n,i),s),{file:c=o,commandArguments:u=a,options:d=l,isSync:f=!1}=e({file:o,commandArguments:a,options:l});return{file:c,commandArguments:u,options:d,isSync:f}},sM=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...n]=sF(e);return{file:r,commandArguments:n}},sF=e=>{if("string"!=typeof e)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(""===t)return[];let r=[];for(let e of t.split(sG)){let t=r.at(-1);t&&t.endsWith("\\")?r[r.length-1]=`${t.slice(0,-1)} ${e}`:r.push(e)}return r},sG=/ +/g,sH=({options:e})=>({...sW(e),isSync:!0}),sW=e=>({options:{...sV(e),...e}}),sV=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},sX=s_(()=>({}));s_(()=>({isSync:!0})),s_(({file:e,commandArguments:t})=>sM(e,t)),s_(({file:e,commandArguments:t})=>({...sM(e,t),isSync:!0})),s_(({options:e})=>{if(!1===e.node)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}}),s_(({options:e})=>sW(e),{},{preferLocal:!0},(e,t,r)=>{e.sync=t(sH,r),e.s=e.sync});let{sendMessage:sK,getOneMessage:sz,getEachMessage:sJ,getCancelSignal:sq}=(n=U.default,{...og(n,!0,i=void 0!==U.default.channel),getCancelSignal:rt.bind(void 0,{anyProcess:n,channel:n.channel,isSubprocess:!0,ipc:i})});e.s(["execa",0,sX],18908);var sY=e.i(33405),sZ=e.i(22734),sQ=e.i(46063),s0=e.i(54799),s1=e.i(4446),s2=e.i(72939),s4=e.i(21517),s3=e.i(92509),s8=e.i(85233);let s6={get url(){return`file://${e.P("packages/sandbox-core/dist/index.js")}`}};var s5=(0,d.join)((0,u.homedir)(),".agentbox"),s9=(0,d.join)(s5,"state.json"),s7={version:1,boxes:[]};async function le(e,t){let r=`${e}.lock`;await (0,c.mkdir)((0,d.dirname)(e),{recursive:!0});let n=Date.now()+2e4,i=!1;for(;!i;)try{let e=await (0,c.open)(r,"wx");await e.writeFile(`${String(process.pid)}
29
- `),await e.close(),i=!0}catch(e){if("EEXIST"!==e.code)throw e;try{let e=await (0,c.stat)(r);if(Date.now()-e.mtimeMs>15e3){await (0,c.rm)(r,{force:!0});continue}}catch{continue}if(Date.now()>=n)break;await (0,f.setTimeout)(25)}try{return await t()}finally{i&&await (0,c.rm)(r,{force:!0}).catch(()=>{})}}async function lt(e,t=s9){await le(t,async()=>{let r=await lr(t);await ln(e(r),t)})}async function lr(e=s9){try{let t=await (0,c.readFile)(e,"utf8"),r=JSON.parse(t);if(1!==r.version||!Array.isArray(r.boxes))throw Error(`unrecognized state file shape at ${e}`);for(let e of r.boxes){e.provider??="docker",(e.provider??"docker")!=="docker"||e.docker||(e.docker=lu(e));let t=e.cloud?.ssh;!e.ssh&&t&&(e.ssh=t)}return r}catch(e){if("ENOENT"===e.code)return{...s7};throw e}}async function ln(e,t=s9){await (0,c.mkdir)((0,d.dirname)(t),{recursive:!0});let r=`${t}.tmp.${String(process.pid)}.${String(Date.now())}`;await (0,c.writeFile)(r,JSON.stringify(e,null,2)+"\n","utf8"),await (0,c.rename)(r,t)}async function li(e,t=s9){let r=(e.provider??"docker")!=="docker"||e.docker?e:{...e,docker:lu(e)};await lt(e=>({version:1,boxes:[...e.boxes.filter(e=>e.id!==r.id),r]}),t)}async function lo(e,t,r=s9){await lt(r=>({version:1,boxes:r.boxes.map(r=>r.id===e?{...r,lastAgent:t}:r)}),r)}async function la(e,t,r=s9){let n=t?.trim()||void 0;await lt(t=>({version:1,boxes:t.boxes.map(t=>{if(t.id!==e)return t;if(n)return{...t,displayName:n};let r={...t};return delete r.displayName,r})}),r)}async function ls(e,t=s9){await lt(t=>({version:1,boxes:t.boxes.map(t=>t.id===e?{...t,portlessAlias:void 0,portlessUrl:void 0}:t)}),t)}async function ll(e,t,r=s9){await lt(r=>({version:1,boxes:r.boxes.map(r=>r.id===e?{...r,ssh:t}:r)}),r)}async function lc(e,t,r=s9){let n=1;return await lt(r=>{n=lp(r,t);let i={...e,projectRoot:t,projectIndex:n};return{version:1,boxes:[...r.boxes.filter(t=>t.id!==e.id),i]}},r),n}function lu(e){return{container:e.container,image:e.image,snapshotDir:e.snapshotDir??null,socketPath:e.socketPath,claudeConfigVolume:e.claudeConfigVolume,codexConfigVolume:e.codexConfigVolume,opencodeConfigVolume:e.opencodeConfigVolume,agentConfigVolumes:e.agentConfigVolumes,vscodeServerVolume:e.vscodeServerVolume,cursorServerVolume:e.cursorServerVolume,vncHostPort:e.vncHostPort,webHostPort:e.webHostPort,portlessAlias:e.portlessAlias,portlessUrl:e.portlessUrl,portlessVncAlias:e.portlessVncAlias,portlessVncUrl:e.portlessVncUrl,dockerVolume:e.dockerVolume,dockerCacheShared:e.dockerCacheShared,checkpointImage:e.checkpointImage}}async function ld(e,t=s9){let r=!1;return await lt(t=>{let n=t.boxes.filter(t=>t.id!==e);return r=n.length!==t.boxes.length,{version:1,boxes:n}},t),r}function lf(e,t){let r=e.trim();if(0===r.length)return{kind:"none"};let n=t.boxes.find(e=>e.id===r);if(n)return{kind:"ok",box:n};let i=t.boxes.filter(e=>e.id.startsWith(r));if(1===i.length)return{kind:"ok",box:i[0]};if(i.length>1)return{kind:"ambiguous",matches:i};let o=t.boxes.find(e=>e.name===r);if(o)return{kind:"ok",box:o};let a=t.boxes.find(e=>e.displayName===r);if(a)return{kind:"ok",box:a};let s=t.boxes.find(e=>e.container===r);return s?{kind:"ok",box:s}:{kind:"none"}}function lp(e,t){let r=0;for(let n of e.boxes)n.projectRoot===t&&"number"==typeof n.projectIndex&&n.projectIndex>r&&(r=n.projectIndex);return r+1}function lh(e,t){let r=e.boxes.filter(e=>e.projectRoot===t);return 0===r.length?{kind:"none"}:1===r.length?{kind:"ok",box:r[0]}:{kind:"ambiguous",matches:r}}async function lm(e){let t,r=[];await lg((0,d.join)(e,".git"))&&r.push({kind:"root",hostMainRepo:e,relPathFromWorkspace:""});try{t=await (0,c.readdir)(e,{withFileTypes:!0})}catch{return r}for(let n of t){if(!n.isDirectory()||n.name.startsWith("."))continue;let t=(0,d.join)(e,n.name);await lg((0,d.join)(t,".git"))&&r.push({kind:"nested",hostMainRepo:t,relPathFromWorkspace:n.name})}return r}async function lg(e){try{return(await (0,c.stat)(e)).isDirectory()}catch{return!1}}async function ly(e,t){let r=t,n=2;for(;await lw(e,r);)if(r=`${t}-${String(n++)}`,n>100)throw new lb(`could not find a free branch name near ${t}`);return r}async function lw(e,t){return 0===(await sX("git",["-C",e,"show-ref","--verify","--quiet",`refs/heads/${t}`],{reject:!1})).exitCode}var lb=class extends Error{constructor(e){super(e),this.name="GitWorktreeError"}};function lv(){return"open"}function lx(){return(0,d.join)((0,u.homedir)(),".claude","settings.json")}function l$(e){let t;if(!(0,sZ.existsSync)(e))return{};try{t=JSON.parse((0,sZ.readFileSync)(e,"utf8"))}catch(t){throw Error(`${e} exists but is not valid JSON (${t instanceof Error?t.message:String(t)}) \u2014 not touching it. Fix the file and retry.`)}if(null===t||"object"!=typeof t||Array.isArray(t))throw Error(`${e} is not a JSON object \u2014 not touching it. Fix the file and retry.`);return t}function lS(e,t){(0,sZ.mkdirSync)((0,d.dirname)(e),{recursive:!0}),(0,sZ.writeFileSync)(e,JSON.stringify(t,null,2)+"\n")}function lE(e){if(null!==e&&"object"==typeof e&&"string"==typeof e.id)return e.id}function lk(e){return lT(t=>t.startsWith("agentbox-")&&!e.has(t.slice(9)))}function lT(e){let t=lx();if(!(0,sZ.existsSync)(t))return 0;let r=l$(t);if(!Array.isArray(r.sshConfigs))return 0;let n=r.sshConfigs.filter(t=>{let r=lE(t);return void 0===r||!e(r)}),i=r.sshConfigs.length-n.length;return 0===i?0:(r.sshConfigs=n,lS(t,r),i)}function lD(){return(0,d.join)((0,u.homedir)(),".ssh","config")}function lA(){return(0,d.join)((0,u.homedir)(),".agentbox","ssh","config")}function lO(){return(0,d.join)((0,u.homedir)(),".agentbox","control-plane","deploy.json")}var lC="agentbox-hub",lj="# BEGIN agentbox ssh include";function lP(e,t="cloud box"){return`# BEGIN agentbox ${t} ${e}`}function lI(e,t="cloud box"){return`# END agentbox ${t} ${e}`}function lR(e){return e}async function lB(e){try{return await sZ.promises.readFile(e,"utf8")}catch(e){if("ENOENT"===e.code)return"";throw e}}function lN(e){let t=[lP(e.alias,e.kind),`Host ${e.alias}`,` HostName ${e.hostname}`,` User ${e.user}`];return e.port&&t.push(` Port ${String(e.port)}`),e.proxyJump&&t.push(` ProxyJump ${e.proxyJump}`),e.identityFile&&(t.push(` IdentityFile ${e.identityFile}`),t.push(" IdentitiesOnly yes")),t.push(" StrictHostKeyChecking accept-new"," UserKnownHostsFile /dev/null"," LogLevel ERROR",lI(e.alias,e.kind),""),t.join("\n")}function l_(e){return e.replace(/^# BEGIN agentbox cloud box .*\n[\s\S]*?^# END agentbox cloud box .*\n?/gm,"")}async function lL(){let e=lD();await sZ.promises.mkdir((0,d.join)((0,u.homedir)(),".ssh"),{recursive:!0,mode:448});let t=l_(await lB(e)),r=t;if(!(t.includes(lj)||t.includes(`Include ${lA()}`))){let e=`${lj}
30
- Include ${lA()}
28
+ if (condition) { yield value; }`)},ik=(e,t,r)=>{if(r)return;if(e)return{transform:iT.bind(void 0,new TextEncoder)};let n=new x.StringDecoder(t);return{transform:iD.bind(void 0,n),final:iA.bind(void 0,n)}},iT=function*(e,t){iv.Buffer.isBuffer(t)?yield E(t):"string"==typeof t?yield e.encode(t):yield t},iD=function*(e,t){yield S(t)?e.write(t):t},iA=function*(e){let t=e.end();""!==t&&(yield t)},iO=(0,L.callbackify)(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let e of t.currentIterable)n.push(e)}finally{delete t.currentIterable}}),iP=async function*(e,t,r){if(r===t.length)return void(yield e);let{transform:n=iR}=t[r];for await(let i of n(e))yield*iP(i,t,r+1)},iC=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*ij(r,Number(t),e)},ij=async function*(e,t,r){if(void 0!==e)for await(let n of e())yield*iP(n,r,t+1)},iI=(0,L.callbackify)(async({currentIterable:e},t)=>{if(void 0!==e)return void await (t?e.throw(t):e.return());if(t)throw t}),iR=function*(e){yield e},iB=(e,t,r,n)=>{try{for(let n of e(...t))r.push(n);n()}catch(e){n(e)}},iN=(e,t)=>[...t.flatMap(t=>[...i_(t,e,0)]),...iL(e)],i_=function*(e,t,r){if(r===t.length)return void(yield e);let{transform:n=iM}=t[r];for(let i of n(e))yield*i_(i,t,r+1)},iL=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*iU(r,Number(t),e)},iU=function*(e,t,r){if(void 0!==e)for(let n of e())yield*i_(n,r,t+1)},iM=function*(e){yield e},iF=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:a})=>{let s={},l=iH(e,a,o),c=nu(t),u=nu(r),d=c?iO.bind(void 0,iP,s):iB.bind(void 0,i_),f=c||u?iO.bind(void 0,iC,s):iB.bind(void 0,iL),p=c||u?iI.bind(void 0,s):void 0;return{stream:new is.Transform({writableObjectMode:n,writableHighWaterMark:(0,is.getDefaultHighWaterMark)(n),readableObjectMode:i,readableHighWaterMark:(0,is.getDefaultHighWaterMark)(i),transform(e,t,r){d([e,l,0],this,r)},flush(e){f([l],this,e)},destroy:p})}},iG=(e,t,r,n)=>{let i=t.filter(({type:e})=>"generator"===e);for(let{value:t,optionName:o}of n?i.reverse():i)e=iN(iH(t,r,o),e);return e},iH=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},a,s)=>{let l={};return[{transform:n?void 0:ix.bind(void 0,s)},ik(r,a,n),il(r,o,n,l),{transform:e,final:t},{transform:i?i$.bind(void 0,s):iS.bind(void 0,s)},(({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:ig.bind(void 0,n)})({binary:r,preserveNewlines:o,readableObjectMode:i,state:l})].filter(Boolean)},iW=(e,t,r)=>{let{stdioItems:n}=e[t],i=n.filter(({contents:e})=>void 0!==e);if(0!==i.length){if(0!==t){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${nk[e]} with synchronous methods.`)}r.input=D(i.map(({contents:e})=>e).map(e=>iV(e,n)))}},iV=(e,t)=>{let r=iG(e,t,"utf8",!0);return iX(r),D(r)},iX=e=>{let t=e.find(e=>"string"!=typeof e&&!S(e));if(void 0!==t)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},iK=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>"all"!==n&&en(r,n)&&!rg.has(t)&&iz(n)&&(e.some(({type:e,value:t})=>"native"===e&&iJ.has(t))||e.every(({type:e})=>nv.has(e))),iz=e=>1===e||2===e,iJ=new Set(["pipe","overlapped"]),iq=async(e,t,r,n)=>{for await(let i of e)iY(t)||iZ(i,r,n)},iY=e=>e._readableState.pipes.length>0,iZ=(e,t,r)=>{ej({type:"output",verboseMessage:eN(e),fdNumber:t,verboseInfo:r})},iQ=(e,t,r,n)=>{try{return iG(e,t,r,!1)}catch(t){return n.error=t,e}},i0=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(t)return{serializedResult:e};if("buffer"===r)return{serializedResult:D(e)};let a=((e,t)=>{if("utf8"===t&&e.every(e=>"string"==typeof e))return e;let r=new x.StringDecoder(t),n=e.map(e=>"string"==typeof e?k.encode(e):e).map(e=>r.write(e)),i=r.end();return""===i?n:[...n,i]})(e,r).join("");return n[o]?{serializedResult:a,finalResult:ic(a,!i[o],t)}:{serializedResult:a}},i1=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:a})=>{if(!iK({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:t}))return;let s=ic(e,!1,a);try{for(let e of s)iZ(e,t,n)}catch(e){r.error??=e}},i2=(e,t,r)=>{for(let{path:n,append:i}of t.filter(({type:e})=>nx.has(e))){let t="string"==typeof n?n:n.toString();i||r.has(t)?(0,rv.appendFileSync)(n,e):(r.add(t),(0,rv.writeFileSync)(n,e))}},i4=async(e,t)=>{let[r,n]=await i3(e);return t.isForcefullyTerminated??=!1,[r,n]},i3=async e=>{let[t,r]=await Promise.allSettled([(0,tu.once)(e,"spawn"),(0,tu.once)(e,"exit")]);return"rejected"===t.status?[]:"rejected"===r.status?i8(e):r.value},i8=async e=>{try{return await (0,tu.once)(e,"exit")}catch{return i8(e)}},i6=async e=>{let[t,r]=await e;if(!i5(t,r)&&i9(t,r))throw new eK;return[t,r]},i5=(e,t)=>void 0===e&&void 0===t,i9=(e,t)=>0!==e||null!==t,i7=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,oe=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&ot("ipcInput"),e&&ot("ipc: true"),r&&ot("detached: true"),n&&ot("cancelSignal")},ot=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},or=({file:e,commandArguments:t,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:a})=>{try{let n;for(let e of(n=o,new Set(Object.entries(n).filter(([,{direction:e}])=>"input"===e).map(([e])=>Number(e)))))iW(o,e,r);let i=on(r);return(0,v.spawnSync)(...rk(e,t,i))}catch(e){return r8({error:e,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:a,isSync:!0})}},on=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:(([,e])=>e)(t)}),oi=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:a,options:s,command:l,escapedCommand:c,startTime:u})=>void 0===e?r3({command:l,escapedCommand:c,stdio:o,all:a,ipcOutput:[],options:s,startTime:u}):r6({error:e,command:l,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:o,all:a,ipcOutput:[],options:s,startTime:u,isSync:!0}),oo=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(tp({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:tX(e)}),oa({anyProcess:e,channel:t,isSubprocess:r,filter:o,reference:i})),oa=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:i})=>{tN(t,i);let o=tH(e,t,r),a=new AbortController;try{return await Promise.race([os(o,n,a),ol(o,r,a),oc(o,r,a)])}catch(t){throw t$(e),t}finally{a.abort(),tL(t,i)}},os=async(e,t,{signal:r})=>{if(void 0===t){let[t]=await (0,tu.once)(e,"message",{signal:r});return t}for await(let[n]of(0,tu.on)(e,"message",{signal:r}))if(t(n))return n},ol=async(e,t,{signal:r})=>{await (0,tu.once)(e,"disconnect",{signal:r});throw Error(`${tb("getOneMessage",t)} could not complete: the ${tx(t)} exited or disconnected.`)},oc=async(e,t,{signal:r})=>{let[n]=await (0,tu.once)(e,"strict:error",{signal:r});throw tg(n,t)},ou=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:i=!0}={})=>od({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),od=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{tp({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:tX(e)}),tN(t,o);let a=tH(e,t,r),s=new AbortController,l={};return of(e,a,s),op({ipcEmitter:a,isSubprocess:r,controller:s,state:l}),oh({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:r,shouldAwait:i,controller:s,state:l,reference:o})},of=async(e,t,r)=>{try{await (0,tu.once)(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},op=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[i]=await (0,tu.once)(e,"strict:error",{signal:r.signal});n.error=tg(i,t),r.abort()}catch{}},oh=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:a,reference:s}){try{for await(let[e]of(0,tu.on)(r,"message",{signal:o.signal}))om(a),yield e}catch{om(a)}finally{o.abort(),tL(t,s),n||t$(e),i&&await e}},om=({error:e})=>{if(e)throw e},og=(e,t,r)=>({sendMessage:t6.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:oo.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:ou.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}),oy=()=>{let e=new is.PassThrough;return e.end(),e},ow=()=>new is.Readable({read(){}}),ob=()=>new is.Writable({write(){}}),ov=()=>new is.Duplex({read(){},write(){}}),ox=async(e,t,r)=>nr(e,t,r),o$=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${nk[e]}.`)},oS={fileNumber:o$,generator:iF,asyncGenerator:iF,nodeStream:({value:e})=>({stream:e}),webTransform:({value:{transform:e,writableObjectMode:t,readableObjectMode:r}})=>({stream:is.Duplex.fromWeb(e,{objectMode:t||r})}),duplex:({value:{transform:e}})=>({stream:e}),native(){}},oE={input:{...oS,fileUrl:({value:e})=>({stream:(0,rv.createReadStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,rv.createReadStream)(e)}),webStream:({value:e})=>({stream:is.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:is.Readable.from(e)}),asyncIterable:({value:e})=>({stream:is.Readable.from(e)}),string:({value:e})=>({stream:is.Readable.from(e)}),uint8Array:({value:e})=>({stream:is.Readable.from(iv.Buffer.from(e))})},output:{...oS,fileUrl:({value:e})=>({stream:(0,rv.createWriteStream)(e)}),filePath:({value:{file:e,append:t}})=>({stream:(0,rv.createWriteStream)(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:is.Writable.fromWeb(e)}),iterable:o$,asyncIterable:o$,string:o$,uint8Array:o$}};var ok=is,oT=e.i(88646);function oD(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)oI(t);let t=e.some(({readableObjectMode:e})=>e),r=oA(e,t),n=new oO({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let t of e)n.add(t);return n}let oA=(e,t)=>0===e.length?(0,ok.getDefaultHighWaterMark)(t):Math.max(...e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e));class oO extends ok.PassThrough{#a=new Set([]);#s=new Set([]);#l=new Set([]);#c;#u=Symbol("unpipe");#d=new WeakMap;add(e){if(oI(e),this.#a.has(e))return;this.#a.add(e),this.#c??=oP(this,this.#a,this.#u);let t=oR({passThroughStream:this,stream:e,streams:this.#a,ended:this.#s,aborted:this.#l,onFinished:this.#c,unpipeEvent:this.#u});this.#d.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(oI(e),!this.#a.has(e))return!1;let t=this.#d.get(e);return void 0!==t&&(this.#d.delete(e),e.unpipe(this),await t,!0)}}let oP=async(e,t,r)=>{oW(e,oV);let n=new AbortController;try{await Promise.race([oC(e,n),oj(e,t,r,n)])}finally{n.abort(),oW(e,-oV)}},oC=async(e,{signal:t})=>{try{await (0,oT.finished)(e,{signal:t,cleanup:!0})}catch(t){throw oU(e,t),t}},oj=async(e,t,r,{signal:n})=>{for await(let[i]of(0,tu.on)(e,"unpipe",{signal:n}))t.has(i)&&i.emit(r)},oI=e=>{if("function"!=typeof e?.pipe)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},oR=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:a})=>{oW(e,oX);let s=new AbortController;try{await Promise.race([oB(o,t,s),oN({passThroughStream:e,stream:t,streams:r,ended:n,aborted:i,controller:s}),o_({stream:t,streams:r,ended:n,aborted:i,unpipeEvent:a,controller:s})])}finally{s.abort(),oW(e,-oX)}r.size>0&&r.size===n.size+i.size&&(0===n.size&&i.size>0?oF(e):oL(e))},oB=async(e,t,{signal:r})=>{try{await e,r.aborted||oF(t)}catch(e){r.aborted||oU(t,e)}},oN=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await (0,oT.finished)(t,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(n){if(o.aborted||!r.has(t))return;oM(n)?i.add(t):oG(e,n)}},o_=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await (0,tu.once)(e,i,{signal:o}),!e.readable)return(0,tu.once)(o,"abort",{signal:o});t.delete(e),r.delete(e),n.delete(e)},oL=e=>{e.writable&&e.end()},oU=(e,t)=>{oM(t)?oF(e):oG(e,t)},oM=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",oF=e=>{(e.readable||e.writable)&&e.destroy()},oG=(e,t)=>{e.destroyed||(e.once("error",oH),e.destroy(t))},oH=()=>{},oW=(e,t)=>{let r=e.getMaxListeners();0!==r&&r!==1/0&&e.setMaxListeners(r+t)},oV=2,oX=1,oK=(e,t)=>{e.pipe(t),oz(e,t),oq(e,t)},oz=async(e,t)=>{if(!(M(e)||M(t))){try{await (0,oT.finished)(e,{cleanup:!0,readable:!0,writable:!1})}catch{}oJ(t)}},oJ=e=>{e.writable&&e.end()},oq=async(e,t)=>{if(!(M(e)||M(t))){try{await (0,oT.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}oY(e)}},oY=e=>{e.readable&&e.destroy()},oZ=(e,t,r,n)=>{"output"===r?oK(e.stdio[n],t):oK(t,e.stdio[n]);let i=oQ[n];void 0!==i&&(e[i]=t),e.stdio[n]=t},oQ=["stdin","stdout","stderr"],o0=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(void 0===t)return;o1(t,o);let[a,s]="output"===r?[t,e.stdio[n]]:[e.stdio[n],t],l=i.get(a)??[];i.set(a,[...l,s])},o1=(e,{signal:t})=>{M(e)&&tB(e,o2,t)},o2=2,o4=[];o4.push("SIGHUP","SIGINT","SIGTERM"),o4.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");let o3=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,o8=Symbol.for("signal-exit emitter"),o6=globalThis,o5=Object.defineProperty.bind(Object);class o9{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(o6[o8])return o6[o8];o5(o6,o8,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let r=this.listeners[e],n=r.indexOf(t);-1!==n&&(0===n&&1===r.length?r.length=0:r.splice(n,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(let i of this.listeners[e])n=!0===i(t,r)||n;return"exit"===e&&(n=this.emit("afterExit",t,r)||n),n}}class o7{}class ae extends o7{#f="win32"===at.platform?"SIGINT":"SIGHUP";#p=new o9;#h;#m;#g;#y={};#w=!1;constructor(e){for(const t of(super(),this.#h=e,this.#y={},o4))this.#y[t]=()=>{let r=this.#h.listeners(t),{count:n}=this.#p;if("object"==typeof e.__signal_exit_emitter__&&"number"==typeof e.__signal_exit_emitter__.count&&(n+=e.__signal_exit_emitter__.count),r.length===n){this.unload();let r=this.#p.emit("exit",null,t),n="SIGHUP"===t?this.#f:t;r||e.kill(e.pid,n)}};this.#g=e.reallyExit,this.#m=e.emit}onExit(e,t){if(!o3(this.#h))return()=>{};!1===this.#w&&this.load();let r=t?.alwaysLast?"afterExit":"exit";return this.#p.on(r,e),()=>{this.#p.removeListener(r,e),0===this.#p.listeners.exit.length&&0===this.#p.listeners.afterExit.length&&this.unload()}}load(){if(!this.#w){for(let e of(this.#w=!0,this.#p.count+=1,o4))try{let t=this.#y[e];t&&this.#h.on(e,t)}catch(e){}this.#h.emit=(e,...t)=>this.#b(e,...t),this.#h.reallyExit=e=>this.#v(e)}}unload(){this.#w&&(this.#w=!1,o4.forEach(e=>{let t=this.#y[e];if(!t)throw Error("Listener not defined for signal: "+e);try{this.#h.removeListener(e,t)}catch(e){}}),this.#h.emit=this.#m,this.#h.reallyExit=this.#g,this.#p.count-=1)}#v(e){return o3(this.#h)?(this.#h.exitCode=e||0,this.#p.emit("exit",this.#h.exitCode,null),this.#g.call(this.#h,this.#h.exitCode)):0}#b(e,...t){let r=this.#m;if(!("exit"===e&&o3(this.#h)))return r.call(this.#h,e,...t);{"number"==typeof t[0]&&(this.#h.exitCode=t[0]);let n=r.call(this.#h,e,...t);return this.#p.emit("exit",this.#h.exitCode,null),n}}}let at=globalThis.process,{onExit:ar,load:an,unload:ai}=(r=o3(at)?new ae(at):new class extends o7{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>r.onExit(e,t),load:()=>r.load(),unload:()=>r.unload()}),ao=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(aa,e)(r,...n),pipeOptions:e};if("string"==typeof r||r instanceof URL||y(r)){if(Object.keys(e).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,a]=b(r,...n);return{destination:t(aa)(i,o,a),pipeOptions:a}}if(tT.has(r)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},aa=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),as=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>r8({error:e,command:al,escapedCommand:al,fileDescriptors:t,options:r,startTime:n,isSync:!1}),al="source.pipe(destination)",ac=async e=>{let[{status:t,reason:r,value:n=r},{status:i,reason:o,value:a=o}]=await e;if(a.pipedFrom.includes(n)||a.pipedFrom.push(n),"rejected"===i)throw a;if("rejected"===t)throw n;return a},au=async e=>{try{await (0,oT.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}ad.delete(e)},ad=new WeakMap,af=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{throw await (0,L.aborted)(e,t),await r.remove(t),as({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:n,sourceOptions:i,startTime:o})},ap=(e,...t)=>{if(p(t[0]))return ap.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=(({source:e,sourcePromise:t,boundOptions:r,createNested:n},...i)=>{let o=U.hrtime.bigint(),{destination:a,destinationStream:s,destinationError:l,from:c,unpipeSignal:u}=((e,t,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:a}={}}=ao(e,t,...r),s=tE(n,o);return{destination:n,destinationStream:s,from:i,unpipeSignal:a}}catch(e){return{destinationError:e}}})(r,n,i),{sourceStream:d,sourceError:f}=((e,t)=>{try{return{sourceStream:tk(e,t)}}catch(e){return{sourceError:e}}})(e,c),{options:p,fileDescriptors:h}=tT.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:a,destinationStream:s,destinationError:l,unpipeSignal:u,fileDescriptors:h,startTime:o}})(e,...t),i=ah({...n,destination:r});return i.pipe=ap.bind(void 0,{...e,source:r,sourcePromise:i,boundOptions:{}}),i},ah=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:a,unpipeSignal:s,fileDescriptors:l,startTime:c})=>{let u=am(e,i);(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:a})=>{let s=(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>void 0!==t&&void 0!==n?n:void 0!==n?(oY(e),n):void 0!==t?(oJ(r),t):void 0)({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(void 0!==s)throw as({error:s,fileDescriptors:i,sourceOptions:o,startTime:a})})({sourceStream:t,sourceError:n,destinationStream:o,destinationError:a,fileDescriptors:l,sourceOptions:r,startTime:c});let d=new AbortController;try{var f,p,h,m;let e,n,i,a,g=(i=ad.has(o)?(f=t,p=o,(e=ad.get(p)).add(f),e):(h=t,m=o,n=oD([h]),oK(n,m),ad.set(m,n),n),tB(t,2,d.signal),tB(o,1,d.signal),au(o),i);return await Promise.race([ac(u),...(a={sourceStream:t,mergedStream:g,sourceOptions:r,fileDescriptors:l,startTime:c},void 0===s?[]:[af(s,a)])])}finally{d.abort()}},am=(e,t)=>Promise.allSettled([e,t]),ag=e=>e,ay=()=>void 0,aw=({contents:e})=>e,ab=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},av=e=>e.length;async function ax(e,t){return rz(e,aS,t)}let a$=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),aS={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:ag,buffer:a$,arrayBuffer:a$,dataView:a$,typedArray:a$,others:ab},getSize:av,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return""===t?void 0:t},finalize:aw};async function aE(e,t){return rz(e,aP,t)}let ak=new TextEncoder,aT=e=>new Uint8Array(e),aD=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),aA=e=>aO**Math.ceil(Math.log(e)/Math.log(aO)),aO=2,aP={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>ak.encode(e),buffer:aT,arrayBuffer:aT,dataView:aD,typedArray:aD,others:ab},getSize:av,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:r},n)=>{let i="resize"in ArrayBuffer.prototype?((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:aA(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n):((e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(aA(t));return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n);return new Uint8Array(i).set(e,r),i},getFinalChunk:ay,finalize:({contents:e,length:t})=>"resize"in ArrayBuffer.prototype?e:e.slice(0,t)};async function aC(e,t){return rz(e,aj,t)}let aj={init:()=>({contents:[]}),convertChunk:{string:ag,buffer:ag,arrayBuffer:ag,dataView:ag,typedArray:ag,others:ag},getSize:()=>1,truncateChunk:ay,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:ay,finalize:aw},aI=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let a=new AbortController;return aR(t,a),a_({stream:e,controller:a,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:o})},aR=async(e,t)=>{try{await e}catch{}finally{t.abort()}},aB=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let a=new AbortController;aN(t,a,e);let s=e.readableObjectMode&&!o;return a_({stream:e,controller:a,binary:"buffer"===n,shouldEncode:!s,encoding:n,shouldSplit:!s&&r,preserveNewlines:!i})},aN=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},a_=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:a})=>aM({onStdoutChunk:(0,tu.on)(e,"data",{signal:t.signal,highWaterMark:aU,highWatermark:aU}),controller:t,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:a}),aL=(0,is.getDefaultHighWaterMark)(!0),aU=aL,aM=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:a}){let s=aF({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:a});try{for await(let[t]of e)yield*i_(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*iL(s)}},aF=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:i})=>[ik(e,r,!t),il(e,i,!n,{})].filter(Boolean),aG=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:a,allMixed:s,stripFinalNewline:l,verboseInfo:c,streamInfo:u})=>{let d=aH({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:s,verboseInfo:c,streamInfo:u});if(!i)return void await Promise.all([aW(e),d]);let f=aB({stream:e,onStreamEnd:t,lines:a,encoding:n,stripFinalNewline:ia(l,r),allMixed:s}),[p]=await Promise.all([aV({stream:e,iterable:f,fdNumber:r,encoding:n,maxBuffer:o,lines:a}),d]);return p},aH=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:a}})=>{if(!iK({stdioItems:a[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let s=aB({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await iq(s,e,r,o)},aW=async e=>{await (0,eX.setImmediate)(),null===e.readableFlowing&&e.resume()},aV=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:a})=>{try{if(t||a)return await aC(r,{maxBuffer:o});if("buffer"===i)return new Uint8Array(await aE(r,{maxBuffer:o}));return await ax(r,{maxBuffer:o})}catch(r){return aK((({error:e,stream:t,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{let a,s,l;if(!(e instanceof r0))throw e;if("all"===o)return e;throw e.maxBufferInfo={fdNumber:o,unit:(a=r,s=n,l=i,a?"objects":s?"lines":"buffer"===l?"bytes":"characters")},t.destroy(),e})({error:r,stream:e,readableObjectMode:t,lines:a,encoding:i,fdNumber:n}))}},aX=async e=>{try{return await e}catch(e){return aK(e)}},aK=({bufferedData:e})=>"[object ArrayBuffer]"===$.call(e)?new Uint8Array(e):e,az=async(e,t,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=aJ(e,r),a=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],(0,oT.finished)(e,{cleanup:!0,signal:a.signal})])}catch(e){o.stdinCleanedUp||aZ(e,t,r,n)}finally{a.abort()}},aJ=(e,{originalStreams:[t],subprocess:r})=>{let n={stdinCleanedUp:!1};return e===t&&aq(e,r,n),n},aq=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...i)=>{aY(t,r),n.call(e,...i)}},aY=({exitCode:e,signalCode:t},r)=>{(null!==e||null!==t)&&(r.stdinCleanedUp=!0)},aZ=(e,t,r,n)=>{if(!aQ(e,t,r,n))throw e},aQ=(e,t,r,n=!0)=>r.propagating?a2(e)||a1(e):(r.propagating=!0,a0(r,t)===n?a2(e):a1(e)),a0=({fileDescriptors:e},t)=>"all"!==t&&"input"===e[t].direction,a1=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",a2=e=>e?.code==="EPIPE",a4=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:a,stripFinalNewline:s,verboseInfo:l,streamInfo:c})=>{if(!e)return;let u=az(e,t,c);if(a0(c,t))return void await u;let[d]=await Promise.all([aG({stream:e,onStreamEnd:u,fdNumber:t,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:a,stripFinalNewline:s,verboseInfo:l,streamInfo:c}),u]);return d},a3=(e,t)=>{ej({type:"ipc",verboseMessage:eN(e),fdNumber:"ipc",verboseInfo:t})},a8=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let a=en(o,"ipc"),s=er(t,"ipc"),l=er(r,"ipc");for await(let t of od({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))s&&(r1(e,i,l),i.push(t)),a&&a3(t,o);return i},a6=async(e,t)=>(await Promise.allSettled([e]),t),a5=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:a,gracefulCancel:s,forceKillAfterDelay:l,stripFinalNewline:c,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:m,onInternalError:g,controller:y})=>{let w=i4(e,f),b={originalStreams:m,fileDescriptors:h,subprocess:e,exitPromise:w,propagating:!1},v=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:a,streamInfo:s})=>e.stdio.map((e,l)=>a4({stream:e,fdNumber:l,encoding:t,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:a,streamInfo:s})))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:c,verboseInfo:p,streamInfo:b}),x=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:a,streamInfo:s})=>a4({...(({stdout:e,stderr:t,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:e,buffer:o}:{stream:t,buffer:o}:{stream:r,buffer:o}})(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:(({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode)(e),stripFinalNewline:o,verboseInfo:a,streamInfo:s}))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:c,verboseInfo:p,streamInfo:b}),$=[],S=a8({subprocess:e,buffer:r,maxBuffer:n,ipc:u,ipcOutput:$,verboseInfo:p}),E=a9(m,e,b),k=a7(h,b);try{return await Promise.race([Promise.all([{},i6(w),Promise.all(v),x,S,rh(e,d),...E,...k]),g,se(e,y),...0===o||void 0===o?[]:[ru(e,o,f,y)],...(({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:i})=>void 0===t||r?[]:[tf(e,t,n,i)])({subprocess:e,cancelSignal:a,gracefulCancel:s,context:f,controller:y}),...(({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[rl({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:i,controller:o})]:[])({subprocess:e,cancelSignal:a,gracefulCancel:s,forceKillAfterDelay:l,context:f,controller:y})])}catch(e){return f.terminationReason??="other",Promise.all([{error:e},w,Promise.all(v.map(e=>aX(e))),aX(x),a6(S,$),Promise.allSettled(E),Promise.allSettled(k)])}},a9=(e,t,r)=>e.map((e,n)=>e===t.stdio[n]?void 0:az(e,n,r)),a7=(e,t)=>e.flatMap(({stdioItems:e},r)=>e.filter(({value:e,stream:t=e})=>rI(t,{checkOpen:!1})&&!M(t)).map(({type:e,value:n,stream:i=n})=>az(i,r,t,{isSameDirection:nv.has(e),stopOnExit:"native"===e}))),se=async(e,{signal:t})=>{let[r]=await (0,tu.once)(e,"error",{signal:t});throw r},st=(e,t,r)=>{let n=e[r];n.has(t)||n.set(t,[]);let i=n.get(t),o=tS();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},sr=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n},sn=async e=>{if(void 0!==e)try{await so(e)}catch{}},si=async e=>{if(void 0!==e)try{await sa(e)}catch{}},so=async e=>{await (0,oT.finished)(e,{cleanup:!0,readable:!1,writable:!0})},sa=async e=>{await (0,oT.finished)(e,{cleanup:!0,readable:!0,writable:!1})},ss=async(e,t)=>{if(await e,t)throw t},sl=(e,t,r)=>{r&&!a1(r)?e.destroy(r):t&&e.destroy()},sc=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let a=i||rg.has(r),{subprocessStdout:s,waitReadableDestroy:l}=su(e,n,t),{readableEncoding:c,readableObjectMode:u,readableHighWaterMark:d}=sd(s,a),{read:f,onStdoutDataDone:p}=sf({subprocessStdout:s,subprocess:e,binary:a,encoding:r,preserveNewlines:o}),h=new is.Readable({read:f,destroy:(0,L.callbackify)(sm.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:l})),highWaterMark:d,objectMode:u,encoding:c});return sh({subprocessStdout:s,onStdoutDataDone:p,readable:h,subprocess:e}),h},su=(e,t,r)=>{let n=tk(e,t),i=st(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},sd=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:aL},sf=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:i})=>{let o=tS(),a=aI({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){sp(this,a,o)},onStdoutDataDone:o}},sp=async(e,t,r)=>{try{let{value:n,done:i}=await t.next();i?r.resolve():e.push(n)}catch{}},sh=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:i})=>{try{await sa(e),await n,await sn(i),await t,r.readable&&r.push(null)}catch(e){await sn(i),sg(r,e)}},sm=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await sr(r,t)&&(sg(e,n),await ss(t,n))},sg=(e,t)=>{sl(e,e.readable,t)},sy=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=sw(e,r,t),a=new is.Writable({...sb(n,e,i),destroy:(0,L.callbackify)(sS.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return s$(n,a),a},sw=(e,t,r)=>{let n=tE(e,t),i=st(r,n,"writableFinal"),o=st(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},sb=(e,t,r)=>({write:sv.bind(void 0,e),final:(0,L.callbackify)(sx.bind(void 0,e,t,r))}),sv=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},sx=async(e,t,r)=>{await sr(r,t)&&(e.writable&&e.end(),await t)},s$=async(e,t,r)=>{try{await so(e),t.writable&&t.end()}catch(e){await si(r),sE(t,e)}},sS=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await sr(r,t),await sr(n,t)&&(sE(e,i),await ss(t,i))},sE=(e,t)=>{sl(e,e.writable,t)},sk=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:a=!0}={})=>{let s=o||rg.has(r),{subprocessStdout:l,waitReadableDestroy:c}=su(e,n,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=sw(e,i,t),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:m}=sd(l,s),{read:g,onStdoutDataDone:y}=sf({subprocessStdout:l,subprocess:e,binary:s,encoding:r,preserveNewlines:a}),w=new is.Duplex({read:g,...sb(u,e,d),destroy:(0,L.callbackify)(sT.bind(void 0,{subprocessStdout:l,subprocessStdin:u,subprocess:e,waitReadableDestroy:c,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:m,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:p});return sh({subprocessStdout:l,onStdoutDataDone:y,readable:w,subprocess:e,subprocessStdin:u}),s$(u,w,l),w},sT=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},a)=>{await Promise.all([sm({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},a),sS({subprocessStdin:t,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},a)])},sD=(e,t,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||rg.has(t),a=tk(e,r);return sA(aI({subprocessStdout:a,subprocess:e,binary:o,shouldEncode:!0,encoding:t,preserveNewlines:i}),a,e)},sA=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}},sO=(async()=>{})().constructor.prototype,sP=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(sO,e)]),sC=({timeout:e,signal:t,...r})=>{if(void 0!==t)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},sj=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:a,escapedCommand:s,context:l,onInternalError:c,controller:u})=>{let[d,[f,p],h,m,g]=await a5({subprocess:e,options:t,context:l,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:c,controller:u});u.abort(),c.resolve();let y=sI({errorInfo:d,exitCode:f,signal:p,stdio:h.map((e,r)=>io(e,t,r)),all:io(m,t,"all"),ipcOutput:g,context:l,options:t,command:a,escapedCommand:s,startTime:r});return nr(y,n,t)},sI=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:i,ipcOutput:o,context:a,options:s,command:l,escapedCommand:c,startTime:u})=>"error"in e?r6({error:e.error,command:l,escapedCommand:c,timedOut:"timeout"===a.terminationReason,isCanceled:"cancel"===a.terminationReason||"gracefulCancel"===a.terminationReason,isGracefullyCanceled:"gracefulCancel"===a.terminationReason,isMaxBuffer:e.error instanceof r0,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:i,ipcOutput:o,options:s,startTime:u,isSync:!1}):r3({command:l,escapedCommand:c,stdio:n,all:i,ipcOutput:o,options:s,startTime:u}),sR=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([t,r])=>[t,sB(t,e[t],r)]));return{...e,...r}},sB=(e,t,r)=>sN.has(e)&&p(t)&&p(r)?{...t,...r}:r,sN=new Set(["env",...et]),s_=(e,t,r,n)=>{let i=(e,t,n)=>s_(e,t,r,n),o=(...o)=>sL({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:i},...o);return void 0!==n&&n(o,i,t),o},sL=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...a)=>{if(p(o))return i(e,sR(r,o),n);let{file:s,commandArguments:l,options:c,isSync:u}=sU({mapArguments:e,firstArgument:o,nextArguments:a,deepOptions:t,boundOptions:r});return u?((e,t,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:a,startTime:s,verboseInfo:l,options:c,fileDescriptors:u}=((e,t,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:a}=eM(e,t,r),{file:s,commandArguments:l,options:c}=r$(e,t,i7(r));oe(c);let u=nq(ii,c,a,!0);return{file:s,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:a,options:c,fileDescriptors:u}})(e,t,r);return nr((({file:e,commandArguments:t,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:a,startTime:s})=>{let l=or({file:e,commandArguments:t,options:r,command:n,escapedCommand:i,fileDescriptors:a,startTime:s});if(l.failed)return l;let{resultError:c,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=(({error:e,status:t,signal:r,output:n},{maxBuffer:i})=>{let o,a,s,l=(o=e,a=t,s=r,void 0!==o?o:i9(a,s)?new eK:void 0),c=l?.code==="ETIMEDOUT",u=l?.code==="ENOBUFS"&&null!==n&&n.some(e=>null!==e&&e.length>(([,e])=>e)(i));return{resultError:l,exitCode:t,signal:r,timedOut:c,isMaxBuffer:u}})(l,r),{output:h,error:m=c}=(({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(null===t)return{output:Array.from({length:3})};let o={},a=new Set([]);return{output:t.map((t,s)=>(({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:a},{buffer:s,encoding:l,lines:c,stripFinalNewline:u,maxBuffer:d})=>{if(null===e)return;let f=E(((e,t,r)=>{if(!t)return e;let n=(([,e])=>e)(r);return e.length>n?e.slice(0,n):e})(e,o,d)),{stdioItems:p,objectMode:h}=t[r],{serializedResult:m,finalResult:g=m}=i0({chunks:iQ([f],p,l,n),objectMode:h,encoding:l,lines:c,stripFinalNewline:u,fdNumber:r});i1({serializedResult:m,fdNumber:r,state:n,verboseInfo:a,encoding:l,stdioItems:p,objectMode:h});let y=s[r]?g:void 0;try{return void 0===n.error&&i2(m,p,i),y}catch(e){return n.error=e,y}})({result:t,fileDescriptors:e,fdNumber:s,state:o,outputFiles:a,isMaxBuffer:n,verboseInfo:i},r)),...o}})({fileDescriptors:a,syncResult:l,options:r,isMaxBuffer:p,verboseInfo:o});return oi({error:m,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:h.map((e,t)=>io(e,r,t)),all:io((([,e,t],r)=>{if(r.all)return void 0===e?t:void 0===t?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,io(t,r,"all")]:Array.isArray(t)?[io(e,r,"all"),...t]:S(e)&&S(t)?O([e,t]):`${e}${t}`})(h,r),r,"all"),options:r,command:n,escapedCommand:i,startTime:s})})({file:n,commandArguments:i,options:c,command:o,escapedCommand:a,verboseInfo:l,fileDescriptors:u,startTime:s}),l,c)})(s,l,c):((e,t,r,n)=>{let{file:i,commandArguments:o,command:a,escapedCommand:s,startTime:l,verboseInfo:c,options:u,fileDescriptors:d}=((e,t,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:a}=eM(e,t,r),{file:s,commandArguments:l,options:c}=r$(e,t,r),u=sC(c),d=nq(oE,u,a,!1);return{file:s,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:a,options:u,fileDescriptors:d}})(e,t,r),{subprocess:f,promise:p}=(({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:a,fileDescriptors:s})=>{let l;try{l=(0,v.spawn)(...rk(e,t,r))}catch(e){return(({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:a})=>{var s,l;let c,u,d,f,p,h;n9(n);let m=new v.ChildProcess;return s=m,l=n,c=oy(),u=oy(),d=oy(),f=Array.from({length:l.length-3},oy),p=oy(),h=[c,u,d,...f],Object.assign(s,{stdin:c,stdout:u,stderr:d,all:p,stdio:h}),Object.assign(m,{readable:ow,writable:ob,duplex:ov}),{subprocess:m,promise:ox(r8({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),a,i)}})({error:e,command:o,escapedCommand:a,fileDescriptors:s,options:r,startTime:n,verboseInfo:i})}let c=new AbortController;(0,tu.setMaxListeners)(1/0,c.signal);let u=[...l.stdio];var d=l;let f=new Map;for(let[e,{stdioItems:t,direction:r}]of Object.entries(s)){for(let{stream:n}of t.filter(({type:e})=>nv.has(e)))oZ(d,n,r,e);for(let{stream:n}of t.filter(({type:e})=>!nv.has(e)))o0({subprocess:d,stream:n,direction:r,fdNumber:e,pipeGroups:f,controller:c})}for(let[e,t]of f.entries())oK(1===t.length?t[0]:oD(t),e);((e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let i=ar(()=>{e.kill()});(0,tu.addAbortListener)(n,()=>{i()})})(l,r,c);let p={},h=tS();l.kill=to.bind(void 0,{kill:l.kill.bind(l),options:r,onInternalError:h,context:p,controller:c}),l.all=(({stdout:e,stderr:t},{all:r})=>r&&(e||t)?oD([e,t].filter(Boolean)):void 0)(l,r),((e,{encoding:t})=>{let r={readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap};e.readable=sc.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=sy.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=sk.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=sD.bind(void 0,e,t),e[Symbol.asyncIterator]=sD.bind(void 0,e,t,{})})(l,r),((e,{ipc:t})=>{Object.assign(e,og(e,!1,t))})(l,r);let m=sj({subprocess:l,options:r,startTime:n,verboseInfo:i,fileDescriptors:s,originalStreams:u,command:o,escapedCommand:a,context:p,onInternalError:h,controller:c});return{subprocess:l,promise:m}})({file:i,commandArguments:o,options:u,startTime:l,verboseInfo:c,command:a,escapedCommand:s,fileDescriptors:d});f.pipe=ap.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n});for(let[e,t]of sP){let r=t.value.bind(p);Reflect.defineProperty(f,e,{...t,value:r})}return tT.set(f,{options:u,fileDescriptors:d}),f})(s,l,c,i)},sU=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:i})=>{let[o,a,s]=b(...Array.isArray(t)&&Array.isArray(t.raw)?((e,t)=>{let r=[];for(let[n,i]of e.entries())r=C({templates:e,expressions:t,tokens:r,index:n,template:i});if(0===r.length)throw TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]})(t,r):[t,...r]),l=sR(sR(n,i),s),{file:c=o,commandArguments:u=a,options:d=l,isSync:f=!1}=e({file:o,commandArguments:a,options:l});return{file:c,commandArguments:u,options:d,isSync:f}},sM=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...n]=sF(e);return{file:r,commandArguments:n}},sF=e=>{if("string"!=typeof e)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(""===t)return[];let r=[];for(let e of t.split(sG)){let t=r.at(-1);t&&t.endsWith("\\")?r[r.length-1]=`${t.slice(0,-1)} ${e}`:r.push(e)}return r},sG=/ +/g,sH=({options:e})=>({...sW(e),isSync:!0}),sW=e=>({options:{...sV(e),...e}}),sV=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},sX=s_(()=>({}));s_(()=>({isSync:!0})),s_(({file:e,commandArguments:t})=>sM(e,t)),s_(({file:e,commandArguments:t})=>({...sM(e,t),isSync:!0})),s_(({options:e})=>{if(!1===e.node)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}}),s_(({options:e})=>sW(e),{},{preferLocal:!0},(e,t,r)=>{e.sync=t(sH,r),e.s=e.sync});let{sendMessage:sK,getOneMessage:sz,getEachMessage:sJ,getCancelSignal:sq}=(n=U.default,{...og(n,!0,i=void 0!==U.default.channel),getCancelSignal:rt.bind(void 0,{anyProcess:n,channel:n.channel,isSubprocess:!0,ipc:i})});e.s(["execa",0,sX],18908);var sY=e.i(33405),sZ=e.i(22734),sQ=e.i(46063),s0=e.i(54799),s1=e.i(4446),s2=e.i(21517),s4=e.i(24836),s3=e.i(72939),s8=e.i(92509),s6=e.i(85233);let s5={get url(){return`file://${e.P("packages/sandbox-core/dist/index.js")}`}};var s9=(0,d.join)((0,u.homedir)(),".agentbox"),s7=(0,d.join)(s9,"state.json"),le={version:1,boxes:[]};async function lt(e,t){let r=`${e}.lock`;await (0,c.mkdir)((0,d.dirname)(e),{recursive:!0});let n=Date.now()+2e4,i=!1;for(;!i;)try{let e=await (0,c.open)(r,"wx");await e.writeFile(`${String(process.pid)}
29
+ `),await e.close(),i=!0}catch(e){if("EEXIST"!==e.code)throw e;try{let e=await (0,c.stat)(r);if(Date.now()-e.mtimeMs>15e3){await (0,c.rm)(r,{force:!0});continue}}catch{continue}if(Date.now()>=n)break;await (0,f.setTimeout)(25)}try{return await t()}finally{i&&await (0,c.rm)(r,{force:!0}).catch(()=>{})}}async function lr(e,t=s7){await lt(t,async()=>{let r=await ln(t);await li(e(r),t)})}async function ln(e=s7){try{let t=await (0,c.readFile)(e,"utf8"),r=JSON.parse(t);if(1!==r.version||!Array.isArray(r.boxes))throw Error(`unrecognized state file shape at ${e}`);for(let e of r.boxes){e.provider??="docker",(e.provider??"docker")!=="docker"||e.docker||(e.docker=ld(e));let t=e.cloud?.ssh;!e.ssh&&t&&(e.ssh=t)}return r}catch(e){if("ENOENT"===e.code)return{...le};throw e}}async function li(e,t=s7){await (0,c.mkdir)((0,d.dirname)(t),{recursive:!0});let r=`${t}.tmp.${String(process.pid)}.${String(Date.now())}`;await (0,c.writeFile)(r,JSON.stringify(e,null,2)+"\n","utf8"),await (0,c.rename)(r,t)}async function lo(e,t=s7){let r=(e.provider??"docker")!=="docker"||e.docker?e:{...e,docker:ld(e)};await lr(e=>({version:1,boxes:[...e.boxes.filter(e=>e.id!==r.id),r]}),t)}async function la(e,t,r=s7){await lr(r=>({version:1,boxes:r.boxes.map(r=>r.id===e?{...r,lastAgent:t}:r)}),r)}async function ls(e,t,r=s7){let n=t?.trim()||void 0;await lr(t=>({version:1,boxes:t.boxes.map(t=>{if(t.id!==e)return t;if(n)return{...t,displayName:n};let r={...t};return delete r.displayName,r})}),r)}async function ll(e,t=s7){await lr(t=>({version:1,boxes:t.boxes.map(t=>t.id===e?{...t,portlessAlias:void 0,portlessUrl:void 0}:t)}),t)}async function lc(e,t,r=s7){await lr(r=>({version:1,boxes:r.boxes.map(r=>r.id===e?{...r,ssh:t}:r)}),r)}async function lu(e,t,r=s7){let n=1;return await lr(r=>{n=lh(r,t);let i={...e,projectRoot:t,projectIndex:n};return{version:1,boxes:[...r.boxes.filter(t=>t.id!==e.id),i]}},r),n}function ld(e){return{container:e.container,image:e.image,snapshotDir:e.snapshotDir??null,socketPath:e.socketPath,claudeConfigVolume:e.claudeConfigVolume,codexConfigVolume:e.codexConfigVolume,opencodeConfigVolume:e.opencodeConfigVolume,agentConfigVolumes:e.agentConfigVolumes,vscodeServerVolume:e.vscodeServerVolume,cursorServerVolume:e.cursorServerVolume,vncHostPort:e.vncHostPort,webHostPort:e.webHostPort,portlessAlias:e.portlessAlias,portlessUrl:e.portlessUrl,portlessVncAlias:e.portlessVncAlias,portlessVncUrl:e.portlessVncUrl,dockerVolume:e.dockerVolume,dockerCacheShared:e.dockerCacheShared,checkpointImage:e.checkpointImage}}async function lf(e,t=s7){let r=!1;return await lr(t=>{let n=t.boxes.filter(t=>t.id!==e);return r=n.length!==t.boxes.length,{version:1,boxes:n}},t),r}function lp(e,t){let r=e.trim();if(0===r.length)return{kind:"none"};let n=t.boxes.find(e=>e.id===r);if(n)return{kind:"ok",box:n};let i=t.boxes.filter(e=>e.id.startsWith(r));if(1===i.length)return{kind:"ok",box:i[0]};if(i.length>1)return{kind:"ambiguous",matches:i};let o=t.boxes.find(e=>e.name===r);if(o)return{kind:"ok",box:o};let a=t.boxes.find(e=>e.displayName===r);if(a)return{kind:"ok",box:a};let s=t.boxes.find(e=>e.container===r);return s?{kind:"ok",box:s}:{kind:"none"}}function lh(e,t){let r=0;for(let n of e.boxes)n.projectRoot===t&&"number"==typeof n.projectIndex&&n.projectIndex>r&&(r=n.projectIndex);return r+1}function lm(e,t){let r=e.boxes.filter(e=>e.projectRoot===t);return 0===r.length?{kind:"none"}:1===r.length?{kind:"ok",box:r[0]}:{kind:"ambiguous",matches:r}}async function lg(e){let t,r=[];await ly((0,d.join)(e,".git"))&&r.push({kind:"root",hostMainRepo:e,relPathFromWorkspace:""});try{t=await (0,c.readdir)(e,{withFileTypes:!0})}catch{return r}for(let n of t){if(!n.isDirectory()||n.name.startsWith("."))continue;let t=(0,d.join)(e,n.name);await ly((0,d.join)(t,".git"))&&r.push({kind:"nested",hostMainRepo:t,relPathFromWorkspace:n.name})}return r}async function ly(e){try{return(await (0,c.stat)(e)).isDirectory()}catch{return!1}}async function lw(e,t){let r=t,n=2;for(;await lb(e,r);)if(r=`${t}-${String(n++)}`,n>100)throw new lv(`could not find a free branch name near ${t}`);return r}async function lb(e,t){return 0===(await sX("git",["-C",e,"show-ref","--verify","--quiet",`refs/heads/${t}`],{reject:!1})).exitCode}var lv=class extends Error{constructor(e){super(e),this.name="GitWorktreeError"}};function lx(){return"open"}function l$(){return(0,d.join)((0,u.homedir)(),".claude","settings.json")}function lS(e){let t;if(!(0,sZ.existsSync)(e))return{};try{t=JSON.parse((0,sZ.readFileSync)(e,"utf8"))}catch(t){throw Error(`${e} exists but is not valid JSON (${t instanceof Error?t.message:String(t)}) \u2014 not touching it. Fix the file and retry.`)}if(null===t||"object"!=typeof t||Array.isArray(t))throw Error(`${e} is not a JSON object \u2014 not touching it. Fix the file and retry.`);return t}function lE(e,t){(0,sZ.mkdirSync)((0,d.dirname)(e),{recursive:!0}),(0,sZ.writeFileSync)(e,JSON.stringify(t,null,2)+"\n")}function lk(e){if(null!==e&&"object"==typeof e&&"string"==typeof e.id)return e.id}function lT(e){return lD(t=>t.startsWith("agentbox-")&&!e.has(t.slice(9)))}function lD(e){let t=l$();if(!(0,sZ.existsSync)(t))return 0;let r=lS(t);if(!Array.isArray(r.sshConfigs))return 0;let n=r.sshConfigs.filter(t=>{let r=lk(t);return void 0===r||!e(r)}),i=r.sshConfigs.length-n.length;return 0===i?0:(r.sshConfigs=n,lE(t,r),i)}function lA(){return(0,d.join)((0,u.homedir)(),".ssh","config")}function lO(){return(0,d.join)((0,u.homedir)(),".agentbox","ssh","config")}function lP(){return(0,d.join)((0,u.homedir)(),".agentbox","control-plane","deploy.json")}var lC="agentbox-hub",lj="# BEGIN agentbox ssh include";function lI(e,t="cloud box"){return`# BEGIN agentbox ${t} ${e}`}function lR(e,t="cloud box"){return`# END agentbox ${t} ${e}`}function lB(e){return e}async function lN(e){try{return await sZ.promises.readFile(e,"utf8")}catch(e){if("ENOENT"===e.code)return"";throw e}}function l_(e){let t=[lI(e.alias,e.kind),`Host ${e.alias}`,` HostName ${e.hostname}`,` User ${e.user}`];return e.port&&t.push(` Port ${String(e.port)}`),e.proxyJump&&t.push(` ProxyJump ${e.proxyJump}`),e.identityFile&&(t.push(` IdentityFile ${e.identityFile}`),t.push(" IdentitiesOnly yes")),t.push(" StrictHostKeyChecking accept-new"," UserKnownHostsFile /dev/null"," LogLevel ERROR",lR(e.alias,e.kind),""),t.join("\n")}function lL(e){return e.replace(/^# BEGIN agentbox cloud box .*\n[\s\S]*?^# END agentbox cloud box .*\n?/gm,"")}async function lU(){let e=lA();await sZ.promises.mkdir((0,d.join)((0,u.homedir)(),".ssh"),{recursive:!0,mode:448});let t=lL(await lN(e)),r=t;if(!(t.includes(lj)||t.includes(`Include ${lO()}`))){let e=`${lj}
30
+ Include ${lO()}
31
31
  # END agentbox ssh include
32
32
  `;r=0===t.length?e:`${e}
33
- ${t}`}await sZ.promises.writeFile(e,r,{mode:384}),await sZ.promises.chmod(e,384)}async function lU(e){let t;try{t=JSON.parse(await sZ.promises.readFile(e,"utf8"))}catch{return""}return t.ip&&t.sshKeyDir?lN({kind:"control box",alias:lC,hostname:t.ip,user:"root",identityFile:(0,d.join)(t.sshKeyDir,"id_ed25519")}):""}async function lM(e=(0,d.join)((0,u.homedir)(),".agentbox","state.json"),t=lO()){let r=await lr(e),n=[],i=new Set;for(let e of r.boxes){let t=e.ssh;t&&(i.add(lR(e.name)),n.push(lN({alias:lR(e.name),hostname:t.host,user:t.user,identityFile:t.identityFile,port:t.port,proxyJump:t.proxyJump})))}if(!i.has(lC)){let e=await lU(t);e&&n.push(e)}let o=lA();await sZ.promises.mkdir((0,d.dirname)(o),{recursive:!0,mode:448}),await sZ.promises.writeFile(o,"# Managed by agentbox — regenerated on box create/start/destroy and hub deploy.\n# Do not edit; changes are overwritten. Disable with `agentbox config set ssh.autoConfig false`.\n\n"+n.join("\n"),{mode:384}),await sZ.promises.chmod(o,384),await lL();try{lk(new Set(r.boxes.map(e=>lR(e.name))))}catch{}}async function lF(e){let t=l_(await lB(lD()));return""!==t&&t.split("\n").some(t=>{let r=/^\s*Host\s+(.+?)\s*$/.exec(t);return!!r&&r[1].split(/\s+/).includes(e)})}function lG(e){let t,r;for(let r=e.length-1;r>=0;r--){let n=e[r];if(!n||n.startsWith("-"))continue;let i=n.indexOf("@");if(!(i<=0)){t={user:n.slice(0,i),host:n.slice(i+1)};break}}if(t){for(let t=0;t<e.length-1;t++)if("-i"===e[t]){r=e[t+1];break}return{...t,identityFile:r}}}async function lH(e){let t=await lB(lA());if(""===t)return;let r=lP(e),n=lI(e),i=RegExp(`^${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\n([\\s\\S]*?)${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"m").exec(t);if(!i)return;let o=i[1]??"",a=e=>RegExp(`^\\s*${e}\\s+(.+)$`,"m").exec(o)?.[1]?.trim();return{hostName:a("HostName"),identityFile:a("IdentityFile")}}var lW="hetzner";function lV(e){let t={};for(let r of e.split("\n")){let e=/^([A-Z_]+)=(.*)$/.exec(r.trim());e&&(t[e[1]]=e[2])}return t}function lX(e,t){let r={AGENTBOX_HUB_HOST:e.bind||"0.0.0.0",AGENTBOX_HUB_PROFILE:lW,AGENTBOX_HUB_AUTH:"on",AGENTBOX_HUB_WORKER:"on"};for(let n of(e.port&&(r.AGENTBOX_HUB_PORT=String(e.port)),e.publicUrl&&(r.AGENTBOX_HUB_PUBLIC_URL=e.publicUrl),e.adminCidr&&(r.AGENTBOX_HUB_ADMIN_CIDR=e.adminCidr),["AGENTBOX_RELAY_ADMIN_TOKEN","AGENTBOX_HUB_API_KEY","BETTER_AUTH_SECRET","AGENTBOX_HUB_ADMIN_EMAIL","AGENTBOX_HUB_ADMIN_PASSWORD","GH_TOKEN","GITHUB_APP_ID","GITHUB_APP_PRIVATE_KEY"]))t[n]&&(r[n]=t[n]);return r}var lK=["AGENTBOX_HUB_PROFILE","AGENTBOX_HUB_AUTH","AGENTBOX_HUB_API_KEY","AGENTBOX_HUB_PUBLIC_URL","AGENTBOX_HUB_ADMIN_CIDR","BETTER_AUTH_SECRET","AGENTBOX_HUB_ADMIN_EMAIL","AGENTBOX_HUB_ADMIN_PASSWORD"];function lz(e){let t={...e};for(let e of lK)delete t[e];return t}var lJ=(0,d.join)((0,u.homedir)(),".agentbox","plugins.json"),lq=[4],lY={version:2,plugins:[]};function lZ(e){return 1===e||2===e}async function lQ(e,t){let r=`${e}.lock`;await (0,c.mkdir)((0,d.dirname)(e),{recursive:!0});let n=Date.now()+2e4,i=!1;for(;!i;)try{let e=await (0,c.open)(r,"wx");await e.writeFile(`${String(process.pid)}
34
- `),await e.close(),i=!0}catch(e){if("EEXIST"!==e.code)throw e;try{let e=await (0,c.stat)(r);if(Date.now()-e.mtimeMs>15e3){await (0,c.rm)(r,{force:!0});continue}}catch{continue}if(Date.now()>=n)break;await (0,f.setTimeout)(25)}try{return await t()}finally{i&&await (0,c.rm)(r,{force:!0}).catch(()=>{})}}function l0(e){return e&&lZ(e.version)&&Array.isArray(e.plugins)?e:{...lY}}function l1(e=lJ){try{if(!(0,sZ.existsSync)(e))return{...lY};return l0(JSON.parse((0,sZ.readFileSync)(e,"utf8")))}catch{return{...lY}}}async function l2(e=lJ){try{return l0(JSON.parse(await (0,c.readFile)(e,"utf8")))}catch(e){return e.code,{...lY}}}async function l4(e){let t,r;try{t=await (0,c.readFile)(e,"utf8")}catch(e){if("ENOENT"===e.code)return{...lY};throw e}try{r=JSON.parse(t)}catch(t){throw Error(`refusing to modify a corrupt plugin registry at ${e} (${t.message}) \u2014 fix or delete the file and retry.`)}let n=r;if(!n||!lZ(n.version)||!Array.isArray(n.plugins))throw Error(`refusing to modify an unrecognized plugin registry at ${e} \u2014 fix or delete the file and retry.`);return n}async function l3(e,t=lJ){await (0,c.mkdir)((0,d.dirname)(t),{recursive:!0});let r=`${t}.tmp.${String(process.pid)}.${String(Date.now())}`,n={...e,version:2};await (0,c.writeFile)(r,JSON.stringify(n,null,2)+"\n","utf8"),await (0,c.rename)(r,t)}async function l8(e,t,r=lJ){await lQ(r,async()=>{let n=await l4(r),i=n.plugins.find(t=>t.providers.includes(e));i&&(i.descriptors={...i.descriptors,[e]:t},await l3(n,r))})}async function l6(e,t=lJ){await lQ(t,async()=>{let r=(await l4(t)).plugins.filter(t=>t.packageName!==e.packageName);r.push(e),await l3({version:2,plugins:r},t)})}async function l5(e,t=lJ){let r=0;return await lQ(t,async()=>{let n=(await l4(t)).plugins.filter(t=>{let n=t.packageName===e||t.providers.includes(e);return n&&(r+=1),!n});await l3({version:2,plugins:n},t)}),r}function l9(e,t=lJ){return l1(t).plugins.find(t=>t.providers.includes(e))??null}function l7(e,t=lJ){return(0,sQ.isProviderKind)(e)?(0,sQ.providerMeta)(e):l9(e,t)?.descriptors?.[e]}var ce={checkpoints:!1,checkpointReboots:!1,ssh:!1,persistentSsh:!1,directBoxSsh:!1,inbound:!1,directGit:!1,resync:!0,prune:!1,vnc:!0,dind:!0,pauseSemantics:"freeze",hubRoutable:!0};function ct(e){return{name:e,kind:"cloud",label:e.charAt(0).toUpperCase()+e.slice(1),loginHint:"",credentials:{envKeys:[],fields:[]},bake:{required:!1,approxMinutes:"1"},capabilities:{...ce},blurb:`the ${e} provider`,sizeDesc:`Per-provider override of \`box.size\` for ${e}.`,imageDesc:`Per-provider override of \`box.image\` for ${e}.`}}function cr(e,t){let r=t.descriptor;if(r)return r;let n=ct(e),{provider:i,backend:o}=t;return{...n,kind:o?"cloud":"local",credentials:{envKeys:[],fields:t.setCredentials?[{key:"apiKey",label:"API key"}]:[]},capabilities:{...n.capabilities,checkpoints:!!i.checkpoint,ssh:!!i.sshTarget,resync:!!i.resyncWorkspace,prune:!!o?.list,inbound:!!o?.setInbound,...o?.timeoutModel?{timeoutModel:o.timeoutModel}:{}}}}async function cn(e,t,r=lJ){let n=l7(e,r);if(n)return n;let i=cr(e,t);return await l8(e,i,r).catch(()=>{}),i}async function ci(e,t,r={}){if(!t.buildAttach)throw Error(`cloud provider '${t.name}' does not support SSH attach`);if(r.bringOnline??!0){let n=await t.probeState(e);if("paused"===n)r.logInfo?.("box is paused; resuming"),await t.resume(e);else if("stopped"===n)r.logInfo?.("box is stopped; starting"),await t.start(e);else if("missing"===n)throw Error(`cloud sandbox for ${e.name} is missing; was it deleted?`)}let n=lR(e.name);if(t.sshTarget){let r=await t.sshTarget(e);if(!r)throw Error(`no SSH target for ${e.name} (its sshd did not come up)`);return{alias:n,host:r.host,user:r.user,identityFile:r.identityFile,port:r.port,proxyJump:r.proxyJump}}let i=await t.buildAttach(e,"shell",{noTmux:!0}),o=lG(i.argv);if(!o)throw Error(`could not parse <user>@<host> from cloud SSH argv: ${i.argv.join(" ")}`);return{alias:n,host:o.host,user:o.user,identityFile:o.identityFile}}async function co(e,t,r={}){let n=await ci(e,t,r);return await ll(e.id,{host:n.host,user:n.user,identityFile:n.identityFile,port:n.port,proxyJump:n.proxyJump}),await lM(),n}async function ca(e,t,r,n){var i;if(r&&(t.sshTarget||(i=t.name,l7(i)?.capabilities.directBoxSsh)))try{let r=await ci(e,t,{bringOnline:!1});if(!r.identityFile)return;await ll(e.id,{host:r.host,user:r.user,identityFile:r.identityFile,port:r.port,proxyJump:r.proxyJump}),await lM()}catch(t){n?.(`ssh-config auto-write for ${e.name} failed: ${t instanceof Error?t.message:String(t)}`)}}async function cs(e,t){let r=(0,d.resolve)(e),n=(0,d.join)(r,"id_ed25519"),i=`${n}.pub`;await (0,c.mkdir)(r,{recursive:!0,mode:448});let o=await (0,c.readFile)(i,"utf8").catch(()=>null);if(null!==o)return{dir:r,privatePath:n,publicPath:i,publicKey:o.trim()};await sX("ssh-keygen",["-t","ed25519","-N","","-C",t,"-f",n,"-q"],{stdio:"pipe"});let a=(await (0,c.readFile)(i,"utf8")).trim();return{dir:r,privatePath:n,publicPath:i,publicKey:a}}async function cl(e){try{return(await (0,c.stat)(e)).isFile()}catch{return!1}}async function cc(e){let t;try{let r=await sX("ssh",["-G",e],{reject:!1,timeout:1e4});if(0!==r.exitCode)return null;t=r.stdout??""}catch{return null}let r=new Map;for(let e of t.split("\n")){let t=/^([a-z0-9]+)\s+(.+)$/i.exec(e.trim());if(!t)continue;let n=t[1].toLowerCase(),i=r.get(n);i?i.push(t[2]):r.set(n,[t[2]])}let n=r.get("hostname")?.[0]?.trim();if(!n)return null;let i={host:n},o=r.get("user")?.[0]?.trim();o&&(i.user=o);let a=Number.parseInt(r.get("port")?.[0]?.trim()??"",10);for(let e of(Number.isInteger(a)&&a>0&&22!==a&&(i.port=a),r.get("identityfile")??[])){let t=e.trim().replace(/^~(?=\/)/,(0,u.homedir)());if(await cl(t)){i.identityFile=t;break}}return i}function cu(e){return e.user?`${e.user}@${e.host}`:e.host}function cd(e){let t=[];for(let[r,n]of(e.identity&&t.push("-i",e.identity,"-o","IdentitiesOnly=yes"),e.knownHosts&&t.push("-o","StrictHostKeyChecking=accept-new","-o",`UserKnownHostsFile=${e.knownHosts}`,"-o","GlobalKnownHostsFile=/dev/null"),t.push("-o","BatchMode=yes","-o","LogLevel=ERROR","-o","ServerAliveInterval=15","-o","ServerAliveCountMax=4"),void 0!==e.port&&t.push("-o",`Port=${String(e.port)}`),e.controlPath&&t.push("-o",`ControlPath=${e.controlPath}`),Object.entries(e.options??{})))t.push("-o",`${r}=${n}`);return t}async function cf(e,t,r={}){let n=sX("ssh",[...cd(e),cu(e),t],{reject:!1,timeout:r.timeoutMs,env:{...process.env,...r.env},stdio:["ignore","pipe","pipe"]});if(r.onLine){let e=e=>{for(let t of("string"==typeof e?e:e.toString("utf8")).split(/\r?\n/))t.length>0&&r.onLine?.(t)};n.stdout?.on("data",e),n.stderr?.on("data",e)}let i=await n;return{exitCode:"number"==typeof i.exitCode?i.exitCode:1,stdout:"string"==typeof i.stdout?i.stdout:"",stderr:"string"==typeof i.stderr?i.stderr:""}}async function cp(e,t,r,n={}){let i=[...cd(e),t,`${cu(e)}:${r}`],o=await sX("scp",i,{reject:!1,timeout:n.timeoutMs});if(0!==o.exitCode)throw Error(`scp upload failed (exit ${String(o.exitCode)}): ${t} \u2192 ${r}
35
- ${o.stderr??""}`)}async function ch(e,t,r,n={}){let i=[...cd(e),`${cu(e)}:${t}`,r],o=await sX("scp",i,{reject:!1,timeout:n.timeoutMs});if(0!==o.exitCode)throw Error(`scp download failed (exit ${String(o.exitCode)}): ${t} \u2192 ${r}
36
- ${o.stderr??""}`)}async function cm(e,t,r=5e3){let n=Date.now()+t;for(;Date.now()<n;){if(0===(await cf({...e,options:{...e.options,ConnectTimeout:"5"}},"true",{timeoutMs:1e4})).exitCode)return!0;await new Promise(e=>setTimeout(e,r))}return!1}var cg="127.0.0.1";function cy(e){return`${e}.forwards.json`}async function cw(e,t){try{let r=JSON.parse(await (0,c.readFile)(cy(e),"utf8"));if(r.masterPid!==t)return new Map;return new Map(Object.entries(r.forwards).map(([e,t])=>[Number(e),t]))}catch{return new Map}}async function cb(e,t,r){let n={masterPid:t,forwards:Object.fromEntries([...r].map(([e,t])=>[String(e),t]))};try{await (0,c.writeFile)(cy(e),JSON.stringify(n),{mode:384})}catch{}}async function cv(e){return new Promise(t=>{let r=(0,s1.createConnection)({host:cg,port:e}),n=e=>{r.destroy(),t(e)};r.setTimeout(400),r.once("connect",()=>n(!0)),r.once("timeout",()=>n(!1)),r.once("error",()=>n(!1))})}function cx(e){let t=(0,s0.createHash)("sha1").update(e).digest("hex").slice(0,12);return(0,d.resolve)((0,u.homedir)(),".agentbox","cm",`${t}.sock`)}var c$=class{constructor(e){this.namespace=e}namespace;boxes=new Map;async open(e){let t=e.boxSshDir??cS(e.boxId,this.namespace);await (0,c.mkdir)(t,{recursive:!0,mode:448});let r=cx(t);await (0,c.mkdir)((0,d.join)(r,".."),{recursive:!0,mode:448});let n=(0,d.join)(t,"known_hosts"),i={controlPath:r,vpsHost:e.vpsHost,vpsUser:e.vpsUser,identity:e.identity,port:e.port,boxSshDir:t,forwards:new Map};if((0,sZ.existsSync)(r)&&await this.isAlive(r))return void this.boxes.set(e.boxId,i);(0,sZ.existsSync)(r)&&await (0,c.rm)(r,{force:!0});let o=e.connectTimeoutSeconds??10,a=["-fNT","-M","-S",r];e.identity&&a.push("-i",e.identity,"-o","IdentitiesOnly=yes","-o","StrictHostKeyChecking=accept-new","-o",`UserKnownHostsFile=${n}`,"-o","GlobalKnownHostsFile=/dev/null"),void 0!==e.port&&a.push("-o",`Port=${String(e.port)}`),a.push("-o","BatchMode=yes","-o","LogLevel=ERROR","-o","ExitOnForwardFailure=yes","-o","ServerAliveInterval=30","-o","ServerAliveCountMax=3","-o",`ConnectTimeout=${String(o)}`,e.vpsUser?`${e.vpsUser}@${e.vpsHost}`:e.vpsHost);let s=await sX("ssh",a,{reject:!1});if(0!==s.exitCode||!(0,sZ.existsSync)(r))throw Error(`ssh ControlMaster failed for ${e.boxId} (exit ${String(s.exitCode)}): ${s.stderr||s.stdout||"(no output)"}`);this.boxes.set(e.boxId,i)}async forward(e,t){let r=this.getTunnelOrThrow(e),{alive:n,pid:i}=await this.masterState(r.controlPath);if(n){let e=r.forwards.get(t);if(void 0!==e)return e;if(null!==i){let e=(await cw(r.controlPath,i)).get(t);if(void 0!==e&&await cv(e))return r.forwards.set(t,e),e}}else r.forwards.clear(),await (0,c.rm)(cy(r.controlPath),{force:!0});let o=await ck(),a=["-O","forward","-L",`${cg}:${String(o)}:${cg}:${String(t)}`,"-S",r.controlPath,"dummy"],s=await sX("ssh",a,{reject:!1});if(0!==s.exitCode)throw Error(`ssh -O forward failed for ${e} (exit ${String(s.exitCode)}): ${s.stderr||s.stdout||"(no output)"}`);if(r.forwards.set(t,o),null!==i){let e=await cw(r.controlPath,i);e.set(t,o),await cb(r.controlPath,i,e)}return o}async refresh(e){let t=this.boxes.get(e.boxId);if(t){if(!await this.isAlive(t.controlPath)&&(0,sZ.existsSync)(t.controlPath)){try{await (0,c.rm)(cy(t.controlPath),{force:!0}),await sX("ssh",["-O","exit","-S",t.controlPath,"dummy"],{reject:!1})}catch{}await (0,c.rm)(t.controlPath,{force:!0})}t.forwards.clear()}await this.open(e)}async unforward(e,t){let r=this.getTunnelOrThrow(e),n=r.forwards.get(t);if(void 0===n)return;let i=["-O","cancel","-L",`${cg}:${String(n)}:${cg}:${String(t)}`,"-S",r.controlPath,"dummy"];await sX("ssh",i,{reject:!1}),r.forwards.delete(t);let{pid:o}=await this.masterState(r.controlPath);if(null!==o){let e=await cw(r.controlPath,o);e.delete(t)&&await cb(r.controlPath,o,e)}}async close(e){let t=this.boxes.get(e);t&&((0,sZ.existsSync)(t.controlPath)&&(await sX("ssh",["-O","exit","-S",t.controlPath,"dummy"],{reject:!1}),await (0,c.rm)(cy(t.controlPath),{force:!0}),await (0,c.rm)(t.controlPath,{force:!0})),this.boxes.delete(e))}async closeAll(){let e=Array.from(this.boxes.keys());await Promise.all(e.map(e=>this.close(e)))}controlPath(e){return this.boxes.get(e)?.controlPath}has(e){return this.boxes.has(e)}boxSshDir(e){return this.boxes.get(e)?.boxSshDir}registerExisting(e,t){let r=t.boxSshDir??cS(t.boxId,this.namespace);this.boxes.set(e,{controlPath:cx(r),vpsHost:t.vpsHost,vpsUser:t.vpsUser,identity:t.identity,port:t.port,boxSshDir:r,forwards:new Map})}async isAlive(e){return(await this.masterState(e)).alive}async masterState(e){let t=await sX("ssh",["-O","check","-S",e,"dummy"],{reject:!1});if(0!==t.exitCode)return{alive:!1,pid:null};let r=/pid=(\d+)/.exec(`${t.stderr}${t.stdout}`);return{alive:!0,pid:r?.[1]?Number(r[1]):null}}getTunnelOrThrow(e){let t=this.boxes.get(e);if(!t)throw Error(`no SSH ControlMaster registered for box ${e}; call open() first`);return t}};function cS(e,t){let r=e.replace(/[^A-Za-z0-9._-]/g,"_");return t?(0,d.resolve)((0,u.homedir)(),".agentbox",t,"boxes",r,"ssh"):(0,d.resolve)((0,u.homedir)(),".agentbox","boxes",r,"ssh")}function cE(e){switch(e){case"hetzner":return;case"digitalocean":return"digitalocean";default:return null}}async function ck(){return new Promise((e,t)=>{let r=(0,s1.createServer)();r.unref(),r.on("error",t),r.listen(0,cg,()=>{let n=r.address();if(!n||"string"==typeof n){r.close(),t(Error("could not get a free local port"));return}let i=n.port;r.close(()=>e(i))})})}var cT=["0.0.0.0/0","::/0"];function cD(e){let t=e.trim();return t.includes("/")?t:t.includes(":")?`${t}/128`:`${t}/32`}var cA="/workspace";function cO(e,t,r){return e.exec(t,r,{cwd:cA})}function cC(e){let t=e.trim();return(0,s2.isScratchBranch)(t)?t:`${s2.SCRATCH_BRANCH_PREFIX}${t}`}async function cj(e,t){let r=await cO(e,t,["git","symbolic-ref","--quiet","--short","HEAD"]).catch(()=>void 0);return r?.exitCode===0&&r.stdout.trim()||void 0}function cP(e,t){let r={path:cA};return e&&(r.remote=e),t.length>0&&(r.args=t),r}async function cI(e,t,r,n={}){let i=[...r.args??[],...r.force?["--force"]:[]],o=cP(r.remote,i),a=["agentbox-ctl","git","push",...n.hostInitiatedArgs?await n.hostInitiatedArgs("git.push",o):[]];return r.remote&&a.push("--remote",r.remote),a.push(...i),cO(e,t,a)}async function cR(e,t,r,n={}){let i=r.args??[],o=cP(r.remote,i),a=["agentbox-ctl","git","pull",...n.hostInitiatedArgs?await n.hostInitiatedArgs("git.fetch",o):[]];return r.remote&&a.push("--remote",r.remote),r.ffOnly&&a.push("--ff-only"),a.push(...i),cO(e,t,a)}function cB(){return["agentbox-ctl","status","--json"]}function cN(e){return["agentbox-ctl","restart",e]}function c_(e,t){let r=["agentbox-ctl","logs",e,"--tail",String(t.tail)];return t.follow&&r.push("--follow"),r}function cL(e,t,r){return cO(e,t,cN(r))}async function cU(e,t,r){let n=[];for(let i of r)n.push({name:i,result:await cL(e,t,i)});return n}function cM(e){let t=e.indexOf("\n");return -1===t?e:e.slice(0,t)}function cF(){return(0,d.resolve)((0,u.homedir)(),".agentbox","secrets.env")}async function cG(e,t){let r=o;if(r)try{await r(e,t)}catch{}}var cH="AGENTBOX_RELAY_PORT",cW=null;function cV(e){return Number.isInteger(e)&&e>=1&&e<=65535}function cX(e){cV(e)&&(cW=e,process.env[cH]=String(e))}function cK(){if(null!==cW)return cW;let e=Number.parseInt(process.env[cH]??"",10);return cV(e)?e:8787}function cz(e,t){return!1===e.cliEntry||"string"==typeof e.version&&!!(e.version.length>0)&&"string"==typeof t&&!!(t.length>0)&&e.version!==t}async function cJ(e){try{return process.kill(e,0),!0}catch{return!1}}async function cq(e){try{process.kill(e,"SIGTERM")}catch{return}for(let t=0;t<20;t++){if(!await cJ(e))return;await (0,f.setTimeout)(100)}try{process.kill(e,"SIGKILL")}catch{}}function cY(e){return new Promise(t=>{let r=(0,s4.request)({host:"127.0.0.1",port:cK(),method:"GET",path:"/healthz",timeout:e},e=>{e.resume();let r=e.statusCode??0;t(r>=200&&r<300)});r.on("error",()=>t(!1)),r.on("timeout",()=>{r.destroy(),t(!1)}),r.end()})}function cZ(e){return new Promise(t=>{let r=(0,s4.request)({host:"127.0.0.1",port:cK(),method:"GET",path:"/healthz",timeout:e},e=>{let r=e.statusCode??0;if(r<200||r>=300){e.resume(),t(null);return}let n=[];e.on("data",e=>n.push(e)),e.on("end",()=>{try{let e=JSON.parse(Buffer.concat(n).toString("utf8"));"boolean"==typeof e.ok&&"number"==typeof e.boxes&&"number"==typeof e.events?t({ok:e.ok,boxes:e.boxes,events:e.events,pid:"number"==typeof e.pid?e.pid:void 0,ui:"boolean"==typeof e.ui?e.ui:void 0,cliEntry:"boolean"==typeof e.cliEntry?e.cliEntry:void 0,version:"string"==typeof e.version&&e.version.length>0?e.version:void 0,commit:"string"==typeof e.commit&&e.commit.length>0?e.commit:void 0,profile:"string"==typeof e.profile&&e.profile.length>0?e.profile:void 0,worker:!0===e.worker||void 0}):t(null)}catch{t(null)}}),e.on("error",()=>t(null))});r.on("error",()=>t(null)),r.on("timeout",()=>{r.destroy(),t(null)}),r.end()})}function cQ(){let e=process.env.AGENTBOX_CLI_ENTRY;if(e&&(0,sZ.existsSync)(e))return e;let t=(0,d.dirname)((0,s3.fileURLToPath)(s6.url));for(let e of[(0,d.resolve)(t,"index.js"),(0,d.resolve)(t,"..","..","..","apps","cli","dist","index.js"),(0,d.resolve)(t,"..","..","..","..","dist","index.js")])if((0,sZ.existsSync)(e))return e;return null}var c0=["CLAUDECODE","CLAUDE_PID","CLAUDE_CODE_SESSION_ID","CLAUDE_CODE_BRIDGE_SESSION_ID","CLAUDE_CODE_CHILD_SESSION","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_EXECPATH","CLAUDE_CODE_MESSAGING_SOCKET","CLAUDE_CODE_MESSAGING_TOKEN","CLAUDE_CODE_SESSION_ATTENDED","CLAUDE_CODE_SESSION_KIND","CLAUDE_AGENTS_SELECT","CLAUDE_BG_BACKEND","CLAUDE_BG_SOCKET_TOKENS_PATH","CODEX_THREAD_ID","AGENTBOX_MANAGER","AGENTBOX_WORKSPACE"];function c1(e){let t={...e};for(let e of[...c0,"TMUX","TMUX_PANE"])delete t[e];return t}var c2="AGENTBOX_RUNTIME_ROOT";function c4(e){let t=[],r=process.env[c2];return r&&t.push(r),t.push((0,d.resolve)(e,"..","runtime"),(0,d.resolve)(e,"..","..","runtime")),t}function c3(e,t){for(let r of c4(e))if((0,sZ.existsSync)((0,d.resolve)(r,t)))return r}var c8="AGENTBOX_CLI_RUNTIME_DIR";async function c6(e,t){if(a)try{return await a.sync(e,t)}catch{return}}async function c5(){if(!a)return null;try{return await a.current()}catch{return null}}async function c9(){if(a)try{await a.teardown()}catch{}}var c7=(0,d.join)((0,u.homedir)(),".agentbox"),ue=(0,d.join)(c7,"hub.pid"),ut=(0,d.join)(c7,"relay.pid"),ur=(0,d.join)(c7,"hub.log"),un=(0,d.join)(c7,"hub","token"),ui="127.0.0.1",uo=(0,d.join)(c7,"control-plane");async function ua(){try{let e=JSON.parse(await (0,c.readFile)(lO(),"utf8"));if("local"!==e.provider)return null;let t=await (0,c.readFile)((0,d.join)(uo,"control-plane.env"),"utf8").catch(()=>"");return{env:lX(e,lV(t)),profile:lW}}catch{return null}}function us(){let[e,t]=process.versions.node.split(".").map(e=>Number.parseInt(e,10));return{major:e??0,minor:t??0}}async function ul(e){try{let t=Number.parseInt((await (0,c.readFile)(e,"utf8")).trim(),10);return Number.isFinite(t)&&t>0?t:null}catch{return null}}async function uc(){try{let e=(await (0,c.readFile)(un,"utf8")).trim();return e.length>0?e:null}catch{return null}}async function uu(e){let t=await uc(),r=e??`http://${ui}:${String(cK())}`;return{hostUrl:r,openUrl:t?`${r}/?token=${t}`:r,port:cK(),token:t}}function ud(){let e=process.env.AGENTBOX_HUB_BIN;if(e&&(0,sZ.existsSync)(e))return e;let t=(0,d.dirname)((0,s3.fileURLToPath)(s6.url)),r=[(0,d.resolve)(t,"..","runtime","hub","apps","hub","server.js"),(0,d.resolve)(t,"..","..","..","apps","hub","dist-standalone","apps","hub","server.js"),(0,d.resolve)(t,"..","..","apps","hub","dist-standalone","apps","hub","server.js")];for(let e of r)if((0,sZ.existsSync)(e))return e;throw Error(`could not locate the built hub server; run \`pnpm --filter @agentbox/hub build:standalone\` (dev), or set AGENTBOX_HUB_BIN. Tried:
37
- ${r.join("\n ")}`)}function uf(e={}){let t={},r=e.dockerContext??s;r&&(t.AGENTBOX_DOCKER_CONTEXT=r);let n=e.runtimeRoot??c3((0,d.dirname)((0,s3.fileURLToPath)(s6.url)),"docker/Dockerfile.box");return n&&(t[c2]=n),t}async function up(e,t){let r=await ul(ue),n=new Set;for(let i of[e,r])!("number"!=typeof i||i<=0||n.has(i))&&(n.add(i),await cJ(i)&&(t(`stopping process on :${String(cK())} (pid ${String(i)})`),await cq(i)));if(await (0,c.unlink)(ue).catch(()=>{}),await (0,c.unlink)(ut).catch(()=>{}),await cY(300))throw Error(`something is still listening on :${String(cK())} and could not be stopped (reported pid ${String(e??"unknown")}); kill it manually and retry`)}async function uh(e={}){let t=e.onLog??(()=>{}),r=us();if(r.major<22||22===r.major&&r.minor<5)throw Error(`agentbox hub needs Node >= 22.5 (running ${process.versions.node}). Upgrade Node, or run the lean relay with \`agentbox relay start\`.`);await (0,c.mkdir)(c7,{recursive:!0});let n=await ua(),i=n?.profile??"localhost",o=Number.parseInt(n?.env.AGENTBOX_HUB_PORT??"",10);cV(o)&&o!==cK()&&(t(`this machine's hub is exposed on :${String(o)}, so relay.port (${String(cK())}) does not apply here \u2014 re-run \`agentbox hub expose --port\` to move it`),cX(o));let a=process.env.AGENTBOX_CLI_VERSION,s=e=>!0===e.ui&&!cz(e,a)&&(e.profile??"localhost")===i,l=await cZ(500);if(null!==l){let r=(l.profile??"localhost")!==i;if(s(l))return uu(await c6(e.portlessEnabled,cK()));t(r?`a hub in the ${l.profile??"localhost"} profile holds :${String(cK())} \u2014 reclaiming to run ${i}`:!0===l.ui?"a hub from a different agentbox version holds :8787 — reclaiming":"a lean relay holds :8787 — reclaiming to start the hub"),await up(l.pid,t)}else{let r=await ul(ue);if(null!==r&&await cJ(r)){let n=null;for(let e=0;e<10&&null===(n=await cZ(300));e++)await (0,f.setTimeout)(200);if(null!==n&&s(n))return uu(await c6(e.portlessEnabled,cK()));null!==n&&t(`a hub in the ${n.profile??"localhost"} profile holds :${String(cK())} \u2014 reclaiming to run ${i}`),t(`hub pid ${String(r)} alive but /healthz unresponsive \u2014 restarting it`),await up(r,t)}else null!==r&&await (0,c.unlink)(ue).catch(()=>{})}let u=ud(),d=cQ();if(null===d)throw Error("cannot start the hub: agentbox CLI entry not found (is the build complete?). Set AGENTBOX_CLI_ENTRY to override.");return n&&t(`bringing the hub up exposed (${i} profile, worker on)`),um(u,d,t,e.portlessEnabled,n?.env)}async function um(e,t,r,n,i){let o=(0,sZ.openSync)(ur,"a"),a=(0,sY.spawn)(process.execPath,[...us().major<24?["--experimental-sqlite"]:[],e],{detached:!0,stdio:["ignore",o,o],env:{...lz(c1(process.env)),NODE_ENV:"production",AGENTBOX_CLI_ENTRY:t,AGENTBOX_HUB_HOST:"0.0.0.0",AGENTBOX_HUB_PORT:String(cK()),...uf(),...i??{}}});a.unref();let s=null;a.on("exit",(e,t)=>{s={code:e,signal:t}}),"number"==typeof a.pid&&(await (0,c.writeFile)(ue,String(a.pid),"utf8"),r(`spawned hub process (pid ${String(a.pid)}, port ${String(cK())})`));for(let e=0;e<50;e++){if(await cY(300)){r(`hub reachable on http://${ui}:${String(cK())}`);let e=await c6(n,cK());return e&&r(`hub also reachable on ${e}`),uu(e)}if(null!==s){var l;throw await (0,c.unlink)(ue).catch(()=>{}),await (0,f.setTimeout)(150),Error(await ug(`hub process exited (${null!==(l=s).signal?`killed by ${l.signal}`:`exit code ${String(l.code??"unknown")}`}) during startup`))}await (0,f.setTimeout)(200)}throw Error(await ug(`hub did not become reachable on http://${ui}:${String(cK())} within ~25s`))}async function ug(e){let t=await uy(ur,20),r=t?`
38
- --- last lines of ${ur} ---
39
- ${t}`:`; see ${ur}`;return`${e}${r}`}async function uy(e,t){try{return(await (0,c.readFile)(e,"utf8")).split("\n").filter(e=>e.trim().length>0).slice(-t).join("\n")}catch{return""}}async function uw(){let e=await ul(ue);return null===e?(await c9(),{stopped:!1,pid:null}):await cJ(e)?(await cq(e),await (0,c.unlink)(ue).catch(()=>{}),await c9(),{stopped:!0,pid:e}):(await (0,c.unlink)(ue).catch(()=>{}),await c9(),{stopped:!1,pid:e})}async function ub(){let e=await ul(ue),t=null!==e&&await cJ(e),r=await cZ(300),n=await uu(await c5()??void 0);return{running:null!==r,ui:r?.ui===!0,pid:e,pidAlive:t,port:cK(),hostUrl:n.hostUrl,openUrl:n.openUrl,token:n.token,pidFile:ue,logFile:ur,...r?.profile?{profile:r.profile}:{},...r?.worker?{worker:!0}:{},...await uv(e)?{staleBundle:!0}:{}}}async function uv(e){if(null===e)return!1;try{let[e,t]=await Promise.all([(0,c.stat)(ue).then(e=>e.mtimeMs),(0,c.stat)(ud()).then(e=>e.mtimeMs)]);return t>e}catch{return!1}}async function ux(e){if(l)try{await l(e)}catch{}}function u$(e){let t={};return e.name&&(t.AGENTBOX_BOX_NAME=e.name),e.id&&(t.AGENTBOX_BOX_ID=e.id),e.kind&&(t.AGENTBOX_BOX_KIND=e.kind),e.hostWorkspace&&(t.AGENTBOX_HOST_WORKSPACE=e.hostWorkspace),e.projectRoot&&(t.AGENTBOX_PROJECT_ROOT=e.projectRoot),(0,s2.deriveBoxHost)(t)}function uS(e){return"file"===e.kind&&(!!e.replaceEnvs||(e.replace?.length??0)>0)}async function uE(e,t,r){if(!e.some(uS))return e;let n=u$(t),i=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-carry-render-")),o=[];for(let[t,a]of e.entries()){if(!uS(a)){o.push(a);continue}let e=await (0,c.readFile)(a.absSrc,"utf8"),s=(0,s2.applyReplacements)(e,{env:a.replaceEnvs,rules:a.replace,context:n,onWarn:e=>r?.(`carry: ${a.rawSrc}: ${e}`)}),l=(0,d.join)(i,`${String(t)}-${(0,d.basename)(a.absSrc)}`);await (0,c.writeFile)(l,s,"utf8"),o.push({...a,absSrc:l,bytes:Buffer.byteLength(s)});let u=[...a.replaceEnvs?["env"]:[],...a.replace?.length?[`${String(a.replace.length)} rule(s)`]:[]].join("+");r?.(`carry: rendered ${a.rawSrc} (${u})`)}return o}function uk(e,t){let r=t.home??(0,u.homedir)(),n=(0,s2.substitutePlaceholders)(e,{AGENTBOX_BOX_NAME:t.boxName});if(n.startsWith("~/"))return(0,d.resolve)(r,n.slice(2));if((0,d.isAbsolute)(n))return(0,d.resolve)(n);throw Error(`perBoxCarry src must be absolute or start with "~/": ${e}`)}async function uT(e,t){let r=e?.clone?.perBoxCarry??[],n=[],i=[];for(let e of r){let r,o=uk(e.src,t);try{let e=await (0,c.stat)(o);if(!e.isFile())throw Error(`perBoxCarry src is not a regular file: ${o}`);r=e.size}catch(t){if("ENOENT"!==t.code)throw t;i.push({path:o,rawSrc:e.src,optional:!0===e.optional});continue}n.push({rawSrc:e.src,rawDest:e.dest,absSrc:o,absDest:e.dest,kind:"file",bytes:r,...void 0!==e.mode?{mode:e.mode}:{},optional:!0===e.optional})}return{entries:n,missing:i}}async function uD(e,t,r,n){let i=[...e??[]];for(let e of t){if(!e?.clone?.perBoxCarry?.length)continue;let{entries:t,missing:o}=await uT(e,r),a=o.filter(e=>!e.optional);if(a.length>0)throw Error(`carry: ${r.boxName} needs ${a.map(e=>e.path).join(", ")} \u2014 create the file and run this again`);for(let e of o)n?.(`carry: no ${e.path} \u2014 ${r.boxName} starts without it`);for(let e of t)n?.(`carry: ${e.absSrc} -> ${e.rawDest} (per-box)`);i.push(...t)}return i}var uA=s8.AGENT_SPECS;function uO(e){let t=uA.find(t=>t.id===e||t.aliases.includes(e));if(!t)throw Error(`no agent sync spec for '${e}'`);return t}function uC(e){return uA.find(t=>t.id===e||t.aliases.includes(e))}var uj=uO("claude").credential?.hostBackup??"";function uP(e,t){let r;try{r=JSON.parse(t)}catch{return!1}if("object"!=typeof r||null===r)return!1;let n=uA.find(t=>t.id===e);if(n?.credential?.realShape==="claude-oauth"){let e=r.claudeAiOauth?.refreshToken;return"string"==typeof e&&e.length>0}return Object.keys(r).length>0}async function uI(e=uj){try{let t=JSON.parse(await (0,c.readFile)(e,"utf8")),r=t?.claudeAiOauth?.refreshToken;return"string"==typeof r&&r.length>0}catch{return!1}}async function uR(e,t={}){let r=t.onLog??(()=>{}),n=[];for(let i of uA){if(!i.credential)continue;let o=t.backups?.[i.id]??i.credential.hostBackup;try{let t=await e.readText(i.credential.boxAbsPath);if(!t||!uP(i.id,t))continue;await (0,c.mkdir)((0,d.dirname)(o),{recursive:!0}),await (0,c.writeFile)(o,t,{mode:384}),await (0,c.chmod)(o,384).catch(()=>{}),n.push(i.id),r(`extracted ${i.id} login from box to ${o}`)}catch(e){r(`WARN: ${i.id} credential extract failed (${e instanceof Error?e.message:String(e)}) \u2014 skipping`)}}return n}function uB(e,t){try{let r=JSON.parse(e);for(let e of t){if(!r||"object"!=typeof r)return null;r=r[e]}return"number"==typeof r&&Number.isFinite(r)?r:null}catch{return null}}async function uN(e,t,r={}){let n=r.backupPath??uO(e).credential?.hostBackup;if(void 0===n)throw Error(`agent '${e}' declares no credential \u2014 there is no host backup to write`);await (0,c.mkdir)((0,d.dirname)(n),{recursive:!0});let i=`${n}.tmp-${String(process.pid)}`;await (0,c.writeFile)(i,t,{mode:384}),await (0,c.rename)(i,n),await (0,c.chmod)(n,384).catch(()=>{})}async function u_(e,t={}){let r=t.backupPath??uO(e).credential?.hostBackup;if(void 0===r)return null;try{return await (0,c.readFile)(r,"utf8")}catch{return null}}async function uL(e){let t=uO(e);if(!t.credential)return null;let r=await u_(e);if(null!==r&&uP(e,r))return r;let n=t.staticPaths[0];if(!n)return null;let i=(0,d.join)((0,u.homedir)(),...n.hostHomeRel,t.credential.boxRelPath);try{let t=await (0,c.readFile)(i,"utf8");return uP(e,t)?t:null}catch{return null}}async function uU(e,t={}){let r=uO(e);if(!r.credential)return null;let n=r.staticPaths[0],i=t.candidates??[r.credential.hostBackup,...n?[(0,d.join)((0,u.homedir)(),...n.hostHomeRel,r.credential.boxRelPath)]:[]],o=[];for(let t of i)try{let r=await (0,c.readFile)(t,"utf8");if(!uP(e,r))continue;o.push({path:t,text:r,mtimeMs:(await (0,c.stat)(t)).mtimeMs})}catch{}if(0===o.length)return null;let a=r.credential.freshness?.jsonPath;o.sort((e,t)=>{if(a){let r=uB(e.text,a)??-1/0,n=uB(t.text,a)??-1/0;if(r!==n)return n-r}return t.mtimeMs-e.mtimeMs});let s=o[0];return{path:s.path,text:s.text}}async function uM(e,t,r){let n=uO(t).credential?.boxAbsPath;if(void 0===n)throw Error(`agent '${t}' declares no credential \u2014 there is nothing to push into a box`);let i=n.slice(0,n.lastIndexOf("/")),o=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-cred-push-"));try{let t=(0,d.join)(o,"credential");await (0,c.writeFile)(t,r,{mode:384});let a=await e.exec(["sh","-c",`mkdir -p '${i}'`]);if(0!==a.exitCode)throw Error(`mkdir ${i} in box failed: ${a.stderr.trim()}`);await e.pushFile(t,n);let s=`chown "$(id -un):" '${n}' && chmod 600 '${n}'`,l=await e.exec(["sh","-c",`{ ${s}; } 2>/dev/null || sudo sh -c "${s.replaceAll('"','\\"')}"`]);if(0!==l.exitCode)throw Error(`chown/chmod of ${n} in box failed: ${l.stderr.trim()}`)}finally{await (0,c.rm)(o,{recursive:!0,force:!0})}}function uF(e,t){let r=[...new Set((t??[]).map(e=>e.trim()).filter(Boolean))];if(0===r.length)return[];let n=new Map((e.modelAuth?.sources??[]).map(e=>[(0,s2.modelAuthSourceId)(e),e]));for(let t of r){let r=n.get(t);if(!r){let r=n.size>0?[...n.keys()].join(", "):"nothing";throw Error(`${e.id} cannot use "${t}" as model auth \u2014 it declares ${r}`)}if("agent"===r.kind&&!uC(r.agent)?.credential)throw Error(`${e.id} declares a borrow of "${r.agent}", which has no host-side credential`)}return r}function uG(e){return e.filter(e=>void 0===(0,s2.modelAuthEnvKey)(e))}async function uH(e,t,r=uU){let n=[];for(let i of uG(e)){let e=uO(i),o=e.credential;if(!o)continue;let a=await r(e.id);if(!a){t?.(`model auth: no ${e.id} login on this host \u2014 the box starts without it`);continue}let s=await (0,c.stat)(a.path);t?.(`model auth: ${a.path} -> ${o.boxAbsPath} (borrowed ${e.id} login)`),n.push({rawSrc:a.path,rawDest:o.boxAbsPath,absSrc:a.path,absDest:o.boxAbsPath,kind:"file",bytes:s.size,mode:384,optional:!0})}return n}function uW(e){return e.modelAuth?.ingest}function uV(e,t=!1){let r=uW(e);if(r)return"serviceTask"===r.kind?["agentbox-ctl","run-task",r.task,...t?["--force"]:[]]:["bash","-lc",r.command]}async function uX(e,t,r={}){let n=uW(e),i=uV(e,r.force);if(!n||!i)return{ran:!1};let o="serviceTask"===n.kind?n.task:n.name;try{let e=await t(i),n=`${e.stdout}${e.stderr}`.trim();if(n.length>0)for(let e of n.split("\n"))r.onLog?.(e);return{ran:!0,exitCode:e.exitCode,name:o}}catch(e){return r.onLog?.(`${o}: ${e instanceof Error?e.message:String(e)}`),{ran:!0,name:o}}}var uK={persistentVolumes:!0,helperContainer:!0,ephemeralFs:!1},uz=["agentbox-"],uJ="/home/vscode/.claude/plugins/";function uq(e,t,r=[]){let n=new Set(t),i=new Set,o=[];for(let t of e)!(0===t.length||n.has(t)||i.has(t))&&(r.some(e=>t.startsWith(e))||(i.add(t),o.push(t)));return o.sort()}function uY(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function uZ(e,t,r,n,i){let o=n(e),a=n(t);if(!uY(a))return{data:e,changed:!1,addedKeys:[]};let s=uY(o)?{...o}:{},l=[];for(let[e,t]of Object.entries(a))Object.prototype.hasOwnProperty.call(s,e)||(s[e]=function e(t,r){if("string"==typeof t)return t.split(uJ).join(r);if(Array.isArray(t))return t.map(t=>e(t,r));if(null!==t&&"object"==typeof t){let n={};for(let[i,o]of Object.entries(t))n[i]=e(o,r);return n}return t}(t,r),l.push(e));return 0===l.length?{data:e,changed:!1,addedKeys:[]}:{data:i(e,s),changed:!0,addedKeys:l.sort()}}function uQ(e,t,r){let n=`${r.hostHome}/.claude/plugins/`;return uZ(uY(e)?e:{},t,n,e=>e,(e,t)=>t)}function u0(e,t,r){let n=`${r.hostHome}/.claude/plugins/`;return uZ(uY(e)?e:{plugins:{}},t,n,e=>uY(e)?e.plugins:void 0,(e,t)=>({...e,plugins:t}))}function u1(e,t){let r=uO(e).pull?.items?.find(e=>e.group===t);return r?.names??[]}function u2(e){let t=uO(e).staticPaths[0]?.boxDir;if(!t)throw Error(`agent ${e} declares no staticPaths[0].boxDir`);return t}var u4=u2("claude"),u3=u2("codex"),u8=u2("opencode"),u6=uO("claude").pull?.categories??[];function u5(e){return`for cat in skills agents commands; do [ -d "${e}/$cat" ] || continue; for d in "${e}/$cat"/*/; do [ -d "$d" ] || continue; printf "DIR %s %s\\n" "$cat" "$(basename "$d")"; done; done; if [ -d ${e}/plugins/cache ]; then for m in ${e}/plugins/cache/*/; do [ -d "$m" ] || continue; for p in "$m"*/; do [ -d "$p" ] || continue; printf "PLUGIN %s/%s\\n" "$(basename "$m")" "$(basename "$p")"; done; done; fi; for f in installed_plugins known_marketplaces; do [ -f "${e}/plugins/$f.json" ] || continue; printf "JSON %s " "$f"; base64 -w0 "${e}/plugins/$f.json"; printf "\\n"; done`}function u9(e){let t={skills:[],agents:[],commands:[]},r=[],n={};for(let i of e.split("\n"))if(i.startsWith("DIR ")){let e=i.slice(4),r=e.indexOf(" ");if(-1===r)continue;let n=e.slice(0,r),o=e.slice(r+1);n in t&&t[n].push(o)}else if(i.startsWith("PLUGIN "))r.push(i.slice(7));else if(i.startsWith("JSON ")){let e=i.slice(5),t=e.indexOf(" ");if(-1===t)continue;let r=e.slice(0,t);try{n[r]=JSON.parse(Buffer.from(e.slice(t+1),"base64").toString("utf8"))}catch{}}return{dirs:t,plugins:r,registries:n}}async function u7(e){try{return(await (0,c.readdir)(e,{withFileTypes:!0})).filter(e=>e.isDirectory()||e.isSymbolicLink()).map(e=>e.name)}catch{return[]}}async function de(e){try{return JSON.parse(await (0,c.readFile)(e,"utf8"))}catch{return}}async function dt(e,t={}){let r=t.hostHome??(0,u.homedir)(),n=(0,d.join)(r,".claude"),i=[],o=[];for(let t of u6){let r=await u7((0,d.join)(n,t)),a="skills"===t?uz:[];for(let n of uq(e.dirs[t]??[],r,a))i.push({category:t,name:n}),o.push(`${t}/${n}`)}let a=[];for(let e of(await u7((0,d.join)(n,"plugins","cache"))))for(let t of(await u7((0,d.join)(n,"plugins","cache",e))))a.push(`${e}/${t}`);for(let t of uq(e.plugins,a))i.push({category:"plugins",name:t}),o.push(`plugins/cache/${t}`);let s=await de((0,d.join)(n,"plugins","installed_plugins.json")),l=await de((0,d.join)(n,"plugins","known_marketplaces.json")),c=u0(s,e.registries.installed_plugins,{hostHome:r}),f=uQ(l,e.registries.known_marketplaces,{hostHome:r}),p=[];return c.changed&&p.push("installed_plugins.json"),f.changed&&p.push("known_marketplaces.json"),{newItems:i,copyRels:o,mergedInstalled:c,mergedMarkets:f,mergedRegistries:p}}async function dr(e,t={}){if(!e.mergedInstalled.changed&&!e.mergedMarkets.changed)return;let r=(0,d.join)(t.hostHome??(0,u.homedir)(),".claude");await (0,c.mkdir)((0,d.join)(r,"plugins"),{recursive:!0}),e.mergedMarkets.changed&&await (0,c.writeFile)((0,d.join)(r,"plugins","known_marketplaces.json"),`${JSON.stringify(e.mergedMarkets.data,null,2)}
33
+ ${t}`}await sZ.promises.writeFile(e,r,{mode:384}),await sZ.promises.chmod(e,384)}async function lM(e){let t;try{t=JSON.parse(await sZ.promises.readFile(e,"utf8"))}catch{return""}return t.ip&&t.sshKeyDir?l_({kind:"control box",alias:lC,hostname:t.ip,user:"root",identityFile:(0,d.join)(t.sshKeyDir,"id_ed25519")}):""}async function lF(e=(0,d.join)((0,u.homedir)(),".agentbox","state.json"),t=lP()){let r=await ln(e),n=[],i=new Set;for(let e of r.boxes){let t=e.ssh;t&&(i.add(lB(e.name)),n.push(l_({alias:lB(e.name),hostname:t.host,user:t.user,identityFile:t.identityFile,port:t.port,proxyJump:t.proxyJump})))}if(!i.has(lC)){let e=await lM(t);e&&n.push(e)}let o=lO();await sZ.promises.mkdir((0,d.dirname)(o),{recursive:!0,mode:448}),await sZ.promises.writeFile(o,"# Managed by agentbox — regenerated on box create/start/destroy and hub deploy.\n# Do not edit; changes are overwritten. Disable with `agentbox config set ssh.autoConfig false`.\n\n"+n.join("\n"),{mode:384}),await sZ.promises.chmod(o,384),await lU();try{lT(new Set(r.boxes.map(e=>lB(e.name))))}catch{}}async function lG(e){let t=lL(await lN(lA()));return""!==t&&t.split("\n").some(t=>{let r=/^\s*Host\s+(.+?)\s*$/.exec(t);return!!r&&r[1].split(/\s+/).includes(e)})}function lH(e){let t,r;for(let r=e.length-1;r>=0;r--){let n=e[r];if(!n||n.startsWith("-"))continue;let i=n.indexOf("@");if(!(i<=0)){t={user:n.slice(0,i),host:n.slice(i+1)};break}}if(t){for(let t=0;t<e.length-1;t++)if("-i"===e[t]){r=e[t+1];break}return{...t,identityFile:r}}}async function lW(e){let t=await lN(lO());if(""===t)return;let r=lI(e),n=lR(e),i=RegExp(`^${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\n([\\s\\S]*?)${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"m").exec(t);if(!i)return;let o=i[1]??"",a=e=>RegExp(`^\\s*${e}\\s+(.+)$`,"m").exec(o)?.[1]?.trim();return{hostName:a("HostName"),identityFile:a("IdentityFile")}}var lV="hetzner";function lX(e){let t={};for(let r of e.split("\n")){let e=/^([A-Z_]+)=(.*)$/.exec(r.trim());e&&(t[e[1]]=e[2])}return t}function lK(e,t){let r={AGENTBOX_HUB_HOST:e.bind||"0.0.0.0",AGENTBOX_HUB_PROFILE:lV,AGENTBOX_HUB_AUTH:"on",AGENTBOX_HUB_WORKER:"on"};for(let n of(e.port&&(r.AGENTBOX_HUB_PORT=String(e.port)),e.publicUrl&&(r.AGENTBOX_HUB_PUBLIC_URL=e.publicUrl),e.adminCidr&&(r.AGENTBOX_HUB_ADMIN_CIDR=e.adminCidr),["AGENTBOX_RELAY_ADMIN_TOKEN","AGENTBOX_HUB_API_KEY","BETTER_AUTH_SECRET","AGENTBOX_HUB_ADMIN_EMAIL","AGENTBOX_HUB_ADMIN_PASSWORD","GH_TOKEN","GITHUB_APP_ID","GITHUB_APP_PRIVATE_KEY"]))t[n]&&(r[n]=t[n]);return r}var lz=["AGENTBOX_HUB_PROFILE","AGENTBOX_HUB_AUTH","AGENTBOX_HUB_API_KEY","AGENTBOX_HUB_PUBLIC_URL","AGENTBOX_HUB_ADMIN_CIDR","BETTER_AUTH_SECRET","AGENTBOX_HUB_ADMIN_EMAIL","AGENTBOX_HUB_ADMIN_PASSWORD"];function lJ(e){let t={...e};for(let e of lz)delete t[e];return t}var lq=(0,d.join)((0,u.homedir)(),".agentbox","plugins.json"),lY=[4],lZ={version:2,plugins:[]};function lQ(e){return 1===e||2===e}async function l0(e,t){let r=`${e}.lock`;await (0,c.mkdir)((0,d.dirname)(e),{recursive:!0});let n=Date.now()+2e4,i=!1;for(;!i;)try{let e=await (0,c.open)(r,"wx");await e.writeFile(`${String(process.pid)}
34
+ `),await e.close(),i=!0}catch(e){if("EEXIST"!==e.code)throw e;try{let e=await (0,c.stat)(r);if(Date.now()-e.mtimeMs>15e3){await (0,c.rm)(r,{force:!0});continue}}catch{continue}if(Date.now()>=n)break;await (0,f.setTimeout)(25)}try{return await t()}finally{i&&await (0,c.rm)(r,{force:!0}).catch(()=>{})}}function l1(e){return e&&lQ(e.version)&&Array.isArray(e.plugins)?e:{...lZ}}function l2(e=lq){try{if(!(0,sZ.existsSync)(e))return{...lZ};return l1(JSON.parse((0,sZ.readFileSync)(e,"utf8")))}catch{return{...lZ}}}async function l4(e=lq){try{return l1(JSON.parse(await (0,c.readFile)(e,"utf8")))}catch(e){return e.code,{...lZ}}}async function l3(e){let t,r;try{t=await (0,c.readFile)(e,"utf8")}catch(e){if("ENOENT"===e.code)return{...lZ};throw e}try{r=JSON.parse(t)}catch(t){throw Error(`refusing to modify a corrupt plugin registry at ${e} (${t.message}) \u2014 fix or delete the file and retry.`)}let n=r;if(!n||!lQ(n.version)||!Array.isArray(n.plugins))throw Error(`refusing to modify an unrecognized plugin registry at ${e} \u2014 fix or delete the file and retry.`);return n}async function l8(e,t=lq){await (0,c.mkdir)((0,d.dirname)(t),{recursive:!0});let r=`${t}.tmp.${String(process.pid)}.${String(Date.now())}`,n={...e,version:2};await (0,c.writeFile)(r,JSON.stringify(n,null,2)+"\n","utf8"),await (0,c.rename)(r,t)}async function l6(e,t,r=lq){await l0(r,async()=>{let n=await l3(r),i=n.plugins.find(t=>t.providers.includes(e));i&&(i.descriptors={...i.descriptors,[e]:t},await l8(n,r))})}async function l5(e,t=lq){await l0(t,async()=>{let r=(await l3(t)).plugins.filter(t=>t.packageName!==e.packageName);r.push(e),await l8({version:2,plugins:r},t)})}async function l9(e,t=lq){let r=0;return await l0(t,async()=>{let n=(await l3(t)).plugins.filter(t=>{let n=t.packageName===e||t.providers.includes(e);return n&&(r+=1),!n});await l8({version:2,plugins:n},t)}),r}function l7(e,t=lq){return l2(t).plugins.find(t=>t.providers.includes(e))??null}function ce(e,t=lq){return(0,sQ.isProviderKind)(e)?(0,sQ.providerMeta)(e):l7(e,t)?.descriptors?.[e]}var ct={checkpoints:!1,checkpointReboots:!1,ssh:!1,persistentSsh:!1,directBoxSsh:!1,inbound:!1,directGit:!1,resync:!0,prune:!1,vnc:!0,dind:!0,pauseSemantics:"freeze",hubRoutable:!0};function cr(e){return{name:e,kind:"cloud",label:e.charAt(0).toUpperCase()+e.slice(1),loginHint:"",credentials:{envKeys:[],fields:[]},bake:{required:!1,approxMinutes:"1"},capabilities:{...ct},blurb:`the ${e} provider`,sizeDesc:`Per-provider override of \`box.size\` for ${e}.`,imageDesc:`Per-provider override of \`box.image\` for ${e}.`}}function cn(e,t){let r=t.descriptor;if(r)return r;let n=cr(e),{provider:i,backend:o}=t;return{...n,kind:o?"cloud":"local",credentials:{envKeys:[],fields:t.setCredentials?[{key:"apiKey",label:"API key"}]:[]},capabilities:{...n.capabilities,checkpoints:!!i.checkpoint,ssh:!!i.sshTarget,resync:!!i.resyncWorkspace,prune:!!o?.list,inbound:!!o?.setInbound,...o?.timeoutModel?{timeoutModel:o.timeoutModel}:{}}}}async function ci(e,t,r=lq){let n=ce(e,r);if(n)return n;let i=cn(e,t);return await l6(e,i,r).catch(()=>{}),i}async function co(e,t,r={}){if(!t.buildAttach)throw Error(`cloud provider '${t.name}' does not support SSH attach`);if(r.bringOnline??!0){let n=await t.probeState(e);if("paused"===n)r.logInfo?.("box is paused; resuming"),await t.resume(e);else if("stopped"===n)r.logInfo?.("box is stopped; starting"),await t.start(e);else if("missing"===n)throw Error(`cloud sandbox for ${e.name} is missing; was it deleted?`)}let n=lB(e.name);if(t.sshTarget){let r=await t.sshTarget(e);if(!r)throw Error(`no SSH target for ${e.name} (its sshd did not come up)`);return{alias:n,host:r.host,user:r.user,identityFile:r.identityFile,port:r.port,proxyJump:r.proxyJump}}let i=await t.buildAttach(e,"shell",{noTmux:!0}),o=lH(i.argv);if(!o)throw Error(`could not parse <user>@<host> from cloud SSH argv: ${i.argv.join(" ")}`);return{alias:n,host:o.host,user:o.user,identityFile:o.identityFile}}async function ca(e,t,r={}){let n=await co(e,t,r);return await lc(e.id,{host:n.host,user:n.user,identityFile:n.identityFile,port:n.port,proxyJump:n.proxyJump}),await lF(),n}async function cs(e,t,r,n){var i;if(r&&(t.sshTarget||(i=t.name,ce(i)?.capabilities.directBoxSsh)))try{let r=await co(e,t,{bringOnline:!1});if(!r.identityFile)return;await lc(e.id,{host:r.host,user:r.user,identityFile:r.identityFile,port:r.port,proxyJump:r.proxyJump}),await lF()}catch(t){n?.(`ssh-config auto-write for ${e.name} failed: ${t instanceof Error?t.message:String(t)}`)}}async function cl(e,t){let r=(0,d.resolve)(e),n=(0,d.join)(r,"id_ed25519"),i=`${n}.pub`;await (0,c.mkdir)(r,{recursive:!0,mode:448});let o=await (0,c.readFile)(i,"utf8").catch(()=>null);if(null!==o)return{dir:r,privatePath:n,publicPath:i,publicKey:o.trim()};await sX("ssh-keygen",["-t","ed25519","-N","","-C",t,"-f",n,"-q"],{stdio:"pipe"});let a=(await (0,c.readFile)(i,"utf8")).trim();return{dir:r,privatePath:n,publicPath:i,publicKey:a}}async function cc(e){try{return(await (0,c.stat)(e)).isFile()}catch{return!1}}async function cu(e){let t;try{let r=await sX("ssh",["-G",e],{reject:!1,timeout:1e4});if(0!==r.exitCode)return null;t=r.stdout??""}catch{return null}let r=new Map;for(let e of t.split("\n")){let t=/^([a-z0-9]+)\s+(.+)$/i.exec(e.trim());if(!t)continue;let n=t[1].toLowerCase(),i=r.get(n);i?i.push(t[2]):r.set(n,[t[2]])}let n=r.get("hostname")?.[0]?.trim();if(!n)return null;let i={host:n},o=r.get("user")?.[0]?.trim();o&&(i.user=o);let a=Number.parseInt(r.get("port")?.[0]?.trim()??"",10);for(let e of(Number.isInteger(a)&&a>0&&22!==a&&(i.port=a),r.get("identityfile")??[])){let t=e.trim().replace(/^~(?=\/)/,(0,u.homedir)());if(await cc(t)){i.identityFile=t;break}}return i}function cd(e){return e.user?`${e.user}@${e.host}`:e.host}function cf(e){let t=[];for(let[r,n]of(e.identity&&t.push("-i",e.identity,"-o","IdentitiesOnly=yes"),e.knownHosts&&t.push("-o","StrictHostKeyChecking=accept-new","-o",`UserKnownHostsFile=${e.knownHosts}`,"-o","GlobalKnownHostsFile=/dev/null"),t.push("-o","BatchMode=yes","-o","LogLevel=ERROR","-o","ServerAliveInterval=15","-o","ServerAliveCountMax=4"),void 0!==e.port&&t.push("-o",`Port=${String(e.port)}`),e.controlPath&&t.push("-o",`ControlPath=${e.controlPath}`),Object.entries(e.options??{})))t.push("-o",`${r}=${n}`);return t}async function cp(e,t,r={}){let n=sX("ssh",[...cf(e),cd(e),t],{reject:!1,timeout:r.timeoutMs,env:{...process.env,...r.env},stdio:["ignore","pipe","pipe"]});if(r.onLine){let e=e=>{for(let t of("string"==typeof e?e:e.toString("utf8")).split(/\r?\n/))t.length>0&&r.onLine?.(t)};n.stdout?.on("data",e),n.stderr?.on("data",e)}let i=await n;return{exitCode:"number"==typeof i.exitCode?i.exitCode:1,stdout:"string"==typeof i.stdout?i.stdout:"",stderr:"string"==typeof i.stderr?i.stderr:""}}async function ch(e,t,r,n={}){let i=[...cf(e),t,`${cd(e)}:${r}`],o=await sX("scp",i,{reject:!1,timeout:n.timeoutMs});if(0!==o.exitCode)throw Error(`scp upload failed (exit ${String(o.exitCode)}): ${t} \u2192 ${r}
35
+ ${o.stderr??""}`)}async function cm(e,t,r,n={}){let i=[...cf(e),`${cd(e)}:${t}`,r],o=await sX("scp",i,{reject:!1,timeout:n.timeoutMs});if(0!==o.exitCode)throw Error(`scp download failed (exit ${String(o.exitCode)}): ${t} \u2192 ${r}
36
+ ${o.stderr??""}`)}async function cg(e,t,r=5e3){let n=Date.now()+t;for(;Date.now()<n;){if(0===(await cp({...e,options:{...e.options,ConnectTimeout:"5"}},"true",{timeoutMs:1e4})).exitCode)return!0;await new Promise(e=>setTimeout(e,r))}return!1}var cy="127.0.0.1";function cw(e){return`${e}.forwards.json`}async function cb(e,t){try{let r=JSON.parse(await (0,c.readFile)(cw(e),"utf8"));if(r.masterPid!==t)return new Map;return new Map(Object.entries(r.forwards).map(([e,t])=>[Number(e),t]))}catch{return new Map}}async function cv(e,t,r){let n={masterPid:t,forwards:Object.fromEntries([...r].map(([e,t])=>[String(e),t]))};try{await (0,c.writeFile)(cw(e),JSON.stringify(n),{mode:384})}catch{}}async function cx(e){return new Promise(t=>{let r=(0,s1.createConnection)({host:cy,port:e}),n=e=>{r.destroy(),t(e)};r.setTimeout(400),r.once("connect",()=>n(!0)),r.once("timeout",()=>n(!1)),r.once("error",()=>n(!1))})}function c$(e){let t=(0,s0.createHash)("sha1").update(e).digest("hex").slice(0,12);return(0,d.resolve)((0,u.homedir)(),".agentbox","cm",`${t}.sock`)}var cS=class{constructor(e){this.namespace=e}namespace;boxes=new Map;async open(e){let t=e.boxSshDir??cE(e.boxId,this.namespace);await (0,c.mkdir)(t,{recursive:!0,mode:448});let r=c$(t);await (0,c.mkdir)((0,d.join)(r,".."),{recursive:!0,mode:448});let n=(0,d.join)(t,"known_hosts"),i={controlPath:r,vpsHost:e.vpsHost,vpsUser:e.vpsUser,identity:e.identity,port:e.port,boxSshDir:t,forwards:new Map};if((0,sZ.existsSync)(r)&&await this.isAlive(r))return void this.boxes.set(e.boxId,i);(0,sZ.existsSync)(r)&&await (0,c.rm)(r,{force:!0});let o=e.connectTimeoutSeconds??10,a=["-fNT","-M","-S",r];e.identity&&a.push("-i",e.identity,"-o","IdentitiesOnly=yes","-o","StrictHostKeyChecking=accept-new","-o",`UserKnownHostsFile=${n}`,"-o","GlobalKnownHostsFile=/dev/null"),void 0!==e.port&&a.push("-o",`Port=${String(e.port)}`),a.push("-o","BatchMode=yes","-o","LogLevel=ERROR","-o","ExitOnForwardFailure=yes","-o","ServerAliveInterval=30","-o","ServerAliveCountMax=3","-o",`ConnectTimeout=${String(o)}`,e.vpsUser?`${e.vpsUser}@${e.vpsHost}`:e.vpsHost);let s=await sX("ssh",a,{reject:!1});if(0!==s.exitCode||!(0,sZ.existsSync)(r))throw Error(`ssh ControlMaster failed for ${e.boxId} (exit ${String(s.exitCode)}): ${s.stderr||s.stdout||"(no output)"}`);this.boxes.set(e.boxId,i)}async forward(e,t){let r=this.getTunnelOrThrow(e),{alive:n,pid:i}=await this.masterState(r.controlPath);if(n){let e=r.forwards.get(t);if(void 0!==e)return e;if(null!==i){let e=(await cb(r.controlPath,i)).get(t);if(void 0!==e&&await cx(e))return r.forwards.set(t,e),e}}else r.forwards.clear(),await (0,c.rm)(cw(r.controlPath),{force:!0});let o=await cT(),a=["-O","forward","-L",`${cy}:${String(o)}:${cy}:${String(t)}`,"-S",r.controlPath,"dummy"],s=await sX("ssh",a,{reject:!1});if(0!==s.exitCode)throw Error(`ssh -O forward failed for ${e} (exit ${String(s.exitCode)}): ${s.stderr||s.stdout||"(no output)"}`);if(r.forwards.set(t,o),null!==i){let e=await cb(r.controlPath,i);e.set(t,o),await cv(r.controlPath,i,e)}return o}async refresh(e){let t=this.boxes.get(e.boxId);if(t){if(!await this.isAlive(t.controlPath)&&(0,sZ.existsSync)(t.controlPath)){try{await (0,c.rm)(cw(t.controlPath),{force:!0}),await sX("ssh",["-O","exit","-S",t.controlPath,"dummy"],{reject:!1})}catch{}await (0,c.rm)(t.controlPath,{force:!0})}t.forwards.clear()}await this.open(e)}async unforward(e,t){let r=this.getTunnelOrThrow(e),n=r.forwards.get(t);if(void 0===n)return;let i=["-O","cancel","-L",`${cy}:${String(n)}:${cy}:${String(t)}`,"-S",r.controlPath,"dummy"];await sX("ssh",i,{reject:!1}),r.forwards.delete(t);let{pid:o}=await this.masterState(r.controlPath);if(null!==o){let e=await cb(r.controlPath,o);e.delete(t)&&await cv(r.controlPath,o,e)}}async close(e){let t=this.boxes.get(e);t&&((0,sZ.existsSync)(t.controlPath)&&(await sX("ssh",["-O","exit","-S",t.controlPath,"dummy"],{reject:!1}),await (0,c.rm)(cw(t.controlPath),{force:!0}),await (0,c.rm)(t.controlPath,{force:!0})),this.boxes.delete(e))}async closeAll(){let e=Array.from(this.boxes.keys());await Promise.all(e.map(e=>this.close(e)))}controlPath(e){return this.boxes.get(e)?.controlPath}has(e){return this.boxes.has(e)}boxSshDir(e){return this.boxes.get(e)?.boxSshDir}registerExisting(e,t){let r=t.boxSshDir??cE(t.boxId,this.namespace);this.boxes.set(e,{controlPath:c$(r),vpsHost:t.vpsHost,vpsUser:t.vpsUser,identity:t.identity,port:t.port,boxSshDir:r,forwards:new Map})}async isAlive(e){return(await this.masterState(e)).alive}async masterState(e){let t=await sX("ssh",["-O","check","-S",e,"dummy"],{reject:!1});if(0!==t.exitCode)return{alive:!1,pid:null};let r=/pid=(\d+)/.exec(`${t.stderr}${t.stdout}`);return{alive:!0,pid:r?.[1]?Number(r[1]):null}}getTunnelOrThrow(e){let t=this.boxes.get(e);if(!t)throw Error(`no SSH ControlMaster registered for box ${e}; call open() first`);return t}};function cE(e,t){let r=e.replace(/[^A-Za-z0-9._-]/g,"_");return t?(0,d.resolve)((0,u.homedir)(),".agentbox",t,"boxes",r,"ssh"):(0,d.resolve)((0,u.homedir)(),".agentbox","boxes",r,"ssh")}function ck(e){switch(e){case"hetzner":return;case"digitalocean":return"digitalocean";default:return null}}async function cT(){return new Promise((e,t)=>{let r=(0,s1.createServer)();r.unref(),r.on("error",t),r.listen(0,cy,()=>{let n=r.address();if(!n||"string"==typeof n){r.close(),t(Error("could not get a free local port"));return}let i=n.port;r.close(()=>e(i))})})}var cD=["0.0.0.0/0","::/0"];function cA(e){let t=e.trim();return t.includes("/")?t:t.includes(":")?`${t}/128`:`${t}/32`}var cO=["https://api4.ipify.org","https://ipv4.icanhazip.com","https://ifconfig.io/ip"],cP=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;function cC(e){let t=cP.exec(e);return!!t&&t.slice(1).every(e=>255>=Number.parseInt(e,10))}async function cj(e={}){let t=e.probes??cO,r=e.timeoutMs??3e3,n=e.get??cR,i=[];for(let o of t)try{let t=await cB(n(o,r),r);if(t.status<200||t.status>=300){i.push(`${o}: HTTP ${String(t.status)}`);continue}let a=t.body.trim();if(cC(a))return e.onLog?.(`egress-ip: detected ${a} via ${o}`),a;i.push(a.includes(":")?`${o}: answered with a non-IPv4 address (${a.slice(0,64)})`:`${o}: empty/invalid response`)}catch(e){i.push(`${o}: ${e instanceof Error?e.message:String(e)}`)}throw Error(`could not auto-detect the host's IPv4 egress address \u2014 all ${String(t.length)} probes failed:
37
+ `+i.map(e=>` - ${e}`).join("\n")+"\nThe box firewall needs the IPv4 address the host uses to reach the VPS; an IPv6-only host cannot be locked down by IP."+(e.overrideHint?`
38
+ ${e.overrideHint}`:""))}async function cI(e={}){return`${await cj(e)}/32`}var cR=(e,t)=>new Promise((r,n)=>{let i=new URL(e),o=("http:"===i.protocol?s2.request:s4.request)(i,{method:"GET",family:4,timeout:t},e=>{let t="";e.setEncoding("utf8"),e.on("data",e=>{t.length<4096&&(t+=e)}),e.on("end",()=>r({status:e.statusCode??0,body:t})),e.on("error",n)});o.on("timeout",()=>o.destroy(Error(`probe timed out after ${String(t)}ms`))),o.on("error",n),o.end()});async function cB(e,t){let r;try{return await Promise.race([e,new Promise((e,n)=>{r=setTimeout(()=>n(Error(`probe timed out after ${String(t)}ms`)),t)})])}finally{void 0!==r&&clearTimeout(r)}}var cN="/workspace";function c_(e,t,r){return e.exec(t,r,{cwd:cN})}function cL(e){let t=e.trim();return(0,s3.isScratchBranch)(t)?t:`${s3.SCRATCH_BRANCH_PREFIX}${t}`}async function cU(e,t){let r=await c_(e,t,["git","symbolic-ref","--quiet","--short","HEAD"]).catch(()=>void 0);return r?.exitCode===0&&r.stdout.trim()||void 0}function cM(e,t){let r={path:cN};return e&&(r.remote=e),t.length>0&&(r.args=t),r}async function cF(e,t,r,n={}){let i=[...r.args??[],...r.force?["--force"]:[]],o=cM(r.remote,i),a=["agentbox-ctl","git","push",...n.hostInitiatedArgs?await n.hostInitiatedArgs("git.push",o):[]];return r.remote&&a.push("--remote",r.remote),a.push(...i),c_(e,t,a)}async function cG(e,t,r,n={}){let i=r.args??[],o=cM(r.remote,i),a=["agentbox-ctl","git","pull",...n.hostInitiatedArgs?await n.hostInitiatedArgs("git.fetch",o):[]];return r.remote&&a.push("--remote",r.remote),r.ffOnly&&a.push("--ff-only"),a.push(...i),c_(e,t,a)}function cH(){return["agentbox-ctl","status","--json"]}function cW(e){return["agentbox-ctl","restart",e]}function cV(e,t){let r=["agentbox-ctl","logs",e,"--tail",String(t.tail)];return t.follow&&r.push("--follow"),r}function cX(e,t,r){return c_(e,t,cW(r))}async function cK(e,t,r){let n=[];for(let i of r)n.push({name:i,result:await cX(e,t,i)});return n}function cz(e){let t=e.indexOf("\n");return -1===t?e:e.slice(0,t)}function cJ(){return(0,d.resolve)((0,u.homedir)(),".agentbox","secrets.env")}async function cq(e,t){let r=o;if(r)try{await r(e,t)}catch{}}var cY="AGENTBOX_RELAY_PORT",cZ=null;function cQ(e){return Number.isInteger(e)&&e>=1&&e<=65535}function c0(e){cQ(e)&&(cZ=e,process.env[cY]=String(e))}function c1(){if(null!==cZ)return cZ;let e=Number.parseInt(process.env[cY]??"",10);return cQ(e)?e:8787}function c2(e,t){return!1===e.cliEntry||"string"==typeof e.version&&!!(e.version.length>0)&&"string"==typeof t&&!!(t.length>0)&&e.version!==t}async function c4(e){try{return process.kill(e,0),!0}catch{return!1}}async function c3(e){try{process.kill(e,"SIGTERM")}catch{return}for(let t=0;t<20;t++){if(!await c4(e))return;await (0,f.setTimeout)(100)}try{process.kill(e,"SIGKILL")}catch{}}function c8(e){return new Promise(t=>{let r=(0,s2.request)({host:"127.0.0.1",port:c1(),method:"GET",path:"/healthz",timeout:e},e=>{e.resume();let r=e.statusCode??0;t(r>=200&&r<300)});r.on("error",()=>t(!1)),r.on("timeout",()=>{r.destroy(),t(!1)}),r.end()})}function c6(e){return new Promise(t=>{let r=(0,s2.request)({host:"127.0.0.1",port:c1(),method:"GET",path:"/healthz",timeout:e},e=>{let r=e.statusCode??0;if(r<200||r>=300){e.resume(),t(null);return}let n=[];e.on("data",e=>n.push(e)),e.on("end",()=>{try{let e=JSON.parse(Buffer.concat(n).toString("utf8"));"boolean"==typeof e.ok&&"number"==typeof e.boxes&&"number"==typeof e.events?t({ok:e.ok,boxes:e.boxes,events:e.events,pid:"number"==typeof e.pid?e.pid:void 0,ui:"boolean"==typeof e.ui?e.ui:void 0,cliEntry:"boolean"==typeof e.cliEntry?e.cliEntry:void 0,version:"string"==typeof e.version&&e.version.length>0?e.version:void 0,commit:"string"==typeof e.commit&&e.commit.length>0?e.commit:void 0,profile:"string"==typeof e.profile&&e.profile.length>0?e.profile:void 0,worker:!0===e.worker||void 0}):t(null)}catch{t(null)}}),e.on("error",()=>t(null))});r.on("error",()=>t(null)),r.on("timeout",()=>{r.destroy(),t(null)}),r.end()})}function c5(){let e=process.env.AGENTBOX_CLI_ENTRY;if(e&&(0,sZ.existsSync)(e))return e;let t=(0,d.dirname)((0,s8.fileURLToPath)(s5.url));for(let e of[(0,d.resolve)(t,"index.js"),(0,d.resolve)(t,"..","..","..","apps","cli","dist","index.js"),(0,d.resolve)(t,"..","..","..","..","dist","index.js")])if((0,sZ.existsSync)(e))return e;return null}var c9=["CLAUDECODE","CLAUDE_PID","CLAUDE_CODE_SESSION_ID","CLAUDE_CODE_BRIDGE_SESSION_ID","CLAUDE_CODE_CHILD_SESSION","CLAUDE_CODE_ENTRYPOINT","CLAUDE_CODE_EXECPATH","CLAUDE_CODE_MESSAGING_SOCKET","CLAUDE_CODE_MESSAGING_TOKEN","CLAUDE_CODE_SESSION_ATTENDED","CLAUDE_CODE_SESSION_KIND","CLAUDE_AGENTS_SELECT","CLAUDE_BG_BACKEND","CLAUDE_BG_SOCKET_TOKENS_PATH","CODEX_THREAD_ID","AGENTBOX_MANAGER","AGENTBOX_WORKSPACE"];function c7(e){let t={...e};for(let e of[...c9,"TMUX","TMUX_PANE"])delete t[e];return t}var ue="AGENTBOX_RUNTIME_ROOT";function ut(e){let t=[],r=process.env[ue];return r&&t.push(r),t.push((0,d.resolve)(e,"..","runtime"),(0,d.resolve)(e,"..","..","runtime")),t}function ur(e,t){for(let r of ut(e))if((0,sZ.existsSync)((0,d.resolve)(r,t)))return r}var un="AGENTBOX_CLI_RUNTIME_DIR";async function ui(e,t){if(a)try{return await a.sync(e,t)}catch{return}}async function uo(){if(!a)return null;try{return await a.current()}catch{return null}}async function ua(){if(a)try{await a.teardown()}catch{}}var us=(0,d.join)((0,u.homedir)(),".agentbox"),ul=(0,d.join)(us,"hub.pid"),uc=(0,d.join)(us,"relay.pid"),uu=(0,d.join)(us,"hub.log"),ud=(0,d.join)(us,"hub","token"),uf="127.0.0.1",up=(0,d.join)(us,"control-plane");async function uh(){try{let e=JSON.parse(await (0,c.readFile)(lP(),"utf8"));if("local"!==e.provider)return null;let t=await (0,c.readFile)((0,d.join)(up,"control-plane.env"),"utf8").catch(()=>"");return{env:lK(e,lX(t)),profile:lV}}catch{return null}}function um(){let[e,t]=process.versions.node.split(".").map(e=>Number.parseInt(e,10));return{major:e??0,minor:t??0}}async function ug(e){try{let t=Number.parseInt((await (0,c.readFile)(e,"utf8")).trim(),10);return Number.isFinite(t)&&t>0?t:null}catch{return null}}async function uy(){try{let e=(await (0,c.readFile)(ud,"utf8")).trim();return e.length>0?e:null}catch{return null}}async function uw(e){let t=await uy(),r=e??`http://${uf}:${String(c1())}`;return{hostUrl:r,openUrl:t?`${r}/?token=${t}`:r,port:c1(),token:t}}function ub(){let e=process.env.AGENTBOX_HUB_BIN;if(e&&(0,sZ.existsSync)(e))return e;let t=(0,d.dirname)((0,s8.fileURLToPath)(s5.url)),r=[(0,d.resolve)(t,"..","runtime","hub","apps","hub","server.js"),(0,d.resolve)(t,"..","..","..","apps","hub","dist-standalone","apps","hub","server.js"),(0,d.resolve)(t,"..","..","apps","hub","dist-standalone","apps","hub","server.js")];for(let e of r)if((0,sZ.existsSync)(e))return e;throw Error(`could not locate the built hub server; run \`pnpm --filter @agentbox/hub build:standalone\` (dev), or set AGENTBOX_HUB_BIN. Tried:
39
+ ${r.join("\n ")}`)}function uv(e={}){let t={},r=e.dockerContext??s;r&&(t.AGENTBOX_DOCKER_CONTEXT=r);let n=e.runtimeRoot??ur((0,d.dirname)((0,s8.fileURLToPath)(s5.url)),"docker/Dockerfile.box");return n&&(t[ue]=n),t}async function ux(e,t){let r=await ug(ul),n=new Set;for(let i of[e,r])!("number"!=typeof i||i<=0||n.has(i))&&(n.add(i),await c4(i)&&(t(`stopping process on :${String(c1())} (pid ${String(i)})`),await c3(i)));if(await (0,c.unlink)(ul).catch(()=>{}),await (0,c.unlink)(uc).catch(()=>{}),await c8(300))throw Error(`something is still listening on :${String(c1())} and could not be stopped (reported pid ${String(e??"unknown")}); kill it manually and retry`)}async function u$(e={}){let t=e.onLog??(()=>{}),r=um();if(r.major<22||22===r.major&&r.minor<5)throw Error(`agentbox hub needs Node >= 22.5 (running ${process.versions.node}). Upgrade Node, or run the lean relay with \`agentbox relay start\`.`);await (0,c.mkdir)(us,{recursive:!0});let n=await uh(),i=n?.profile??"localhost",o=Number.parseInt(n?.env.AGENTBOX_HUB_PORT??"",10);cQ(o)&&o!==c1()&&(t(`this machine's hub is exposed on :${String(o)}, so relay.port (${String(c1())}) does not apply here \u2014 re-run \`agentbox hub expose --port\` to move it`),c0(o));let a=process.env.AGENTBOX_CLI_VERSION,s=e=>!0===e.ui&&!c2(e,a)&&(e.profile??"localhost")===i,l=await c6(500);if(null!==l){let r=(l.profile??"localhost")!==i;if(s(l))return uw(await ui(e.portlessEnabled,c1()));t(r?`a hub in the ${l.profile??"localhost"} profile holds :${String(c1())} \u2014 reclaiming to run ${i}`:!0===l.ui?"a hub from a different agentbox version holds :8787 — reclaiming":"a lean relay holds :8787 — reclaiming to start the hub"),await ux(l.pid,t)}else{let r=await ug(ul);if(null!==r&&await c4(r)){let n=null;for(let e=0;e<10&&null===(n=await c6(300));e++)await (0,f.setTimeout)(200);if(null!==n&&s(n))return uw(await ui(e.portlessEnabled,c1()));null!==n&&t(`a hub in the ${n.profile??"localhost"} profile holds :${String(c1())} \u2014 reclaiming to run ${i}`),t(`hub pid ${String(r)} alive but /healthz unresponsive \u2014 restarting it`),await ux(r,t)}else null!==r&&await (0,c.unlink)(ul).catch(()=>{})}let u=ub(),d=c5();if(null===d)throw Error("cannot start the hub: agentbox CLI entry not found (is the build complete?). Set AGENTBOX_CLI_ENTRY to override.");return n&&t(`bringing the hub up exposed (${i} profile, worker on)`),uS(u,d,t,e.portlessEnabled,n?.env)}async function uS(e,t,r,n,i){let o=(0,sZ.openSync)(uu,"a"),a=(0,sY.spawn)(process.execPath,[...um().major<24?["--experimental-sqlite"]:[],e],{detached:!0,stdio:["ignore",o,o],env:{...lJ(c7(process.env)),NODE_ENV:"production",AGENTBOX_CLI_ENTRY:t,AGENTBOX_HUB_HOST:"0.0.0.0",AGENTBOX_HUB_PORT:String(c1()),...uv(),...i??{}}});a.unref();let s=null;a.on("exit",(e,t)=>{s={code:e,signal:t}}),"number"==typeof a.pid&&(await (0,c.writeFile)(ul,String(a.pid),"utf8"),r(`spawned hub process (pid ${String(a.pid)}, port ${String(c1())})`));for(let e=0;e<50;e++){if(await c8(300)){r(`hub reachable on http://${uf}:${String(c1())}`);let e=await ui(n,c1());return e&&r(`hub also reachable on ${e}`),uw(e)}if(null!==s){var l;throw await (0,c.unlink)(ul).catch(()=>{}),await (0,f.setTimeout)(150),Error(await uE(`hub process exited (${null!==(l=s).signal?`killed by ${l.signal}`:`exit code ${String(l.code??"unknown")}`}) during startup`))}await (0,f.setTimeout)(200)}throw Error(await uE(`hub did not become reachable on http://${uf}:${String(c1())} within ~25s`))}async function uE(e){let t=await uk(uu,20),r=t?`
40
+ --- last lines of ${uu} ---
41
+ ${t}`:`; see ${uu}`;return`${e}${r}`}async function uk(e,t){try{return(await (0,c.readFile)(e,"utf8")).split("\n").filter(e=>e.trim().length>0).slice(-t).join("\n")}catch{return""}}async function uT(){let e=await ug(ul);return null===e?(await ua(),{stopped:!1,pid:null}):await c4(e)?(await c3(e),await (0,c.unlink)(ul).catch(()=>{}),await ua(),{stopped:!0,pid:e}):(await (0,c.unlink)(ul).catch(()=>{}),await ua(),{stopped:!1,pid:e})}async function uD(){let e=await ug(ul),t=null!==e&&await c4(e),r=await c6(300),n=await uw(await uo()??void 0);return{running:null!==r,ui:r?.ui===!0,pid:e,pidAlive:t,port:c1(),hostUrl:n.hostUrl,openUrl:n.openUrl,token:n.token,pidFile:ul,logFile:uu,...r?.profile?{profile:r.profile}:{},...r?.worker?{worker:!0}:{},...await uA(e)?{staleBundle:!0}:{}}}async function uA(e){if(null===e)return!1;try{let[e,t]=await Promise.all([(0,c.stat)(ul).then(e=>e.mtimeMs),(0,c.stat)(ub()).then(e=>e.mtimeMs)]);return t>e}catch{return!1}}async function uO(e){if(l)try{await l(e)}catch{}}function uP(e){let t={};return e.name&&(t.AGENTBOX_BOX_NAME=e.name),e.id&&(t.AGENTBOX_BOX_ID=e.id),e.kind&&(t.AGENTBOX_BOX_KIND=e.kind),e.hostWorkspace&&(t.AGENTBOX_HOST_WORKSPACE=e.hostWorkspace),e.projectRoot&&(t.AGENTBOX_PROJECT_ROOT=e.projectRoot),(0,s3.deriveBoxHost)(t)}function uC(e){return"file"===e.kind&&(!!e.replaceEnvs||(e.replace?.length??0)>0)}async function uj(e,t,r){if(!e.some(uC))return e;let n=uP(t),i=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-carry-render-")),o=[];for(let[t,a]of e.entries()){if(!uC(a)){o.push(a);continue}let e=await (0,c.readFile)(a.absSrc,"utf8"),s=(0,s3.applyReplacements)(e,{env:a.replaceEnvs,rules:a.replace,context:n,onWarn:e=>r?.(`carry: ${a.rawSrc}: ${e}`)}),l=(0,d.join)(i,`${String(t)}-${(0,d.basename)(a.absSrc)}`);await (0,c.writeFile)(l,s,"utf8"),o.push({...a,absSrc:l,bytes:Buffer.byteLength(s)});let u=[...a.replaceEnvs?["env"]:[],...a.replace?.length?[`${String(a.replace.length)} rule(s)`]:[]].join("+");r?.(`carry: rendered ${a.rawSrc} (${u})`)}return o}function uI(e,t){let r=t.home??(0,u.homedir)(),n=(0,s3.substitutePlaceholders)(e,{AGENTBOX_BOX_NAME:t.boxName});if(n.startsWith("~/"))return(0,d.resolve)(r,n.slice(2));if((0,d.isAbsolute)(n))return(0,d.resolve)(n);throw Error(`perBoxCarry src must be absolute or start with "~/": ${e}`)}async function uR(e,t){let r=e?.clone?.perBoxCarry??[],n=[],i=[];for(let e of r){let r,o=uI(e.src,t);try{let e=await (0,c.stat)(o);if(!e.isFile())throw Error(`perBoxCarry src is not a regular file: ${o}`);r=e.size}catch(t){if("ENOENT"!==t.code)throw t;i.push({path:o,rawSrc:e.src,optional:!0===e.optional});continue}n.push({rawSrc:e.src,rawDest:e.dest,absSrc:o,absDest:e.dest,kind:"file",bytes:r,...void 0!==e.mode?{mode:e.mode}:{},optional:!0===e.optional})}return{entries:n,missing:i}}async function uB(e,t,r,n){let i=[...e??[]];for(let e of t){if(!e?.clone?.perBoxCarry?.length)continue;let{entries:t,missing:o}=await uR(e,r),a=o.filter(e=>!e.optional);if(a.length>0)throw Error(`carry: ${r.boxName} needs ${a.map(e=>e.path).join(", ")} \u2014 create the file and run this again`);for(let e of o)n?.(`carry: no ${e.path} \u2014 ${r.boxName} starts without it`);for(let e of t)n?.(`carry: ${e.absSrc} -> ${e.rawDest} (per-box)`);i.push(...t)}return i}var uN=s6.AGENT_SPECS;function u_(e){let t=uN.find(t=>t.id===e||t.aliases.includes(e));if(!t)throw Error(`no agent sync spec for '${e}'`);return t}function uL(e){return uN.find(t=>t.id===e||t.aliases.includes(e))}var uU=u_("claude").credential?.hostBackup??"";function uM(e,t){let r;try{r=JSON.parse(t)}catch{return!1}if("object"!=typeof r||null===r)return!1;let n=uN.find(t=>t.id===e);if(n?.credential?.realShape==="claude-oauth"){let e=r.claudeAiOauth?.refreshToken;return"string"==typeof e&&e.length>0}return Object.keys(r).length>0}async function uF(e=uU){try{let t=JSON.parse(await (0,c.readFile)(e,"utf8")),r=t?.claudeAiOauth?.refreshToken;return"string"==typeof r&&r.length>0}catch{return!1}}async function uG(e,t={}){let r=t.onLog??(()=>{}),n=[];for(let i of uN){if(!i.credential)continue;let o=t.backups?.[i.id]??i.credential.hostBackup;try{let t=await e.readText(i.credential.boxAbsPath);if(!t||!uM(i.id,t))continue;await (0,c.mkdir)((0,d.dirname)(o),{recursive:!0}),await (0,c.writeFile)(o,t,{mode:384}),await (0,c.chmod)(o,384).catch(()=>{}),n.push(i.id),r(`extracted ${i.id} login from box to ${o}`)}catch(e){r(`WARN: ${i.id} credential extract failed (${e instanceof Error?e.message:String(e)}) \u2014 skipping`)}}return n}function uH(e,t){try{let r=JSON.parse(e);for(let e of t){if(!r||"object"!=typeof r)return null;r=r[e]}return"number"==typeof r&&Number.isFinite(r)?r:null}catch{return null}}async function uW(e,t,r={}){let n=r.backupPath??u_(e).credential?.hostBackup;if(void 0===n)throw Error(`agent '${e}' declares no credential \u2014 there is no host backup to write`);await (0,c.mkdir)((0,d.dirname)(n),{recursive:!0});let i=`${n}.tmp-${String(process.pid)}`;await (0,c.writeFile)(i,t,{mode:384}),await (0,c.rename)(i,n),await (0,c.chmod)(n,384).catch(()=>{})}async function uV(e,t={}){let r=t.backupPath??u_(e).credential?.hostBackup;if(void 0===r)return null;try{return await (0,c.readFile)(r,"utf8")}catch{return null}}async function uX(e){let t=u_(e);if(!t.credential)return null;let r=await uV(e);if(null!==r&&uM(e,r))return r;let n=t.staticPaths[0];if(!n)return null;let i=(0,d.join)((0,u.homedir)(),...n.hostHomeRel,t.credential.boxRelPath);try{let t=await (0,c.readFile)(i,"utf8");return uM(e,t)?t:null}catch{return null}}async function uK(e,t={}){let r=u_(e);if(!r.credential)return null;let n=r.staticPaths[0],i=t.candidates??[r.credential.hostBackup,...n?[(0,d.join)((0,u.homedir)(),...n.hostHomeRel,r.credential.boxRelPath)]:[]],o=[];for(let t of i)try{let r=await (0,c.readFile)(t,"utf8");if(!uM(e,r))continue;o.push({path:t,text:r,mtimeMs:(await (0,c.stat)(t)).mtimeMs})}catch{}if(0===o.length)return null;let a=r.credential.freshness?.jsonPath;o.sort((e,t)=>{if(a){let r=uH(e.text,a)??-1/0,n=uH(t.text,a)??-1/0;if(r!==n)return n-r}return t.mtimeMs-e.mtimeMs});let s=o[0];return{path:s.path,text:s.text}}async function uz(e,t,r){let n=u_(t).credential?.boxAbsPath;if(void 0===n)throw Error(`agent '${t}' declares no credential \u2014 there is nothing to push into a box`);let i=n.slice(0,n.lastIndexOf("/")),o=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-cred-push-"));try{let t=(0,d.join)(o,"credential");await (0,c.writeFile)(t,r,{mode:384});let a=await e.exec(["sh","-c",`mkdir -p '${i}'`]);if(0!==a.exitCode)throw Error(`mkdir ${i} in box failed: ${a.stderr.trim()}`);await e.pushFile(t,n);let s=`chown "$(id -un):" '${n}' && chmod 600 '${n}'`,l=await e.exec(["sh","-c",`{ ${s}; } 2>/dev/null || sudo sh -c "${s.replaceAll('"','\\"')}"`]);if(0!==l.exitCode)throw Error(`chown/chmod of ${n} in box failed: ${l.stderr.trim()}`)}finally{await (0,c.rm)(o,{recursive:!0,force:!0})}}function uJ(e,t){let r=[...new Set((t??[]).map(e=>e.trim()).filter(Boolean))];if(0===r.length)return[];let n=new Map((e.modelAuth?.sources??[]).map(e=>[(0,s3.modelAuthSourceId)(e),e]));for(let t of r){let r=n.get(t);if(!r){let r=n.size>0?[...n.keys()].join(", "):"nothing";throw Error(`${e.id} cannot use "${t}" as model auth \u2014 it declares ${r}`)}if("agent"===r.kind&&!uL(r.agent)?.credential)throw Error(`${e.id} declares a borrow of "${r.agent}", which has no host-side credential`)}return r}function uq(e){return e.filter(e=>void 0===(0,s3.modelAuthEnvKey)(e))}async function uY(e,t,r=uK){let n=[];for(let i of uq(e)){let e=u_(i),o=e.credential;if(!o)continue;let a=await r(e.id);if(!a){t?.(`model auth: no ${e.id} login on this host \u2014 the box starts without it`);continue}let s=await (0,c.stat)(a.path);t?.(`model auth: ${a.path} -> ${o.boxAbsPath} (borrowed ${e.id} login)`),n.push({rawSrc:a.path,rawDest:o.boxAbsPath,absSrc:a.path,absDest:o.boxAbsPath,kind:"file",bytes:s.size,mode:384,optional:!0})}return n}function uZ(e){return e.modelAuth?.ingest}function uQ(e,t=!1){let r=uZ(e);if(r)return"serviceTask"===r.kind?["agentbox-ctl","run-task",r.task,...t?["--force"]:[]]:["bash","-lc",r.command]}async function u0(e,t,r={}){let n=uZ(e),i=uQ(e,r.force);if(!n||!i)return{ran:!1};let o="serviceTask"===n.kind?n.task:n.name;try{let e=await t(i),n=`${e.stdout}${e.stderr}`.trim();if(n.length>0)for(let e of n.split("\n"))r.onLog?.(e);return{ran:!0,exitCode:e.exitCode,name:o}}catch(e){return r.onLog?.(`${o}: ${e instanceof Error?e.message:String(e)}`),{ran:!0,name:o}}}var u1={persistentVolumes:!0,helperContainer:!0,ephemeralFs:!1},u2=["agentbox-"],u4="/home/vscode/.claude/plugins/";function u3(e,t,r=[]){let n=new Set(t),i=new Set,o=[];for(let t of e)!(0===t.length||n.has(t)||i.has(t))&&(r.some(e=>t.startsWith(e))||(i.add(t),o.push(t)));return o.sort()}function u8(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function u6(e,t,r,n,i){let o=n(e),a=n(t);if(!u8(a))return{data:e,changed:!1,addedKeys:[]};let s=u8(o)?{...o}:{},l=[];for(let[e,t]of Object.entries(a))Object.prototype.hasOwnProperty.call(s,e)||(s[e]=function e(t,r){if("string"==typeof t)return t.split(u4).join(r);if(Array.isArray(t))return t.map(t=>e(t,r));if(null!==t&&"object"==typeof t){let n={};for(let[i,o]of Object.entries(t))n[i]=e(o,r);return n}return t}(t,r),l.push(e));return 0===l.length?{data:e,changed:!1,addedKeys:[]}:{data:i(e,s),changed:!0,addedKeys:l.sort()}}function u5(e,t,r){let n=`${r.hostHome}/.claude/plugins/`;return u6(u8(e)?e:{},t,n,e=>e,(e,t)=>t)}function u9(e,t,r){let n=`${r.hostHome}/.claude/plugins/`;return u6(u8(e)?e:{plugins:{}},t,n,e=>u8(e)?e.plugins:void 0,(e,t)=>({...e,plugins:t}))}function u7(e,t){let r=u_(e).pull?.items?.find(e=>e.group===t);return r?.names??[]}function de(e){let t=u_(e).staticPaths[0]?.boxDir;if(!t)throw Error(`agent ${e} declares no staticPaths[0].boxDir`);return t}var dt=de("claude"),dr=de("codex"),dn=de("opencode"),di=u_("claude").pull?.categories??[];function da(e){return`for cat in skills agents commands; do [ -d "${e}/$cat" ] || continue; for d in "${e}/$cat"/*/; do [ -d "$d" ] || continue; printf "DIR %s %s\\n" "$cat" "$(basename "$d")"; done; done; if [ -d ${e}/plugins/cache ]; then for m in ${e}/plugins/cache/*/; do [ -d "$m" ] || continue; for p in "$m"*/; do [ -d "$p" ] || continue; printf "PLUGIN %s/%s\\n" "$(basename "$m")" "$(basename "$p")"; done; done; fi; for f in installed_plugins known_marketplaces; do [ -f "${e}/plugins/$f.json" ] || continue; printf "JSON %s " "$f"; base64 -w0 "${e}/plugins/$f.json"; printf "\\n"; done`}function ds(e){let t={skills:[],agents:[],commands:[]},r=[],n={};for(let i of e.split("\n"))if(i.startsWith("DIR ")){let e=i.slice(4),r=e.indexOf(" ");if(-1===r)continue;let n=e.slice(0,r),o=e.slice(r+1);n in t&&t[n].push(o)}else if(i.startsWith("PLUGIN "))r.push(i.slice(7));else if(i.startsWith("JSON ")){let e=i.slice(5),t=e.indexOf(" ");if(-1===t)continue;let r=e.slice(0,t);try{n[r]=JSON.parse(Buffer.from(e.slice(t+1),"base64").toString("utf8"))}catch{}}return{dirs:t,plugins:r,registries:n}}async function dl(e){try{return(await (0,c.readdir)(e,{withFileTypes:!0})).filter(e=>e.isDirectory()||e.isSymbolicLink()).map(e=>e.name)}catch{return[]}}async function dc(e){try{return JSON.parse(await (0,c.readFile)(e,"utf8"))}catch{return}}async function du(e,t={}){let r=t.hostHome??(0,u.homedir)(),n=(0,d.join)(r,".claude"),i=[],o=[];for(let t of di){let r=await dl((0,d.join)(n,t)),a="skills"===t?u2:[];for(let n of u3(e.dirs[t]??[],r,a))i.push({category:t,name:n}),o.push(`${t}/${n}`)}let a=[];for(let e of(await dl((0,d.join)(n,"plugins","cache"))))for(let t of(await dl((0,d.join)(n,"plugins","cache",e))))a.push(`${e}/${t}`);for(let t of u3(e.plugins,a))i.push({category:"plugins",name:t}),o.push(`plugins/cache/${t}`);let s=await dc((0,d.join)(n,"plugins","installed_plugins.json")),l=await dc((0,d.join)(n,"plugins","known_marketplaces.json")),c=u9(s,e.registries.installed_plugins,{hostHome:r}),f=u5(l,e.registries.known_marketplaces,{hostHome:r}),p=[];return c.changed&&p.push("installed_plugins.json"),f.changed&&p.push("known_marketplaces.json"),{newItems:i,copyRels:o,mergedInstalled:c,mergedMarkets:f,mergedRegistries:p}}async function dd(e,t={}){if(!e.mergedInstalled.changed&&!e.mergedMarkets.changed)return;let r=(0,d.join)(t.hostHome??(0,u.homedir)(),".claude");await (0,c.mkdir)((0,d.join)(r,"plugins"),{recursive:!0}),e.mergedMarkets.changed&&await (0,c.writeFile)((0,d.join)(r,"plugins","known_marketplaces.json"),`${JSON.stringify(e.mergedMarkets.data,null,2)}
40
42
  `),e.mergedInstalled.changed&&await (0,c.writeFile)((0,d.join)(r,"plugins","installed_plugins.json"),`${JSON.stringify(e.mergedInstalled.data,null,2)}
41
- `)}async function dn(e,t={}){let r=t.boxDir??u4,n=await e.exec(["sh","-c",u5(r)]);if(0!==n.exitCode)throw Error(`failed to inventory ${r} in the box: ${n.stderr.trim()||`exit ${String(n.exitCode)}`}`);let i=u9(n.stdout),o=await dt(i,{hostHome:t.hostHome}),a={newItems:o.newItems,mergedRegistries:o.mergedRegistries,sourceRegistries:i.registries};if(t.dryRun||0===o.newItems.length&&0===o.mergedRegistries.length)return a;let s=(0,d.join)(t.hostHome??(0,u.homedir)(),".claude");for(let t of o.copyRels){let n=(0,d.join)(s,t);await (0,c.mkdir)(n,{recursive:!0}),await e.pullTree(`${r}/${t}`,n,{exclude:["node_modules"]})}return await dr(o,{hostHome:t.hostHome}),a}var di=u1("codex","data"),da=u1("opencode","data"),ds=u1("opencode","config");function dl(e){let t=[];for(let[r,{dir:n,items:i}]of Object.entries(e))t.push(`for f in ${i.join(" ")}; do if [ -d "${n}/$f" ]; then echo "${r} DIR $f"; elif [ -e "${n}/$f" ]; then echo "${r} FILE $f"; fi; done;`);return t.push("true"),t.join(" ")}function dc(e){let t=[];for(let[r,{dir:n}]of Object.entries(e))t.push(`if [ -d "${n}" ]; then for f in "${n}"/*; do [ -e "$f" ] || continue; n=$(basename "$f"); if [ -d "$f" ]; then echo "${r} DIR $n"; else echo "${r} FILE $n"; fi; done; fi;`);return t.push("true"),t.join(" ")}function du(e){let t=[];for(let r of e.split("\n")){let e=/^(\S+) (FILE|DIR) (\S+)$/.exec(r.trim());e&&t.push({group:e[1],kind:"DIR"===e[2]?"dir":"file",name:e[3]})}return t}async function dd(e){try{return await (0,c.stat)(e),!0}catch{return!1}}async function df(e,t,r,n){if("dir"===t.kind){await (0,c.mkdir)(n,{recursive:!0}),await e.pullTree(r,n,{exclude:["node_modules"]});return}await (0,c.mkdir)((0,d.dirname)(n),{recursive:!0}),await e.pullFile(r,n),"auth.json"===t.name&&await (0,c.chmod)(n,384)}function dp(e,t,r){let n=e.pull?.roots?.find(e=>e.group===t);if(n)return{boxDir:n.boxDir,hostDir:(0,d.join)(r,...n.hostHomeRel)};let i=e.staticPaths[0];if(!i)return null;if("data"===t)return{boxDir:i.boxDir,hostDir:(0,d.join)(r,...i.hostHomeRel)};let o=e.staticPaths.find(e=>e.relocToSubpath===t);return o?{boxDir:`${i.boxDir}/${t}`,hostDir:(0,d.join)(r,...o.hostHomeRel)}:null}async function dh(e,t,r={}){let n=uO(e),i=r.hostHome??(0,u.homedir)(),o={},a={};for(let e of n.pull?.items??[]){let t=dp(n,e.group,i);t&&(a[e.group]=t,o[e.group]={dir:t.boxDir,items:e.names})}let s={},l=dp(n,n.pull?.items?.[0]?.group??"data",i);for(let e of n.pull?.categories??[]){if(!l)break;a[e]={boxDir:`${l.boxDir}/${e}`,hostDir:(0,d.join)(l.hostDir,e)},s[e]={dir:`${l.boxDir}/${e}`}}if(0===Object.keys(o).length&&0===Object.keys(s).length)return{newItems:[]};let c=[Object.keys(o).length>0?dl(o):"",Object.keys(s).length>0?dc(s):""].filter(e=>e.length>0).join("; "),f=await t.exec(["sh","-c",c]);if(0!==f.exitCode)throw Error(`failed to inventory ${n.id} config in the box: ${f.stderr.trim()||`exit ${String(f.exitCode)}`}`);let p=n.pull?.items?.[0]?.group,h=[],m=new Set((n.seeds??[]).map(e=>e.destRel));for(let e of du(f.stdout)){let t=a[e.group];if(!t)continue;let r=e.group in s?`${e.group}/${e.name}`:e.name;if(m.has(r))continue;let n=(0,d.join)(t.hostDir,e.name);await dd(n)||h.push({entry:e,label:e.group!==p||e.group in s?`${e.group}/${e.name}`:e.name,box:`${t.boxDir}/${e.name}`,host:n})}let g=h.map(e=>e.label);if(r.dryRun||0===h.length)return{newItems:g};for(let e of h)await df(t,e.entry,e.box,e.host);return{newItems:g}}async function dm(e,t,r,n){for(let i of r){let r=(0,d.join)(n,i.rel);"dir"===i.kind?(await (0,c.mkdir)(r,{recursive:!0}),await e.pullTree(`${t}/${i.rel}`,r,{exclude:["node_modules"]})):(await (0,c.mkdir)((0,d.dirname)(r),{recursive:!0}),await e.pullFile(`${t}/${i.rel}`,r))}}async function dg(e){return(0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),`agentbox-${e}-propagate-`))}async function dy(e){await (0,c.rm)(e,{recursive:!0,force:!0})}var dw=[{key:"installed_plugins",rel:"plugins/installed_plugins.json"},{key:"known_marketplaces",rel:"plugins/known_marketplaces.json"}];async function db(e,t){let r={target:e.label,copied:[],skipped:[],mergedRegistries:[]};for(let n of t.items){if(await e.exists(n.rel)){r.skipped.push(n.label);continue}await e.copyIn((0,d.join)(t.stagingDir,n.rel),n.rel,n.kind),r.copied.push(n.label)}if("claude"===t.agent&&t.sourceRegistries)for(let{key:n,rel:i}of dw){let o,a=t.sourceRegistries[n];if(void 0===a)continue;let s=await e.readText(i);try{o=null===s?void 0:JSON.parse(s)}catch{o=void 0}let l="installed_plugins"===n?u0(o,a,{hostHome:"/home/vscode"}):uQ(o,a,{hostHome:"/home/vscode"});l.changed&&(await e.writeText(i,`${JSON.stringify(l.data,null,2)}
42
- `),r.mergedRegistries.push(i))}return r}function dv(e,t,r={}){return e.map(e=>{var n;let i=e.destRel.split("/").filter(e=>e.length>0).slice(0,-1),o=[],a=t.replace(/\/+$/,"");for(let e of i)a=`${a}/${e}`,o.push(a);return{src:r.srcFor?r.srcFor(e):e.bakedPath,dest:(n=e.destRel,`${t.replace(/\/+$/,"")}/${n.replace(/^\/+/,"")}`),ancestors:o,destRel:e.destRel,label:e.label}})}var dx="AGENTBOX_SEEDED";function d$(e){return`'${e.replace(/'/g,"'\\''")}'`}async function dS(t){try{let{agentSettingsFor:r}=await e.A(47714);return await r(t)}catch{return}}var dE=class extends Error{constructor(e){super(e),this.name="AgentInstallError"}};function dk(e){return["sh","-c",'if [ "$(id -u)" = 0 ]; then sh -c "$1"; else sudo -n sh -c "$1"; fi',"agentbox-install",e]}function dT(e){let t=Object.entries(e??{}).sort(([e],[t])=>e<t?-1:1);if(0===t.length)return"";let r=t.map(([e,t])=>{var r,n;return`${r=e,`AGENTBOX_AGENT_SETTING_${r.replace(/[^A-Za-z0-9]/g,"_").toUpperCase()}`}=${n=t,`'${String(n).replaceAll("'","'\\''")}'`}`});return`export ${r.join(" ")}; `}function dD(e){switch(e.kind){case"npm":{let t=e.allowScripts?` --allow-scripts=${e.package}`:"";return`npm install -g ${e.package}${t} 2>&1`}case"script":return`i=1; while :; do curl -fsSL ${e.url} -o /tmp/agentbox-agent-install.sh && bash /tmp/agentbox-agent-install.sh stable && break; [ "$i" -ge ${String(e.retries??1)} ] && { rm -f /tmp/agentbox-agent-install.sh; exit 71; }; i=$((i+1)); sleep 5; done; rm -f /tmp/agentbox-agent-install.sh`;case"exec":return e.script}}function dA(e){let t=e.join(" ");return`if command -v apt-get >/dev/null 2>&1; then apt-get update && apt-get install -y --no-install-recommends ${t} && rm -rf /var/lib/apt/lists/*; elif command -v dnf >/dev/null 2>&1; then dnf install -y ${t}; elif command -v microdnf >/dev/null 2>&1; then microdnf install -y ${t}; else echo "no supported package manager (apt-get/dnf) for: ${t}" >&2; exit 66; fi`}async function dO(e,t){let r=await e.exec(dk(dA(t)),{user:"root"});return{ok:0===r.exitCode,detail:`${r.stdout}
43
- ${r.stderr}`.trim()}}async function dC(e,t,r={}){let n=uO(t);if(0===(await e.exec(["sh","-c",`command -v ${n.binary}`])).exitCode)return{installed:!1};r.onProgress?.(`installing ${n.id} (absent from this box image)`);let i=r.settings??await dS(n.id),o=(0,s2.resolveAgentInstall)(n.install,i);if(o.packages&&o.packages.length>0){let t=await dO(e,o.packages);if(!t.ok){let e=o.packages.join(", ");if(o.packagesOptional)r.onProgress?.(`${n.id}: optional prerequisites (${e}) could not be installed; continuing without them`);else throw new dE(`${n.id}: installing its prerequisites (${e}) failed.
44
- ${t.detail.slice(-600)}`)}}let a=dT(i),s=a+dD(o.recipe),l="root"===o.runAs?dk(s):["sh","-lc",s],c=await e.exec(l,"root"===o.runAs?{user:"root"}:void 0);if(0!==c.exitCode)throw new dE(`${n.id} is not in this box's image and installing it failed (exit ${String(c.exitCode)}). This box was likely created from a checkpoint or base image captured before ${n.id} support \u2014 recapture the project checkpoint from a fresh box. Install output:
43
+ `)}async function df(e,t={}){let r=t.boxDir??dt,n=await e.exec(["sh","-c",da(r)]);if(0!==n.exitCode)throw Error(`failed to inventory ${r} in the box: ${n.stderr.trim()||`exit ${String(n.exitCode)}`}`);let i=ds(n.stdout),o=await du(i,{hostHome:t.hostHome}),a={newItems:o.newItems,mergedRegistries:o.mergedRegistries,sourceRegistries:i.registries};if(t.dryRun||0===o.newItems.length&&0===o.mergedRegistries.length)return a;let s=(0,d.join)(t.hostHome??(0,u.homedir)(),".claude");for(let t of o.copyRels){let n=(0,d.join)(s,t);await (0,c.mkdir)(n,{recursive:!0}),await e.pullTree(`${r}/${t}`,n,{exclude:["node_modules"]})}return await dd(o,{hostHome:t.hostHome}),a}var dp=u7("codex","data"),dh=u7("opencode","data"),dm=u7("opencode","config");function dg(e){let t=[];for(let[r,{dir:n,items:i}]of Object.entries(e))t.push(`for f in ${i.join(" ")}; do if [ -d "${n}/$f" ]; then echo "${r} DIR $f"; elif [ -e "${n}/$f" ]; then echo "${r} FILE $f"; fi; done;`);return t.push("true"),t.join(" ")}function dy(e){let t=[];for(let[r,{dir:n}]of Object.entries(e))t.push(`if [ -d "${n}" ]; then for f in "${n}"/*; do [ -e "$f" ] || continue; n=$(basename "$f"); if [ -d "$f" ]; then echo "${r} DIR $n"; else echo "${r} FILE $n"; fi; done; fi;`);return t.push("true"),t.join(" ")}function dw(e){let t=[];for(let r of e.split("\n")){let e=/^(\S+) (FILE|DIR) (\S+)$/.exec(r.trim());e&&t.push({group:e[1],kind:"DIR"===e[2]?"dir":"file",name:e[3]})}return t}async function db(e){try{return await (0,c.stat)(e),!0}catch{return!1}}async function dv(e,t,r,n){if("dir"===t.kind){await (0,c.mkdir)(n,{recursive:!0}),await e.pullTree(r,n,{exclude:["node_modules"]});return}await (0,c.mkdir)((0,d.dirname)(n),{recursive:!0}),await e.pullFile(r,n),"auth.json"===t.name&&await (0,c.chmod)(n,384)}function dx(e,t,r){let n=e.pull?.roots?.find(e=>e.group===t);if(n)return{boxDir:n.boxDir,hostDir:(0,d.join)(r,...n.hostHomeRel)};let i=e.staticPaths[0];if(!i)return null;if("data"===t)return{boxDir:i.boxDir,hostDir:(0,d.join)(r,...i.hostHomeRel)};let o=e.staticPaths.find(e=>e.relocToSubpath===t);return o?{boxDir:`${i.boxDir}/${t}`,hostDir:(0,d.join)(r,...o.hostHomeRel)}:null}async function d$(e,t,r={}){let n=u_(e),i=r.hostHome??(0,u.homedir)(),o={},a={};for(let e of n.pull?.items??[]){let t=dx(n,e.group,i);t&&(a[e.group]=t,o[e.group]={dir:t.boxDir,items:e.names})}let s={},l=dx(n,n.pull?.items?.[0]?.group??"data",i);for(let e of n.pull?.categories??[]){if(!l)break;a[e]={boxDir:`${l.boxDir}/${e}`,hostDir:(0,d.join)(l.hostDir,e)},s[e]={dir:`${l.boxDir}/${e}`}}if(0===Object.keys(o).length&&0===Object.keys(s).length)return{newItems:[]};let c=[Object.keys(o).length>0?dg(o):"",Object.keys(s).length>0?dy(s):""].filter(e=>e.length>0).join("; "),f=await t.exec(["sh","-c",c]);if(0!==f.exitCode)throw Error(`failed to inventory ${n.id} config in the box: ${f.stderr.trim()||`exit ${String(f.exitCode)}`}`);let p=n.pull?.items?.[0]?.group,h=[],m=new Set((n.seeds??[]).map(e=>e.destRel));for(let e of dw(f.stdout)){let t=a[e.group];if(!t)continue;let r=e.group in s?`${e.group}/${e.name}`:e.name;if(m.has(r))continue;let n=(0,d.join)(t.hostDir,e.name);await db(n)||h.push({entry:e,label:e.group!==p||e.group in s?`${e.group}/${e.name}`:e.name,box:`${t.boxDir}/${e.name}`,host:n})}let g=h.map(e=>e.label);if(r.dryRun||0===h.length)return{newItems:g};for(let e of h)await dv(t,e.entry,e.box,e.host);return{newItems:g}}async function dS(e,t,r,n){for(let i of r){let r=(0,d.join)(n,i.rel);"dir"===i.kind?(await (0,c.mkdir)(r,{recursive:!0}),await e.pullTree(`${t}/${i.rel}`,r,{exclude:["node_modules"]})):(await (0,c.mkdir)((0,d.dirname)(r),{recursive:!0}),await e.pullFile(`${t}/${i.rel}`,r))}}async function dE(e){return(0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),`agentbox-${e}-propagate-`))}async function dk(e){await (0,c.rm)(e,{recursive:!0,force:!0})}var dT=[{key:"installed_plugins",rel:"plugins/installed_plugins.json"},{key:"known_marketplaces",rel:"plugins/known_marketplaces.json"}];async function dD(e,t){let r={target:e.label,copied:[],skipped:[],mergedRegistries:[]};for(let n of t.items){if(await e.exists(n.rel)){r.skipped.push(n.label);continue}await e.copyIn((0,d.join)(t.stagingDir,n.rel),n.rel,n.kind),r.copied.push(n.label)}if("claude"===t.agent&&t.sourceRegistries)for(let{key:n,rel:i}of dT){let o,a=t.sourceRegistries[n];if(void 0===a)continue;let s=await e.readText(i);try{o=null===s?void 0:JSON.parse(s)}catch{o=void 0}let l="installed_plugins"===n?u9(o,a,{hostHome:"/home/vscode"}):u5(o,a,{hostHome:"/home/vscode"});l.changed&&(await e.writeText(i,`${JSON.stringify(l.data,null,2)}
44
+ `),r.mergedRegistries.push(i))}return r}function dA(e,t,r={}){return e.map(e=>{var n;let i=e.destRel.split("/").filter(e=>e.length>0).slice(0,-1),o=[],a=t.replace(/\/+$/,"");for(let e of i)a=`${a}/${e}`,o.push(a);return{src:r.srcFor?r.srcFor(e):e.bakedPath,dest:(n=e.destRel,`${t.replace(/\/+$/,"")}/${n.replace(/^\/+/,"")}`),ancestors:o,destRel:e.destRel,label:e.label}})}var dO="AGENTBOX_SEEDED";function dP(e){return`'${e.replace(/'/g,"'\\''")}'`}async function dC(t){try{let{agentSettingsFor:r}=await e.A(47714);return await r(t)}catch{return}}var dj=class extends Error{constructor(e){super(e),this.name="AgentInstallError"}};function dI(e){return["sh","-c",'if [ "$(id -u)" = 0 ]; then sh -c "$1"; else sudo -n sh -c "$1"; fi',"agentbox-install",e]}function dR(e){let t=Object.entries(e??{}).sort(([e],[t])=>e<t?-1:1);if(0===t.length)return"";let r=t.map(([e,t])=>{var r,n;return`${r=e,`AGENTBOX_AGENT_SETTING_${r.replace(/[^A-Za-z0-9]/g,"_").toUpperCase()}`}=${n=t,`'${String(n).replaceAll("'","'\\''")}'`}`});return`export ${r.join(" ")}; `}function dB(e){switch(e.kind){case"npm":{let t=e.allowScripts?` --allow-scripts=${e.package}`:"";return`npm install -g ${e.package}${t} 2>&1`}case"script":return`i=1; while :; do curl -fsSL ${e.url} -o /tmp/agentbox-agent-install.sh && bash /tmp/agentbox-agent-install.sh stable && break; [ "$i" -ge ${String(e.retries??1)} ] && { rm -f /tmp/agentbox-agent-install.sh; exit 71; }; i=$((i+1)); sleep 5; done; rm -f /tmp/agentbox-agent-install.sh`;case"exec":return e.script}}function dN(e){let t=e.join(" ");return`if command -v apt-get >/dev/null 2>&1; then apt-get update && apt-get install -y --no-install-recommends ${t} && rm -rf /var/lib/apt/lists/*; elif command -v dnf >/dev/null 2>&1; then dnf install -y ${t}; elif command -v microdnf >/dev/null 2>&1; then microdnf install -y ${t}; else echo "no supported package manager (apt-get/dnf) for: ${t}" >&2; exit 66; fi`}async function d_(e,t){let r=await e.exec(dI(dN(t)),{user:"root"});return{ok:0===r.exitCode,detail:`${r.stdout}
45
+ ${r.stderr}`.trim()}}async function dL(e,t,r={}){let n=u_(t);if(0===(await e.exec(["sh","-c",`command -v ${n.binary}`])).exitCode)return{installed:!1};r.onProgress?.(`installing ${n.id} (absent from this box image)`);let i=r.settings??await dC(n.id),o=(0,s3.resolveAgentInstall)(n.install,i);if(o.packages&&o.packages.length>0){let t=await d_(e,o.packages);if(!t.ok){let e=o.packages.join(", ");if(o.packagesOptional)r.onProgress?.(`${n.id}: optional prerequisites (${e}) could not be installed; continuing without them`);else throw new dj(`${n.id}: installing its prerequisites (${e}) failed.
46
+ ${t.detail.slice(-600)}`)}}let a=dR(i),s=a+dB(o.recipe),l="root"===o.runAs?dI(s):["sh","-lc",s],c=await e.exec(l,"root"===o.runAs?{user:"root"}:void 0);if(0!==c.exitCode)throw new dj(`${n.id} is not in this box's image and installing it failed (exit ${String(c.exitCode)}). This box was likely created from a checkpoint or base image captured before ${n.id} support \u2014 recapture the project checkpoint from a fresh box. Install output:
45
47
  ${`${c.stdout}
46
- ${c.stderr}`.trim().slice(-600)}`);if(o.postInstall){let t=await e.exec(dk(a+o.postInstall),{user:"root"});if(0!==t.exitCode)throw new dE(`${n.id}: post-install step failed (exit ${String(t.exitCode)}).
48
+ ${c.stderr}`.trim().slice(-600)}`);if(o.postInstall){let t=await e.exec(dI(a+o.postInstall),{user:"root"});if(0!==t.exitCode)throw new dj(`${n.id}: post-install step failed (exit ${String(t.exitCode)}).
47
49
  ${`${t.stdout}
48
- ${t.stderr}`.trim().slice(-600)}`)}if(0!==(await e.exec(["sh","-lc",`command -v ${n.binary}`])).exitCode)throw new dE(`${n.id}: the installer reported success but \`${n.binary}\` is still not on PATH in the box.`);try{let t=await uL(n.id);null!==t&&(await uM(e,n.id,t),r.onProgress?.(`seeded ${n.id} credentials into the box`))}catch(e){r.onProgress?.(`could not seed ${n.id} credentials (${e instanceof Error?e.message:String(e)}); sign in inside the box`)}return{installed:!0}}var dj=["node_modules",".git",".venv","venv","__pycache__","dist",".next","build"];function dP(e){let t=[];return e.forEach((e,r)=>{r>0&&t.push("-o"),t.push("-name",e)}),t}function dI(e){return["find",".","(","-type","d","(",...dP(dj),")","-prune",")","-o","(","-type","f","(",...dP(e),")","-print0",")"]}async function dR(e,t){if(0===t.length)return[];let r=await sX("find",dI(t).slice(1),{cwd:e,reject:!1});return 0!==r.exitCode?[]:String(r.stdout).split("\0").filter(e=>e.length>0)}async function dB(e,t){return(await dR(e,t)).map(e=>e.replace(/^\.\//,"")).filter(e=>e.length>0)}async function dN(e,t,r){let n=await dR(e.hostWorkspace,r);if(0===n.length)return{copied:0};let i=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-envfiles-")),o=(0,d.join)(i,"envfiles.tar");try{let r=await sX("tar",["-C",e.hostWorkspace,"--null","-T","-","-cf",o],{input:n.join("\0"),reject:!1,env:{...process.env,COPYFILE_DISABLE:"1"}});if(0!==r.exitCode)return e.onLog(`warning: env-file tar pack failed: ${String(r.stderr).slice(0,300)}`),{copied:0};try{await t.applyTarball(o,e.boxWorkspace,{uid:1e3})}catch(t){return e.onLog(`warning: env-file copy into box failed: ${t instanceof Error?t.message:String(t)}`),{copied:0}}}finally{await (0,c.rm)(i,{recursive:!0,force:!0})}return{copied:n.length}}var d_="/home/vscode";function dL(e){let t=e.lastIndexOf("/");return t<=0?"/":e.slice(0,t)}function dU(e){let t=e.lastIndexOf("/");return t<0?e:e.slice(t+1)}var dM=class extends Error{constructor(e){super([`carry: ${String(e.length)} approved ${1===e.length?"entry":"entries"} could not be copied into the box:`,...e.map(e=>` - ${e}`)].join("\n")),this.failures=e,this.name="CarryCopyError"}failures};async function dF(e){try{return await (0,c.stat)(e),!0}catch{return!1}}function dG(e){return e.replace(/[^a-zA-Z0-9]/g,"-")}var dH="/home/vscode/.claude/projects/-workspace";async function dW(e,t=(0,u.homedir)()){if(0===e.length)return null;let r=(0,d.join)(t,".claude","projects",dG(e),"memory");if(!await dF(r))return null;try{let e=await (0,c.readdir)(r);if(0===e.length)return null}catch{return null}return r}async function dV(e,t){let r=await Promise.all(t.map(async e=>{try{return await (0,c.realpath)(e)}catch{return e}})),n=[],i=new Set;async function o(e,t){if(!i.has(e)){i.add(e);try{let i;try{i=await (0,c.readdir)(e,{withFileTypes:!0})}catch{return}for(let a of i){let i=(0,d.join)(e,a.name),s=t?(0,d.join)(t,a.name):a.name;if(a.isSymbolicLink()){let e;try{e=await (0,c.realpath)(i)}catch{n.push(s);continue}if(!r.some(t=>(function(e,t){let r=(0,d.relative)(e,t);return""===r||!r.startsWith("..")&&!(0,d.isAbsolute)(r)})(t,e))){n.push(s);continue}let t=await (0,c.stat)(e).catch(()=>null);t?.isDirectory()&&await o(e,s)}else a.isDirectory()&&await o(i,s)}}finally{i.delete(e)}}}return await o(e,""),n}async function dX(e){try{return await (0,c.stat)(e),!0}catch{return!1}}async function dK(e){let t=e.transport.seedVolumeFromHost;if(!t)throw Error("seedAgentsVolume requires a transport with seedVolumeFromHost");if(!(e.syncFromHost&&await dX(e.hostAgents))){try{await t.call(e.transport,e.volume,[])}catch(t){e.onLog?.(`skills: volume writable-chown failed (ignored): ${t instanceof Error?t.message:String(t)}`)}return{synced:!1}}let r=(await dV(e.hostAgents,[e.hostAgents])).map(e=>`/${e}`);return await t.call(e.transport,e.volume,[{hostDir:e.hostAgents,destSubpath:"",exclude:r,copyUnsafeLinks:!0}]),r.length>0&&e.onLog?.(`skills: excluded ${String(r.length)} unsyncable symlink(s) from ~/.agents`),{synced:!0}}function dz(e,t){return void 0===e?"copy":"-"===e?"conflict":e===t?"identical":"conflict"}function dJ(e){return e.split("\0").filter(e=>e.length>0)}async function dq(e,t){let r=await e.boxGit(t,["diff","--name-only","--diff-filter=U","-z"]);return 0===r.exitCode?dJ(r.stdout):[]}async function dY(e,t,r){let n=r??(()=>{}),i=[];for(let r of e){let e=r.containerPath,o=r.hostMainRepo,a=r.branch,s={containerPath:e,mergeConflicts:[],overlaySkipped:[]},l=await t.resolveHostRef(o);if(!l){n(`resync: ${e}: could not resolve host ref; skipping`),i.push(s);continue}let c=await t.createHostStash(o),u=await t.listHostUntracked(o);if(l!==a){let r=(await t.boxGit(e,["status","--porcelain"])).stdout.split("\n").some(e=>e.length>0&&!e.startsWith("??")),i=!1;r&&(i=0===(await t.boxGit(e,["stash","push","-m","agentbox-resync"])).exitCode);let o=await t.boxGit(e,["rev-list","--count",`${a}..${l}`]),c=0===o.exitCode?o.stdout.trim():"?",u=await t.boxGit(e,["merge","--no-commit",l]),d=0===(await t.boxGit(e,["rev-parse","-q","--verify","MERGE_HEAD"])).exitCode,f=await dq(t,e);if(f.length>0&&(await t.boxGit(e,["checkout","--ours","--",...f]),await t.boxGit(e,["add","--",...f]),s.mergeConflicts.push(...f)),d?(await t.boxGit(e,["-c","user.name=agentbox","-c","user.email=agentbox@users.noreply.github.com","commit","--no-edit"]),n(`resync: ${e}: merged ${c} new host commit(s) from ${l}`+(f.length>0?` (${String(f.length)} conflict(s) kept box version)`:""))):0===u.exitCode?n(`resync: ${e}: ${"0"===c?"already up to date":`fast-forwarded to ${l}`}`):(await t.boxGit(e,["merge","--abort"]),n(`resync: ${e}: merge skipped (${(u.stderr||u.stdout).trim().split("\n")[0]})`)),i&&0!==(await t.boxGit(e,["stash","pop"])).exitCode){for(let r of(await dq(t,e)))await t.boxGit(e,["checkout","--theirs","--",r]),await t.boxGit(e,["reset","-q","--",r]);await t.boxGit(e,["stash","drop"])}}if(c&&0!==(await t.boxGit(e,["stash","apply",c])).exitCode){let r=await dq(t,e);for(let n of r)await t.boxGit(e,["checkout","--ours","--",n]),await t.boxGit(e,["reset","-q","--",n]);r.length>0&&s.overlaySkipped.push(...r)}if(u.length>0){let r=await t.probeUntrackedTokens(e,u),i=[],a=0;for(let e of u){let n=r.get(e),l="";if(void 0!==n&&"-"!==n)try{l=await t.hashHostFile(o,e)}catch{a++;continue}let c=dz(n,l);"copy"===c?i.push(e):"conflict"===c?s.overlaySkipped.push(e):a++}if(a>0&&n(`resync: ${e}: ${String(a)} untracked host file(s) already identical in box (no-op)`),i.length>0){let r=await t.packHostFiles(o,i);r&&(await t.applyTarToBox(e,r),n(`resync: ${e}: copied ${String(i.length)} untracked host file(s)`))}}i.push(s)}return i}var dZ=new Map;async function dQ(e,t,r){let n=`${t}.agentbox-snapshot`,i=`import sqlite3,sys
50
+ ${t.stderr}`.trim().slice(-600)}`)}if(0!==(await e.exec(["sh","-lc",`command -v ${n.binary}`])).exitCode)throw new dj(`${n.id}: the installer reported success but \`${n.binary}\` is still not on PATH in the box.`);try{let t=await uX(n.id);null!==t&&(await uz(e,n.id,t),r.onProgress?.(`seeded ${n.id} credentials into the box`))}catch(e){r.onProgress?.(`could not seed ${n.id} credentials (${e instanceof Error?e.message:String(e)}); sign in inside the box`)}return{installed:!0}}var dU=["node_modules",".git",".venv","venv","__pycache__","dist",".next","build"];function dM(e){let t=[];return e.forEach((e,r)=>{r>0&&t.push("-o"),t.push("-name",e)}),t}function dF(e){return["find",".","(","-type","d","(",...dM(dU),")","-prune",")","-o","(","-type","f","(",...dM(e),")","-print0",")"]}async function dG(e,t){if(0===t.length)return[];let r=await sX("find",dF(t).slice(1),{cwd:e,reject:!1});return 0!==r.exitCode?[]:String(r.stdout).split("\0").filter(e=>e.length>0)}async function dH(e,t){return(await dG(e,t)).map(e=>e.replace(/^\.\//,"")).filter(e=>e.length>0)}async function dW(e,t,r){let n=await dG(e.hostWorkspace,r);if(0===n.length)return{copied:0};let i=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-envfiles-")),o=(0,d.join)(i,"envfiles.tar");try{let r=await sX("tar",["-C",e.hostWorkspace,"--null","-T","-","-cf",o],{input:n.join("\0"),reject:!1,env:{...process.env,COPYFILE_DISABLE:"1"}});if(0!==r.exitCode)return e.onLog(`warning: env-file tar pack failed: ${String(r.stderr).slice(0,300)}`),{copied:0};try{await t.applyTarball(o,e.boxWorkspace,{uid:1e3})}catch(t){return e.onLog(`warning: env-file copy into box failed: ${t instanceof Error?t.message:String(t)}`),{copied:0}}}finally{await (0,c.rm)(i,{recursive:!0,force:!0})}return{copied:n.length}}var dV="/home/vscode";function dX(e){let t=e.lastIndexOf("/");return t<=0?"/":e.slice(0,t)}function dK(e){let t=e.lastIndexOf("/");return t<0?e:e.slice(t+1)}var dz=class extends Error{constructor(e){super([`carry: ${String(e.length)} approved ${1===e.length?"entry":"entries"} could not be copied into the box:`,...e.map(e=>` - ${e}`)].join("\n")),this.failures=e,this.name="CarryCopyError"}failures};async function dJ(e){try{return await (0,c.stat)(e),!0}catch{return!1}}function dq(e){return e.replace(/[^a-zA-Z0-9]/g,"-")}var dY="/home/vscode/.claude/projects/-workspace";async function dZ(e,t=(0,u.homedir)()){if(0===e.length)return null;let r=(0,d.join)(t,".claude","projects",dq(e),"memory");if(!await dJ(r))return null;try{let e=await (0,c.readdir)(r);if(0===e.length)return null}catch{return null}return r}async function dQ(e,t){let r=await Promise.all(t.map(async e=>{try{return await (0,c.realpath)(e)}catch{return e}})),n=[],i=new Set;async function o(e,t){if(!i.has(e)){i.add(e);try{let i;try{i=await (0,c.readdir)(e,{withFileTypes:!0})}catch{return}for(let a of i){let i=(0,d.join)(e,a.name),s=t?(0,d.join)(t,a.name):a.name;if(a.isSymbolicLink()){let e;try{e=await (0,c.realpath)(i)}catch{n.push(s);continue}if(!r.some(t=>(function(e,t){let r=(0,d.relative)(e,t);return""===r||!r.startsWith("..")&&!(0,d.isAbsolute)(r)})(t,e))){n.push(s);continue}let t=await (0,c.stat)(e).catch(()=>null);t?.isDirectory()&&await o(e,s)}else a.isDirectory()&&await o(i,s)}}finally{i.delete(e)}}}return await o(e,""),n}async function d0(e){try{return await (0,c.stat)(e),!0}catch{return!1}}async function d1(e){let t=e.transport.seedVolumeFromHost;if(!t)throw Error("seedAgentsVolume requires a transport with seedVolumeFromHost");if(!(e.syncFromHost&&await d0(e.hostAgents))){try{await t.call(e.transport,e.volume,[])}catch(t){e.onLog?.(`skills: volume writable-chown failed (ignored): ${t instanceof Error?t.message:String(t)}`)}return{synced:!1}}let r=(await dQ(e.hostAgents,[e.hostAgents])).map(e=>`/${e}`);return await t.call(e.transport,e.volume,[{hostDir:e.hostAgents,destSubpath:"",exclude:r,copyUnsafeLinks:!0}]),r.length>0&&e.onLog?.(`skills: excluded ${String(r.length)} unsyncable symlink(s) from ~/.agents`),{synced:!0}}function d2(e,t){return void 0===e?"copy":"-"===e?"conflict":e===t?"identical":"conflict"}function d4(e){return e.split("\0").filter(e=>e.length>0)}async function d3(e,t){let r=await e.boxGit(t,["diff","--name-only","--diff-filter=U","-z"]);return 0===r.exitCode?d4(r.stdout):[]}async function d8(e,t,r){let n=r??(()=>{}),i=[];for(let r of e){let e=r.containerPath,o=r.hostMainRepo,a=r.branch,s={containerPath:e,mergeConflicts:[],overlaySkipped:[]},l=await t.resolveHostRef(o);if(!l){n(`resync: ${e}: could not resolve host ref; skipping`),i.push(s);continue}let c=await t.createHostStash(o),u=await t.listHostUntracked(o);if(l!==a){let r=(await t.boxGit(e,["status","--porcelain"])).stdout.split("\n").some(e=>e.length>0&&!e.startsWith("??")),i=!1;r&&(i=0===(await t.boxGit(e,["stash","push","-m","agentbox-resync"])).exitCode);let o=await t.boxGit(e,["rev-list","--count",`${a}..${l}`]),c=0===o.exitCode?o.stdout.trim():"?",u=await t.boxGit(e,["merge","--no-commit",l]),d=0===(await t.boxGit(e,["rev-parse","-q","--verify","MERGE_HEAD"])).exitCode,f=await d3(t,e);if(f.length>0&&(await t.boxGit(e,["checkout","--ours","--",...f]),await t.boxGit(e,["add","--",...f]),s.mergeConflicts.push(...f)),d?(await t.boxGit(e,["-c","user.name=agentbox","-c","user.email=agentbox@users.noreply.github.com","commit","--no-edit"]),n(`resync: ${e}: merged ${c} new host commit(s) from ${l}`+(f.length>0?` (${String(f.length)} conflict(s) kept box version)`:""))):0===u.exitCode?n(`resync: ${e}: ${"0"===c?"already up to date":`fast-forwarded to ${l}`}`):(await t.boxGit(e,["merge","--abort"]),n(`resync: ${e}: merge skipped (${(u.stderr||u.stdout).trim().split("\n")[0]})`)),i&&0!==(await t.boxGit(e,["stash","pop"])).exitCode){for(let r of(await d3(t,e)))await t.boxGit(e,["checkout","--theirs","--",r]),await t.boxGit(e,["reset","-q","--",r]);await t.boxGit(e,["stash","drop"])}}if(c&&0!==(await t.boxGit(e,["stash","apply",c])).exitCode){let r=await d3(t,e);for(let n of r)await t.boxGit(e,["checkout","--ours","--",n]),await t.boxGit(e,["reset","-q","--",n]);r.length>0&&s.overlaySkipped.push(...r)}if(u.length>0){let r=await t.probeUntrackedTokens(e,u),i=[],a=0;for(let e of u){let n=r.get(e),l="";if(void 0!==n&&"-"!==n)try{l=await t.hashHostFile(o,e)}catch{a++;continue}let c=d2(n,l);"copy"===c?i.push(e):"conflict"===c?s.overlaySkipped.push(e):a++}if(a>0&&n(`resync: ${e}: ${String(a)} untracked host file(s) already identical in box (no-op)`),i.length>0){let r=await t.packHostFiles(o,i);r&&(await t.applyTarToBox(e,r),n(`resync: ${e}: copied ${String(i.length)} untracked host file(s)`))}}i.push(s)}return i}var d6=new Map;async function d5(e,t,r){let n=`${t}.agentbox-snapshot`,i=`import sqlite3,sys
49
51
  src=sqlite3.connect('file:${t}?mode=ro',uri=True)
50
52
  dst=sqlite3.connect('${n}')
51
53
  src.backup(dst); dst.close(); src.close()
52
54
  `;if(0!==(await e.exec(["sh","-c",`[ -f '${t}' ] || exit 3; if command -v python3 >/dev/null 2>&1; then python3 - <<'PY'
53
55
  ${i}PY
54
- elif command -v node >/dev/null 2>&1; then node -e "const{DatabaseSync}=require('node:sqlite');const d=new DatabaseSync('${t}');d.exec(\\"VACUUM INTO '${n}'\\");d.close()"; else exit 4; fi`])).exitCode)return!1;try{return await e.pullFile(n,r),!0}finally{await e.exec(["rm","-f",n])}}function d0(e){let t=uO(e),r=t.staticPaths[0]?.boxDir;if(!r)throw Error(`agent '${e}' declares no staticPaths to pull from`);return r}var d1=(0,d.join)(".agentbox","bots"),d2=".agentbox/";function d4(e=new Date){return e.toISOString().replace(/\.\d+Z$/,"Z").replace(/:/g,"-")}var d3=/^\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}Z$/;function d8(e,t){return(0,d.join)(e,d1,t)}function d6(e){let t=e.split(d.sep),r=t.length;return r>=4&&"workspace"===t[r-1]&&"bots"===t[r-3]&&".agentbox"===t[r-4]?t.slice(0,r-4).join(d.sep):e}function d5(e,t,r){return(0,d.join)(d8(e,t),r)}async function d9(e){await (0,c.mkdir)(e.workspaceDir,{recursive:!0})}async function d7(e,t){await (0,c.mkdir)(e,{recursive:!0}),await (0,c.writeFile)((0,d.join)(e,"manifest.json"),`${JSON.stringify(t,null,2)}
55
- `,"utf8")}async function fe(e,t,r){let n=(0,d.join)(d8(e,t),"latest");await (0,c.rm)(n,{force:!0}),await (0,c.symlink)(r,n)}async function ft(e,t){let r;try{r=await (0,c.readdir)(d8(e,t))}catch{return[]}let n=[];for(let i of r){if(!d3.test(i))continue;let r=await (0,c.lstat)((0,d.join)(d8(e,t),i)).catch(()=>null);r?.isDirectory()&&n.push(i)}return n.sort().reverse()}async function fr(e){let t;try{t=await (0,c.readdir)((0,d.join)(e,d1),{withFileTypes:!0})}catch{return[]}let r=[];for(let n of t.sort((e,t)=>e.name.localeCompare(t.name))){if(!n.isDirectory())continue;let t=await ft(e,n.name);if(0===t.length)continue;let i=[];for(let r of t){let t=await fc(d5(e,n.name,r)).catch(()=>null);i.push({stamp:r,...t?.agent?{agent:t.agent}:{},state:t?.state===!0,...t?.boxName?{boxName:t.boxName}:{},...t?.provider?{provider:t.provider}:{}})}let o=await (0,c.readlink)((0,d.join)(d8(e,n.name),"latest")).catch(()=>null);r.push({bot:n.name,...o&&t.includes(o)?{latest:o}:{},backups:i})}return r}async function fn(e,t,r){if(r<1)return[];let n=await ft(e,t),i=await (0,c.readlink)((0,d.join)(d8(e,t),"latest")).catch(()=>null),o=[];for(let a of n.slice(r))a!==i&&(await (0,c.rm)((0,d.join)(d8(e,t),a),{recursive:!0,force:!0}),o.push(a));return o}async function fi(e){if(0!==(await sX("git",["-C",e,"rev-parse","--git-dir"],{reject:!1})).exitCode)return!1;let t=(0,d.join)(d1,".probe");if(0===(await sX("git",["-C",e,"check-ignore","-q",t],{reject:!1})).exitCode)return!1;let r=(0,d.join)(e,".gitignore"),n=await (0,c.readFile)(r,"utf8").catch(()=>""),i=0===n.length||n.endsWith("\n")?"":"\n";return await (0,c.writeFile)(r,`${n}${i}
56
+ elif command -v node >/dev/null 2>&1; then node -e "const{DatabaseSync}=require('node:sqlite');const d=new DatabaseSync('${t}');d.exec(\\"VACUUM INTO '${n}'\\");d.close()"; else exit 4; fi`])).exitCode)return!1;try{return await e.pullFile(n,r),!0}finally{await e.exec(["rm","-f",n])}}function d9(e){let t=u_(e),r=t.staticPaths[0]?.boxDir;if(!r)throw Error(`agent '${e}' declares no staticPaths to pull from`);return r}var d7=(0,d.join)(".agentbox","bots"),fe=".agentbox/";function ft(e=new Date){return e.toISOString().replace(/\.\d+Z$/,"Z").replace(/:/g,"-")}var fr=/^\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}Z$/;function fn(e,t){return(0,d.join)(e,d7,t)}function fi(e){let t=e.split(d.sep),r=t.length;return r>=4&&"workspace"===t[r-1]&&"bots"===t[r-3]&&".agentbox"===t[r-4]?t.slice(0,r-4).join(d.sep):e}function fo(e,t,r){return(0,d.join)(fn(e,t),r)}async function fa(e){await (0,c.mkdir)(e.workspaceDir,{recursive:!0})}async function fs(e,t){await (0,c.mkdir)(e,{recursive:!0}),await (0,c.writeFile)((0,d.join)(e,"manifest.json"),`${JSON.stringify(t,null,2)}
57
+ `,"utf8")}async function fl(e,t,r){let n=(0,d.join)(fn(e,t),"latest");await (0,c.rm)(n,{force:!0}),await (0,c.symlink)(r,n)}async function fc(e,t){let r;try{r=await (0,c.readdir)(fn(e,t))}catch{return[]}let n=[];for(let i of r){if(!fr.test(i))continue;let r=await (0,c.lstat)((0,d.join)(fn(e,t),i)).catch(()=>null);r?.isDirectory()&&n.push(i)}return n.sort().reverse()}async function fu(e){let t;try{t=await (0,c.readdir)((0,d.join)(e,d7),{withFileTypes:!0})}catch{return[]}let r=[];for(let n of t.sort((e,t)=>e.name.localeCompare(t.name))){if(!n.isDirectory())continue;let t=await fc(e,n.name);if(0===t.length)continue;let i=[];for(let r of t){let t=await fy(fo(e,n.name,r)).catch(()=>null);i.push({stamp:r,...t?.agent?{agent:t.agent}:{},state:t?.state===!0,...t?.boxName?{boxName:t.boxName}:{},...t?.provider?{provider:t.provider}:{}})}let o=await (0,c.readlink)((0,d.join)(fn(e,n.name),"latest")).catch(()=>null);r.push({bot:n.name,...o&&t.includes(o)?{latest:o}:{},backups:i})}return r}async function fd(e,t,r){if(r<1)return[];let n=await fc(e,t),i=await (0,c.readlink)((0,d.join)(fn(e,t),"latest")).catch(()=>null),o=[];for(let a of n.slice(r))a!==i&&(await (0,c.rm)((0,d.join)(fn(e,t),a),{recursive:!0,force:!0}),o.push(a));return o}async function ff(e){if(0!==(await sX("git",["-C",e,"rev-parse","--git-dir"],{reject:!1})).exitCode)return!1;let t=(0,d.join)(d7,".probe");if(0===(await sX("git",["-C",e,"check-ignore","-q",t],{reject:!1})).exitCode)return!1;let r=(0,d.join)(e,".gitignore"),n=await (0,c.readFile)(r,"utf8").catch(()=>""),i=0===n.length||n.endsWith("\n")?"":"\n";return await (0,c.writeFile)(r,`${n}${i}
56
58
  # AgentBox bot backups (workspace + agent identity). Never commit these.
57
- ${d2}
58
- `,"utf8"),!0}async function fo(e){let t=uO(e.agent),r=d0(e.agent),n=[...t.stateBackup?.exclude??[]];await (0,c.mkdir)(e.destDir,{recursive:!0}),await e.transport.pullTree(r,e.destDir,{exclude:[...n,...s2.LIVE_DATABASE_EXCLUDES]});let i=await fa(e,r,n);return await (0,c.chmod)(e.destDir,448).catch(()=>{}),{databases:i,excluded:n}}async function fa(e,t,r){let n=r.map(e=>`-path ${fs(`./${e}`)} -prune -o`).join(" "),i=await e.transport.exec(["sh","-c",`cd ${fs(t)} 2>/dev/null || exit 0; find . ${n} \\( -name '*.sqlite' -o -name '*.db' \\) -type f -print 2>/dev/null`]);if(0!==i.exitCode)return[];let o=i.stdout.split("\n").map(e=>e.trim().replace(/^\.\//,"")).filter(e=>e.length>0),a=[];for(let r of o){let n=(0,d.join)(e.destDir,r);await (0,c.mkdir)((0,d.join)(n,".."),{recursive:!0}),await dQ(e.transport,`${t}/${r}`,n)&&(a.push(r),await (0,c.chmod)(n,384).catch(()=>{}))}return a}function fs(e){return`'${e.replace(/'/g,"'\\''")}'`}async function fl(e){if(await (0,c.mkdir)(e.workspaceDir,{recursive:!0}),(await (0,c.readdir)(e.workspaceDir)).length>0&&!e.force)throw Error(`${e.workspaceDir} is not empty \u2014 pass a different destination, or force to overwrite it`);return await (0,c.cp)(e.bundle.workspaceDir,e.workspaceDir,{recursive:!0,force:!0}),{files:(await (0,c.readdir)(e.workspaceDir)).length}}async function fc(e){let t,r=(0,d.join)(e,"manifest.json");try{t=JSON.parse(await (0,c.readFile)(r,"utf8"))}catch(e){throw Error(`${r}: not a readable backup manifest (${e instanceof Error?e.message:String(e)})`)}let n=t;if(1!==n.version)throw Error(`${r}: manifest version ${String(n.version)} is not one this build restores`);if("string"!=typeof n.bot||"string"!=typeof n.stamp)throw Error(`${r}: manifest is missing 'bot' or 'stamp'`);return n}async function fu(e,t,r){let n=d8(e,t),i=r;if(i||void 0===(i=await (0,c.readlink)((0,d.join)(n,"latest")).catch(()=>null)??void 0)&&(i=(await ft(e,t))[0]),!i)throw Error(`no backup of '${t}' under ${n} \u2014 run \`agentbox download --backup\` first`);let o=(0,d.join)(n,i),a=await fc(o),s=(0,d.join)(o,"workspace");if(!(await (0,c.lstat)(s).catch(()=>null))?.isDirectory())throw Error(`${o}: the backup has no workspace/ directory`);let l=(0,d.join)(o,"state"),u=(await (0,c.lstat)(l).catch(()=>null))?.isDirectory()===!0;return{dir:o,bot:a.bot,stamp:i,manifest:a,workspaceDir:s,...u?{stateDir:l}:{}}}async function fd(e){let t=d0(e.agent),r=await ff(e,t);return await e.transport.pushTree(e.srcDir,t),{clearedSidecars:r}}async function ff(e,t){let r=await fp(e.srcDir);if(0===r.length)return[];let n=r.flatMap(e=>[`${t}/${e}-wal`,`${t}/${e}-shm`]),i=await e.transport.exec(["sh","-c",`rm -f ${n.map(fs).join(" ")}`]);if(0!==i.exitCode)throw Error(`could not clear stale write-ahead logs under ${t}: ${i.stderr.trim()||`exit ${String(i.exitCode)}`}`);return n}async function fp(e,t=""){let r;try{r=await (0,c.readdir)((0,d.join)(e,t),{withFileTypes:!0})}catch{return[]}let n=[];for(let i of r){let r=t?(0,d.join)(t,i.name):i.name;i.isDirectory()?n.push(...await fp(e,r)):i.isFile()&&(i.name.endsWith(".sqlite")||i.name.endsWith(".db"))&&n.push(r)}return n}function fh(e){for(let t of[e.lastAgent,...e.agents??[]].filter(e=>!!e)){let e=uC(t);if(e?.caps.surface==="service")return e}}async function fm(e,t){let r;try{return await Promise.race([e,new Promise(e=>{r=setTimeout(()=>e(void 0),t)})])}finally{r&&clearTimeout(r)}}async function fg(e,t,r){if(0===r.length)return[];let n=[],i=new Map;for(let o of r){let r=o.command&&o.command.length>0?[...o.command]:o.file?["cat",o.file]:null;if(!r)continue;let a=r.join("\0");if(!i.has(a)){let n;try{let i=await fm(e.exec(t,r,{user:"vscode"}),2e4),o=i?.stdout.slice(i.stdout.indexOf("{"));n=i?.exitCode===0&&o?.startsWith("{")?JSON.parse(o):void 0}catch{n=void 0}i.set(a,n)}let s=function(e,t){let r=e;for(let e of t.split(".")){if(null===r||"object"!=typeof r)return;r=r[e]}return r}(i.get(a),o.jsonPath);if("string"!=typeof s||0===s.length)continue;let l=o.fromUrlFragment?function(e,t){let r=e.indexOf("#");if(!(r<0))return new URLSearchParams(e.slice(r+1)).get(t)??void 0}(s,o.fromUrlFragment):s;void 0!==l&&0!==l.length&&n.push({label:o.label,value:l,...o.fragmentKey?{fragmentKey:o.fragmentKey}:{}})}return n}function fy(e,t){let r=t.filter(e=>e.fragmentKey).map(e=>`${encodeURIComponent(e.fragmentKey)}=${encodeURIComponent(e.value)}`);if(0===r.length)return null;let n=e.endsWith("/")?e:`${e}/`;return`${n}#${r.join("&")}`}async function fw(e,t,r){try{let n=fh(t)?.service?.urlFields??[];if(0===n.length)return r;return fy(r,await fg(e,t,n))??r}catch{return r}}var fb=[".git","node_modules","media",".agentbox"],fv=[".agentbox"];function fx(e={}){let t=fv.map(e=>`:(exclude)${e}`);return e.includeNodeModules||t.push(":(exclude)node_modules",":(exclude)*/node_modules",":(exclude)*/node_modules/*"),t}function f$(){let e=new Set;for(let t of uA)for(let r of t.staticPaths)r.hostHomeRel.length>0&&e.add(r.hostHomeRel.join("/"));return[...e].sort()}function fS(e={}){return[...fb.filter(t=>"node_modules"!==t||!e.includeNodeModules),...f$(),...s2.LIVE_DATABASE_EXCLUDES]}function fE(e){return`'${e.replace(/'/g,"'\\''")}'`}function fk(e){let t=e.workspaceDir??"/workspace",{dirNames:r,dirPaths:n,fileGlobs:i}=function(e){let t=[],r=[],n=[];for(let i of e){let e=i.replace(/\/+$/,"");0!==e.length&&(e.includes("*")?n.push(e):e.includes("/")?r.push(e):t.push(e))}return{dirNames:t,dirPaths:r,fileGlobs:n}}(e.excludes),o=[...r.map(e=>`-name ${fE(e)}`),...n.map(e=>`-path ${fE(`./${e}`)}`)],a=o.length>0?`\\( -type d \\( ${o.join(" -o ")} \\) -prune \\) -o `:"",s=[...r.map(e=>`! -name ${fE(e)}`),...n.flatMap(e=>[`! -path ${fE(`./${e}`)}`,`! -path ${fE(`./${e}/*`)}`]),...i.map(e=>`! -name ${fE(e)}`)].join(" "),l=`find . ${a}\\( \\( -type f -o -type l \\) ${s} -print0 \\)`,c=!1===e.respectGitignore?"false":"git rev-parse --is-inside-work-tree",u=fx(e).map(fE).join(" ");return`set -u
59
+ ${fe}
60
+ `,"utf8"),!0}async function fp(e){let t=u_(e.agent),r=d9(e.agent),n=[...t.stateBackup?.exclude??[]];await (0,c.mkdir)(e.destDir,{recursive:!0}),await e.transport.pullTree(r,e.destDir,{exclude:[...n,...s3.LIVE_DATABASE_EXCLUDES]});let i=await fh(e,r,n);return await (0,c.chmod)(e.destDir,448).catch(()=>{}),{databases:i,excluded:n}}async function fh(e,t,r){let n=r.map(e=>`-path ${fm(`./${e}`)} -prune -o`).join(" "),i=await e.transport.exec(["sh","-c",`cd ${fm(t)} 2>/dev/null || exit 0; find . ${n} \\( -name '*.sqlite' -o -name '*.db' \\) -type f -print 2>/dev/null`]);if(0!==i.exitCode)return[];let o=i.stdout.split("\n").map(e=>e.trim().replace(/^\.\//,"")).filter(e=>e.length>0),a=[];for(let r of o){let n=(0,d.join)(e.destDir,r);await (0,c.mkdir)((0,d.join)(n,".."),{recursive:!0}),await d5(e.transport,`${t}/${r}`,n)&&(a.push(r),await (0,c.chmod)(n,384).catch(()=>{}))}return a}function fm(e){return`'${e.replace(/'/g,"'\\''")}'`}async function fg(e){if(await (0,c.mkdir)(e.workspaceDir,{recursive:!0}),(await (0,c.readdir)(e.workspaceDir)).length>0&&!e.force)throw Error(`${e.workspaceDir} is not empty \u2014 pass a different destination, or force to overwrite it`);return await (0,c.cp)(e.bundle.workspaceDir,e.workspaceDir,{recursive:!0,force:!0}),{files:(await (0,c.readdir)(e.workspaceDir)).length}}async function fy(e){let t,r=(0,d.join)(e,"manifest.json");try{t=JSON.parse(await (0,c.readFile)(r,"utf8"))}catch(e){throw Error(`${r}: not a readable backup manifest (${e instanceof Error?e.message:String(e)})`)}let n=t;if(1!==n.version)throw Error(`${r}: manifest version ${String(n.version)} is not one this build restores`);if("string"!=typeof n.bot||"string"!=typeof n.stamp)throw Error(`${r}: manifest is missing 'bot' or 'stamp'`);return n}async function fw(e,t,r){let n=fn(e,t),i=r;if(i||void 0===(i=await (0,c.readlink)((0,d.join)(n,"latest")).catch(()=>null)??void 0)&&(i=(await fc(e,t))[0]),!i)throw Error(`no backup of '${t}' under ${n} \u2014 run \`agentbox download --backup\` first`);let o=(0,d.join)(n,i),a=await fy(o),s=(0,d.join)(o,"workspace");if(!(await (0,c.lstat)(s).catch(()=>null))?.isDirectory())throw Error(`${o}: the backup has no workspace/ directory`);let l=(0,d.join)(o,"state"),u=(await (0,c.lstat)(l).catch(()=>null))?.isDirectory()===!0;return{dir:o,bot:a.bot,stamp:i,manifest:a,workspaceDir:s,...u?{stateDir:l}:{}}}async function fb(e){let t=d9(e.agent),r=await fv(e,t);return await e.transport.pushTree(e.srcDir,t),{clearedSidecars:r}}async function fv(e,t){let r=await fx(e.srcDir);if(0===r.length)return[];let n=r.flatMap(e=>[`${t}/${e}-wal`,`${t}/${e}-shm`]),i=await e.transport.exec(["sh","-c",`rm -f ${n.map(fm).join(" ")}`]);if(0!==i.exitCode)throw Error(`could not clear stale write-ahead logs under ${t}: ${i.stderr.trim()||`exit ${String(i.exitCode)}`}`);return n}async function fx(e,t=""){let r;try{r=await (0,c.readdir)((0,d.join)(e,t),{withFileTypes:!0})}catch{return[]}let n=[];for(let i of r){let r=t?(0,d.join)(t,i.name):i.name;i.isDirectory()?n.push(...await fx(e,r)):i.isFile()&&(i.name.endsWith(".sqlite")||i.name.endsWith(".db"))&&n.push(r)}return n}function f$(e){for(let t of[e.lastAgent,...e.agents??[]].filter(e=>!!e)){let e=uL(t);if(e?.caps.surface==="service")return e}}async function fS(e,t){let r;try{return await Promise.race([e,new Promise(e=>{r=setTimeout(()=>e(void 0),t)})])}finally{r&&clearTimeout(r)}}async function fE(e,t,r){if(0===r.length)return[];let n=[],i=new Map;for(let o of r){let r=o.command&&o.command.length>0?[...o.command]:o.file?["cat",o.file]:null;if(!r)continue;let a=r.join("\0");if(!i.has(a)){let n;try{let i=await fS(e.exec(t,r,{user:"vscode"}),2e4),o=i?.stdout.slice(i.stdout.indexOf("{"));n=i?.exitCode===0&&o?.startsWith("{")?JSON.parse(o):void 0}catch{n=void 0}i.set(a,n)}let s=function(e,t){let r=e;for(let e of t.split(".")){if(null===r||"object"!=typeof r)return;r=r[e]}return r}(i.get(a),o.jsonPath);if("string"!=typeof s||0===s.length)continue;let l=o.fromUrlFragment?function(e,t){let r=e.indexOf("#");if(!(r<0))return new URLSearchParams(e.slice(r+1)).get(t)??void 0}(s,o.fromUrlFragment):s;void 0!==l&&0!==l.length&&n.push({label:o.label,value:l,...o.fragmentKey?{fragmentKey:o.fragmentKey}:{}})}return n}function fk(e,t){let r=t.filter(e=>e.fragmentKey).map(e=>`${encodeURIComponent(e.fragmentKey)}=${encodeURIComponent(e.value)}`);if(0===r.length)return null;let n=e.endsWith("/")?e:`${e}/`;return`${n}#${r.join("&")}`}async function fT(e,t,r){try{let n=f$(t)?.service?.urlFields??[];if(0===n.length)return r;return fk(r,await fE(e,t,n))??r}catch{return r}}var fD=[".git","node_modules","media",".agentbox"],fA=[".agentbox"];function fO(e={}){let t=fA.map(e=>`:(exclude)${e}`);return e.includeNodeModules||t.push(":(exclude)node_modules",":(exclude)*/node_modules",":(exclude)*/node_modules/*"),t}function fP(){let e=new Set;for(let t of uN)for(let r of t.staticPaths)r.hostHomeRel.length>0&&e.add(r.hostHomeRel.join("/"));return[...e].sort()}function fC(e={}){return[...fD.filter(t=>"node_modules"!==t||!e.includeNodeModules),...fP(),...s3.LIVE_DATABASE_EXCLUDES]}function fj(e){return`'${e.replace(/'/g,"'\\''")}'`}function fI(e){let t=e.workspaceDir??"/workspace",{dirNames:r,dirPaths:n,fileGlobs:i}=function(e){let t=[],r=[],n=[];for(let i of e){let e=i.replace(/\/+$/,"");0!==e.length&&(e.includes("*")?n.push(e):e.includes("/")?r.push(e):t.push(e))}return{dirNames:t,dirPaths:r,fileGlobs:n}}(e.excludes),o=[...r.map(e=>`-name ${fj(e)}`),...n.map(e=>`-path ${fj(`./${e}`)}`)],a=o.length>0?`\\( -type d \\( ${o.join(" -o ")} \\) -prune \\) -o `:"",s=[...r.map(e=>`! -name ${fj(e)}`),...n.flatMap(e=>[`! -path ${fj(`./${e}`)}`,`! -path ${fj(`./${e}/*`)}`]),...i.map(e=>`! -name ${fj(e)}`)].join(" "),l=`find . ${a}\\( \\( -type f -o -type l \\) ${s} -print0 \\)`,c=!1===e.respectGitignore?"false":"git rev-parse --is-inside-work-tree",u=fO(e).map(fj).join(" ");return`set -u
59
61
  set -o pipefail
60
- cd ${fE(t)} 2>/dev/null || exit 3
62
+ cd ${fj(t)} 2>/dev/null || exit 3
61
63
  if ${c} >/dev/null 2>&1; then
62
64
  printf 'MODE=git\\n'
63
65
  git ls-files -z --cached --others --exclude-standard -- . ${u} |
@@ -65,16 +67,16 @@ if ${c} >/dev/null 2>&1; then
65
67
  else
66
68
  printf 'MODE=exclude\\n'
67
69
  ${l}
68
- fi`}function fT(e){let t=e.indexOf("\n"),r=t>=0?e.slice(0,t):e,n=t>=0?e.slice(t+1):"";if("MODE=git"!==r&&"MODE=exclude"!==r)throw Error(`workspace file list: unexpected mode marker ${JSON.stringify(r)}`);let i=n.split("\0").filter(e=>e.length>0).map(e=>e.startsWith("./")?e.slice(2):e);return{mode:"MODE=git"===r?"git":"exclude",fileList:i.join("\0"),paths:i}}function fD(e,t){let r=e.split("/"),n=r[r.length-1]??"";for(let i of t){let t=i.replace(/^\.\//,"").replace(/\/+$/,"");if(0!==t.length){if(t.includes("*")){if(RegExp(`^${t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")}$`).test(n))return!0;continue}if(t.includes("/")){if(e===t||e.startsWith(`${t}/`))return!0;continue}if(r.includes(t))return!0}}return!1}function fA(e){let t=[];for(let r of e.split("\n")){let e=r.trimEnd();if(0===e.length)continue;let n=e.slice(0,-1===e.indexOf(" ")?e.length:e.indexOf(" ")),i=e[1],o=e[0];if(">"!==o&&"<"!==o&&"c"!==o&&"*"!==o||"d"===i)continue;let a=e.slice(n.length).trimStart(),s=a.indexOf(" -> "),l=-1===s?a:a.slice(0,s),c=n.slice(2),u=(">"===o||"<"===o||"c"===o)&&"f"===i&&c.length>0&&[...c].every(e=>"+"===e);t.push({raw:e,code:n,path:l,created:u})}return t}function fO(e){return fA(e).map(e=>e.raw)}function fC(e){if(!e)return[];let t=uA.filter(t=>t.id===e),r=new Set;for(let e of t)for(let t of e.clone?.drop??[])r.add(t);return[...r].sort()}function fj(e,t){return t.includes(e)}async function fP(e,t){let r=[];for(let n=0;n<t.length;n+=64){let i=t.slice(n,n+64);for(let t of(await Promise.all(i.map(async t=>{try{return await (0,c.lstat)((0,d.join)(e,t)),t}catch{return null}}))))null!==t&&r.push(t)}return r}async function fI(e){let t=["-a","--checksum"];if(null===e.fileList)for(let r of e.excludes??[])t.push(`--exclude=${r}`);else t.push("--files-from=-","--from0");let r=`${e.scratchDir}/`,n=`${e.destDir}/`,i=[],o=null!==e.fileList?e.fileList:void 0;if(null!==e.fileList){let t=e.fileList.split("\0").filter(e=>e.length>0),r=new Set(e.skipPaths??[]),n=t.filter(e=>!r.has(e)),a=await fP(e.scratchDir,n);if(i=n.filter(e=>!a.includes(e)),0===a.length&&n.length>0)throw Error(`none of the ${String(n.length)} selected file(s) are in the staged copy at ${e.scratchDir} \u2014 the staging is stale or empty; re-run without --no-refresh`);o=a.join("\0")}let a=await sX("rsync",[...t,"--dry-run","-i",r,n],{reject:!1,input:o});if(0!==a.exitCode)throw Error(`rsync dry-run failed: ${a.stderr||a.stdout}`);let s=fO(a.stdout);if(e.dryRun)return{changes:s,applied:!1,missing:i};let l=await sX("rsync",[...t,r,n],{reject:!1,input:o});if(0!==l.exitCode)throw Error(`rsync into ${e.destDir} failed: ${l.stderr||l.stdout}`);return{changes:s,applied:!0,missing:i}}async function fR(e){let t=e.onLog??(()=>{}),r=await fB(e.hostDir,e.excludes);if(0===r.length)return t("sync: nothing to push (host workspace is empty or fully excluded)"),{copied:[],skipped:[],identical:0,empty:!0};let n=await e.ports.probeBoxTokens(r),i=[],o=[],a=0;for(let t of r){let r;try{r=(0,s0.createHash)("sha256").update(await (0,c.readFile)((0,d.join)(e.hostDir,t))).digest("hex")}catch{continue}let s=dz(n.get(t),r);"copy"===s?i.push(t):"conflict"===s?o.push(t):a+=1}if(i.length>0){let t=await sX("tar",["-C",e.hostDir,"--null","-T","-","-cf","-"],{input:i.join("\0"),encoding:"buffer",reject:!1,env:{...process.env,COPYFILE_DISABLE:"1"}});if(0!==t.exitCode)throw Error(`tar of ${e.hostDir} failed`);await e.ports.applyTarToBox(t.stdout)}return t(`sync: ${String(i.length)} copied, ${String(a)} unchanged, ${String(o.length)} kept by the box`),{copied:i,skipped:o,identical:a,empty:!1}}async function fB(e,t){let r=fk({workspaceDir:e,respectGitignore:!1,excludes:t}),n=await sX("bash",["-c",r],{reject:!1});if(0!==n.exitCode)throw Error(`listing ${e} failed: ${n.stderr||n.stdout}`);return fT(n.stdout).paths}var fN="/tmp/agentbox-workspace-xfer.tar";function f_(e){return 0===e.length?"":`${e.join("\0")}\0`}function fL(e,t=49152){let r=[],n=[],i=0;for(let o of e){let e=Buffer.byteLength(o,"utf8")+1;n.length>0&&i+e>t&&(r.push(n),n=[],i=0),n.push(o),i+=e}return n.length>0&&r.push(n),r}function fU(e){return`'${e.replace(/'/g,"'\\''")}'`}function fM(e,t){let r=async(r,n)=>e.exec(t,["bash","-c",r],n?.asRoot?{user:"root"}:void 0);return{run:r,async pushTar(n,i){if(!e.uploadPath)throw Error(`provider '${e.name}' cannot upload files into a box`);let o=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-xfer-")),a=(0,d.join)(o,"payload.tar");try{await (0,c.writeFile)(a,i),await e.uploadPath(t,[a],fN);let o=await r(`set -e
69
- tar -C ${fU(n)} -xf ${fU(fN)}
70
- rm -f ${fU(fN)}`);if(0!==o.exitCode)throw Error(`extract into ${n} failed: ${o.stderr||o.stdout}`)}finally{await (0,c.rm)(o,{recursive:!0,force:!0})}},async pullTar(n,i){if(!e.downloadPath)throw Error(`provider '${e.name}' cannot download files from a box`);let o=fL(i),a=await r(`rm -f ${fU(fN)}`);if(0!==a.exitCode)throw Error(`clearing ${fN} failed: ${a.stderr||a.stdout}`);let s=!1;for(let e of o){let t=Buffer.from(f_(e)).toString("base64"),i=await r(`set -e
71
- printf %s ${fU(t)} | base64 -d | tar -C ${fU(n)} --null -T - ${s?"-rf":"-cf"} ${fU(fN)}`);if(0!==i.exitCode)throw Error(`packing ${n} failed: ${i.stderr||i.stdout}`);s=!0}if(!s){let e=await r(`tar -C ${fU(n)} --null -T /dev/null -cf ${fU(fN)}`);if(0!==e.exitCode)throw Error(`packing ${n} failed: ${e.stderr||e.stdout}`)}let l=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-xfer-")),f=(0,d.join)(l,"payload.tar");try{await e.downloadPath(t,[fN],f);let n=await (0,c.readFile)(f);return await r(`rm -f ${fU(fN)}`).catch(()=>void 0),n}finally{await (0,c.rm)(l,{recursive:!0,force:!0})}}}}var fF=class extends Error{constructor(e){super(e),this.name="BoxProbeError"}};function fG(e,t){return{async probeBoxTokens(r){let n=new Map;if(0===r.length)return n;for(let i of fL(r)){let r=Buffer.from(f_(i)).toString("base64"),o=`printf %s ${fU(r)} | base64 -d | ( cd ${fU(t)} && while IFS= read -r -d '' f; do if [ -f "$f" ] && [ ! -L "$f" ]; then printf '%s\\0%s\\0' "$(sha256sum < "$f" | cut -d' ' -f1)" "$f"; elif [ -e "$f" ] || [ -L "$f" ]; then printf '%s\\0%s\\0' ${fU("-")} "$f"; fi; done )`,a=await e.run(o,{asRoot:!0});if(0!==a.exitCode)throw new fF(`could not read ${t} in the box (exit ${String(a.exitCode)}): ${a.stderr||a.stdout||"no output"}
72
- Refusing to sync: without the box's file list every host file would look new and overwrite the box's version.`);let s=a.stdout.split("\0").filter(e=>e.length>0);for(let e=0;e+1<s.length;e+=2){let t=s[e],r=s[e+1];void 0!==t&&void 0!==r&&n.set(r,t)}}return n},applyTarToBox:r=>e.pushTar(t,r)}}function fH(e){return`'${e.replace(/'/g,"'\\''")}'`}function fW(e){return(0,d.join)((0,d.dirname)(e),"pull-filelist.json")}async function fV(e){let t=e.boxWorkspaceDir??"/workspace",r=fM(e.provider,e.box),n=fS({includeNodeModules:e.includeNodeModules}),i=await r.run(fk({workspaceDir:t,respectGitignore:e.respectGitignore,excludes:n,includeNodeModules:e.includeNodeModules}),{asRoot:!0});if(0!==i.exitCode)throw Error(`listing ${t} in the box failed: ${i.stderr||i.stdout}`);let o=fT(i.stdout),a=e.dropExcludedInGitMode?fC(e.agent):[],s="git"===o.mode&&e.dropExcludedInGitMode?o.paths.filter(e=>!fD(e,n)):o.paths,l=new Set(a.length>0?s.filter(e=>!fj(e,a)):s);if(e.envPatterns&&e.envPatterns.length>0){let n=dI(e.envPatterns).map(fH).join(" "),i=await r.run(`cd ${fH(t)} 2>/dev/null || exit 0
73
- ${n}`,{asRoot:!0});if(0===i.exitCode)for(let e of i.stdout.split("\0"))0!==e.length&&l.add(e.startsWith("./")?e.slice(2):e)}await (0,c.rm)(e.scratchDir,{recursive:!0,force:!0}),await (0,c.mkdir)(e.scratchDir,{recursive:!0});let u=[...l];if(u.length>0){let n=await r.pullTar(t,u),i=await sX("tar",["-xf","-","-C",e.scratchDir],{input:n,reject:!1});if(0!==i.exitCode)throw Error(`extracting the box workspace failed: ${i.stderr}`)}let d={scratchDir:e.scratchDir,fileList:u.length>0?u.join("\0"):null,mode:o.mode};return!1!==e.writeSidecar&&await (0,c.writeFile)(fW(e.scratchDir),JSON.stringify({mode:d.mode,paths:u}),"utf8"),d}async function fX(e){try{let t=JSON.parse(await (0,c.readFile)(fW(e),"utf8")),r=t.paths??[];return{scratchDir:e,fileList:r.length>0?r.join("\0"):null,mode:"git"===t.mode?"git":"exclude"}}catch{return null}}async function fK(e){let t=e.noRefresh?await fX(e.scratchDir)??await fV(e):await fV(e),{changes:r,applied:n,missing:i}=await fI({scratchDir:t.scratchDir,destDir:e.destDir,fileList:t.fileList,excludes:fS({includeNodeModules:e.includeNodeModules}),dryRun:e.dryRun,skipPaths:e.skipPaths});return{hostPath:e.destDir,changes:r,applied:n,usedGitignore:"git"===t.mode,missing:i}}async function fz(e){let t;try{t=await (0,c.lstat)(e)}catch(t){if("ENOENT"===t.code)return;throw Error(`cannot use ${e} as a destination: ${t.message}`)}if(t.isSymbolicLink())throw Error(`${e} is a symlink; pick a real directory (the export would replace the link, not its target)`);if(!t.isDirectory())throw Error(`${e} exists and is not a directory; pick another destination`);if((await (0,c.readdir)(e)).length>0)throw Error(`${e} is not empty; pick another destination or empty it first`)}async function fJ(e){let t=e.onLog??(()=>{});await fz(e.destDir),t(`exporting ${e.box.name}:/workspace to ${e.destDir}`);let r=await fV({provider:e.provider,box:e.box,boxWorkspaceDir:e.boxWorkspaceDir,scratchDir:e.destDir,includeNodeModules:e.includeNodeModules,dropExcludedInGitMode:!0,writeSidecar:!1,...!1===e.dropAgentScaffolding?{}:{agent:e.agent}}),n=null===r.fileList?0:r.fileList.split("\0").length;return t(`exported ${String(n)} file(s)${"git"===r.mode?"":" (exclude-list mode)"}`),{destDir:e.destDir,files:n,usedGitignore:"git"===r.mode}}async function fq(e){let t=e.onLog??(()=>{}),r=e.boxWorkspaceDir??"/workspace";if((await lm(e.box.workspacePath)).length>0){if(!e.provider.resyncWorkspace)throw Error(`provider '${e.provider.name}' cannot resync a git workspace into a live box`);t("syncing git workspace (merge host branch + overlay uncommitted/untracked)");let r=await e.provider.resyncWorkspace(e.box,t);return{mode:"git",conflicts:r.repos.flatMap(e=>[...e.mergeConflicts,...e.overlaySkipped]),copied:0,repos:r.repos}}t("syncing non-git workspace (file overlay; the box wins on conflict)");let n=fM(e.provider,e.box),i=await fR({hostDir:e.box.workspacePath,excludes:fS({includeNodeModules:e.includeNodeModules}),ports:fG(n,r),onLog:t});return{mode:"files",conflicts:i.skipped,copied:i.copied.length}}var fY="/home/vscode/.claude/workflows",fZ=`${dH}/memory`;async function fQ(e){try{return await (0,c.stat)(e),!0}catch{return!1}}async function f0(e,t=""){let r;try{r=await (0,c.readdir)(e,{withFileTypes:!0})}catch{return[]}let n=[];for(let i of r){let r=t?`${t}/${i.name}`:i.name,o=(0,d.join)(e,i.name);if(i.isDirectory())n.push(...await f0(o,r));else if(i.isFile())n.push(r);else if(i.isSymbolicLink())try{(await (0,c.stat)(o)).isFile()&&n.push(r)}catch{}}return n}async function f1(e){let t=await (0,c.readFile)(e);return(0,s0.createHash)("sha256").update(t).digest("hex")}async function f2(e,t,r){if(null===t)return{dst:r,files:{},hostDir:null};let n=await f0(t),i={};for(let e of n)i[e]=await f1((0,d.join)(t,e));return{dst:r,files:i,hostDir:t}}async function f4(e,t=(0,u.homedir)()){let r=(0,d.join)(t,".claude","workflows"),n=await fQ(r)?r:null,i=await dW(e,t),[o,a]=await Promise.all([f2("workflows",n,fY),f2("memory",i,fZ)]);return{sets:{workflows:o,memory:a}}}var f3=["workflows","memory"];async function f8(e){if(0===e.length)return{tarballPath:null,cleanup:async()=>{}};let t=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-dynsync-stage-")),r=null;try{for(let r of e){let e=(0,d.join)(t,r.set,r.rel);await (0,c.mkdir)((0,d.dirname)(e),{recursive:!0}),await (0,c.copyFile)(r.absSrc,e)}r=(0,d.join)((0,u.tmpdir)(),`agentbox-dynsync-${(0,d.basename)(t)}.tar.gz`),await sX("tar",["-czf",r,"-C",t,"."],{env:{...process.env,COPYFILE_DISABLE:"1"}});let n=r;return{tarballPath:n,cleanup:async()=>{await (0,c.rm)(t,{recursive:!0,force:!0}),await (0,c.rm)(n,{force:!0})}}}catch(e){throw await (0,c.rm)(t,{recursive:!0,force:!0}),r&&await (0,c.rm)(r,{force:!0}),e}}async function f6(e){try{return await (0,c.stat)(e),!0}catch{return!1}}async function f5(e){let t=[];async function r(n){let i;try{i=await (0,c.readdir)(n,{withFileTypes:!0})}catch{return}for(let o of i){let i=(0,d.join)(n,o.name);if(o.isSymbolicLink())try{await (0,c.stat)(i)}catch{t.push((0,d.relative)(e,i))}else o.isDirectory()&&await r(i)}}return await r(e),t}async function f9(e){return(0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),`agentbox-${e}-stage-`))}var f7="--chmod=Du+rwx,Fu+rw",pe="--no-D";function pt(e=[]){return{tarballPath:null,cleanup:async()=>{},warnings:e}}async function pr(e,t){let r=(0,d.join)((0,u.tmpdir)(),`agentbox-${t}-${(0,d.basename)(e)}.tar.gz`);return await sX("tar",["-czf",r,"-C",e,"."],{env:{...process.env,COPYFILE_DISABLE:"1"}}),r}function pn(e){return async()=>{for(let t of e)await (0,c.rm)(t,{recursive:!0,force:!0})}}async function pi(e,t,r){let n=await f9(e),i=null;try{return await (0,c.copyFile)(t,(0,d.join)(n,r)),{tarballPath:i=await pr(n,e),cleanup:pn([n,i]),warnings:[]}}catch(e){throw await (0,c.rm)(n,{recursive:!0,force:!0}),i&&await (0,c.rm)(i,{force:!0}),e}}async function po(e,t={}){let r=uO(e),n=t.hostHome??(0,u.homedir)(),i=r.staticPaths.filter(e=>(e.stagedAs??"static")==="static"),o=[];for(let e of i){let t=(0,d.join)(n,...e.hostHomeRel);await f6(t)&&o.push({path:e,hostPath:t})}if(0===o.length)return pt();let a=await f9(`${r.id}-static`),s=null;try{for(let{path:e,hostPath:t}of o){let n=e.relocToSubpath?(0,d.join)(a,e.relocToSubpath):a,i=await f5(t);await sX("rsync",["-a",f7,pe,"-L",...i.map(e=>`--exclude=/${e}`),...(e.include??[]).map(e=>`--include=${e}`),...(0,s2.agentPushExcludes)(r,e,"snapshot").map(e=>`--exclude=${e}`),`${t}/`,`${n}/`])}return{tarballPath:s=await pr(a,`${r.id}-static`),cleanup:pn([a,s]),warnings:[]}}catch(e){throw await (0,c.rm)(a,{recursive:!0,force:!0}),s&&await (0,c.rm)(s,{force:!0}),e}}async function pa(e={}){let t=e.hostHome??(0,u.homedir)(),r=(0,d.join)(t,".agents");if(!await f6(r))return pt();let n=await f9("agents-static"),i=null;try{let e=await f5(r);return await sX("rsync",["-a",f7,pe,"-L",...e.map(e=>`--exclude=/${e}`),`${r}/`,`${n}/`]),{tarballPath:i=await pr(n,"agents-static"),cleanup:pn([n,i]),warnings:[]}}catch(e){throw await (0,c.rm)(n,{recursive:!0,force:!0}),i&&await (0,c.rm)(i,{force:!0}),e}}function ps(e){if(!/^[A-Za-z0-9._-]+$/.test(e))throw Error(`invalid provider name for prepared-state: ${JSON.stringify(e)}`);return(0,d.resolve)((0,u.homedir)(),".agentbox",`${e}-prepared.json`)}async function pl(e){let t=await (0,c.readFile)(e);return(0,s0.createHash)("sha256").update(t).digest("hex")}async function pc(e){return(await pu(e)).contextSha256}async function pu(e){let t=[...e].sort((e,t)=>e.rel<t.rel?-1:+(e.rel>t.rel)),r=(0,s0.createHash)("sha256"),n={};for(let e of t){let t=await pl(e.abs);n[e.rel]=t,r.update(`${e.rel}\0${t}
74
- `)}return{contextSha256:r.digest("hex"),files:n}}function pd(e){return[...new Set((e??[]).map(e=>e.trim()).filter(e=>e.length>0))].sort()}function pf(e){return pd(e).join(",")}function pp(e){if(!e)return[];let t=[];for(let[r,n]of Object.entries(e)){let e=uC(r);for(let i of e?.settings??[]){if(!i.affectsBake)continue;let e=n[i.key];void 0!==e&&e!==i.default&&t.push(`${r}.${i.key}=${String(e)}`)}}return t.sort()}var ph="ghcr.io/madarco/agentbox/box";function pm(e){let t=e.trim();if(0===t.length)return null;let r=null,n=/^[^@/\s]+@[^:/\s]+:(.+)$/.exec(t);if(n)r=n[1];else try{r=function(e){try{return decodeURIComponent(e)}catch{return e}}(new URL(t).pathname)}catch{return null}let i=r.replace(/\.git\/?$/,"").split("/").filter(e=>e.length>0);if(i.length<2)return null;let o=i[i.length-2],a=i[i.length-1];return 0===o.length||0===a.length?null:{owner:o,repo:a}}var pg="agentbox-hub-worker-",py=[".git","node_modules","bin","obj","packages","dist",".next","target"];function pw(e){return!e.includes("/")&&!e.includes("*")&&!e.includes("?")}function pb(e){let t=[];for(let r of e)pw(r)?t.push(`*/${r}`,r):t.push(r);return t}function pv(e,t){let r=new Set,n=[],i=e=>{e&&!r.has(e)&&(r.add(e),n.push(e))};return t&&py.forEach(i),e.forEach(i),n}function px(e,t){let r=e.split("/");for(let n of t)if(pw(n)){if(r.includes(n))return!0}else if((function(e){let t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return RegExp(`^${t}$`)})(n).test(e))return!0;return!1}async function p$(e,t,r,n){let i,o=0,a=[];try{i=await (0,c.readdir)(e)}catch{return{path:t||".",bytes:0,children:a}}for(let s of i){let i,l=t?`${t}/${s}`:s;if(px(l,r))continue;let u=(0,d.join)(e,s);try{i=await (0,c.stat)(u)}catch{continue}let f=`${String(i.dev)}:${String(i.ino)}`;if(!n.has(f))if(n.add(f),i.isDirectory()){let e=await p$(u,l,r,n);o+=e.bytes,a.push(e)}else i.isFile()&&(o+=i.size)}return{path:t||".",bytes:o,children:a}}async function pS(e,t,r={}){let n=await (0,c.stat)(e);if(!n.isDirectory())return{totalBytes:n.size,isDir:!1,treeLines:[],topChildren:[]};let i=await p$(e,"",t,new Set),o=r.maxDepth??3,a=r.floorBytes??0xa00000,s=r.perLevel??8,l=[],u=(e,t,r)=>{let n=" ".repeat(t);if(l.push(` ${pE(e.bytes).padStart(8)} ${n}${r}`),!(t>=o))for(let r of[...e.children].sort((e,t)=>t.bytes-e.bytes).filter(e=>e.bytes>=a).slice(0,s))u(r,t+1,`./${r.path}`)};u(i,0,"./");let d=[...i.children].sort((e,t)=>t.bytes-e.bytes).map(e=>({path:e.path,bytes:e.bytes}));return{totalBytes:i.bytes,isDir:!0,treeLines:l,topChildren:d}}function pE(e){if(e<1024)return`${String(e)} B`;let t=["KB","MB","GB","TB"],r=e/1024,n=0;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r>=10||Number.isInteger(r)?r.toFixed(0):r.toFixed(1)} ${t[n]}`}var pk=["/proc","/sys","/dev"],pT=new Set(["/etc/passwd","/etc/shadow"]);async function pD(e,t){let r=t.homeDir??(0,u.homedir)(),n=t.maxBytes??sQ.BUILT_IN_DEFAULTS.box.cpMaxBytes,i=t.projectRoot,o=t.replacements??{},a=[],s=[];for(let[t,l]of e.entries()){let e=`carry[${String(t)}]`;try{let t=await pA(l,{projectRoot:i,home:r,cap:n,where:e,replacements:o});a.push(t)}catch(e){s.push(e instanceof Error?e.message:String(e))}}return{entries:a,errors:s}}async function pA(e,t){let r,n,i=function(e,t){if(e.startsWith("~/"))return(0,d.resolve)(t.home,e.slice(2));if(e.startsWith("./"))return(0,d.resolve)(t.projectRoot,e.slice(2));if((0,d.isAbsolute)(e))return(0,d.resolve)(e);throw Error(`${t.where}: src "${e}" must start with /, ~/, or ./`)}(e.src,t);if(o=i,(0,d.normalize)(o).split("/").some(e=>".."===e))throw Error(`${t.where}: resolved src "${i}" contains .. \u2014 refused`);var o,a=e.dest,s=t;if(0===a.length)throw Error(`${s.where}.dest must not be empty`);if(!a.startsWith("/")&&!a.startsWith("~/"))throw Error(`${s.where}.dest "${a}" must start with / or ~/`);if((a.startsWith("~/")?a.slice(2):a.slice(1)).split("/").some(e=>".."===e))throw Error(`${s.where}.dest "${a}" contains .. \u2014 refused`);if(pT.has(a))throw Error(`${s.where}.dest "${a}" is on the denylist`);for(let e of pk)if(a===e||a.startsWith(`${e}/`))throw Error(`${s.where}.dest "${a}" is on the denylist (prefix ${e})`);let l=e.optional,u=e.src,f=e.dest,p=e.dest,h=!!(e.replaceEnvs||e.replace||e.rules),m=[...(0,s2.resolveRuleRefs)(e.rules??[],t.replacements,`${t.where}.rules`),...e.replace??[]],g={...e.replaceEnvs?{replaceEnvs:!0}:{},...m.length>0?{replace:m}:{}};try{r=await (0,c.stat)(i)}catch(r){if("ENOENT"===r.code){if(l)return{rawSrc:u,rawDest:f,absSrc:i,absDest:p,kind:"missing",...void 0!==e.mode?{mode:e.mode}:{},...void 0!==e.user?{user:e.user}:{},optional:!0};throw Error(`${t.where}: host src "${i}" does not exist (use optional: true to skip)`)}throw r}try{let e=await (0,c.realpath)(i);if(e!==i){let r=await (0,s2.realpathSafe)(t.home),i=await (0,s2.realpathSafe)(t.projectRoot);n=(0,s2.isInside)(e,r)||(0,s2.isInside)(e,i)?"safe":"outside-home"}}catch{}if(r.isDirectory()){if(h)throw Error(`${t.where}: replaceEnvs/replace/rules are file-only (src "${i}" is a directory)`);let r=pv(e.exclude??[],!0),o=pb(r),a=await pO(i,t.cap,r);if(a>t.cap)throw Error(`${t.where}: dir "${i}" exceeds ${String(t.cap)} bytes after excludes (add carry exclude: patterns, raise box.cpMaxBytes, or narrow the path)`);return{rawSrc:u,rawDest:f,absSrc:i,absDest:p,kind:"dir",bytes:a,...void 0!==e.mode?{mode:e.mode}:{},...void 0!==e.user?{user:e.user}:{},...o.length>0?{exclude:o}:{},optional:l,...n?{symlinkInfo:n}:{}}}if(r.isFile()){if(r.size>t.cap)throw Error(`${t.where}: file "${i}" is ${String(r.size)} bytes, exceeds cap ${String(t.cap)} (raise box.cpMaxBytes)`);return{rawSrc:u,rawDest:f,absSrc:i,absDest:p,kind:"file",bytes:r.size,...void 0!==e.mode?{mode:e.mode}:{},...void 0!==e.user?{user:e.user}:{},optional:l,...n?{symlinkInfo:n}:{},...g}}throw Error(`${t.where}: src "${i}" is neither a regular file nor a directory`)}async function pO(t,r,n=[]){let i=0,o=new Set;async function a(s){let l;if(i>r)return;let{readdir:u}=await e.A(60815);try{l=await u(s)}catch{return}for(let e of l){let l;if(i>r)return;let u=(0,d.join)(s,e),f=(0,d.relative)(t,u).split(/[\\/]/).join("/");if(n.length>0&&px(f,n))continue;try{l=await (0,c.stat)(u)}catch{continue}let p=`${String(l.dev)}:${String(l.ino)}`;if(!o.has(p)){if(o.add(p),l.isDirectory())await a(u);else if(l.isFile()&&(i+=l.size)>r)return}}}return await a(t),i}var pC="carry",pj="carry-grant",pP="Set AGENTBOX_CARRY_YES=1 to allow the copy, or AGENTBOX_CARRY=skip to skip it.";function pI(e){let t=e.map(p_),r=t.reduce((e,t)=>e+(t.bytes??0),0);return{id:(0,s2.promptId)(pC,t),topic:pC,kind:"select",heading:"Copy files",title:"Copy these files into the box?",choices:[{value:"approve",label:"Copy"},{value:"skip-this-run",label:"Skip"},{value:"cancel",label:"Cancel",danger:!0}],defaultValue:"approve",detail:{type:"file-table",summary:pL(t),rows:t,totalBytes:r},required:!0,fallback:{value:"cancel",reason:"nobody was there to approve the copy"},nonInteractiveHint:pP}}function pR(e){let t=e.map(e=>{let t=p_(e);return{src:t.src,dest:t.dest,kind:t.kind,...void 0!==t.mode?{mode:t.mode}:{},...void 0!==t.user?{user:t.user}:{},flags:t.flags,...t.warn?{warn:t.warn}:{},...e.exclude?.length?{exclude:e.exclude}:{},...e.replaceEnvs?{replaceEnvs:!0}:{},...e.replace?.length?{replace:e.replace}:{}}});return(0,s2.promptId)(pj,t)}async function pB(e){var t;let r=e.onLog??(()=>{});if(0===e.items.length)return{decision:"approve",entries:[]};let n=await pD(e.items,{projectRoot:e.projectRoot,...void 0!==e.maxBytes?{maxBytes:e.maxBytes}:{},...e.replacements?{replacements:e.replacements}:{}});if(n.errors.length>0)throw Error(["carry: these files can't be copied:",...n.errors.map(e=>` - ${e}`)].join("\n"));if(e.carrySkip)return pN(n.entries.length,r);let i=pR(n.entries);if(e.carryYes)return{decision:"approve",entries:n.entries,grantId:i};if(!e.carryAsk&&e.approvedGrantId===i){let e=n.entries.length;return r(`carry: approved earlier for this project (${String(e)} ${1===e?"file":"files"}, list unchanged)`),{decision:"approve",entries:n.entries,grantId:i,fromGrant:!0}}let o=pI(n.entries),a=await e.ask(o),s=a.cancelled?"cancel":"approve"===(t=a.value)||"skip-this-run"===t||"cancel"===t?a.value:"cancel";return"cancel"===s?{decision:"cancel",asked:!0}:"skip-this-run"===s?pN(n.entries.length,r,!0):{decision:"approve",entries:n.entries,grantId:i,asked:!0}}function pN(e,t,r=!1){return t(`carry: skipped (${String(e)} ${1===e?"file":"files"} not copied)`),{decision:"skip",entries:[],...r?{asked:!0}:{}}}function p_(e){let t=[];return"missing"===e.kind?t.push("not on this machine"):e.optional&&t.push("optional"),"dir"===e.kind&&t.push("folder"),"outside-home"===e.symlinkInfo&&t.push("shortcut to somewhere else"),{src:e.rawSrc,dest:e.rawDest,..."missing"===e.kind?{}:{bytes:e.bytes??0},kind:e.kind,...void 0!==e.mode?{mode:e.mode.toString(8).padStart(4,"0")}:{},...void 0!==e.user?{user:e.user}:{},flags:t,..."outside-home"===e.symlinkInfo?{warn:!0}:{}}}function pL(e){if(0===e.length)return"";let t=Math.max(3,...e.map(e=>e.src.length)),r=Math.max(4,...e.map(e=>e.dest.length)),n=[`${pU("from",t)} -> ${pU("to",r)} size notes`];for(let i of e){let e=[...i.flags];void 0!==i.mode&&e.push(`mode ${i.mode}`),void 0!==i.user&&e.push(`user ${String(i.user)}`);let o="missing"===i.kind?"-":function(e){if(e<1024)return`${String(e)} B`;let t=["KB","MB","GB","TB"],r=e/1024,n=0;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r<10?r.toFixed(1):String(Math.round(r))} ${t[n]}`}(i.bytes??0);n.push(`${pU(i.src,t)} -> ${pU(i.dest,r)} ${pU(o,9)} ${e.join(", ")}`)}return n.join("\n")}function pU(e,t){return e.length>=t?e:e+" ".repeat(t-e.length)}var pM="model-auth",pF="modelAuth",pG="none";function pH(e){return{value:e.id,source:"agent"===e.kind?"file":"env",label:e.label,...e.provider?{provider:e.provider}:{},...e.caveat?{caveat:e.caveat}:{},...e.hostPath?{hostPath:e.hostPath}:{},...e.boxPath?{boxPath:e.boxPath}:{},...void 0!==e.bytes?{bytes:e.bytes}:{},...e.envVar?{envVar:e.envVar}:{}}}function pW(e,t){let r=(0,s2.promptId)(pM,{agent:e,sources:t.map(e=>({id:e.id,hostPath:e.hostPath,envVar:e.envVar}))}),n=[...t.map(e=>({value:e.id,label:e.label,...e.caveat??e.provider?{hint:e.caveat??e.provider}:{}})),{value:pG,label:"None"}],i=t[0];return{id:r,topic:pM,kind:"select",heading:"Model provider",title:"Which login should this box use as its model provider?",choices:n,defaultValue:i?i.id:pG,detail:1===t.length&&i?.kind==="agent"?{type:"credential",summary:`${i.hostPath??""} -> ${i.boxPath??""}`,agent:i.id,label:i.label,...i.caveat?{caveat:i.caveat}:{},hostPath:i.hostPath??"",boxPath:i.boxPath??"",...void 0!==i.bytes?{bytes:i.bytes}:{}}:{type:"credential-list",summary:t.map(e=>"agent"===e.kind?`${e.label}
70
+ fi`}function fR(e){let t=e.indexOf("\n"),r=t>=0?e.slice(0,t):e,n=t>=0?e.slice(t+1):"";if("MODE=git"!==r&&"MODE=exclude"!==r)throw Error(`workspace file list: unexpected mode marker ${JSON.stringify(r)}`);let i=n.split("\0").filter(e=>e.length>0).map(e=>e.startsWith("./")?e.slice(2):e);return{mode:"MODE=git"===r?"git":"exclude",fileList:i.join("\0"),paths:i}}function fB(e,t){let r=e.split("/"),n=r[r.length-1]??"";for(let i of t){let t=i.replace(/^\.\//,"").replace(/\/+$/,"");if(0!==t.length){if(t.includes("*")){if(RegExp(`^${t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")}$`).test(n))return!0;continue}if(t.includes("/")){if(e===t||e.startsWith(`${t}/`))return!0;continue}if(r.includes(t))return!0}}return!1}function fN(e){let t=[];for(let r of e.split("\n")){let e=r.trimEnd();if(0===e.length)continue;let n=e.slice(0,-1===e.indexOf(" ")?e.length:e.indexOf(" ")),i=e[1],o=e[0];if(">"!==o&&"<"!==o&&"c"!==o&&"*"!==o||"d"===i)continue;let a=e.slice(n.length).trimStart(),s=a.indexOf(" -> "),l=-1===s?a:a.slice(0,s),c=n.slice(2),u=(">"===o||"<"===o||"c"===o)&&"f"===i&&c.length>0&&[...c].every(e=>"+"===e);t.push({raw:e,code:n,path:l,created:u})}return t}function f_(e){return fN(e).map(e=>e.raw)}function fL(e){if(!e)return[];let t=uN.filter(t=>t.id===e),r=new Set;for(let e of t)for(let t of e.clone?.drop??[])r.add(t);return[...r].sort()}function fU(e,t){return t.includes(e)}async function fM(e,t){let r=[];for(let n=0;n<t.length;n+=64){let i=t.slice(n,n+64);for(let t of(await Promise.all(i.map(async t=>{try{return await (0,c.lstat)((0,d.join)(e,t)),t}catch{return null}}))))null!==t&&r.push(t)}return r}async function fF(e){let t=["-a","--checksum"];if(null===e.fileList)for(let r of e.excludes??[])t.push(`--exclude=${r}`);else t.push("--files-from=-","--from0");let r=`${e.scratchDir}/`,n=`${e.destDir}/`,i=[],o=null!==e.fileList?e.fileList:void 0;if(null!==e.fileList){let t=e.fileList.split("\0").filter(e=>e.length>0),r=new Set(e.skipPaths??[]),n=t.filter(e=>!r.has(e)),a=await fM(e.scratchDir,n);if(i=n.filter(e=>!a.includes(e)),0===a.length&&n.length>0)throw Error(`none of the ${String(n.length)} selected file(s) are in the staged copy at ${e.scratchDir} \u2014 the staging is stale or empty; re-run without --no-refresh`);o=a.join("\0")}let a=await sX("rsync",[...t,"--dry-run","-i",r,n],{reject:!1,input:o});if(0!==a.exitCode)throw Error(`rsync dry-run failed: ${a.stderr||a.stdout}`);let s=f_(a.stdout);if(e.dryRun)return{changes:s,applied:!1,missing:i};let l=await sX("rsync",[...t,r,n],{reject:!1,input:o});if(0!==l.exitCode)throw Error(`rsync into ${e.destDir} failed: ${l.stderr||l.stdout}`);return{changes:s,applied:!0,missing:i}}async function fG(e){let t=e.onLog??(()=>{}),r=await fH(e.hostDir,e.excludes);if(0===r.length)return t("sync: nothing to push (host workspace is empty or fully excluded)"),{copied:[],skipped:[],identical:0,empty:!0};let n=await e.ports.probeBoxTokens(r),i=[],o=[],a=0;for(let t of r){let r;try{r=(0,s0.createHash)("sha256").update(await (0,c.readFile)((0,d.join)(e.hostDir,t))).digest("hex")}catch{continue}let s=d2(n.get(t),r);"copy"===s?i.push(t):"conflict"===s?o.push(t):a+=1}if(i.length>0){let t=await sX("tar",["-C",e.hostDir,"--null","-T","-","-cf","-"],{input:i.join("\0"),encoding:"buffer",reject:!1,env:{...process.env,COPYFILE_DISABLE:"1"}});if(0!==t.exitCode)throw Error(`tar of ${e.hostDir} failed`);await e.ports.applyTarToBox(t.stdout)}return t(`sync: ${String(i.length)} copied, ${String(a)} unchanged, ${String(o.length)} kept by the box`),{copied:i,skipped:o,identical:a,empty:!1}}async function fH(e,t){let r=fI({workspaceDir:e,respectGitignore:!1,excludes:t}),n=await sX("bash",["-c",r],{reject:!1});if(0!==n.exitCode)throw Error(`listing ${e} failed: ${n.stderr||n.stdout}`);return fR(n.stdout).paths}var fW="/tmp/agentbox-workspace-xfer.tar";function fV(e){return 0===e.length?"":`${e.join("\0")}\0`}function fX(e,t=49152){let r=[],n=[],i=0;for(let o of e){let e=Buffer.byteLength(o,"utf8")+1;n.length>0&&i+e>t&&(r.push(n),n=[],i=0),n.push(o),i+=e}return n.length>0&&r.push(n),r}function fK(e){return`'${e.replace(/'/g,"'\\''")}'`}function fz(e,t){let r=async(r,n)=>e.exec(t,["bash","-c",r],n?.asRoot?{user:"root"}:void 0);return{run:r,async pushTar(n,i){if(!e.uploadPath)throw Error(`provider '${e.name}' cannot upload files into a box`);let o=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-xfer-")),a=(0,d.join)(o,"payload.tar");try{await (0,c.writeFile)(a,i),await e.uploadPath(t,[a],fW);let o=await r(`set -e
71
+ tar -C ${fK(n)} -xf ${fK(fW)}
72
+ rm -f ${fK(fW)}`);if(0!==o.exitCode)throw Error(`extract into ${n} failed: ${o.stderr||o.stdout}`)}finally{await (0,c.rm)(o,{recursive:!0,force:!0})}},async pullTar(n,i){if(!e.downloadPath)throw Error(`provider '${e.name}' cannot download files from a box`);let o=fX(i),a=await r(`rm -f ${fK(fW)}`);if(0!==a.exitCode)throw Error(`clearing ${fW} failed: ${a.stderr||a.stdout}`);let s=!1;for(let e of o){let t=Buffer.from(fV(e)).toString("base64"),i=await r(`set -e
73
+ printf %s ${fK(t)} | base64 -d | tar -C ${fK(n)} --null -T - ${s?"-rf":"-cf"} ${fK(fW)}`);if(0!==i.exitCode)throw Error(`packing ${n} failed: ${i.stderr||i.stdout}`);s=!0}if(!s){let e=await r(`tar -C ${fK(n)} --null -T /dev/null -cf ${fK(fW)}`);if(0!==e.exitCode)throw Error(`packing ${n} failed: ${e.stderr||e.stdout}`)}let l=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-xfer-")),f=(0,d.join)(l,"payload.tar");try{await e.downloadPath(t,[fW],f);let n=await (0,c.readFile)(f);return await r(`rm -f ${fK(fW)}`).catch(()=>void 0),n}finally{await (0,c.rm)(l,{recursive:!0,force:!0})}}}}var fJ=class extends Error{constructor(e){super(e),this.name="BoxProbeError"}};function fq(e,t){return{async probeBoxTokens(r){let n=new Map;if(0===r.length)return n;for(let i of fX(r)){let r=Buffer.from(fV(i)).toString("base64"),o=`printf %s ${fK(r)} | base64 -d | ( cd ${fK(t)} && while IFS= read -r -d '' f; do if [ -f "$f" ] && [ ! -L "$f" ]; then printf '%s\\0%s\\0' "$(sha256sum < "$f" | cut -d' ' -f1)" "$f"; elif [ -e "$f" ] || [ -L "$f" ]; then printf '%s\\0%s\\0' ${fK("-")} "$f"; fi; done )`,a=await e.run(o,{asRoot:!0});if(0!==a.exitCode)throw new fJ(`could not read ${t} in the box (exit ${String(a.exitCode)}): ${a.stderr||a.stdout||"no output"}
74
+ Refusing to sync: without the box's file list every host file would look new and overwrite the box's version.`);let s=a.stdout.split("\0").filter(e=>e.length>0);for(let e=0;e+1<s.length;e+=2){let t=s[e],r=s[e+1];void 0!==t&&void 0!==r&&n.set(r,t)}}return n},applyTarToBox:r=>e.pushTar(t,r)}}function fY(e){return`'${e.replace(/'/g,"'\\''")}'`}function fZ(e){return(0,d.join)((0,d.dirname)(e),"pull-filelist.json")}async function fQ(e){let t=e.boxWorkspaceDir??"/workspace",r=fz(e.provider,e.box),n=fC({includeNodeModules:e.includeNodeModules}),i=await r.run(fI({workspaceDir:t,respectGitignore:e.respectGitignore,excludes:n,includeNodeModules:e.includeNodeModules}),{asRoot:!0});if(0!==i.exitCode)throw Error(`listing ${t} in the box failed: ${i.stderr||i.stdout}`);let o=fR(i.stdout),a=e.dropExcludedInGitMode?fL(e.agent):[],s="git"===o.mode&&e.dropExcludedInGitMode?o.paths.filter(e=>!fB(e,n)):o.paths,l=new Set(a.length>0?s.filter(e=>!fU(e,a)):s);if(e.envPatterns&&e.envPatterns.length>0){let n=dF(e.envPatterns).map(fY).join(" "),i=await r.run(`cd ${fY(t)} 2>/dev/null || exit 0
75
+ ${n}`,{asRoot:!0});if(0===i.exitCode)for(let e of i.stdout.split("\0"))0!==e.length&&l.add(e.startsWith("./")?e.slice(2):e)}await (0,c.rm)(e.scratchDir,{recursive:!0,force:!0}),await (0,c.mkdir)(e.scratchDir,{recursive:!0});let u=[...l];if(u.length>0){let n=await r.pullTar(t,u),i=await sX("tar",["-xf","-","-C",e.scratchDir],{input:n,reject:!1});if(0!==i.exitCode)throw Error(`extracting the box workspace failed: ${i.stderr}`)}let d={scratchDir:e.scratchDir,fileList:u.length>0?u.join("\0"):null,mode:o.mode};return!1!==e.writeSidecar&&await (0,c.writeFile)(fZ(e.scratchDir),JSON.stringify({mode:d.mode,paths:u}),"utf8"),d}async function f0(e){try{let t=JSON.parse(await (0,c.readFile)(fZ(e),"utf8")),r=t.paths??[];return{scratchDir:e,fileList:r.length>0?r.join("\0"):null,mode:"git"===t.mode?"git":"exclude"}}catch{return null}}async function f1(e){let t=e.noRefresh?await f0(e.scratchDir)??await fQ(e):await fQ(e),{changes:r,applied:n,missing:i}=await fF({scratchDir:t.scratchDir,destDir:e.destDir,fileList:t.fileList,excludes:fC({includeNodeModules:e.includeNodeModules}),dryRun:e.dryRun,skipPaths:e.skipPaths});return{hostPath:e.destDir,changes:r,applied:n,usedGitignore:"git"===t.mode,missing:i}}async function f2(e){let t;try{t=await (0,c.lstat)(e)}catch(t){if("ENOENT"===t.code)return;throw Error(`cannot use ${e} as a destination: ${t.message}`)}if(t.isSymbolicLink())throw Error(`${e} is a symlink; pick a real directory (the export would replace the link, not its target)`);if(!t.isDirectory())throw Error(`${e} exists and is not a directory; pick another destination`);if((await (0,c.readdir)(e)).length>0)throw Error(`${e} is not empty; pick another destination or empty it first`)}async function f4(e){let t=e.onLog??(()=>{});await f2(e.destDir),t(`exporting ${e.box.name}:/workspace to ${e.destDir}`);let r=await fQ({provider:e.provider,box:e.box,boxWorkspaceDir:e.boxWorkspaceDir,scratchDir:e.destDir,includeNodeModules:e.includeNodeModules,dropExcludedInGitMode:!0,writeSidecar:!1,...!1===e.dropAgentScaffolding?{}:{agent:e.agent}}),n=null===r.fileList?0:r.fileList.split("\0").length;return t(`exported ${String(n)} file(s)${"git"===r.mode?"":" (exclude-list mode)"}`),{destDir:e.destDir,files:n,usedGitignore:"git"===r.mode}}async function f3(e){let t=e.onLog??(()=>{}),r=e.boxWorkspaceDir??"/workspace";if((await lg(e.box.workspacePath)).length>0){if(!e.provider.resyncWorkspace)throw Error(`provider '${e.provider.name}' cannot resync a git workspace into a live box`);t("syncing git workspace (merge host branch + overlay uncommitted/untracked)");let r=await e.provider.resyncWorkspace(e.box,t);return{mode:"git",conflicts:r.repos.flatMap(e=>[...e.mergeConflicts,...e.overlaySkipped]),copied:0,repos:r.repos}}t("syncing non-git workspace (file overlay; the box wins on conflict)");let n=fz(e.provider,e.box),i=await fG({hostDir:e.box.workspacePath,excludes:fC({includeNodeModules:e.includeNodeModules}),ports:fq(n,r),onLog:t});return{mode:"files",conflicts:i.skipped,copied:i.copied.length}}var f8="/home/vscode/.claude/workflows",f6=`${dY}/memory`;async function f5(e){try{return await (0,c.stat)(e),!0}catch{return!1}}async function f9(e,t=""){let r;try{r=await (0,c.readdir)(e,{withFileTypes:!0})}catch{return[]}let n=[];for(let i of r){let r=t?`${t}/${i.name}`:i.name,o=(0,d.join)(e,i.name);if(i.isDirectory())n.push(...await f9(o,r));else if(i.isFile())n.push(r);else if(i.isSymbolicLink())try{(await (0,c.stat)(o)).isFile()&&n.push(r)}catch{}}return n}async function f7(e){let t=await (0,c.readFile)(e);return(0,s0.createHash)("sha256").update(t).digest("hex")}async function pe(e,t,r){if(null===t)return{dst:r,files:{},hostDir:null};let n=await f9(t),i={};for(let e of n)i[e]=await f7((0,d.join)(t,e));return{dst:r,files:i,hostDir:t}}async function pt(e,t=(0,u.homedir)()){let r=(0,d.join)(t,".claude","workflows"),n=await f5(r)?r:null,i=await dZ(e,t),[o,a]=await Promise.all([pe("workflows",n,f8),pe("memory",i,f6)]);return{sets:{workflows:o,memory:a}}}var pr=["workflows","memory"];async function pn(e){if(0===e.length)return{tarballPath:null,cleanup:async()=>{}};let t=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-dynsync-stage-")),r=null;try{for(let r of e){let e=(0,d.join)(t,r.set,r.rel);await (0,c.mkdir)((0,d.dirname)(e),{recursive:!0}),await (0,c.copyFile)(r.absSrc,e)}r=(0,d.join)((0,u.tmpdir)(),`agentbox-dynsync-${(0,d.basename)(t)}.tar.gz`),await sX("tar",["-czf",r,"-C",t,"."],{env:{...process.env,COPYFILE_DISABLE:"1"}});let n=r;return{tarballPath:n,cleanup:async()=>{await (0,c.rm)(t,{recursive:!0,force:!0}),await (0,c.rm)(n,{force:!0})}}}catch(e){throw await (0,c.rm)(t,{recursive:!0,force:!0}),r&&await (0,c.rm)(r,{force:!0}),e}}async function pi(e){try{return await (0,c.stat)(e),!0}catch{return!1}}async function po(e){return dQ(e,["/"])}async function pa(e){return(0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),`agentbox-${e}-stage-`))}var ps="--chmod=Du+rwx,Fu+rw",pl="--no-D";function pc(e=[]){return{tarballPath:null,cleanup:async()=>{},warnings:e}}async function pu(e,t){let r=(0,d.join)((0,u.tmpdir)(),`agentbox-${t}-${(0,d.basename)(e)}.tar.gz`);return await sX("tar",["-czf",r,"-C",e,"."],{env:{...process.env,COPYFILE_DISABLE:"1"}}),r}function pd(e){return async()=>{for(let t of e)await (0,c.rm)(t,{recursive:!0,force:!0})}}async function pf(e,t,r){let n=await pa(e),i=null;try{return await (0,c.copyFile)(t,(0,d.join)(n,r)),{tarballPath:i=await pu(n,e),cleanup:pd([n,i]),warnings:[]}}catch(e){throw await (0,c.rm)(n,{recursive:!0,force:!0}),i&&await (0,c.rm)(i,{force:!0}),e}}async function pp(e,t={}){let r=u_(e),n=t.hostHome??(0,u.homedir)(),i=r.staticPaths.filter(e=>(e.stagedAs??"static")==="static"),o=[];for(let e of i){let t=(0,d.join)(n,...e.hostHomeRel);await pi(t)&&o.push({path:e,hostPath:t})}if(0===o.length)return pc();let a=t.target??"snapshot",s=[],l=await pa(`${r.id}-static`),f=null;try{for(let{path:e,hostPath:t}of o){let n=e.relocToSubpath?(0,d.join)(l,e.relocToSubpath):l,i=await po(t);for(let e of i)s.push(`${r.id}: skipped ${(0,d.join)(t,e)} \u2014 it is a broken symlink on this host`);await sX("rsync",["-a",ps,pl,"-L",...i.map(e=>`--exclude=/${e}`),...(e.include??[]).map(e=>`--include=${e}`),...(0,s3.agentPushExcludes)(r,e,a).map(e=>`--exclude=${e}`),`${t}/`,`${n}/`])}return{tarballPath:f=await pu(l,`${r.id}-static`),cleanup:pd([l,f]),warnings:s}}catch(e){throw await (0,c.rm)(l,{recursive:!0,force:!0}),f&&await (0,c.rm)(f,{force:!0}),e}}async function ph(e={}){let t=e.hostHome??(0,u.homedir)(),r=(0,d.join)(t,".agents");if(!await pi(r))return pc();let n=await pa("agents-static"),i=null;try{let e=await po(r);return await sX("rsync",["-a",ps,pl,"-L",...e.map(e=>`--exclude=/${e}`),`${r}/`,`${n}/`]),{tarballPath:i=await pu(n,"agents-static"),cleanup:pd([n,i]),warnings:[]}}catch(e){throw await (0,c.rm)(n,{recursive:!0,force:!0}),i&&await (0,c.rm)(i,{force:!0}),e}}function pm(e){if(!/^[A-Za-z0-9._-]+$/.test(e))throw Error(`invalid provider name for prepared-state: ${JSON.stringify(e)}`);return(0,d.resolve)((0,u.homedir)(),".agentbox",`${e}-prepared.json`)}async function pg(e){let t=await (0,c.readFile)(e);return(0,s0.createHash)("sha256").update(t).digest("hex")}async function py(e){return(await pw(e)).contextSha256}async function pw(e){let t=[...e].sort((e,t)=>e.rel<t.rel?-1:+(e.rel>t.rel)),r=(0,s0.createHash)("sha256"),n={};for(let e of t){let t=await pg(e.abs);n[e.rel]=t,r.update(`${e.rel}\0${t}
76
+ `)}return{contextSha256:r.digest("hex"),files:n}}function pb(e){return[...new Set((e??[]).map(e=>e.trim()).filter(e=>e.length>0))].sort()}function pv(e){return pb(e).join(",")}function px(e){if(!e)return[];let t=[];for(let[r,n]of Object.entries(e)){let e=uL(r);for(let i of e?.settings??[]){if(!i.affectsBake)continue;let e=n[i.key];void 0!==e&&e!==i.default&&t.push(`${r}.${i.key}=${String(e)}`)}}return t.sort()}var p$="ghcr.io/madarco/agentbox/box";function pS(e){let t=e.trim();if(0===t.length)return null;let r=null,n=/^[^@/\s]+@[^:/\s]+:(.+)$/.exec(t);if(n)r=n[1];else try{r=function(e){try{return decodeURIComponent(e)}catch{return e}}(new URL(t).pathname)}catch{return null}let i=r.replace(/\.git\/?$/,"").split("/").filter(e=>e.length>0);if(i.length<2)return null;let o=i[i.length-2],a=i[i.length-1];return 0===o.length||0===a.length?null:{owner:o,repo:a}}var pE="agentbox-hub-worker-",pk=[".git","node_modules","bin","obj","packages","dist",".next","target"];function pT(e){return!e.includes("/")&&!e.includes("*")&&!e.includes("?")}function pD(e){let t=[];for(let r of e)pT(r)?t.push(`*/${r}`,r):t.push(r);return t}function pA(e,t){let r=new Set,n=[],i=e=>{e&&!r.has(e)&&(r.add(e),n.push(e))};return t&&pk.forEach(i),e.forEach(i),n}function pO(e,t){let r=e.split("/");for(let n of t)if(pT(n)){if(r.includes(n))return!0}else if((function(e){let t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return RegExp(`^${t}$`)})(n).test(e))return!0;return!1}async function pP(e,t,r,n){let i,o=0,a=[];try{i=await (0,c.readdir)(e)}catch{return{path:t||".",bytes:0,children:a}}for(let s of i){let i,l=t?`${t}/${s}`:s;if(pO(l,r))continue;let u=(0,d.join)(e,s);try{i=await (0,c.stat)(u)}catch{continue}let f=`${String(i.dev)}:${String(i.ino)}`;if(!n.has(f))if(n.add(f),i.isDirectory()){let e=await pP(u,l,r,n);o+=e.bytes,a.push(e)}else i.isFile()&&(o+=i.size)}return{path:t||".",bytes:o,children:a}}async function pC(e,t,r={}){let n=await (0,c.stat)(e);if(!n.isDirectory())return{totalBytes:n.size,isDir:!1,treeLines:[],topChildren:[]};let i=await pP(e,"",t,new Set),o=r.maxDepth??3,a=r.floorBytes??0xa00000,s=r.perLevel??8,l=[],u=(e,t,r)=>{let n=" ".repeat(t);if(l.push(` ${pj(e.bytes).padStart(8)} ${n}${r}`),!(t>=o))for(let r of[...e.children].sort((e,t)=>t.bytes-e.bytes).filter(e=>e.bytes>=a).slice(0,s))u(r,t+1,`./${r.path}`)};u(i,0,"./");let d=[...i.children].sort((e,t)=>t.bytes-e.bytes).map(e=>({path:e.path,bytes:e.bytes}));return{totalBytes:i.bytes,isDir:!0,treeLines:l,topChildren:d}}function pj(e){if(e<1024)return`${String(e)} B`;let t=["KB","MB","GB","TB"],r=e/1024,n=0;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r>=10||Number.isInteger(r)?r.toFixed(0):r.toFixed(1)} ${t[n]}`}var pI=["/proc","/sys","/dev"],pR=new Set(["/etc/passwd","/etc/shadow"]);async function pB(e,t){let r=t.homeDir??(0,u.homedir)(),n=t.maxBytes??sQ.BUILT_IN_DEFAULTS.box.cpMaxBytes,i=t.projectRoot,o=t.replacements??{},a=[],s=[];for(let[t,l]of e.entries()){let e=`carry[${String(t)}]`;try{let t=await pN(l,{projectRoot:i,home:r,cap:n,where:e,replacements:o});a.push(t)}catch(e){s.push(e instanceof Error?e.message:String(e))}}return{entries:a,errors:s}}async function pN(e,t){let r,n,i=function(e,t){if(e.startsWith("~/"))return(0,d.resolve)(t.home,e.slice(2));if(e.startsWith("./"))return(0,d.resolve)(t.projectRoot,e.slice(2));if((0,d.isAbsolute)(e))return(0,d.resolve)(e);throw Error(`${t.where}: src "${e}" must start with /, ~/, or ./`)}(e.src,t);if(o=i,(0,d.normalize)(o).split("/").some(e=>".."===e))throw Error(`${t.where}: resolved src "${i}" contains .. \u2014 refused`);var o,a=e.dest,s=t;if(0===a.length)throw Error(`${s.where}.dest must not be empty`);if(!a.startsWith("/")&&!a.startsWith("~/"))throw Error(`${s.where}.dest "${a}" must start with / or ~/`);if((a.startsWith("~/")?a.slice(2):a.slice(1)).split("/").some(e=>".."===e))throw Error(`${s.where}.dest "${a}" contains .. \u2014 refused`);if(pR.has(a))throw Error(`${s.where}.dest "${a}" is on the denylist`);for(let e of pI)if(a===e||a.startsWith(`${e}/`))throw Error(`${s.where}.dest "${a}" is on the denylist (prefix ${e})`);let l=e.optional,u=e.src,f=e.dest,p=e.dest,h=!!(e.replaceEnvs||e.replace||e.rules),m=[...(0,s3.resolveRuleRefs)(e.rules??[],t.replacements,`${t.where}.rules`),...e.replace??[]],g={...e.replaceEnvs?{replaceEnvs:!0}:{},...m.length>0?{replace:m}:{}};try{r=await (0,c.stat)(i)}catch(r){if("ENOENT"===r.code){if(l)return{rawSrc:u,rawDest:f,absSrc:i,absDest:p,kind:"missing",...void 0!==e.mode?{mode:e.mode}:{},...void 0!==e.user?{user:e.user}:{},optional:!0};throw Error(`${t.where}: host src "${i}" does not exist (use optional: true to skip)`)}throw r}try{let e=await (0,c.realpath)(i);if(e!==i){let r=await (0,s3.realpathSafe)(t.home),i=await (0,s3.realpathSafe)(t.projectRoot);n=(0,s3.isInside)(e,r)||(0,s3.isInside)(e,i)?"safe":"outside-home"}}catch{}if(r.isDirectory()){if(h)throw Error(`${t.where}: replaceEnvs/replace/rules are file-only (src "${i}" is a directory)`);let r=pA(e.exclude??[],!0),o=pD(r),a=await p_(i,t.cap,r);if(a>t.cap)throw Error(`${t.where}: dir "${i}" exceeds ${String(t.cap)} bytes after excludes (add carry exclude: patterns, raise box.cpMaxBytes, or narrow the path)`);return{rawSrc:u,rawDest:f,absSrc:i,absDest:p,kind:"dir",bytes:a,...void 0!==e.mode?{mode:e.mode}:{},...void 0!==e.user?{user:e.user}:{},...o.length>0?{exclude:o}:{},optional:l,...n?{symlinkInfo:n}:{}}}if(r.isFile()){if(r.size>t.cap)throw Error(`${t.where}: file "${i}" is ${String(r.size)} bytes, exceeds cap ${String(t.cap)} (raise box.cpMaxBytes)`);return{rawSrc:u,rawDest:f,absSrc:i,absDest:p,kind:"file",bytes:r.size,...void 0!==e.mode?{mode:e.mode}:{},...void 0!==e.user?{user:e.user}:{},optional:l,...n?{symlinkInfo:n}:{},...g}}throw Error(`${t.where}: src "${i}" is neither a regular file nor a directory`)}async function p_(t,r,n=[]){let i=0,o=new Set;async function a(s){let l;if(i>r)return;let{readdir:u}=await e.A(60815);try{l=await u(s)}catch{return}for(let e of l){let l;if(i>r)return;let u=(0,d.join)(s,e),f=(0,d.relative)(t,u).split(/[\\/]/).join("/");if(n.length>0&&pO(f,n))continue;try{l=await (0,c.stat)(u)}catch{continue}let p=`${String(l.dev)}:${String(l.ino)}`;if(!o.has(p)){if(o.add(p),l.isDirectory())await a(u);else if(l.isFile()&&(i+=l.size)>r)return}}}return await a(t),i}var pL="carry",pU="carry-grant",pM="Set AGENTBOX_CARRY_YES=1 to allow the copy, or AGENTBOX_CARRY=skip to skip it.";function pF(e){let t=e.map(pV),r=t.reduce((e,t)=>e+(t.bytes??0),0);return{id:(0,s3.promptId)(pL,t),topic:pL,kind:"select",heading:"Copy files",title:"Copy these files into the box?",choices:[{value:"approve",label:"Copy"},{value:"skip-this-run",label:"Skip"},{value:"cancel",label:"Cancel",danger:!0}],defaultValue:"approve",detail:{type:"file-table",summary:pX(t),rows:t,totalBytes:r},required:!0,fallback:{value:"cancel",reason:"nobody was there to approve the copy"},nonInteractiveHint:pM}}function pG(e){let t=e.map(e=>{let t=pV(e);return{src:t.src,dest:t.dest,kind:t.kind,...void 0!==t.mode?{mode:t.mode}:{},...void 0!==t.user?{user:t.user}:{},flags:t.flags,...t.warn?{warn:t.warn}:{},...e.exclude?.length?{exclude:e.exclude}:{},...e.replaceEnvs?{replaceEnvs:!0}:{},...e.replace?.length?{replace:e.replace}:{}}});return(0,s3.promptId)(pU,t)}async function pH(e){var t;let r=e.onLog??(()=>{});if(0===e.items.length)return{decision:"approve",entries:[]};let n=await pB(e.items,{projectRoot:e.projectRoot,...void 0!==e.maxBytes?{maxBytes:e.maxBytes}:{},...e.replacements?{replacements:e.replacements}:{}});if(n.errors.length>0)throw Error(["carry: these files can't be copied:",...n.errors.map(e=>` - ${e}`)].join("\n"));if(e.carrySkip)return pW(n.entries.length,r);let i=pG(n.entries);if(e.carryYes)return{decision:"approve",entries:n.entries,grantId:i};if(!e.carryAsk&&e.approvedGrantId===i){let e=n.entries.length;return r(`carry: approved earlier for this project (${String(e)} ${1===e?"file":"files"}, list unchanged)`),{decision:"approve",entries:n.entries,grantId:i,fromGrant:!0}}let o=pF(n.entries),a=await e.ask(o),s=a.cancelled?"cancel":"approve"===(t=a.value)||"skip-this-run"===t||"cancel"===t?a.value:"cancel";return"cancel"===s?{decision:"cancel",asked:!0}:"skip-this-run"===s?pW(n.entries.length,r,!0):{decision:"approve",entries:n.entries,grantId:i,asked:!0}}function pW(e,t,r=!1){return t(`carry: skipped (${String(e)} ${1===e?"file":"files"} not copied)`),{decision:"skip",entries:[],...r?{asked:!0}:{}}}function pV(e){let t=[];return"missing"===e.kind?t.push("not on this machine"):e.optional&&t.push("optional"),"dir"===e.kind&&t.push("folder"),"outside-home"===e.symlinkInfo&&t.push("shortcut to somewhere else"),{src:e.rawSrc,dest:e.rawDest,..."missing"===e.kind?{}:{bytes:e.bytes??0},kind:e.kind,...void 0!==e.mode?{mode:e.mode.toString(8).padStart(4,"0")}:{},...void 0!==e.user?{user:e.user}:{},flags:t,..."outside-home"===e.symlinkInfo?{warn:!0}:{}}}function pX(e){if(0===e.length)return"";let t=Math.max(3,...e.map(e=>e.src.length)),r=Math.max(4,...e.map(e=>e.dest.length)),n=[`${pK("from",t)} -> ${pK("to",r)} size notes`];for(let i of e){let e=[...i.flags];void 0!==i.mode&&e.push(`mode ${i.mode}`),void 0!==i.user&&e.push(`user ${String(i.user)}`);let o="missing"===i.kind?"-":function(e){if(e<1024)return`${String(e)} B`;let t=["KB","MB","GB","TB"],r=e/1024,n=0;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r<10?r.toFixed(1):String(Math.round(r))} ${t[n]}`}(i.bytes??0);n.push(`${pK(i.src,t)} -> ${pK(i.dest,r)} ${pK(o,9)} ${e.join(", ")}`)}return n.join("\n")}function pK(e,t){return e.length>=t?e:e+" ".repeat(t-e.length)}var pz="model-auth",pJ="modelAuth",pq="none";function pY(e){return{value:e.id,source:"agent"===e.kind?"file":"env",label:e.label,...e.provider?{provider:e.provider}:{},...e.caveat?{caveat:e.caveat}:{},...e.hostPath?{hostPath:e.hostPath}:{},...e.boxPath?{boxPath:e.boxPath}:{},...void 0!==e.bytes?{bytes:e.bytes}:{},...e.envVar?{envVar:e.envVar}:{}}}function pZ(e,t){let r=(0,s3.promptId)(pz,{agent:e,sources:t.map(e=>({id:e.id,hostPath:e.hostPath,envVar:e.envVar}))}),n=[...t.map(e=>({value:e.id,label:e.label,...e.caveat??e.provider?{hint:e.caveat??e.provider}:{}})),{value:pq,label:"None"}],i=t[0];return{id:r,topic:pz,kind:"select",heading:"Model provider",title:"Which login should this box use as its model provider?",choices:n,defaultValue:i?i.id:pq,detail:1===t.length&&i?.kind==="agent"?{type:"credential",summary:`${i.hostPath??""} -> ${i.boxPath??""}`,agent:i.id,label:i.label,...i.caveat?{caveat:i.caveat}:{},hostPath:i.hostPath??"",boxPath:i.boxPath??"",...void 0!==i.bytes?{bytes:i.bytes}:{}}:{type:"credential-list",summary:t.map(e=>"agent"===e.kind?`${e.label}
75
77
  ${e.hostPath??""} -> ${e.boxPath??""}`:`${e.label}
76
- ${e.envVar??""}${e.provider?` (${e.provider})`:""}`).join("\n"),rows:t.map(pH)},fallback:{value:pG,reason:"not asked - the box starts without it"},nonInteractiveHint:`Use --model-auth <source|none>, or \`agentbox config set ${e}.${pF} <source>\` to decide this once.`}}function pV(e){let t=("string"==typeof e?[e]:e).flatMap(e=>(0,s2.decodeMultiAnswer)(e));if(0===t.length)return[];if(t.includes(pG)){if(t.length>1)throw Error(`--model-auth ${pG} cannot be combined with ${t.filter(e=>e!==pG).join(", ")}`);return[]}return t}async function pX(e){let{spec:t}=e;if(0===(t.modelAuth?.sources??[]).length){if(void 0!==e.flags&&pV(e.flags).length>0)throw Error(`${t.id} uses no host login \u2014 --model-auth does not apply to it`);return[]}if(void 0!==e.flags)return uF(t,pV(e.flags));let r=e.settings[pF],n="string"==typeof r?pV(r):[];if(e.configuredExplicitly||n.length>0)return uF(t,n);if(!t.modelAuth?.promptOnCreate)return[];let i=await (e.listAvailable??pK)(t);if(0===i.length)return[];let o=await e.ask(pW(t.id,i));if(o.cancelled)return[];let a=pV(o.value);return 0===a.length?[]:uF(t,a)}async function pK(t,r=process.env){let{findAgentSpec:n}=await e.A(13172),i=[];for(let e of t.modelAuth?.sources??[]){if("env"===e.kind){let t=r[e.envKey];if("string"!=typeof t||0===t.length)continue;i.push({id:(0,s2.modelAuthSourceId)(e),kind:"env",label:e.label,...e.provider?{provider:e.provider}:{},...e.caveat?{caveat:e.caveat}:{},envVar:e.envKey});continue}let t=await uU(e.agent);t&&i.push({id:(0,s2.modelAuthSourceId)(e),kind:"agent",label:e.label,...e.caveat?{caveat:e.caveat}:{},hostPath:t.path,boxPath:n(e.agent)?.credential?.boxAbsPath??"",bytes:Buffer.byteLength(t.text,"utf8")})}return i}function pz(e=s5){return(0,d.join)(e,"pty")}function pJ(e,t=s5){return(0,d.join)(pz(t),`${e}.sock`)}function pq(e,t=s5){return(0,d.join)(pz(t),`${e}.json`)}async function pY(e=s5){let t=pz(e);return await (0,c.mkdir)(t,{recursive:!0,mode:448}),await (0,c.chmod)(t,448).catch(()=>{}),t}async function pZ(e,t=s5){await pY(t);let r=pq(e.managerId,t),n=`${r}.tmp`;await (0,c.writeFile)(n,`${JSON.stringify(e,null,2)}
77
- `,{mode:384}),await (0,c.rename)(n,r)}async function pQ(e,t=s5){try{let r=await (0,c.readFile)(pq(e,t),"utf8"),n=JSON.parse(r);return 1===n.v&&"string"==typeof n.managerId?n:void 0}catch{return}}async function p0(e=s5){let t;try{t=await (0,c.readdir)(pz(e))}catch{return[]}let r=[];for(let n of t){if(!n.endsWith(".json"))continue;let t=await pQ(n.slice(0,-5),e);t&&r.push(t)}return r}async function p1(e,t=s5){await Promise.all([(0,c.rm)(pJ(e,t),{force:!0}),(0,c.rm)(pq(e,t),{force:!0})])}e.s(["AGENTBOX_HUB_SSH_ALIAS",0,lC,"AGENTS_STATIC_BOX_DIR",0,"/home/vscode/.agents","AGENT_SEED_MARKER",0,dx,"AGENT_SESSION_ENV_VARS",0,c0,"AGENT_SYNC_SPECS",0,uA,"AgentInstallError",0,dE,"BACKUP_GITIGNORE_ENTRY",0,d2,"BOTS_DIR_REL",0,d1,"BOX_CLAUDE_PROJECT_DIR",0,dH,"BOX_DYNAMIC_SYNC_MANIFEST",0,"/home/vscode/.agentbox/dynamic-sync.json","BOX_HOME",0,d_,"BOX_IMAGE_REGISTRY",0,ph,"BOX_MEMORY_DIR",0,fZ,"BOX_WORKFLOWS_DIR",0,fY,"BOX_WORKSPACE",0,cA,"BoxProbeError",0,fF,"CARRY_GRANT_TOPIC",0,pj,"CARRY_NON_INTERACTIVE_HINT",0,pP,"CARRY_TOPIC",0,pC,"CLAUDE_BOX_CONFIG_DIR",0,u4,"CLAUDE_PULL_DIR_CATEGORIES",0,u6,"CLI_RUNTIME_DIR_ENV",0,c8,"CODEX_BOX_CONFIG_DIR",0,u3,"CODEX_PULL_ITEMS",0,di,"CONTAINER_PLUGINS_PREFIX",0,uJ,"CarryCopyError",0,dM,"DEFAULT_BACKUP_KEEP",0,3,"DEFAULT_CP_EXCLUDES",0,py,"DEFAULT_ENV_PATTERNS",0,[".env",".env.*",".envrc",".dev.vars","secrets.toml","local.settings.json","appsettings.*.json","agentbox.yaml"],"DOCKER_CONTEXT_FILE_MAP",0,{"Dockerfile.box":{staged:"Dockerfile.box",dev:"Dockerfile.box"},"ctl/bin.cjs":{staged:"packages/ctl/dist/bin.cjs",dev:"../ctl/dist/bin.cjs"},"share/agentbox-setup/SKILL.md":{staged:"apps/cli/share/agentbox-setup/SKILL.md",dev:"../../apps/cli/share/agentbox-setup/SKILL.md"},"share/agentbox-identity/SKILL.md":{staged:"apps/cli/share/agentbox-identity/SKILL.md",dev:"../../apps/cli/share/agentbox-identity/SKILL.md"},"scripts/agentbox-vnc-start":{staged:"packages/sandbox-docker/scripts/agentbox-vnc-start",dev:"scripts/agentbox-vnc-start"},"scripts/agentbox-dockerd-start":{staged:"packages/sandbox-docker/scripts/agentbox-dockerd-start",dev:"scripts/agentbox-dockerd-start"},"scripts/agentbox-checkpoint-cleanup":{staged:"packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup",dev:"scripts/agentbox-checkpoint-cleanup"},"scripts/agentbox-open":{staged:"packages/sandbox-docker/scripts/agentbox-open",dev:"scripts/agentbox-open"},"scripts/custom-system-CLAUDE.md":{staged:"packages/sandbox-docker/scripts/custom-system-CLAUDE.md",dev:"scripts/custom-system-CLAUDE.md"},"scripts/claude-managed-settings.json":{staged:"packages/sandbox-docker/scripts/claude-managed-settings.json",dev:"scripts/claude-managed-settings.json"},"scripts/agentbox-codex-hooks.json":{staged:"packages/sandbox-docker/scripts/agentbox-codex-hooks.json",dev:"scripts/agentbox-codex-hooks.json"},"scripts/gh-shim":{staged:"packages/sandbox-docker/scripts/gh-shim",dev:"scripts/gh-shim"},"scripts/git-shim":{staged:"packages/sandbox-docker/scripts/git-shim",dev:"scripts/git-shim"},"scripts/agentbox-tool-shim":{staged:"packages/sandbox-docker/scripts/agentbox-tool-shim",dev:"scripts/agentbox-tool-shim"},"scripts/chromium-resolver":{staged:"packages/sandbox-docker/scripts/chromium-resolver",dev:"scripts/chromium-resolver"},"scripts/agentbox-sshd-start":{staged:"packages/sandbox-docker/scripts/agentbox-sshd-start",dev:"scripts/agentbox-sshd-start"},"scripts/agentbox-portless-trust":{staged:"packages/sandbox-docker/scripts/agentbox-portless-trust",dev:"scripts/agentbox-portless-trust"},"scripts/opencode-agentbox-plugin.js":{staged:"packages/sandbox-docker/scripts/opencode-agentbox-plugin.js",dev:"scripts/opencode-agentbox-plugin.js"},"scripts/pi-agentbox-extension.js":{staged:"packages/sandbox-docker/scripts/pi-agentbox-extension.js",dev:"scripts/pi-agentbox-extension.js"}},"ENV_PRUNE_DIRS",0,dj,"EXPOSED_HUB_PROFILE",0,lW,"FALLBACK_RELAY_PORT",0,8787,"GIT_MODE_EXCLUDE_DIRS",0,fv,"GitWorktreeError",0,lb,"HUB_TOKEN_FILE",0,un,"HUB_WORKER_CLONE_PREFIX",0,pg,"MODEL_AUTH_NONE",0,pG,"MODEL_AUTH_SETTING",0,pF,"MODEL_AUTH_TOPIC",0,pM,"NON_REGULAR_TOKEN",0,"-","OPENCODE_BOX_DATA_DIR",0,u8,"OPENCODE_PULL_CONFIG_ITEMS",0,ds,"OPENCODE_PULL_DATA_ITEMS",0,da,"OPEN_INBOUND_SOURCES",0,cT,"PLUGINS_FILE",0,lJ,"PLUGINS_FILE_VERSION",0,2,"PULL_CATEGORIES",0,["skills","plugins","agents","commands"],"RELAY_PORT_ENV",0,cH,"RUNTIME_ROOT_ENV",0,c2,"SEED_MARKER",0,".agentbox-seeded-at","SKILL_EXCLUDE_PREFIXES",0,uz,"STAGE_NO_SPECIALS",0,pe,"STAGE_WRITABLE_CHMOD",0,f7,"STATE_DIR",0,s5,"STATE_FILE",0,s9,"SUPPORTED_SDK_API_VERSIONS",0,lq,"SshTunnelManager",0,c$,"WORKSPACE_EXCLUDE_DIR_NAMES",0,fb,"addPluginRecord",0,l6,"agentBoxConfigDir",0,function(e){return u2(e)},"agentBoxDir",0,u2,"agentCloneDropPaths",0,fC,"agentIds",0,function(){return uA.map(e=>e.id)},"agentPull",0,function(e,t,r={}){let n=dZ.get(e);return n?n.pull(t,r):dh(e,t,r)},"agentPullBoxDir",0,d0,"agentSeedPlacements",0,function(e,t){let r=uO(e),n=t??r.staticPaths[0]?.boxDir;return n&&r.seeds&&0!==r.seeds.length?dv(r.seeds,n):[]},"agentSetArg",0,pf,"agentSourceIds",0,uG,"agentStateExcludePaths",0,f$,"agentTuiEnv",0,function(e,t){let r=uC(e);if(!r?.tuiEnv||!r.tuiEnvFrom)return{};let n=r.settings?.find(e=>e.key===r.tuiEnvFrom),i=t?.[r.tuiEnvFrom]??n?.default;return"string"!=typeof i?{}:{...r.tuiEnv[i]??{}}},"agentWorkspaceArtifactPaths",0,function(){let e=new Set;for(let t of uA){for(let r of t.clone?.drop??[])e.add(r);for(let r of t.clone?.render??[])e.add(r)}return[...e].sort()},"agentboxAliasFor",0,lR,"agentboxSshConfigPath",0,lA,"agentsRejectProxyHeaders",0,function(e){return(e??[]).some(e=>uC(e)?.service?.rejectsProxyHeaders===!0)},"allocateProjectIndex",0,lp,"assertEmptyDir",0,fz,"autoPickProjectBox",0,lh,"autoWriteSshConfig",0,ca,"backupAgentState",0,fo,"backupStamp",0,d4,"bakeSettingsFingerprintInput",0,pp,"basenameUnix",0,dU,"borrowedCredentialCarry",0,uH,"botBackupDir",0,d5,"botDir",0,d8,"botWorkspaceRoot",0,d6,"boxGitCheckout",0,function(e,t,r,n=[]){return cO(e,t,["git","checkout",r,...n])},"boxGitCurrentBranch",0,cj,"boxGitNewBranch",0,function(e,t,r,n){let i=["git","checkout","-b",cC(r)];return n&&n.trim()&&i.push(n.trim()),cO(e,t,i)},"boxGitPull",0,cR,"boxGitPush",0,cI,"boxGitPushHost",0,function(e,t,r={}){let n=["agentbox-ctl","git","push","--host-only"];return r.as&&n.push("--as",r.as),r.force&&n.push("--force"),n.push(...r.args??[]),cO(e,t,n)},"boxLogsArgv",0,c_,"boxLogsRaw",0,function(e,t,r,n){return cO(e,t,c_(r,{tail:n,follow:!1}))},"boxNameBasisFromOriginUrl",0,function(e){return pm(e)?.repo??null},"boxOverlayPorts",0,fG,"boxRefWithRestoreRefusal",0,function(e){return void 0===e?null:`--restore always creates a new box, so it cannot also take the box ref "${e}" \u2014 drop the ref, or name the new box with -n <name>`},"boxRestartService",0,cL,"boxRestartServices",0,cU,"boxServicesStatusRaw",0,function(e,t){return cO(e,t,cB())},"boxSshDirForProvider",0,function(e,t){let r=cE(e);return null===r?null:cS(t,r)},"boxSshNamespaceForProvider",0,cE,"buildAgentDescriptors",0,function(e={}){let t=t=>void 0===e.boxAgents||e.boxAgents.includes(t);return{schema:2,agents:uA.map(e=>{var r,n;return{id:e.id,sessionName:e.sessionName,activitySource:e.caps.activitySource,surface:e.caps.surface??"tui",...e.service&&t(e.id)?{service:(r=e.service,0===Object.keys(n=e.boxRunEnv).length?r:{...r,env:{...n,...r.env??{}},...r.tasks?{tasks:r.tasks.map(e=>({...e,env:{...n,...e.env??{}}}))}:{}})}:{},...e.configRender&&t(e.id)?{configRender:e.configRender}:{},watch:[...e.credential?[{path:e.credential.boxAbsPath,sync:"fanout",shape:e.credential.realShape}]:[],...(e.watch??[]).map(e=>({path:e.path,sync:e.sync??"backup",...e.hostDest?{hostDest:e.hostDest}:{}}))]}})}},"buildAgentSeedScript",0,function(e,t={}){return e.map(e=>{let r=[`[ -f ${d$(e.src)} ]`];for(let t of e.ancestors)r.push(`mkdir -p ${d$(t)}`);if(r.push(`cp -a ${d$(e.src)} ${d$(e.dest)}`),t.owner){for(let n of e.ancestors)r.push(`chown ${t.owner} ${d$(n)}`);r.push(`chown ${t.owner} ${d$(e.dest)}`)}return r.push(`echo ${d$(`${dx} ${e.destRel}`)}`),`{ ${r.join(" && ")}; } || true`}).join("; ")},"buildCarryPrompt",0,pI,"buildExposedHubEnv",0,lX,"buildHostEnvFindArgs",0,dI,"buildHostSyncManifest",0,f4,"buildModelAuthPrompt",0,pW,"buildWorkspaceListScript",0,fk,"carryGrantId",0,pR,"carryPlaceholderContext",0,u$,"categoryInventoryScript",0,dc,"chunkPathsForExec",0,fL,"classifyUntrackedOverlay",0,dz,"claudeInventoryScript",0,u5,"claudeSettingsPath",0,lx,"claudeSshEntryFor",0,function(e,t){return{id:`agentbox-${e}`,name:`AgentBox: ${t}`,sshHost:e,startDirectory:"/workspace"}},"clearBoxPortlessWebAlias",0,ls,"clonePerBoxCarryRefusal",0,function(e,t){if(0===e.length)return null;let r=e.map(e=>e.path).join(", ");return`${t} needs its own secrets before it can be a separate bot \u2014 create ${r} (0600) and run this again`},"computeClaudePullPlan",0,dt,"computeContextManifest",0,pu,"computeContextSha256",0,pc,"computeSyncDelta",0,function(e,t){let r=[],n=[],i={};for(let o of f3){let a=e.sets[o],s=t?.sets?.[o]?.files??{};for(let[e,t]of Object.entries(a.files))s[e]!==t&&r.push({set:o,rel:e,absSrc:(0,d.join)(a.hostDir,e),dst:`${a.dst}/${e}`});for(let e of Object.keys(s))e in a.files||n.push({set:o,rel:e,dst:`${a.dst}/${e}`});i[o]={dst:a.dst,files:a.files}}return{uploads:r,deletions:n,nextManifest:{version:1,sets:i}}},"controlPlaneDeployPath",0,lO,"controlSockPath",0,cx,"credentialFreshness",0,function(e,t){let r=uO(e).credential?.freshness?.jsonPath;return r?uB(t,r):null},"defaultBoxSshDir",0,cS,"deriveDescriptor",0,cr,"deriveRepoLabel",0,function(e){let t=pm(e);return t?`${t.owner}/${t.repo}`:e},"describeInbound",0,function(e){switch(e.mode){case"open":return"open (SSH reachable from anywhere — 0.0.0.0/0, key-only)";case"whitelist":return`whitelist (host egress + ${e.sources.join(", ")})`;default:return"locked (SSH reachable only from the host egress IP)"}},"detectGitRepos",0,lm,"diffFileManifests",0,function(e,t){let r=[],n=[],i=[];for(let[i,o]of Object.entries(t)){let t=e[i];void 0===t?n.push(i):t!==o&&r.push({rel:i,from:t,to:o})}for(let r of Object.keys(e))void 0===t[r]&&i.push(r);return r.sort((e,t)=>e.rel<t.rel?-1:1),n.sort(),i.sort(),{changed:r,added:n,removed:i}},"dirnameUnix",0,dL,"dropHostOnlyPaths",0,function(e){let t=e.split("\0").filter(e=>e.length>0&&!fD(e,fv));return t.length>0?`${t.join("\0")}\0`:""},"effectiveExcludes",0,pv,"emptyResult",0,pt,"encodeClaudeProjectsKey",0,dG,"ensureAgentInstalled",0,dC,"ensureBackupGitignored",0,fi,"ensureCloudSshAlias",0,co,"ensureHub",0,uh,"ensureProviderDescriptor",0,cn,"ensurePtyDir",0,pY,"ensureSshInclude",0,lL,"envSourceKeys",0,function(e){return e.map(e=>(0,s2.modelAuthEnvKey)(e)).filter(e=>void 0!==e)},"errSummary",0,function(e){return e instanceof Error?cM(e.message):String(e)},"existingBoxRefusal",0,function(e,t,r="restore it somewhere else"){return e?`box ${e.name} already runs on ${t} \u2014 ${r} to restore alongside it`:null},"existingPathsIn",0,fP,"exportBoxWorkspace",0,fJ,"extractCredentials",0,uR,"fetchHealthz",0,cZ,"findAgentSpec",0,uC,"findBox",0,lf,"findBrokenSymlinks",0,f5,"findUnsyncableSymlinks",0,dV,"firstLine",0,cM,"flatInventoryScript",0,dl,"fmtBytes",0,pE,"getHubStatus",0,ub,"gitModeExcludePathspecs",0,fx,"hasUnmanagedHostConflict",0,lF,"hostBackupHasCredentials",0,uI,"hostOpenCommand",0,lv,"hubRuntimeEnv",0,uf,"isAgentWorkspaceArtifact",0,fj,"isExcludedPath",0,fD,"isHubWorkerClone",0,function(e){return(0,d.basename)(e).startsWith(pg)},"isPathExcluded",0,px,"isRealAgentCredential",0,uP,"isRuntimeAgent",0,function(e){return uA.some(t=>t.id===e||t.aliases.includes(e))},"isSupportedApiVersion",0,function(e){return lq.includes(e)},"isValidRelayPort",0,cV,"jsonNumberAt",0,uB,"killPid",0,cq,"linkLatest",0,fe,"listAvailableSources",0,pK,"listBackups",0,ft,"listBots",0,fr,"listHostFiles",0,fB,"listProviderDescriptors",0,function(e=lJ){let t=[...sQ.PROVIDERS],r=[];for(let t of l1(e).plugins)for(let e of t.providers){let n=t.descriptors?.[e];r.push(n??ct(e))}return[...t,...r]},"listPtySessions",0,p0,"makeCleanup",0,pn,"makeHostGitPorts",0,function(){return{async resolveHostRef(e){let t=await sX("git",["-C",e,"symbolic-ref","--short","-q","HEAD"],{reject:!1});return(0===t.exitCode&&t.stdout.trim()?t.stdout.trim():(await sX("git",["-C",e,"rev-parse","HEAD"],{reject:!1})).stdout.trim())||null},async createHostStash(e){let t=await sX("git",["-C",e,"stash","create"],{reject:!1});return 0===t.exitCode&&t.stdout.trim()||null},async listHostUntracked(e){let t=await sX("git",["-C",e,"ls-files","--others","--exclude-standard","-z"],{reject:!1});return 0===t.exitCode?dJ(t.stdout):[]},hashHostFile:async(e,t)=>(0,s0.createHash)("sha256").update(await (0,c.readFile)((0,d.join)(e,t))).digest("hex"),async packHostFiles(e,t){let r=await sX("tar",["-C",e,"--null","-T","-","-cf","-"],{input:t.join("\0"),encoding:"buffer",reject:!1,env:{...process.env,COPYFILE_DISABLE:"1"}});return 0===r.exitCode?r.stdout:null}}},"makeRecordingTransport",0,function(e={}){let t=[],r={...uK,...e.caps},n=e.withVolumes??!0,i=(e,r)=>t.push({op:e,args:r}),o={caps:r,exec:async(t,r)=>(i("exec",{cmd:t,opts:r}),e.execResult?.(t,r)??{exitCode:0,stdout:"",stderr:""}),async applyTarball(e,t,r){i("applyTarball",{hostTarPath:e,boxDestDir:t,opts:r})},async pushTree(e,t,r){i("pushTree",{hostSrcDir:e,boxDestDir:t,opts:r})},async pushFile(e,t,r){i("pushFile",{hostSrcPath:e,boxDestPath:t,opts:r})},async pullTree(e,t,r){i("pullTree",{boxSrcDir:e,hostDestDir:t,opts:r})},async pullFile(e,t){i("pullFile",{boxSrcPath:e,hostDestPath:t})},readText:async t=>(i("readText",{boxPath:t}),e.readText?.(t)??null)};return n&&(o.ensureVolume=async e=>(i("ensureVolume",{name:e}),{volumeId:`vol-${e}`}),o.seedVolumeFromHost=async(e,t)=>{i("seedVolumeFromHost",{volume:e,sources:t})}),{...o,get ops(){return t},clear(){t.length=0}}},"makeStagingDir",0,dg,"makeSyncContext",0,function(e){return{boxName:e.boxName,boxId:e.boxId,provider:e.provider,hostWorkspace:e.hostWorkspace,projectRoot:e.projectRoot??e.hostWorkspace,boxWorkspace:e.boxWorkspace??"/workspace",hostHome:e.hostHome??(0,u.homedir)(),onLog:e.onLog??(()=>{})}},"maskSecret",0,function(e){return e.length<=8?"*".repeat(e.length):`${e.slice(0,4)}\u2026${"*".repeat(8)}${e.slice(-4)}`},"measureCopy",0,pS,"mergeInstalledPlugins",0,u0,"mergeKnownMarketplaces",0,uQ,"mintSshKey",0,cs,"mkStageDir",0,f9,"modelAuthIngestArgv",0,uV,"mutateState",0,lt,"newPtyRunId",0,function(){return(0,s0.randomBytes)(16).toString("hex")},"newPtyToken",0,function(){return(0,s0.randomBytes)(32).toString("hex")},"normalizeAgentSet",0,pd,"normalizeInboundCidr",0,cD,"oauthRefreshExpiresAt",0,function(e){return uB(e,["claudeAiOauth","refreshTokenExpiresAt"])},"openOnHost",0,function(e){try{let t=(0,sY.spawn)(lv(),[e],{detached:!0,stdio:"ignore"});t.on("error",()=>{}),t.unref()}catch{}},"overlayHostDirIntoBox",0,fR,"ownerRepoFromOriginUrl",0,pm,"parseClaudeInventory",0,u9,"parseCredentialsUpdate",0,function(e){let t;if(null===e||"object"!=typeof e)return null;let r=e.agent;if("string"!=typeof r||!uA.some(e=>e.id===r&&e.credential))return null;let n=e.contentBase64;if("string"!=typeof n||0===n.length||n.length>262144)return null;try{t=Buffer.from(n,"base64").toString("utf8")}catch{return null}return uP(r,t)?{agent:r,content:t}:null},"parseEnvFileBody",0,lV,"parseFlatInventory",0,du,"parseInboundSpec",0,function(e){let t=(e??"").trim();if(""===t||/^lock(ed)?$/i.test(t))return{mode:"locked",sources:[]};if(/^open$/i.test(t))return{mode:"open",sources:[]};/^whitelist\b:?/i.test(t)&&(t=t.replace(/^whitelist\b:?/i,"").trim());let r=t.split(/[\s,]+/).map(e=>e.trim()).filter(e=>e.length>0).map(cD);if(0===r.length)throw Error("inbound 'whitelist' needs at least one CIDR, e.g. `--inbound 203.0.113.5/32` or `--inbound whitelist:203.0.113.0/24`");return{mode:"whitelist",sources:r}},"parseItemizedChanges",0,fO,"parseItemizedEntries",0,fA,"parseModelAuthValue",0,pV,"parseSeedMarkers",0,function(e){let t=[];for(let r of e.split("\n")){let e=r.trim();e.startsWith(`${dx} `)&&t.push(e.slice(dx.length+1))}return t},"parseSshTarget",0,lG,"parseWorkspaceList",0,fT,"pathExists",0,f6,"perBoxCarrySrc",0,uk,"pickFreePort",0,ck,"pickFreshBranch",0,ly,"pickNewItems",0,uq,"pingHealthz",0,cY,"planAgentSeeds",0,dv,"planCarryEntry",0,function(e){if("missing"===e.kind)return null;let t=e.absDest.startsWith("~/")?`${d_}/${e.absDest.slice(2)}`:e.absDest,r=t.endsWith("/")?t.slice(0,-1):t,n="dir"===e.kind,i=n?r:dL(r),o=n?e.exclude??[]:[],a=void 0===e.user?[`--reference=${d_}`]:[`${String(e.user)}:${String(e.user)}`],s=void 0!==e.mode?e.mode.toString(8).padStart(4,"0"):void 0,l=n?"":dU(e.absSrc),c=n?"":dU(t),u=t.startsWith(`${d_}/`)&&dL(t)!==d_;return{boxDest:t,isDir:n,parentDir:i,exclude:o,chownArgs:a,mode:s,fileBase:l,destBase:c,renameNeeded:!n&&l!==c,parentChainNeeded:u}},"planPropagateTargets",0,function(e,t){let r=uO(t.agent).dockerVolume,n=e.filter(e=>e.id!==t.sourceBoxId&&("all"===t.scope||(e.projectRoot??"")===(t.projectRoot??""))),i=new Map,o=[],a=[];for(let e of n){var s;if(e.agents&&!e.agents.includes(t.agent)){e.borrowedCredentials?.includes(t.agent)&&a.push(e);continue}if((e.provider??"docker")!=="docker"){o.push(e);continue}let n=(s=t.agent,(0,s2.agentConfigVolume)(e,s)??r);if(n===t.excludeVolume)continue;let l=i.get(n)??{boxNames:[],shared:n===r};l.boxNames.push(e.name),i.set(n,l)}return{dockerVolumes:[...i.entries()].map(([e,t])=>({volume:e,...t})),cloudBoxes:o,borrowingBoxes:a}},"pluginForProvider",0,l9,"pluginProviderNames",0,function(e=lJ){return l1(e).plugins.flatMap(e=>e.providers)},"portIsOccupied",0,function(e,t=cK()){return new Promise(r=>{let n=(0,s1.connect)({host:"127.0.0.1",port:t}),i=e=>{n.destroy(),r(e)};n.setTimeout(e),n.once("connect",()=>i(!0)),n.once("timeout",()=>i(!1)),n.once("error",()=>i(!1))})},"prepareBackupDir",0,d9,"preparedStatePathFor",0,ps,"processAlive",0,cJ,"projectSlugFromOriginUrl",0,function(e){let t=pm(e);return t?`${t.owner.replace(/[^A-Za-z0-9._-]/g,"-")}__${t.repo.replace(/[^A-Za-z0-9._-]/g,"-")}`:null},"propagateStagedSettings",0,db,"providerBoxFilePorts",0,fM,"pruneBackups",0,fn,"pruneOrphanClaudeSshConfigs",0,lk,"ptyDir",0,pz,"ptyLogPath",0,function(e,t=s5){return(0,d.join)(t,"logs",`pty-${e}.log`)},"ptyMetaPath",0,pq,"ptySocketPath",0,pJ,"publishManagedCredentials",0,cG,"pullClaudeExtrasViaTransport",0,dn,"pullFlatConfigViaTransport",0,dh,"pullSqliteSnapshot",0,dQ,"pullWorkspaceToHost",0,fK,"pushCredentialToBox",0,uM,"pushEnvFiles",0,dN,"readAgentboxSshAlias",0,lH,"readBackupManifest",0,fc,"readCliStamp",0,function(){return{cliVersion:process.env.AGENTBOX_CLI_VERSION??"unknown",cliCommit:process.env.AGENTBOX_CLI_COMMIT??"unknown"}},"readCredentialBackup",0,u_,"readHubToken",0,function(){return uc()},"readPluginRegistry",0,l2,"readPluginRegistrySync",0,l1,"readPreparedStateRaw",0,function(e){let t=ps(e);if(!(0,sZ.existsSync)(t))return null;try{return JSON.parse((0,sZ.readFileSync)(t,"utf8"))}catch{return null}},"readPtyMeta",0,pQ,"readServiceUrlFields",0,fg,"readStagedWorkspace",0,fX,"readState",0,lr,"recordBox",0,li,"recordBoxSsh",0,ll,"recordLastAgent",0,lo,"recordPluginDescriptor",0,l8,"referencedPluginVersionKeys",0,function(e){let t=new Set;if(!uY(e))return t;let r=e.plugins;if(!uY(r))return t;for(let e of Object.values(r))if(Array.isArray(e))for(let r of e){if(!uY(r))continue;let e=r.installPath;if("string"!=typeof e)continue;let n=e.split("/").filter(e=>e.length>0);n.length<3||t.add(n.slice(-3).join("/"))}return t},"registerAgentPullModule",0,function(e){dZ.set(e.id,e)},"registeredAgentPullModules",0,function(){return[...dZ.values()]},"registryRefForSha",0,function(e,t=ph){return`${t}:sha-${e.slice(0,16)}`},"relayPort",0,cK,"removeBoxRecord",0,ld,"removeClaudeSshConfigs",0,lT,"removePluginRecord",0,l5,"removePtySession",0,p1,"removeStagingDir",0,dy,"renderAgentSettingEnv",0,dT,"renderCarryEntries",0,uE,"renderCarryTable",0,pL,"renderInstallRecipe",0,dD,"renderPackageInstall",0,dA,"reserveProjectIndex",0,lc,"resetRelayPort",0,function(){cW=null,delete process.env[cH]},"resolveAgentSpec",0,uO,"resolveBackupTarget",0,function(e,t){let r,n=d6(e.projectRoot??e.workspacePath),i=(t.name??e.name).trim();if(0===i.length||i.includes("/")||"."===i||".."===i)throw Error(`name "${t.name??""}": a bot name must be a single path segment`);let o=void 0===t.keep?3:"number"==typeof t.keep?t.keep:Number.parseInt(t.keep,10);if(!Number.isInteger(o)||o<1)throw Error(`keep "${String(t.keep??"")}": expected a positive integer`);if(t.agent){let e=uC(t.agent);if(!e)throw Error(`agent "${t.agent}": no such agent`);r=e.id}else{let t=e.lastAgent??e.agents?.[0];r=t?uC(t)?.id:void 0}let a=d4(),s=d5(n,i,a);return{projectRoot:n,bot:i,stamp:a,dir:s,workspaceDir:(0,d.join)(s,"workspace"),keep:o,agent:r}},"resolveBotBundle",0,fu,"resolveBoxRef",0,function(e,t,r){if(void 0===e)return void 0===r?{kind:"none"}:lh(t,r);let n=e.trim();if(void 0!==r&&/^[1-9][0-9]*$/.test(n)){let e=Number.parseInt(n,10),i=t.boxes.find(t=>t.projectRoot===r&&t.projectIndex===e);return i?{kind:"ok",box:i}:{kind:"none"}}return lf(n,t)},"resolveCarry",0,pD,"resolveClaudeMemoryDir",0,dW,"resolveCliEntry",0,cQ,"resolveCloudSshTarget",0,ci,"resolveContextFilesFrom",0,function(e,t){let r=[];for(let[n,i]of Object.entries(e)){let e=[(0,d.resolve)(t.contextDir,i.staged),(0,d.resolve)(t.devRoot,i.dev)].find(e=>(0,sZ.existsSync)(e));if(!e)return null;r.push({rel:n,abs:e})}return r},"resolveHostCredential",0,uL,"resolveHostCredentialFile",0,uU,"resolveHubServer",0,ud,"resolveInboundSources",0,function(e,t){if("open"===e.mode)return[...cT];let r=new Set;if(t&&t.trim().length>0&&r.add(cD(t)),"whitelist"===e.mode)for(let t of e.sources)r.add(cD(t));return[...r]},"resolveModelAuth",0,pX,"resolveModelAuthIngest",0,uW,"resolveModelAuthSources",0,uF,"resolvePerBoxCarry",0,uT,"resolveProviderDescriptor",0,l7,"resolveSshConfigTarget",0,cc,"resolveStagedRuntimeRoot",0,c3,"restartServiceArgv",0,cN,"restoreAgentState",0,fd,"restoreScope",0,function(e){return e.stateDir?"workspace+state":"workspace"},"restoreWorkspaceDir",0,function(e,t){return(0,d.join)(d8(e,t),"workspace")},"resyncWorkspace",0,dY,"rsyncPullToHost",0,fI,"runCarryGate",0,pB,"runDockerCredentialRefresh",0,ux,"runModelAuthIngest",0,uX,"scanHostEnvFiles",0,dB,"scpDownload",0,ch,"scpUpload",0,cp,"scratchBranchName",0,cC,"scrubAgentSessionEnv",0,c1,"scrubControlPlaneHubEnv",0,lz,"secretsEnvPath",0,cF,"seedAgentsVolume",0,dK,"seedExcludeTarArgs",0,function(){return fv.map(e=>`--exclude=${e}`)},"serviceAgentForBox",0,fh,"serviceSignInUrl",0,fy,"servicesStatusArgv",0,cB,"setBoxDisplayName",0,la,"setCredentialPublisher",0,function(e){o=e},"setDockerCredentialRefresh",0,function(e){l=e},"setHubDockerContext",0,function(e){s=e},"setHubPortlessHooks",0,function(e){a=e},"setRelayPort",0,cX,"sha256OfFile",0,pl,"sharedRuntimeAssetPath",0,function(e){let t=[],r=process.env[c8];r&&t.push(r);let n=c3((0,d.dirname)((0,s3.fileURLToPath)(s6.url)),`_shared/${e}`);for(let r of(n&&t.push(n),t)){let t=(0,d.resolve)(r,"_shared",e);if((0,sZ.existsSync)(t))return t}return null},"shortFingerprint",0,function(e){return e.slice(0,12)},"shouldAcceptCredentialUpdate",0,function(e,t,r){if(null===r)return{accept:!0,reason:"no existing backup"};if(r===t)return{accept:!1,reason:"unchanged"};let n=uO(e).credential?.freshness?.jsonPath;if(n){let e=n.join("."),i=uB(t,n),o=uB(r,n);return null===i?{accept:!1,reason:`incoming blob has no ${e}`}:null!==o&&i<=o?{accept:!1,reason:"not newer than backup"}:{accept:!0,reason:`newer ${e}`}}return{accept:!0,reason:"content changed"}},"shouldReclaimForVersion",0,cz,"sourceBoxRunningRefusal",0,function(e,t,r,n="force the restore"){return e&&"running"===t?`box ${e.name} is still running and holds ${r}'s identity \u2014 two live gateways cannot share one. Stop or destroy it, or ${n}.`:null},"sshDestination",0,cu,"sshExec",0,cf,"sshOptArgs",0,cd,"stageAgentStaticForUpload",0,po,"stageAgentsStaticForUpload",0,pa,"stageBoxWorkspace",0,fV,"stageDynamicSyncTarball",0,f8,"stageItemsViaTransport",0,dm,"stageRestoreWorkspace",0,fl,"stageSingleFileTarball",0,pi,"stagedRuntimeRootCandidates",0,c4,"statusBadge",0,function(e){return"ok"===e?"[ ok ]":"info"===e?"[info]":"warn"===e?"[warn]":"[FAIL]"},"stopHub",0,uw,"syncAgentboxSshConfig",0,lM,"tarballFromDir",0,pr,"toFileRow",0,p_,"toTarExcludes",0,pb,"transportSettingsTarget",0,function(e,t,r){let n=e=>`${t}/${e}`;return{label:r,exists:async t=>0===(await e.exec(["sh","-c",`test -e '${n(t)}'`])).exitCode,readText:t=>e.readText(n(t)),async writeText(t,r,i){let o=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-target-write-"));try{let a=(0,d.join)(o,"file");await (0,c.writeFile)(a,r),await e.exec(["sh","-c",`mkdir -p '${(0,d.dirname)(n(t))}'`]),await e.pushFile(a,n(t)),i?.mode!==void 0&&await e.exec(["sh","-c",`chmod ${i.mode.toString(8)} '${n(t)}'`])}finally{await (0,c.rm)(o,{recursive:!0,force:!0})}},async copyIn(t,r,i){"dir"===i?(await e.exec(["sh","-c",`mkdir -p '${n(r)}'`]),await e.pushTree(t,n(r),{exclude:["node_modules"]})):(await e.exec(["sh","-c",`mkdir -p '${(0,d.dirname)(n(r))}'`]),await e.pushFile(t,n(r)))}}},"uploadWorkspaceToBox",0,fq,"upsertClaudeSshConfig",0,function(e){let t=lx(),r=l$(t),n=Array.isArray(r.sshConfigs)?r.sshConfigs:[],i=n.findIndex(t=>lE(t)===e.id);i>=0?n[i]=e:n.push(e),r.sshConfigs=n,lS(t,r)},"variantFingerprint",0,function(e,t={}){let r=pf(t.agents),n=pp(t.agentSettings);if(0===n.length&&""===r)return e;let i=[...n];return""!==r&&i.push(`agents=${r}`),(0,s0.createHash)("sha256").update(`${e}\0${i.join("\0")}`).digest("hex")},"waitForSsh",0,cm,"withPerBoxCarry",0,uD,"withServiceSignIn",0,fw,"workspaceExcludes",0,fS,"writeBackupManifest",0,d7,"writeClaudeMergedRegistries",0,dr,"writeCredentialBackup",0,uN,"writeManagedSecrets",0,function(e,t){for(let t of e)delete process.env[t];for(let[e,r]of Object.entries(t))process.env[e]=r;let r=cF();(0,sZ.mkdirSync)((0,d.dirname)(r),{recursive:!0});let n="";if((0,sZ.existsSync)(r))try{n=(0,sZ.readFileSync)(r,"utf8")}catch{n=""}let i=n.split(/\r?\n/).filter(t=>{let r=t.startsWith("export ")?t.slice(7):t,n=r.indexOf("=");if(n<=0)return!0;let i=r.slice(0,n).trim();return!e.includes(i)}).join("\n").replace(/\s+$/u,""),o=(i?`${i}
78
- `:"")+Object.entries(t).map(([e,t])=>`${e}=${t}`).join("\n")+"\n",a=`${r}.tmp`;(0,sZ.writeFileSync)(a,o,{mode:384});try{(0,sZ.chmodSync)(a,384)}catch{}(0,sZ.renameSync)(a,r);try{(0,sZ.chmodSync)(r,384)}catch{}},"writePreparedStateRaw",0,function(e,t){let r=ps(e);(0,sZ.mkdirSync)((0,d.dirname)(r),{recursive:!0});let n=JSON.stringify(t,null,2)+"\n",i=`${r}.tmp`;(0,sZ.writeFileSync)(i,n,{mode:384}),(0,sZ.renameSync)(i,r)},"writePtyMeta",0,pZ,"writeState",0,ln],25206)}];
78
+ ${e.envVar??""}${e.provider?` (${e.provider})`:""}`).join("\n"),rows:t.map(pY)},fallback:{value:pq,reason:"not asked - the box starts without it"},nonInteractiveHint:`Use --model-auth <source|none>, or \`agentbox config set ${e}.${pJ} <source>\` to decide this once.`}}function pQ(e){let t=("string"==typeof e?[e]:e).flatMap(e=>(0,s3.decodeMultiAnswer)(e));if(0===t.length)return[];if(t.includes(pq)){if(t.length>1)throw Error(`--model-auth ${pq} cannot be combined with ${t.filter(e=>e!==pq).join(", ")}`);return[]}return t}async function p0(e){let{spec:t}=e;if(0===(t.modelAuth?.sources??[]).length){if(void 0!==e.flags&&pQ(e.flags).length>0)throw Error(`${t.id} uses no host login \u2014 --model-auth does not apply to it`);return[]}if(void 0!==e.flags)return uJ(t,pQ(e.flags));let r=e.settings[pJ],n="string"==typeof r?pQ(r):[];if(e.configuredExplicitly||n.length>0)return uJ(t,n);if(!t.modelAuth?.promptOnCreate)return[];let i=await (e.listAvailable??p1)(t);if(0===i.length)return[];let o=await e.ask(pZ(t.id,i));if(o.cancelled)return[];let a=pQ(o.value);return 0===a.length?[]:uJ(t,a)}async function p1(t,r=process.env){let{findAgentSpec:n}=await e.A(13172),i=[];for(let e of t.modelAuth?.sources??[]){if("env"===e.kind){let t=r[e.envKey];if("string"!=typeof t||0===t.length)continue;i.push({id:(0,s3.modelAuthSourceId)(e),kind:"env",label:e.label,...e.provider?{provider:e.provider}:{},...e.caveat?{caveat:e.caveat}:{},envVar:e.envKey});continue}let t=await uK(e.agent);t&&i.push({id:(0,s3.modelAuthSourceId)(e),kind:"agent",label:e.label,...e.caveat?{caveat:e.caveat}:{},hostPath:t.path,boxPath:n(e.agent)?.credential?.boxAbsPath??"",bytes:Buffer.byteLength(t.text,"utf8")})}return i}function p2(e=s9){return(0,d.join)(e,"pty")}function p4(e,t=s9){return(0,d.join)(p2(t),`${e}.sock`)}function p3(e,t=s9){return(0,d.join)(p2(t),`${e}.json`)}async function p8(e=s9){let t=p2(e);return await (0,c.mkdir)(t,{recursive:!0,mode:448}),await (0,c.chmod)(t,448).catch(()=>{}),t}async function p6(e,t=s9){await p8(t);let r=p3(e.managerId,t),n=`${r}.tmp`;await (0,c.writeFile)(n,`${JSON.stringify(e,null,2)}
79
+ `,{mode:384}),await (0,c.rename)(n,r)}async function p5(e,t=s9){try{let r=await (0,c.readFile)(p3(e,t),"utf8"),n=JSON.parse(r);return 1===n.v&&"string"==typeof n.managerId?n:void 0}catch{return}}async function p9(e=s9){let t;try{t=await (0,c.readdir)(p2(e))}catch{return[]}let r=[];for(let n of t){if(!n.endsWith(".json"))continue;let t=await p5(n.slice(0,-5),e);t&&r.push(t)}return r}async function p7(e,t=s9){await Promise.all([(0,c.rm)(p4(e,t),{force:!0}),(0,c.rm)(p3(e,t),{force:!0})])}e.s(["AGENTBOX_HUB_SSH_ALIAS",0,lC,"AGENTS_STATIC_BOX_DIR",0,"/home/vscode/.agents","AGENT_SEED_MARKER",0,dO,"AGENT_SESSION_ENV_VARS",0,c9,"AGENT_SYNC_SPECS",0,uN,"AgentInstallError",0,dj,"BACKUP_GITIGNORE_ENTRY",0,fe,"BOTS_DIR_REL",0,d7,"BOX_CLAUDE_PROJECT_DIR",0,dY,"BOX_DYNAMIC_SYNC_MANIFEST",0,"/home/vscode/.agentbox/dynamic-sync.json","BOX_HOME",0,dV,"BOX_IMAGE_REGISTRY",0,p$,"BOX_MEMORY_DIR",0,f6,"BOX_WORKFLOWS_DIR",0,f8,"BOX_WORKSPACE",0,cN,"BoxProbeError",0,fJ,"CARRY_GRANT_TOPIC",0,pU,"CARRY_NON_INTERACTIVE_HINT",0,pM,"CARRY_TOPIC",0,pL,"CLAUDE_BOX_CONFIG_DIR",0,dt,"CLAUDE_PULL_DIR_CATEGORIES",0,di,"CLI_RUNTIME_DIR_ENV",0,un,"CODEX_BOX_CONFIG_DIR",0,dr,"CODEX_PULL_ITEMS",0,dp,"CONTAINER_PLUGINS_PREFIX",0,u4,"CarryCopyError",0,dz,"DEFAULT_BACKUP_KEEP",0,3,"DEFAULT_CP_EXCLUDES",0,pk,"DEFAULT_ENV_PATTERNS",0,[".env",".env.*",".envrc",".dev.vars","secrets.toml","local.settings.json","appsettings.*.json","agentbox.yaml"],"DOCKER_CONTEXT_FILE_MAP",0,{"Dockerfile.box":{staged:"Dockerfile.box",dev:"Dockerfile.box"},"ctl/bin.cjs":{staged:"packages/ctl/dist/bin.cjs",dev:"../ctl/dist/bin.cjs"},"share/agentbox-setup/SKILL.md":{staged:"apps/cli/share/agentbox-setup/SKILL.md",dev:"../../apps/cli/share/agentbox-setup/SKILL.md"},"share/agentbox-identity/SKILL.md":{staged:"apps/cli/share/agentbox-identity/SKILL.md",dev:"../../apps/cli/share/agentbox-identity/SKILL.md"},"scripts/agentbox-vnc-start":{staged:"packages/sandbox-docker/scripts/agentbox-vnc-start",dev:"scripts/agentbox-vnc-start"},"scripts/agentbox-dockerd-start":{staged:"packages/sandbox-docker/scripts/agentbox-dockerd-start",dev:"scripts/agentbox-dockerd-start"},"scripts/agentbox-checkpoint-cleanup":{staged:"packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup",dev:"scripts/agentbox-checkpoint-cleanup"},"scripts/agentbox-open":{staged:"packages/sandbox-docker/scripts/agentbox-open",dev:"scripts/agentbox-open"},"scripts/custom-system-CLAUDE.md":{staged:"packages/sandbox-docker/scripts/custom-system-CLAUDE.md",dev:"scripts/custom-system-CLAUDE.md"},"scripts/claude-managed-settings.json":{staged:"packages/sandbox-docker/scripts/claude-managed-settings.json",dev:"scripts/claude-managed-settings.json"},"scripts/agentbox-codex-hooks.json":{staged:"packages/sandbox-docker/scripts/agentbox-codex-hooks.json",dev:"scripts/agentbox-codex-hooks.json"},"scripts/gh-shim":{staged:"packages/sandbox-docker/scripts/gh-shim",dev:"scripts/gh-shim"},"scripts/git-shim":{staged:"packages/sandbox-docker/scripts/git-shim",dev:"scripts/git-shim"},"scripts/agentbox-tool-shim":{staged:"packages/sandbox-docker/scripts/agentbox-tool-shim",dev:"scripts/agentbox-tool-shim"},"scripts/chromium-resolver":{staged:"packages/sandbox-docker/scripts/chromium-resolver",dev:"scripts/chromium-resolver"},"scripts/agentbox-sshd-start":{staged:"packages/sandbox-docker/scripts/agentbox-sshd-start",dev:"scripts/agentbox-sshd-start"},"scripts/agentbox-portless-trust":{staged:"packages/sandbox-docker/scripts/agentbox-portless-trust",dev:"scripts/agentbox-portless-trust"},"scripts/opencode-agentbox-plugin.js":{staged:"packages/sandbox-docker/scripts/opencode-agentbox-plugin.js",dev:"scripts/opencode-agentbox-plugin.js"},"scripts/pi-agentbox-extension.js":{staged:"packages/sandbox-docker/scripts/pi-agentbox-extension.js",dev:"scripts/pi-agentbox-extension.js"}},"ENV_PRUNE_DIRS",0,dU,"EXPOSED_HUB_PROFILE",0,lV,"FALLBACK_RELAY_PORT",0,8787,"GIT_MODE_EXCLUDE_DIRS",0,fA,"GitWorktreeError",0,lv,"HUB_TOKEN_FILE",0,ud,"HUB_WORKER_CLONE_PREFIX",0,pE,"MODEL_AUTH_NONE",0,pq,"MODEL_AUTH_SETTING",0,pJ,"MODEL_AUTH_TOPIC",0,pz,"NON_REGULAR_TOKEN",0,"-","OPENCODE_BOX_DATA_DIR",0,dn,"OPENCODE_PULL_CONFIG_ITEMS",0,dm,"OPENCODE_PULL_DATA_ITEMS",0,dh,"OPEN_INBOUND_SOURCES",0,cD,"PLUGINS_FILE",0,lq,"PLUGINS_FILE_VERSION",0,2,"PULL_CATEGORIES",0,["skills","plugins","agents","commands"],"RELAY_PORT_ENV",0,cY,"RUNTIME_ROOT_ENV",0,ue,"SEED_MARKER",0,".agentbox-seeded-at","SKILL_EXCLUDE_PREFIXES",0,u2,"STAGE_NO_SPECIALS",0,pl,"STAGE_WRITABLE_CHMOD",0,ps,"STATE_DIR",0,s9,"STATE_FILE",0,s7,"SUPPORTED_SDK_API_VERSIONS",0,lY,"SshTunnelManager",0,cS,"WORKSPACE_EXCLUDE_DIR_NAMES",0,fD,"addPluginRecord",0,l5,"agentBoxConfigDir",0,function(e){return de(e)},"agentBoxDir",0,de,"agentCloneDropPaths",0,fL,"agentIds",0,function(){return uN.map(e=>e.id)},"agentPull",0,function(e,t,r={}){let n=d6.get(e);return n?n.pull(t,r):d$(e,t,r)},"agentPullBoxDir",0,d9,"agentSeedPlacements",0,function(e,t){let r=u_(e),n=t??r.staticPaths[0]?.boxDir;return n&&r.seeds&&0!==r.seeds.length?dA(r.seeds,n):[]},"agentSetArg",0,pv,"agentSourceIds",0,uq,"agentStateExcludePaths",0,fP,"agentTuiEnv",0,function(e,t){let r=uL(e);if(!r?.tuiEnv||!r.tuiEnvFrom)return{};let n=r.settings?.find(e=>e.key===r.tuiEnvFrom),i=t?.[r.tuiEnvFrom]??n?.default;return"string"!=typeof i?{}:{...r.tuiEnv[i]??{}}},"agentWorkspaceArtifactPaths",0,function(){let e=new Set;for(let t of uN){for(let r of t.clone?.drop??[])e.add(r);for(let r of t.clone?.render??[])e.add(r)}return[...e].sort()},"agentboxAliasFor",0,lB,"agentboxSshConfigPath",0,lO,"agentsRejectProxyHeaders",0,function(e){return(e??[]).some(e=>uL(e)?.service?.rejectsProxyHeaders===!0)},"allocateProjectIndex",0,lh,"assertEmptyDir",0,f2,"autoPickProjectBox",0,lm,"autoWriteSshConfig",0,cs,"backupAgentState",0,fp,"backupStamp",0,ft,"bakeSettingsFingerprintInput",0,px,"basenameUnix",0,dK,"borrowedCredentialCarry",0,uY,"botBackupDir",0,fo,"botDir",0,fn,"botWorkspaceRoot",0,fi,"boxGitCheckout",0,function(e,t,r,n=[]){return c_(e,t,["git","checkout",r,...n])},"boxGitCurrentBranch",0,cU,"boxGitNewBranch",0,function(e,t,r,n){let i=["git","checkout","-b",cL(r)];return n&&n.trim()&&i.push(n.trim()),c_(e,t,i)},"boxGitPull",0,cG,"boxGitPush",0,cF,"boxGitPushHost",0,function(e,t,r={}){let n=["agentbox-ctl","git","push","--host-only"];return r.as&&n.push("--as",r.as),r.force&&n.push("--force"),n.push(...r.args??[]),c_(e,t,n)},"boxLogsArgv",0,cV,"boxLogsRaw",0,function(e,t,r,n){return c_(e,t,cV(r,{tail:n,follow:!1}))},"boxNameBasisFromOriginUrl",0,function(e){return pS(e)?.repo??null},"boxOverlayPorts",0,fq,"boxRefWithRestoreRefusal",0,function(e){return void 0===e?null:`--restore always creates a new box, so it cannot also take the box ref "${e}" \u2014 drop the ref, or name the new box with -n <name>`},"boxRestartService",0,cX,"boxRestartServices",0,cK,"boxServicesStatusRaw",0,function(e,t){return c_(e,t,cH())},"boxSshDirForProvider",0,function(e,t){let r=ck(e);return null===r?null:cE(t,r)},"boxSshNamespaceForProvider",0,ck,"buildAgentDescriptors",0,function(e={}){let t=t=>void 0===e.boxAgents||e.boxAgents.includes(t);return{schema:2,agents:uN.map(e=>{var r,n;return{id:e.id,sessionName:e.sessionName,activitySource:e.caps.activitySource,surface:e.caps.surface??"tui",...e.service&&t(e.id)?{service:(r=e.service,0===Object.keys(n=e.boxRunEnv).length?r:{...r,env:{...n,...r.env??{}},...r.tasks?{tasks:r.tasks.map(e=>({...e,env:{...n,...e.env??{}}}))}:{}})}:{},...e.configRender&&t(e.id)?{configRender:e.configRender}:{},watch:[...e.credential?[{path:e.credential.boxAbsPath,sync:"fanout",shape:e.credential.realShape}]:[],...(e.watch??[]).map(e=>({path:e.path,sync:e.sync??"backup",...e.hostDest?{hostDest:e.hostDest}:{}}))]}})}},"buildAgentSeedScript",0,function(e,t={}){return e.map(e=>{let r=[`[ -f ${dP(e.src)} ]`];for(let t of e.ancestors)r.push(`mkdir -p ${dP(t)}`);if(r.push(`cp -a ${dP(e.src)} ${dP(e.dest)}`),t.owner){for(let n of e.ancestors)r.push(`chown ${t.owner} ${dP(n)}`);r.push(`chown ${t.owner} ${dP(e.dest)}`)}return r.push(`echo ${dP(`${dO} ${e.destRel}`)}`),`{ ${r.join(" && ")}; } || true`}).join("; ")},"buildCarryPrompt",0,pF,"buildExposedHubEnv",0,lK,"buildHostEnvFindArgs",0,dF,"buildHostSyncManifest",0,pt,"buildModelAuthPrompt",0,pZ,"buildWorkspaceListScript",0,fI,"carryGrantId",0,pG,"carryPlaceholderContext",0,uP,"categoryInventoryScript",0,dy,"chunkPathsForExec",0,fX,"classifyUntrackedOverlay",0,d2,"claudeInventoryScript",0,da,"claudeSettingsPath",0,l$,"claudeSshEntryFor",0,function(e,t){return{id:`agentbox-${e}`,name:`AgentBox: ${t}`,sshHost:e,startDirectory:"/workspace"}},"clearBoxPortlessWebAlias",0,ll,"clonePerBoxCarryRefusal",0,function(e,t){if(0===e.length)return null;let r=e.map(e=>e.path).join(", ");return`${t} needs its own secrets before it can be a separate bot \u2014 create ${r} (0600) and run this again`},"computeClaudePullPlan",0,du,"computeContextManifest",0,pw,"computeContextSha256",0,py,"computeSyncDelta",0,function(e,t){let r=[],n=[],i={};for(let o of pr){let a=e.sets[o],s=t?.sets?.[o]?.files??{};for(let[e,t]of Object.entries(a.files))s[e]!==t&&r.push({set:o,rel:e,absSrc:(0,d.join)(a.hostDir,e),dst:`${a.dst}/${e}`});for(let e of Object.keys(s))e in a.files||n.push({set:o,rel:e,dst:`${a.dst}/${e}`});i[o]={dst:a.dst,files:a.files}}return{uploads:r,deletions:n,nextManifest:{version:1,sets:i}}},"controlPlaneDeployPath",0,lP,"controlSockPath",0,c$,"credentialFreshness",0,function(e,t){let r=u_(e).credential?.freshness?.jsonPath;return r?uH(t,r):null},"defaultBoxSshDir",0,cE,"deriveDescriptor",0,cn,"deriveRepoLabel",0,function(e){let t=pS(e);return t?`${t.owner}/${t.repo}`:e},"describeInbound",0,function(e){switch(e.mode){case"open":return"open (SSH reachable from anywhere — 0.0.0.0/0, key-only)";case"whitelist":return`whitelist (host egress + ${e.sources.join(", ")})`;default:return"locked (SSH reachable only from the host egress IP)"}},"detectEgressCidr",0,cI,"detectEgressIp",0,cj,"detectGitRepos",0,lg,"diffFileManifests",0,function(e,t){let r=[],n=[],i=[];for(let[i,o]of Object.entries(t)){let t=e[i];void 0===t?n.push(i):t!==o&&r.push({rel:i,from:t,to:o})}for(let r of Object.keys(e))void 0===t[r]&&i.push(r);return r.sort((e,t)=>e.rel<t.rel?-1:1),n.sort(),i.sort(),{changed:r,added:n,removed:i}},"dirnameUnix",0,dX,"dropHostOnlyPaths",0,function(e){let t=e.split("\0").filter(e=>e.length>0&&!fB(e,fA));return t.length>0?`${t.join("\0")}\0`:""},"effectiveExcludes",0,pA,"emptyResult",0,pc,"encodeClaudeProjectsKey",0,dq,"ensureAgentInstalled",0,dL,"ensureBackupGitignored",0,ff,"ensureCloudSshAlias",0,ca,"ensureHub",0,u$,"ensureProviderDescriptor",0,ci,"ensurePtyDir",0,p8,"ensureSshInclude",0,lU,"envSourceKeys",0,function(e){return e.map(e=>(0,s3.modelAuthEnvKey)(e)).filter(e=>void 0!==e)},"errSummary",0,function(e){return e instanceof Error?cz(e.message):String(e)},"existingBoxRefusal",0,function(e,t,r="restore it somewhere else"){return e?`box ${e.name} already runs on ${t} \u2014 ${r} to restore alongside it`:null},"existingPathsIn",0,fM,"exportBoxWorkspace",0,f4,"extractCredentials",0,uG,"fetchHealthz",0,c6,"findAgentSpec",0,uL,"findBox",0,lp,"findBrokenSymlinks",0,po,"findUnsyncableSymlinks",0,dQ,"firstLine",0,cz,"flatInventoryScript",0,dg,"fmtBytes",0,pj,"getHubStatus",0,uD,"getOverIpv4",0,cR,"gitModeExcludePathspecs",0,fO,"hasUnmanagedHostConflict",0,lG,"hostBackupHasCredentials",0,uF,"hostOpenCommand",0,lx,"hubRuntimeEnv",0,uv,"isAgentWorkspaceArtifact",0,fU,"isExcludedPath",0,fB,"isHubWorkerClone",0,function(e){return(0,d.basename)(e).startsWith(pE)},"isIpv4",0,cC,"isPathExcluded",0,pO,"isRealAgentCredential",0,uM,"isRuntimeAgent",0,function(e){return uN.some(t=>t.id===e||t.aliases.includes(e))},"isSupportedApiVersion",0,function(e){return lY.includes(e)},"isValidRelayPort",0,cQ,"jsonNumberAt",0,uH,"killPid",0,c3,"linkLatest",0,fl,"listAvailableSources",0,p1,"listBackups",0,fc,"listBots",0,fu,"listHostFiles",0,fH,"listProviderDescriptors",0,function(e=lq){let t=[...sQ.PROVIDERS],r=[];for(let t of l2(e).plugins)for(let e of t.providers){let n=t.descriptors?.[e];r.push(n??cr(e))}return[...t,...r]},"listPtySessions",0,p9,"makeCleanup",0,pd,"makeHostGitPorts",0,function(){return{async resolveHostRef(e){let t=await sX("git",["-C",e,"symbolic-ref","--short","-q","HEAD"],{reject:!1});return(0===t.exitCode&&t.stdout.trim()?t.stdout.trim():(await sX("git",["-C",e,"rev-parse","HEAD"],{reject:!1})).stdout.trim())||null},async createHostStash(e){let t=await sX("git",["-C",e,"stash","create"],{reject:!1});return 0===t.exitCode&&t.stdout.trim()||null},async listHostUntracked(e){let t=await sX("git",["-C",e,"ls-files","--others","--exclude-standard","-z"],{reject:!1});return 0===t.exitCode?d4(t.stdout):[]},hashHostFile:async(e,t)=>(0,s0.createHash)("sha256").update(await (0,c.readFile)((0,d.join)(e,t))).digest("hex"),async packHostFiles(e,t){let r=await sX("tar",["-C",e,"--null","-T","-","-cf","-"],{input:t.join("\0"),encoding:"buffer",reject:!1,env:{...process.env,COPYFILE_DISABLE:"1"}});return 0===r.exitCode?r.stdout:null}}},"makeRecordingTransport",0,function(e={}){let t=[],r={...u1,...e.caps},n=e.withVolumes??!0,i=(e,r)=>t.push({op:e,args:r}),o={caps:r,exec:async(t,r)=>(i("exec",{cmd:t,opts:r}),e.execResult?.(t,r)??{exitCode:0,stdout:"",stderr:""}),async applyTarball(e,t,r){i("applyTarball",{hostTarPath:e,boxDestDir:t,opts:r})},async pushTree(e,t,r){i("pushTree",{hostSrcDir:e,boxDestDir:t,opts:r})},async pushFile(e,t,r){i("pushFile",{hostSrcPath:e,boxDestPath:t,opts:r})},async pullTree(e,t,r){i("pullTree",{boxSrcDir:e,hostDestDir:t,opts:r})},async pullFile(e,t){i("pullFile",{boxSrcPath:e,hostDestPath:t})},readText:async t=>(i("readText",{boxPath:t}),e.readText?.(t)??null)};return n&&(o.ensureVolume=async e=>(i("ensureVolume",{name:e}),{volumeId:`vol-${e}`}),o.seedVolumeFromHost=async(e,t)=>{i("seedVolumeFromHost",{volume:e,sources:t})}),{...o,get ops(){return t},clear(){t.length=0}}},"makeStagingDir",0,dE,"makeSyncContext",0,function(e){return{boxName:e.boxName,boxId:e.boxId,provider:e.provider,hostWorkspace:e.hostWorkspace,projectRoot:e.projectRoot??e.hostWorkspace,boxWorkspace:e.boxWorkspace??"/workspace",hostHome:e.hostHome??(0,u.homedir)(),onLog:e.onLog??(()=>{})}},"maskSecret",0,function(e){return e.length<=8?"*".repeat(e.length):`${e.slice(0,4)}\u2026${"*".repeat(8)}${e.slice(-4)}`},"measureCopy",0,pC,"mergeInstalledPlugins",0,u9,"mergeKnownMarketplaces",0,u5,"mintSshKey",0,cl,"mkStageDir",0,pa,"modelAuthIngestArgv",0,uQ,"mutateState",0,lr,"newPtyRunId",0,function(){return(0,s0.randomBytes)(16).toString("hex")},"newPtyToken",0,function(){return(0,s0.randomBytes)(32).toString("hex")},"normalizeAgentSet",0,pb,"normalizeInboundCidr",0,cA,"oauthRefreshExpiresAt",0,function(e){return uH(e,["claudeAiOauth","refreshTokenExpiresAt"])},"openOnHost",0,function(e){try{let t=(0,sY.spawn)(lx(),[e],{detached:!0,stdio:"ignore"});t.on("error",()=>{}),t.unref()}catch{}},"overlayHostDirIntoBox",0,fG,"ownerRepoFromOriginUrl",0,pS,"parseClaudeInventory",0,ds,"parseCredentialsUpdate",0,function(e){let t;if(null===e||"object"!=typeof e)return null;let r=e.agent;if("string"!=typeof r||!uN.some(e=>e.id===r&&e.credential))return null;let n=e.contentBase64;if("string"!=typeof n||0===n.length||n.length>262144)return null;try{t=Buffer.from(n,"base64").toString("utf8")}catch{return null}return uM(r,t)?{agent:r,content:t}:null},"parseEnvFileBody",0,lX,"parseFlatInventory",0,dw,"parseInboundSpec",0,function(e){let t=(e??"").trim();if(""===t||/^lock(ed)?$/i.test(t))return{mode:"locked",sources:[]};if(/^open$/i.test(t))return{mode:"open",sources:[]};/^whitelist\b:?/i.test(t)&&(t=t.replace(/^whitelist\b:?/i,"").trim());let r=t.split(/[\s,]+/).map(e=>e.trim()).filter(e=>e.length>0).map(cA);if(0===r.length)throw Error("inbound 'whitelist' needs at least one CIDR, e.g. `--inbound 203.0.113.5/32` or `--inbound whitelist:203.0.113.0/24`");return{mode:"whitelist",sources:r}},"parseItemizedChanges",0,f_,"parseItemizedEntries",0,fN,"parseModelAuthValue",0,pQ,"parseSeedMarkers",0,function(e){let t=[];for(let r of e.split("\n")){let e=r.trim();e.startsWith(`${dO} `)&&t.push(e.slice(dO.length+1))}return t},"parseSshTarget",0,lH,"parseWorkspaceList",0,fR,"pathExists",0,pi,"perBoxCarrySrc",0,uI,"pickFreePort",0,cT,"pickFreshBranch",0,lw,"pickNewItems",0,u3,"pingHealthz",0,c8,"planAgentSeeds",0,dA,"planCarryEntry",0,function(e){if("missing"===e.kind)return null;let t=e.absDest.startsWith("~/")?`${dV}/${e.absDest.slice(2)}`:e.absDest,r=t.endsWith("/")?t.slice(0,-1):t,n="dir"===e.kind,i=n?r:dX(r),o=n?e.exclude??[]:[],a=void 0===e.user?[`--reference=${dV}`]:[`${String(e.user)}:${String(e.user)}`],s=void 0!==e.mode?e.mode.toString(8).padStart(4,"0"):void 0,l=n?"":dK(e.absSrc),c=n?"":dK(t),u=t.startsWith(`${dV}/`)&&dX(t)!==dV;return{boxDest:t,isDir:n,parentDir:i,exclude:o,chownArgs:a,mode:s,fileBase:l,destBase:c,renameNeeded:!n&&l!==c,parentChainNeeded:u}},"planPropagateTargets",0,function(e,t){let r=u_(t.agent).dockerVolume,n=e.filter(e=>e.id!==t.sourceBoxId&&("all"===t.scope||(e.projectRoot??"")===(t.projectRoot??""))),i=new Map,o=[],a=[];for(let e of n){var s;if(e.agents&&!e.agents.includes(t.agent)){e.borrowedCredentials?.includes(t.agent)&&a.push(e);continue}if((e.provider??"docker")!=="docker"){o.push(e);continue}let n=(s=t.agent,(0,s3.agentConfigVolume)(e,s)??r);if(n===t.excludeVolume)continue;let l=i.get(n)??{boxNames:[],shared:n===r};l.boxNames.push(e.name),i.set(n,l)}return{dockerVolumes:[...i.entries()].map(([e,t])=>({volume:e,...t})),cloudBoxes:o,borrowingBoxes:a}},"pluginForProvider",0,l7,"pluginProviderNames",0,function(e=lq){return l2(e).plugins.flatMap(e=>e.providers)},"portIsOccupied",0,function(e,t=c1()){return new Promise(r=>{let n=(0,s1.connect)({host:"127.0.0.1",port:t}),i=e=>{n.destroy(),r(e)};n.setTimeout(e),n.once("connect",()=>i(!0)),n.once("timeout",()=>i(!1)),n.once("error",()=>i(!1))})},"prepareBackupDir",0,fa,"preparedStatePathFor",0,pm,"processAlive",0,c4,"projectSlugFromOriginUrl",0,function(e){let t=pS(e);return t?`${t.owner.replace(/[^A-Za-z0-9._-]/g,"-")}__${t.repo.replace(/[^A-Za-z0-9._-]/g,"-")}`:null},"propagateStagedSettings",0,dD,"providerBoxFilePorts",0,fz,"pruneBackups",0,fd,"pruneOrphanClaudeSshConfigs",0,lT,"ptyDir",0,p2,"ptyLogPath",0,function(e,t=s9){return(0,d.join)(t,"logs",`pty-${e}.log`)},"ptyMetaPath",0,p3,"ptySocketPath",0,p4,"publishManagedCredentials",0,cq,"pullClaudeExtrasViaTransport",0,df,"pullFlatConfigViaTransport",0,d$,"pullSqliteSnapshot",0,d5,"pullWorkspaceToHost",0,f1,"pushCredentialToBox",0,uz,"pushEnvFiles",0,dW,"readAgentboxSshAlias",0,lW,"readBackupManifest",0,fy,"readCliStamp",0,function(){return{cliVersion:process.env.AGENTBOX_CLI_VERSION??"unknown",cliCommit:process.env.AGENTBOX_CLI_COMMIT??"unknown"}},"readCredentialBackup",0,uV,"readHubToken",0,function(){return uy()},"readPluginRegistry",0,l4,"readPluginRegistrySync",0,l2,"readPreparedStateRaw",0,function(e){let t=pm(e);if(!(0,sZ.existsSync)(t))return null;try{return JSON.parse((0,sZ.readFileSync)(t,"utf8"))}catch{return null}},"readPtyMeta",0,p5,"readServiceUrlFields",0,fE,"readStagedWorkspace",0,f0,"readState",0,ln,"recordBox",0,lo,"recordBoxSsh",0,lc,"recordLastAgent",0,la,"recordPluginDescriptor",0,l6,"referencedPluginVersionKeys",0,function(e){let t=new Set;if(!u8(e))return t;let r=e.plugins;if(!u8(r))return t;for(let e of Object.values(r))if(Array.isArray(e))for(let r of e){if(!u8(r))continue;let e=r.installPath;if("string"!=typeof e)continue;let n=e.split("/").filter(e=>e.length>0);n.length<3||t.add(n.slice(-3).join("/"))}return t},"registerAgentPullModule",0,function(e){d6.set(e.id,e)},"registeredAgentPullModules",0,function(){return[...d6.values()]},"registryRefForSha",0,function(e,t=p$){return`${t}:sha-${e.slice(0,16)}`},"relayPort",0,c1,"removeBoxRecord",0,lf,"removeClaudeSshConfigs",0,lD,"removePluginRecord",0,l9,"removePtySession",0,p7,"removeStagingDir",0,dk,"renderAgentSettingEnv",0,dR,"renderCarryEntries",0,uj,"renderCarryTable",0,pX,"renderInstallRecipe",0,dB,"renderPackageInstall",0,dN,"reserveProjectIndex",0,lu,"resetRelayPort",0,function(){cZ=null,delete process.env[cY]},"resolveAgentSpec",0,u_,"resolveBackupTarget",0,function(e,t){let r,n=fi(e.projectRoot??e.workspacePath),i=(t.name??e.name).trim();if(0===i.length||i.includes("/")||"."===i||".."===i)throw Error(`name "${t.name??""}": a bot name must be a single path segment`);let o=void 0===t.keep?3:"number"==typeof t.keep?t.keep:Number.parseInt(t.keep,10);if(!Number.isInteger(o)||o<1)throw Error(`keep "${String(t.keep??"")}": expected a positive integer`);if(t.agent){let e=uL(t.agent);if(!e)throw Error(`agent "${t.agent}": no such agent`);r=e.id}else{let t=e.lastAgent??e.agents?.[0];r=t?uL(t)?.id:void 0}let a=ft(),s=fo(n,i,a);return{projectRoot:n,bot:i,stamp:a,dir:s,workspaceDir:(0,d.join)(s,"workspace"),keep:o,agent:r}},"resolveBotBundle",0,fw,"resolveBoxRef",0,function(e,t,r){if(void 0===e)return void 0===r?{kind:"none"}:lm(t,r);let n=e.trim();if(void 0!==r&&/^[1-9][0-9]*$/.test(n)){let e=Number.parseInt(n,10),i=t.boxes.find(t=>t.projectRoot===r&&t.projectIndex===e);return i?{kind:"ok",box:i}:{kind:"none"}}return lp(n,t)},"resolveCarry",0,pB,"resolveClaudeMemoryDir",0,dZ,"resolveCliEntry",0,c5,"resolveCloudSshTarget",0,co,"resolveContextFilesFrom",0,function(e,t){let r=[];for(let[n,i]of Object.entries(e)){let e=[(0,d.resolve)(t.contextDir,i.staged),(0,d.resolve)(t.devRoot,i.dev)].find(e=>(0,sZ.existsSync)(e));if(!e)return null;r.push({rel:n,abs:e})}return r},"resolveHostCredential",0,uX,"resolveHostCredentialFile",0,uK,"resolveHubServer",0,ub,"resolveInboundSources",0,function(e,t){if("open"===e.mode)return[...cD];let r=new Set;if(t&&t.trim().length>0&&r.add(cA(t)),"whitelist"===e.mode)for(let t of e.sources)r.add(cA(t));return[...r]},"resolveModelAuth",0,p0,"resolveModelAuthIngest",0,uZ,"resolveModelAuthSources",0,uJ,"resolvePerBoxCarry",0,uR,"resolveProviderDescriptor",0,ce,"resolveSshConfigTarget",0,cu,"resolveStagedRuntimeRoot",0,ur,"restartServiceArgv",0,cW,"restoreAgentState",0,fb,"restoreScope",0,function(e){return e.stateDir?"workspace+state":"workspace"},"restoreWorkspaceDir",0,function(e,t){return(0,d.join)(fn(e,t),"workspace")},"resyncWorkspace",0,d8,"rsyncPullToHost",0,fF,"runCarryGate",0,pH,"runDockerCredentialRefresh",0,uO,"runModelAuthIngest",0,u0,"scanHostEnvFiles",0,dH,"scpDownload",0,cm,"scpUpload",0,ch,"scratchBranchName",0,cL,"scrubAgentSessionEnv",0,c7,"scrubControlPlaneHubEnv",0,lJ,"secretsEnvPath",0,cJ,"seedAgentsVolume",0,d1,"seedExcludeTarArgs",0,function(){return fA.map(e=>`--exclude=${e}`)},"serviceAgentForBox",0,f$,"serviceSignInUrl",0,fk,"servicesStatusArgv",0,cH,"setBoxDisplayName",0,ls,"setCredentialPublisher",0,function(e){o=e},"setDockerCredentialRefresh",0,function(e){l=e},"setHubDockerContext",0,function(e){s=e},"setHubPortlessHooks",0,function(e){a=e},"setRelayPort",0,c0,"sha256OfFile",0,pg,"sharedRuntimeAssetPath",0,function(e){let t=[],r=process.env[un];r&&t.push(r);let n=ur((0,d.dirname)((0,s8.fileURLToPath)(s5.url)),`_shared/${e}`);for(let r of(n&&t.push(n),t)){let t=(0,d.resolve)(r,"_shared",e);if((0,sZ.existsSync)(t))return t}return null},"shortFingerprint",0,function(e){return e.slice(0,12)},"shouldAcceptCredentialUpdate",0,function(e,t,r){if(null===r)return{accept:!0,reason:"no existing backup"};if(r===t)return{accept:!1,reason:"unchanged"};let n=u_(e).credential?.freshness?.jsonPath;if(n){let e=n.join("."),i=uH(t,n),o=uH(r,n);return null===i?{accept:!1,reason:`incoming blob has no ${e}`}:null!==o&&i<=o?{accept:!1,reason:"not newer than backup"}:{accept:!0,reason:`newer ${e}`}}return{accept:!0,reason:"content changed"}},"shouldReclaimForVersion",0,c2,"sourceBoxRunningRefusal",0,function(e,t,r,n="force the restore"){return e&&"running"===t?`box ${e.name} is still running and holds ${r}'s identity \u2014 two live gateways cannot share one. Stop or destroy it, or ${n}.`:null},"sshDestination",0,cd,"sshExec",0,cp,"sshOptArgs",0,cf,"stageAgentStaticForUpload",0,pp,"stageAgentsStaticForUpload",0,ph,"stageBoxWorkspace",0,fQ,"stageDynamicSyncTarball",0,pn,"stageItemsViaTransport",0,dS,"stageRestoreWorkspace",0,fg,"stageSingleFileTarball",0,pf,"stagedRuntimeRootCandidates",0,ut,"statusBadge",0,function(e){return"ok"===e?"[ ok ]":"info"===e?"[info]":"warn"===e?"[warn]":"[FAIL]"},"stopHub",0,uT,"syncAgentboxSshConfig",0,lF,"tarballFromDir",0,pu,"toFileRow",0,pV,"toTarExcludes",0,pD,"transportSettingsTarget",0,function(e,t,r){let n=e=>`${t}/${e}`;return{label:r,exists:async t=>0===(await e.exec(["sh","-c",`test -e '${n(t)}'`])).exitCode,readText:t=>e.readText(n(t)),async writeText(t,r,i){let o=await (0,c.mkdtemp)((0,d.join)((0,u.tmpdir)(),"agentbox-target-write-"));try{let a=(0,d.join)(o,"file");await (0,c.writeFile)(a,r),await e.exec(["sh","-c",`mkdir -p '${(0,d.dirname)(n(t))}'`]),await e.pushFile(a,n(t)),i?.mode!==void 0&&await e.exec(["sh","-c",`chmod ${i.mode.toString(8)} '${n(t)}'`])}finally{await (0,c.rm)(o,{recursive:!0,force:!0})}},async copyIn(t,r,i){"dir"===i?(await e.exec(["sh","-c",`mkdir -p '${n(r)}'`]),await e.pushTree(t,n(r),{exclude:["node_modules"]})):(await e.exec(["sh","-c",`mkdir -p '${(0,d.dirname)(n(r))}'`]),await e.pushFile(t,n(r)))}}},"uploadWorkspaceToBox",0,f3,"upsertClaudeSshConfig",0,function(e){let t=l$(),r=lS(t),n=Array.isArray(r.sshConfigs)?r.sshConfigs:[],i=n.findIndex(t=>lk(t)===e.id);i>=0?n[i]=e:n.push(e),r.sshConfigs=n,lE(t,r)},"variantFingerprint",0,function(e,t={}){let r=pv(t.agents),n=px(t.agentSettings);if(0===n.length&&""===r)return e;let i=[...n];return""!==r&&i.push(`agents=${r}`),(0,s0.createHash)("sha256").update(`${e}\0${i.join("\0")}`).digest("hex")},"waitForSsh",0,cg,"withPerBoxCarry",0,uB,"withServiceSignIn",0,fT,"workspaceExcludes",0,fC,"writeBackupManifest",0,fs,"writeClaudeMergedRegistries",0,dd,"writeCredentialBackup",0,uW,"writeManagedSecrets",0,function(e,t){for(let t of e)delete process.env[t];for(let[e,r]of Object.entries(t))process.env[e]=r;let r=cJ();(0,sZ.mkdirSync)((0,d.dirname)(r),{recursive:!0});let n="";if((0,sZ.existsSync)(r))try{n=(0,sZ.readFileSync)(r,"utf8")}catch{n=""}let i=n.split(/\r?\n/).filter(t=>{let r=t.startsWith("export ")?t.slice(7):t,n=r.indexOf("=");if(n<=0)return!0;let i=r.slice(0,n).trim();return!e.includes(i)}).join("\n").replace(/\s+$/u,""),o=(i?`${i}
80
+ `:"")+Object.entries(t).map(([e,t])=>`${e}=${t}`).join("\n")+"\n",a=`${r}.tmp`;(0,sZ.writeFileSync)(a,o,{mode:384});try{(0,sZ.chmodSync)(a,384)}catch{}(0,sZ.renameSync)(a,r);try{(0,sZ.chmodSync)(r,384)}catch{}},"writePreparedStateRaw",0,function(e,t){let r=pm(e);(0,sZ.mkdirSync)((0,d.dirname)(r),{recursive:!0});let n=JSON.stringify(t,null,2)+"\n",i=`${r}.tmp`;(0,sZ.writeFileSync)(i,n,{mode:384}),(0,sZ.renameSync)(i,r)},"writePtyMeta",0,p6,"writeState",0,li],25206)}];
79
81
 
80
82
  //# sourceMappingURL=_0vg6gvw._.js.map