@madarco/agentbox 0.31.4 → 0.32.0

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 (722) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/_cloud-attach-6RKS3MAP.js +31 -0
  3. package/dist/{chunk-LR5RNEVO.js → chunk-27S7QLDF.js} +3 -3
  4. package/dist/{chunk-QT4MOS6R.js → chunk-2APGFWEU.js} +23 -23
  5. package/dist/{chunk-RUKTOHK7.js → chunk-3AYSA62C.js} +2 -2
  6. package/dist/{chunk-EXF4PLBN.js → chunk-3ISG5THX.js} +3 -3
  7. package/dist/{chunk-IFPTD73K.js → chunk-3L2DIPRM.js} +2 -2
  8. package/dist/{chunk-IQ6BQ2LX.js → chunk-4FOXMGJ7.js} +3 -3
  9. package/dist/{chunk-5UX2HAF4.js → chunk-5OKDSI6M.js} +43 -43
  10. package/dist/{chunk-KCDLAP5Q.js → chunk-66GAYIJZ.js} +3252 -936
  11. package/dist/chunk-66GAYIJZ.js.map +1 -0
  12. package/dist/{chunk-IF4VXKJK.js → chunk-6XMOBI5V.js} +3 -3
  13. package/dist/{chunk-OXBWZG2N.js → chunk-7QTBRHB7.js} +4 -4
  14. package/dist/{chunk-YSC4VY43.js → chunk-ANSPBIYG.js} +3 -3
  15. package/dist/{chunk-75JF44DH.js → chunk-AWI2TSWS.js} +2 -2
  16. package/dist/{chunk-2MBELUE6.js → chunk-CDRKQ5BH.js} +9 -9
  17. package/dist/{chunk-L567TKOK.js → chunk-CXAWPWGZ.js} +5 -5
  18. package/dist/{chunk-VWJBQGXD.js → chunk-EDJ6O6CI.js} +6 -6
  19. package/dist/{chunk-NKHRFR5G.js → chunk-GSMQL4IJ.js} +16 -16
  20. package/dist/chunk-GVNKIACA.js +223 -0
  21. package/dist/chunk-GVNKIACA.js.map +1 -0
  22. package/dist/{chunk-4Y365UYP.js → chunk-JWQYZ6V4.js} +2 -2
  23. package/dist/{chunk-AYREFYEF.js → chunk-KOTW7QQW.js} +4 -4
  24. package/dist/{chunk-BYZPRB7U.js → chunk-L4KBYI3I.js} +5 -5
  25. package/dist/{chunk-MJZPECVQ.js → chunk-M2DWTQRF.js} +2 -2
  26. package/dist/{chunk-PXH3DERD.js → chunk-MB2K74BI.js} +164 -2
  27. package/dist/chunk-MB2K74BI.js.map +1 -0
  28. package/dist/{chunk-GCS5XAPC.js → chunk-MI3V2MAE.js} +3 -3
  29. package/dist/{chunk-4LSLXBFN.js → chunk-MO3QJTVS.js} +6 -6
  30. package/dist/{chunk-AAMPHDB2.js → chunk-MPTE57BZ.js} +5 -5
  31. package/dist/{chunk-EP4IFSV5.js → chunk-PE5LPD23.js} +67 -24
  32. package/dist/chunk-PE5LPD23.js.map +1 -0
  33. package/dist/{chunk-M6VAID7T.js → chunk-QBVRWGXD.js} +2 -2
  34. package/dist/{chunk-4NO5MO2P.js → chunk-RIXW4HSE.js} +6 -6
  35. package/dist/{chunk-YL3VEQTS.js → chunk-S7LPQXR5.js} +5 -5
  36. package/dist/{chunk-CUIJ2PIN.js → chunk-TAZYSVLT.js} +26 -22
  37. package/dist/{chunk-CUIJ2PIN.js.map → chunk-TAZYSVLT.js.map} +1 -1
  38. package/dist/{chunk-QDVIMN57.js → chunk-TDPHZWJI.js} +4 -4
  39. package/dist/{chunk-IQMDGAMB.js → chunk-WLEGSKKE.js} +4 -4
  40. package/dist/{chunk-MBZ4UOWF.js → chunk-WTOG3CC6.js} +3 -3
  41. package/dist/{chunk-VQONUZE4.js → chunk-X6CO4WIX.js} +4 -4
  42. package/dist/{chunk-ENFWBFBI.js → chunk-XLJ4D4FI.js} +4 -4
  43. package/dist/{chunk-ZUTC2JZM.js → chunk-XNZ6UHTM.js} +27 -5
  44. package/dist/chunk-XNZ6UHTM.js.map +1 -0
  45. package/dist/{chunk-QWWDG5B7.js → chunk-XTNAIM7X.js} +6 -6
  46. package/dist/{chunk-X6SZPGL5.js → chunk-YNAJUTYC.js} +6 -6
  47. package/dist/{chunk-VOVRWIBC.js → chunk-YSACCMUB.js} +13 -13
  48. package/dist/{chunk-C67DVYWA.js → chunk-ZKOLV4ZN.js} +37 -2
  49. package/dist/chunk-ZKOLV4ZN.js.map +1 -0
  50. package/dist/{cli-KT5X4J74.js → cli-IFXU5XNZ.js} +8 -8
  51. package/dist/{cli-7JW54ZTA.js → cli-MZSWFSTW.js} +8 -8
  52. package/dist/{cli-7Z7BD23R.js → cli-O3WXOFNS.js} +7 -7
  53. package/dist/{cli-HFLU5QTD.js → cli-RQJUQJEP.js} +7 -7
  54. package/dist/{cli-XRF7WFE5.js → cli-ZGYSHJP7.js} +8 -8
  55. package/dist/cloud-backends.js +4 -4
  56. package/dist/{control-plane-DGLF4MBB.js → control-plane-3TII2JGM.js} +19 -19
  57. package/dist/{cp-hub-upload-7YESYCVS.js → cp-hub-upload-3W7Z4BMT.js} +6 -6
  58. package/dist/{custody-client-P7SCEDU2.js → custody-client-KYEZET6C.js} +4 -4
  59. package/dist/{deploy-hetzner-FOCNRRB2.js → deploy-hetzner-EO5PFKBG.js} +8 -8
  60. package/dist/{dist-MITAKWKQ.js → dist-3AR6L5MF.js} +7 -7
  61. package/dist/{dist-54VRDCUU.js → dist-4GHNQ2AK.js} +7 -7
  62. package/dist/{dist-63YBVZW4.js → dist-BFH537FO.js} +8 -8
  63. package/dist/{dist-TJJ6KBNZ.js → dist-ETGTZQUT.js} +255 -5
  64. package/dist/{dist-XSAPZOEG.js → dist-H2CSUDEI.js} +7 -7
  65. package/dist/{dist-CBPQZPQN.js → dist-IABCQB5D.js} +7 -7
  66. package/dist/{dist-2CAWJQT5.js → dist-JJZ3NZRO.js} +9 -5
  67. package/dist/{dist-E4VLIH3H.js → dist-RPBA2EL5.js} +7 -7
  68. package/dist/{dist-FHPNYDCF.js → dist-URWWHI3X.js} +8 -2
  69. package/dist/{dist-36WLI6E2.js → dist-V224SH3Z.js} +6 -6
  70. package/dist/{host-reach-drainer-XFLSMTSX.js → host-reach-drainer-NYN3YXHG.js} +2 -2
  71. package/dist/host-session-YP5RKV6T.js +29 -0
  72. package/dist/hub-OWUC4IGW.js +39 -0
  73. package/dist/{hub-adopt-IYZ3WXYN.js → hub-adopt-HYXFUPPO.js} +6 -6
  74. package/dist/{hub-api-client-WOZ2BQ6H.js → hub-api-client-BI3E37CF.js} +3 -3
  75. package/dist/{hub-docker-target-IQHX6OYX.js → hub-docker-target-6ODSK7ZE.js} +13 -13
  76. package/dist/index.js +1223 -229
  77. package/dist/index.js.map +1 -1
  78. package/dist/{plugin-update-2ACFHFUI.js → plugin-update-LI3QDA4K.js} +4 -4
  79. package/dist/prepare-MYFNDJPP.js +45 -0
  80. package/dist/prepared-custody-WSHX6XTQ.js +39 -0
  81. package/dist/{prepared-state-FO74QUCP-PZLOM6HD.js → prepared-state-FO74QUCP-M4Q2X3KN.js} +3 -3
  82. package/dist/{publish-credentials-TO5IIW2T.js → publish-credentials-FCEQSIPE.js} +8 -8
  83. package/dist/{registry-X33JZU6B.js → registry-GG23NEBF.js} +4 -4
  84. package/dist/relay-YUOIK3HN.js +22 -0
  85. package/dist/{remote-docker-share-YADHIHXV.js → remote-docker-share-4Z4VVUPG.js} +10 -10
  86. package/dist/remote-docker-share-4Z4VVUPG.js.map +1 -0
  87. package/dist/{tool-grant-push-7G2QAN3J.js → tool-grant-push-A2JYLJVF.js} +3 -3
  88. package/package.json +1 -1
  89. package/runtime/_shared/ctl.cjs +1026 -309
  90. package/runtime/digitalocean/ctl.cjs +1026 -309
  91. package/runtime/docker/packages/ctl/dist/bin.cjs +1026 -309
  92. package/runtime/e2b/ctl.cjs +1026 -309
  93. package/runtime/hetzner/ctl.cjs +1026 -309
  94. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  95. package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +24 -0
  96. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  97. package/runtime/hub/apps/hub/.next/routes-manifest.json +188 -0
  98. package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
  99. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js +2 -2
  100. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -1
  101. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -1
  102. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js +4 -4
  103. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -1
  104. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/agent/route.js.nft.json +1 -1
  105. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/backup/route.js +2 -2
  106. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/backup/route.js.nft.json +1 -1
  107. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -1
  108. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js +2 -2
  109. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js.nft.json +1 -1
  110. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/clone/route.js +2 -2
  111. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/clone/route.js.nft.json +1 -1
  112. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js +4 -4
  113. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -1
  114. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -1
  115. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/logs/route.js.nft.json +1 -1
  116. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +2 -2
  117. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -1
  118. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js +2 -2
  119. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -1
  120. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -1
  121. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js +2 -2
  122. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -1
  123. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -1
  124. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/upload/route.js +2 -2
  125. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/upload/route.js.nft.json +1 -1
  126. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js.nft.json +1 -1
  127. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/web/route.js.nft.json +1 -1
  128. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js +4 -4
  129. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -1
  130. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/checkpoints/route.js.nft.json +1 -1
  131. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/[...path]/route.js +3 -3
  132. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -1
  133. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -1
  134. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js +2 -2
  135. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -1
  136. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js +2 -2
  137. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -1
  138. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -1
  139. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -1
  140. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/route.js.nft.json +1 -1
  141. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route/app-paths-manifest.json +3 -0
  142. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route/build-manifest.json +9 -0
  143. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route/server-reference-manifest.json +4 -0
  144. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js +9 -0
  145. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js.map +5 -0
  146. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js.nft.json +1 -0
  147. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route_client-reference-manifest.js +3 -0
  148. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route/app-paths-manifest.json +3 -0
  149. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route/build-manifest.json +9 -0
  150. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route/server-reference-manifest.json +4 -0
  151. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js +10 -0
  152. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js.map +5 -0
  153. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js.nft.json +1 -0
  154. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route_client-reference-manifest.js +3 -0
  155. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route/app-paths-manifest.json +3 -0
  156. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route/build-manifest.json +9 -0
  157. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route/server-reference-manifest.json +4 -0
  158. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js +10 -0
  159. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js.map +5 -0
  160. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js.nft.json +1 -0
  161. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route_client-reference-manifest.js +3 -0
  162. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route/app-paths-manifest.json +3 -0
  163. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route/build-manifest.json +9 -0
  164. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route/server-reference-manifest.json +4 -0
  165. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js +9 -0
  166. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js.map +5 -0
  167. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js.nft.json +1 -0
  168. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route_client-reference-manifest.js +3 -0
  169. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route/app-paths-manifest.json +3 -0
  170. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route/build-manifest.json +9 -0
  171. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route/server-reference-manifest.json +4 -0
  172. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js +10 -0
  173. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js.map +5 -0
  174. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js.nft.json +1 -0
  175. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route_client-reference-manifest.js +3 -0
  176. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route/app-paths-manifest.json +3 -0
  177. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route/build-manifest.json +9 -0
  178. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route/server-reference-manifest.json +4 -0
  179. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js +9 -0
  180. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js.map +5 -0
  181. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js.nft.json +1 -0
  182. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route_client-reference-manifest.js +3 -0
  183. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route/app-paths-manifest.json +3 -0
  184. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route/build-manifest.json +9 -0
  185. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route/server-reference-manifest.json +4 -0
  186. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js +10 -0
  187. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js.map +5 -0
  188. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js.nft.json +1 -0
  189. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route_client-reference-manifest.js +3 -0
  190. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route/app-paths-manifest.json +3 -0
  191. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route/build-manifest.json +9 -0
  192. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route/server-reference-manifest.json +4 -0
  193. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js +10 -0
  194. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js.map +5 -0
  195. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js.nft.json +1 -0
  196. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route_client-reference-manifest.js +3 -0
  197. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -1
  198. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/bots/route.js.nft.json +1 -1
  199. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -1
  200. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/create-preflight/route.js +2 -2
  201. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/create-preflight/route.js.nft.json +1 -1
  202. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/restore/route.js +2 -2
  203. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/restore/route.js.nft.json +1 -1
  204. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -1
  205. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/seed/route.js.nft.json +1 -1
  206. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js +2 -2
  207. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -1
  208. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js +2 -2
  209. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -1
  210. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js +2 -2
  211. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -1
  212. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/size-check/route.js +2 -2
  213. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/size-check/route.js.nft.json +1 -1
  214. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -1
  215. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js +2 -2
  216. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js.nft.json +1 -1
  217. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/system/route.js.nft.json +1 -1
  218. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route/app-paths-manifest.json +3 -0
  219. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route/build-manifest.json +9 -0
  220. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route/server-reference-manifest.json +4 -0
  221. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js +10 -0
  222. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js.map +5 -0
  223. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js.nft.json +1 -0
  224. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route_client-reference-manifest.js +3 -0
  225. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route/app-paths-manifest.json +3 -0
  226. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route/build-manifest.json +9 -0
  227. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route/server-reference-manifest.json +4 -0
  228. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js +9 -0
  229. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js.map +5 -0
  230. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js.nft.json +1 -0
  231. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route_client-reference-manifest.js +3 -0
  232. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route/app-paths-manifest.json +3 -0
  233. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route/build-manifest.json +9 -0
  234. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route/server-reference-manifest.json +4 -0
  235. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js +9 -0
  236. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js.map +5 -0
  237. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js.nft.json +1 -0
  238. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route_client-reference-manifest.js +3 -0
  239. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route/app-paths-manifest.json +3 -0
  240. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route/build-manifest.json +9 -0
  241. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route/server-reference-manifest.json +4 -0
  242. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js +10 -0
  243. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js.map +5 -0
  244. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js.nft.json +1 -0
  245. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route_client-reference-manifest.js +3 -0
  246. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route/app-paths-manifest.json +3 -0
  247. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route/build-manifest.json +9 -0
  248. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route/server-reference-manifest.json +4 -0
  249. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js +10 -0
  250. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js.map +5 -0
  251. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js.nft.json +1 -0
  252. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route_client-reference-manifest.js +3 -0
  253. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route/app-paths-manifest.json +3 -0
  254. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route/build-manifest.json +9 -0
  255. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route/server-reference-manifest.json +4 -0
  256. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.js +9 -0
  257. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.js.map +5 -0
  258. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.js.nft.json +1 -0
  259. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route_client-reference-manifest.js +3 -0
  260. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route/app-paths-manifest.json +3 -0
  261. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route/build-manifest.json +9 -0
  262. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route/server-reference-manifest.json +4 -0
  263. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js +10 -0
  264. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js.map +5 -0
  265. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js.nft.json +1 -0
  266. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route_client-reference-manifest.js +3 -0
  267. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route/app-paths-manifest.json +3 -0
  268. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route/build-manifest.json +9 -0
  269. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route/server-reference-manifest.json +4 -0
  270. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js +10 -0
  271. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js.map +5 -0
  272. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js.nft.json +1 -0
  273. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route_client-reference-manifest.js +3 -0
  274. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route/app-paths-manifest.json +3 -0
  275. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route/build-manifest.json +9 -0
  276. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route/server-reference-manifest.json +4 -0
  277. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js +9 -0
  278. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js.map +5 -0
  279. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js.nft.json +1 -0
  280. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route_client-reference-manifest.js +3 -0
  281. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route/app-paths-manifest.json +3 -0
  282. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route/build-manifest.json +9 -0
  283. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route/server-reference-manifest.json +4 -0
  284. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js +10 -0
  285. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js.map +5 -0
  286. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js.nft.json +1 -0
  287. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route_client-reference-manifest.js +3 -0
  288. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route/app-paths-manifest.json +3 -0
  289. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route/build-manifest.json +9 -0
  290. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route/server-reference-manifest.json +4 -0
  291. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js +9 -0
  292. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js.map +5 -0
  293. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js.nft.json +1 -0
  294. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route_client-reference-manifest.js +3 -0
  295. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route/app-paths-manifest.json +3 -0
  296. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route/build-manifest.json +9 -0
  297. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route/server-reference-manifest.json +4 -0
  298. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js +10 -0
  299. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js.map +5 -0
  300. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js.nft.json +1 -0
  301. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route_client-reference-manifest.js +3 -0
  302. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route/app-paths-manifest.json +3 -0
  303. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route/build-manifest.json +9 -0
  304. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route/server-reference-manifest.json +4 -0
  305. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js +10 -0
  306. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js.map +5 -0
  307. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js.nft.json +1 -0
  308. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route_client-reference-manifest.js +3 -0
  309. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route/app-paths-manifest.json +3 -0
  310. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route/build-manifest.json +9 -0
  311. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route/server-reference-manifest.json +4 -0
  312. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js +10 -0
  313. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js.map +5 -0
  314. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js.nft.json +1 -0
  315. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route_client-reference-manifest.js +3 -0
  316. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route/app-paths-manifest.json +3 -0
  317. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route/build-manifest.json +9 -0
  318. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route/server-reference-manifest.json +4 -0
  319. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js +10 -0
  320. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js.map +5 -0
  321. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js.nft.json +1 -0
  322. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route_client-reference-manifest.js +3 -0
  323. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route/app-paths-manifest.json +3 -0
  324. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route/build-manifest.json +9 -0
  325. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route/server-reference-manifest.json +4 -0
  326. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js +10 -0
  327. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js.map +5 -0
  328. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js.nft.json +1 -0
  329. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route_client-reference-manifest.js +3 -0
  330. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  331. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  332. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
  333. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  334. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js.nft.json +1 -1
  335. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/web/route.js.nft.json +1 -1
  336. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page.js.nft.json +1 -1
  337. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page_client-reference-manifest.js +1 -1
  338. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  339. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  340. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
  341. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  342. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  343. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  344. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page.js.nft.json +1 -1
  345. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page_client-reference-manifest.js +1 -1
  346. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +1 -1
  347. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
  348. package/runtime/hub/apps/hub/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  349. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  350. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  351. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  352. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  353. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  354. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  355. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  356. package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  357. package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +24 -0
  358. package/runtime/hub/apps/hub/.next/server/chunks/00je_(dashboard)_api_v1_workspaces_[id]_tasks_[taskId]_assign_route_actions_1sufsej.js +3 -0
  359. package/runtime/hub/apps/hub/.next/server/chunks/00je_(dashboard)_api_v1_workspaces_[id]_tasks_[taskId]_done_route_actions_216dixx.js +3 -0
  360. package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_api_v1_managers_route_actions_1_vtgih.js +3 -0
  361. package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_api_v1_tasks_route_actions_1h8tg_m.js +3 -0
  362. package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_managers_sessions_route_actions_16dksub.js +3 -0
  363. package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_managers_start_route_actions_1g-vmis.js +3 -0
  364. package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_tasks_[taskId]_route_actions_03oih6y.js +3 -0
  365. package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_tasks_assign_route_actions_196zwo9.js +3 -0
  366. package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_tasks_reorder_route_actions_1zkcfk-.js +3 -0
  367. package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_workspaces_route_actions_12a7_y8.js +3 -0
  368. package/runtime/hub/apps/hub/.next/server/chunks/0web_next-internal_server_app_(dashboard)_api_v1_managers_[id]_route_actions_07cpyb_.js +3 -0
  369. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_attach_route_actions_0o-khw8.js +3 -0
  370. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_message_route_actions_0rjcqe5.js +3 -0
  371. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_notes_route_actions_1-mf4r_.js +3 -0
  372. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_resume_route_actions_0-cm1mu.js +3 -0
  373. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_stop_route_actions_16nrl1r.js +3 -0
  374. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_detect_route_actions_1sdbs-_.js +3 -0
  375. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_managers_route_actions_1sxymv0.js +3 -0
  376. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_rename_route_actions_0df5zi2.js +3 -0
  377. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_rescan_route_actions_1yra_w8.js +3 -0
  378. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_route_actions_1f56n_0.js +3 -0
  379. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_tasks_route_actions_1t-6quw.js +3 -0
  380. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_timeline_route_actions_0pbxblt.js +3 -0
  381. package/runtime/hub/apps/hub/.next/server/chunks/1viy_api_v1_workspaces_[id]_tasks_[taskId]_unassign_route_actions_18a1p_r.js +3 -0
  382. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-c97gb._.js +1 -1
  383. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0spnud2._.js → [root-of-the-server]__0-kl55b._.js} +1 -1
  384. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__028ifqb._.js → [root-of-the-server]__0-xlf9z._.js} +2 -2
  385. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__074mxl5._.js → [root-of-the-server]__0004tsz._.js} +2 -2
  386. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00bupbc._.js +1 -1
  387. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1cpr4qy._.js → [root-of-the-server]__0126167._.js} +1 -1
  388. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01fy5q0._.js +1 -1
  389. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02c077x._.js +3 -0
  390. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1ta1gr1._.js → [root-of-the-server]__02sueng._.js} +1 -1
  391. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0nndlre._.js → [root-of-the-server]__04-gm8c._.js} +2 -2
  392. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05uinnp._.js +1 -1
  393. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06wy8zz._.js +3 -0
  394. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__071c-t4._.js +3 -0
  395. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08jg8w8._.js +1 -1
  396. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09059m-._.js +1 -1
  397. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__092y7_z._.js +1 -1
  398. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09ti2-t._.js +3 -0
  399. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09y4pdw._.js +3 -0
  400. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_mog_h._.js +1 -1
  401. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a689u5._.js +3 -0
  402. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a8ere2._.js +3 -0
  403. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bzqrje._.js +3 -0
  404. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c_r3oe._.js +3 -0
  405. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cdoz9i._.js +1 -1
  406. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cmu4sk._.js +1 -1
  407. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cxjxz0._.js +1 -1
  408. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d27tlu._.js +3 -0
  409. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d3fx1z._.js +3 -0
  410. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dm5oqm._.js +1 -1
  411. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dy5g2k._.js +1 -1
  412. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0e1uaxg._.js +1 -1
  413. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0e6_t-d._.js +3 -0
  414. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ets4cd._.js +1 -1
  415. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f2u0ul._.js +1 -1
  416. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f9p_4f._.js +1 -1
  417. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f_jmq2._.js +1 -1
  418. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fksz_r._.js +1 -1
  419. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fpygqn._.js +3 -0
  420. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gym-rp._.js +1 -1
  421. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0hhlb2_._.js +1 -1
  422. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0i9phow._.js +1 -1
  423. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ikyoac._.js +1 -1
  424. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0j72bti._.js +1 -1
  425. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jb371p._.js +1 -1
  426. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jq6cdw._.js +3 -0
  427. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jt1d2s._.js +3 -0
  428. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0kcw8t0._.js +1 -1
  429. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0kdt9-i._.js +1 -1
  430. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0l27vs0._.js +1 -1
  431. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lc-j_n._.js +3 -0
  432. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lna-vq._.js +3 -0
  433. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0m5woxc._.js +1 -1
  434. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mi9xib._.js +3 -0
  435. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0muy7eg._.js +3 -0
  436. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nn0_b5._.js +3 -0
  437. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0no30or._.js +3 -0
  438. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0o3sjtx._.js +1 -1
  439. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0onk5r0._.js +1 -1
  440. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pik2ie._.js +3 -0
  441. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qde3vr._.js +1 -1
  442. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qt_r6a._.js +3 -0
  443. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ry8baf._.js +1 -1
  444. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sg4y_2._.js +3 -0
  445. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sgjn2j._.js +1 -1
  446. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0st6oln._.js +1 -1
  447. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0t0p64l._.js +1 -1
  448. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0tbl11-._.js +3 -0
  449. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ve_tqz._.js +1 -1
  450. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w4smfx._.js +3 -0
  451. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wo4sqj._.js +1 -1
  452. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wujjkl._.js +3 -0
  453. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xbu3yj._.js +3 -0
  454. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xl1-w6._.js +1 -1
  455. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yct1tu._.js +1 -1
  456. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yg67t0._.js +1 -1
  457. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ykw5oe._.js +3 -0
  458. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1c1rcl-._.js → [root-of-the-server]__0zznyx2._.js} +2 -2
  459. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1--u2xl._.js +3 -0
  460. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-8sj4i._.js +1 -1
  461. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10kmcrt._.js +3 -0
  462. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10l_-cd._.js +3 -0
  463. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10yfcvu._.js +1 -1
  464. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__112hqrh._.js +3 -0
  465. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11c-21i._.js +3 -0
  466. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11qbpq8._.js +3 -0
  467. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11s1mrd._.js +1 -1
  468. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__128w1nz._.js +3 -0
  469. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12b2kuv._.js +1 -1
  470. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12gbq5m._.js +1 -1
  471. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13nfpq5._.js +3 -0
  472. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13vl4-h._.js +1 -1
  473. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__153b7kv._.js +1 -1
  474. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__157kmse._.js +1 -1
  475. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16695dw._.js +1 -1
  476. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__166_uek._.js +3 -0
  477. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16o0ij7._.js +1 -1
  478. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__175lucf._.js +1 -1
  479. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17p53e3._.js +3 -0
  480. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17y9pmx._.js +3 -0
  481. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18ec5_t._.js +3 -0
  482. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18xpvkc._.js +1 -1
  483. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1925hyw._.js +3 -0
  484. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19ew1r2._.js +3 -0
  485. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19grunx._.js +1 -1
  486. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_4v0mh._.js +3 -0
  487. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_cbcl1._.js +1 -1
  488. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_wb2uh._.js +3 -0
  489. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_xgm2e._.js +3 -0
  490. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1an6-yb._.js +3 -0
  491. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1c0ex8m._.js +1 -1
  492. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1c1e08-._.js +3 -0
  493. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1c9f4uu._.js +1 -1
  494. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ci8hc2._.js +1 -1
  495. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cs6d52._.js +3 -0
  496. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d60scp._.js +3 -0
  497. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dicjoc._.js +3 -0
  498. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1diipl4._.js +3 -0
  499. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dp2exz._.js +1 -1
  500. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1epnstn._.js +1 -1
  501. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1fjnz2l._.js +3 -0
  502. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1g5wnt2._.js +1 -1
  503. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1g9v7bq._.js +1 -1
  504. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1gon0_4._.js +3 -0
  505. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h_59cs._.js +1 -1
  506. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h_q3sn._.js +3 -0
  507. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hlugb4._.js +1 -1
  508. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hux-70._.js +1 -1
  509. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i-7bnu._.js +3 -0
  510. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i_el2y._.js +3 -0
  511. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1j6clag._.js +1 -1
  512. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1k6q17t._.js +3 -0
  513. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1khvg39._.js +1 -1
  514. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lx9lyn._.js +3 -0
  515. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m36v6k._.js +1 -1
  516. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mgu19x._.js +3 -0
  517. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mhyrr5._.js +3 -0
  518. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mk_lpu._.js +3 -0
  519. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mt32fu._.js +1 -1
  520. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1n1_2tw._.js +1 -1
  521. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1na4sdw._.js +3 -0
  522. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ntihlm._.js +3 -0
  523. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1odu62n._.js +3 -0
  524. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q6xrlt._.js +2 -2
  525. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1r4x1-y._.js +3 -0
  526. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rjs_x0._.js +1 -1
  527. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rxud0j._.js +1 -1
  528. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1s5app0._.js +1 -1
  529. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sjz59l._.js +3 -0
  530. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1slo4q_._.js +1 -1
  531. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thrazp._.js +3 -0
  532. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1twtnwr._.js +1 -1
  533. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1txvsbk._.js +3 -0
  534. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1uch-60._.js +1 -1
  535. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1um2jum._.js +3 -0
  536. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1vnnuo1._.js +1 -1
  537. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wegvep._.js +3 -0
  538. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wi5roz._.js +1 -1
  539. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xa9oiv._.js +3 -0
  540. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ypmy86._.js +3 -0
  541. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zml9me._.js +1 -1
  542. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zrf_a6._.js +1 -1
  543. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__2019yzl._.js +3 -0
  544. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20jyxyo._.js +2 -2
  545. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20ybhif._.js +1 -1
  546. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20zl5fr._.js +1 -1
  547. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__212dyoi._.js +1 -1
  548. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__218oup-._.js +1 -1
  549. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__21abvx9._.js +3 -0
  550. package/runtime/hub/apps/hub/.next/server/chunks/_0907rw0._.js +2 -1
  551. package/runtime/hub/apps/hub/.next/server/chunks/_0mcxq5g._.js +1 -1
  552. package/runtime/hub/apps/hub/.next/server/chunks/_0vg6gvw._.js +41 -41
  553. package/runtime/hub/apps/hub/.next/server/chunks/apps_hub_app_(dashboard)_api_v1_lib_openapi_ts_1yokmzt._.js +1 -1
  554. package/runtime/hub/apps/hub/.next/server/chunks/apps_hub_app_(dashboard)_api_v1_lib_validate_ts_16dhbzz._.js +1 -1
  555. package/runtime/hub/apps/hub/.next/server/chunks/packages_relay_dist_control-plane_03a-9aj.js +6 -6
  556. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__03-x9xy._.js +1 -1
  557. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1jqga8h._.js +1 -1
  558. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r2xlss._.js +2 -1
  559. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_14-qzbg._.js +26 -26
  560. package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_relay_dist_control-plane_0ve-wz4.js +1 -1
  561. package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +24 -0
  562. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  563. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  564. package/runtime/hub/apps/hub/.next/static/chunks/{31e1wjin30i__.css → 03_fxfc3849ms.css} +1 -1
  565. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/[id]/[action]/route.ts +4 -2
  566. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.ts +6 -4
  567. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/route.ts +2 -1
  568. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/actor.ts +48 -0
  569. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/envelope.ts +5 -2
  570. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/openapi.ts +1687 -52
  571. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/validate.ts +527 -1
  572. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/attach/route.ts +26 -0
  573. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/message/route.ts +34 -0
  574. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/notes/route.ts +26 -0
  575. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/resume/route.ts +26 -0
  576. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/route.ts +34 -0
  577. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/stop/route.ts +23 -0
  578. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/detect/route.ts +33 -0
  579. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/route.ts +27 -0
  580. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/tasks/route.ts +30 -0
  581. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/managers/route.ts +19 -0
  582. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.ts +22 -0
  583. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.ts +61 -0
  584. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/rename/route.ts +25 -0
  585. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.ts +20 -0
  586. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/route.ts +34 -0
  587. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.ts +33 -0
  588. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.ts +23 -0
  589. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.ts +54 -0
  590. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.ts +25 -0
  591. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.ts +34 -0
  592. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.ts +33 -0
  593. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.ts +59 -0
  594. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.ts +25 -0
  595. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/route.ts +31 -0
  596. package/runtime/hub/apps/hub/{chunk-7JBH42LK.js → chunk-BR4WVGWJ.js} +2 -2
  597. package/runtime/hub/apps/hub/{chunk-AIFVVQPX.js → chunk-EVB2OTLU.js} +3311 -1031
  598. package/runtime/hub/apps/hub/{chunk-SM2XYDPL.js → chunk-FBNAIUXZ.js} +36 -1
  599. package/runtime/hub/apps/hub/{chunk-F6GOERHP.js → chunk-G2AEPH7C.js} +3 -3
  600. package/runtime/hub/apps/hub/{chunk-7IIG6MIB.js → chunk-JX5JUFSR.js} +9 -9
  601. package/runtime/hub/apps/hub/{chunk-AAF4CYVH.js → chunk-MD2UNTZR.js} +5 -5
  602. package/runtime/hub/apps/hub/{dist-DS5LGBGK.js → dist-3LDUYWPK.js} +7 -1
  603. package/runtime/hub/apps/hub/{dist-MQADLEEQ.js → dist-CJ6QFUFV.js} +4 -4
  604. package/runtime/hub/apps/hub/{dist-H7NIUVBD.js → dist-GGLWLMY6.js} +5 -5
  605. package/runtime/hub/apps/hub/{dist-YG4RVC24.js → dist-HLLYJGIT.js} +5 -5
  606. package/runtime/hub/apps/hub/{dist-VENYRIRW.js → dist-IIQU4I42.js} +4 -4
  607. package/runtime/hub/apps/hub/{dist-LV6CHJVA.js → dist-UFMCOK3W.js} +4 -4
  608. package/runtime/hub/apps/hub/{dist-BKCL4HAA.js → dist-XUNBQ4WM.js} +4 -4
  609. package/runtime/hub/apps/hub/{dist-YOTRYCRK.js → dist-Y2263LMY.js} +7 -3
  610. package/runtime/hub/apps/hub/{dist-RJBPZWSZ.js → dist-YV4M6NJO.js} +4 -4
  611. package/runtime/hub/apps/hub/{hub-worker-DLFLGKCV.js → hub-worker-LJYEEAJL.js} +6 -6
  612. package/runtime/hub/apps/hub/lib/backend/background.ts +19 -0
  613. package/runtime/hub/apps/hub/lib/backend/box-facts.ts +97 -0
  614. package/runtime/hub/apps/hub/lib/backend/box-prs.ts +213 -0
  615. package/runtime/hub/apps/hub/lib/backend/deps.ts +99 -0
  616. package/runtime/hub/apps/hub/lib/backend/errors.ts +7 -0
  617. package/runtime/hub/apps/hub/lib/backend/github-prs.ts +302 -0
  618. package/runtime/hub/apps/hub/lib/backend/managers.ts +748 -0
  619. package/runtime/hub/apps/hub/lib/backend/timeline-lanes.ts +150 -0
  620. package/runtime/hub/apps/hub/lib/backend/timeline.ts +611 -0
  621. package/runtime/hub/apps/hub/lib/backend/workspaces.ts +439 -0
  622. package/runtime/hub/apps/hub/lib/boxes/backend-types.ts +355 -10
  623. package/runtime/hub/apps/hub/lib/boxes/postgres-source.ts +3 -0
  624. package/runtime/hub/apps/hub/lib/boxes/source.ts +18 -1
  625. package/runtime/hub/apps/hub/lib/boxes/types.ts +66 -0
  626. package/runtime/hub/apps/hub/lib/hub-backend.ts +114 -7
  627. package/runtime/hub/apps/hub/{prepared-state-FO74QUCP-FZ6PT4LA.js → prepared-state-FO74QUCP-75UBPW5I.js} +2 -2
  628. package/runtime/hub/apps/hub/server.js +2032 -163
  629. package/runtime/hub/apps/hub/test/backend-managers-background.test.ts +336 -0
  630. package/runtime/hub/apps/hub/test/backend-managers.test.ts +493 -0
  631. package/runtime/hub/apps/hub/test/backend-workspaces.test.ts +208 -0
  632. package/runtime/hub/apps/hub/test/box-prs.test.ts +198 -0
  633. package/runtime/hub/apps/hub/test/timeline-lanes.test.ts +261 -0
  634. package/runtime/hub/apps/hub/test/timeline.test.ts +1185 -0
  635. package/runtime/hub/apps/hub/test/validate.test.ts +252 -0
  636. package/runtime/hub/apps/hub/tsconfig.tsbuildinfo +1 -1
  637. package/runtime/relay/bin.cjs +1399 -616
  638. package/runtime/vercel/ctl.cjs +1026 -309
  639. package/share/host-skills/agentbox-info/SKILL.md +25 -4
  640. package/dist/_cloud-attach-B3BCOZ7U.js +0 -31
  641. package/dist/chunk-C67DVYWA.js.map +0 -1
  642. package/dist/chunk-EP4IFSV5.js.map +0 -1
  643. package/dist/chunk-KCDLAP5Q.js.map +0 -1
  644. package/dist/chunk-PXH3DERD.js.map +0 -1
  645. package/dist/chunk-ZUTC2JZM.js.map +0 -1
  646. package/dist/hub-OMGLWQEV.js +0 -39
  647. package/dist/prepare-OOZF37J6.js +0 -45
  648. package/dist/prepared-custody-E7CSZJ6V.js +0 -39
  649. package/dist/relay-7D5NOFKS.js +0 -22
  650. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00o_3sf._.js +0 -3
  651. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08xwxyo._.js +0 -3
  652. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-mtsr6._.js +0 -3
  653. /package/dist/{_cloud-attach-B3BCOZ7U.js.map → _cloud-attach-6RKS3MAP.js.map} +0 -0
  654. /package/dist/{chunk-LR5RNEVO.js.map → chunk-27S7QLDF.js.map} +0 -0
  655. /package/dist/{chunk-QT4MOS6R.js.map → chunk-2APGFWEU.js.map} +0 -0
  656. /package/dist/{chunk-RUKTOHK7.js.map → chunk-3AYSA62C.js.map} +0 -0
  657. /package/dist/{chunk-EXF4PLBN.js.map → chunk-3ISG5THX.js.map} +0 -0
  658. /package/dist/{chunk-IFPTD73K.js.map → chunk-3L2DIPRM.js.map} +0 -0
  659. /package/dist/{chunk-IQ6BQ2LX.js.map → chunk-4FOXMGJ7.js.map} +0 -0
  660. /package/dist/{chunk-5UX2HAF4.js.map → chunk-5OKDSI6M.js.map} +0 -0
  661. /package/dist/{chunk-IF4VXKJK.js.map → chunk-6XMOBI5V.js.map} +0 -0
  662. /package/dist/{chunk-OXBWZG2N.js.map → chunk-7QTBRHB7.js.map} +0 -0
  663. /package/dist/{chunk-YSC4VY43.js.map → chunk-ANSPBIYG.js.map} +0 -0
  664. /package/dist/{chunk-75JF44DH.js.map → chunk-AWI2TSWS.js.map} +0 -0
  665. /package/dist/{chunk-2MBELUE6.js.map → chunk-CDRKQ5BH.js.map} +0 -0
  666. /package/dist/{chunk-L567TKOK.js.map → chunk-CXAWPWGZ.js.map} +0 -0
  667. /package/dist/{chunk-VWJBQGXD.js.map → chunk-EDJ6O6CI.js.map} +0 -0
  668. /package/dist/{chunk-NKHRFR5G.js.map → chunk-GSMQL4IJ.js.map} +0 -0
  669. /package/dist/{chunk-4Y365UYP.js.map → chunk-JWQYZ6V4.js.map} +0 -0
  670. /package/dist/{chunk-AYREFYEF.js.map → chunk-KOTW7QQW.js.map} +0 -0
  671. /package/dist/{chunk-BYZPRB7U.js.map → chunk-L4KBYI3I.js.map} +0 -0
  672. /package/dist/{chunk-MJZPECVQ.js.map → chunk-M2DWTQRF.js.map} +0 -0
  673. /package/dist/{chunk-GCS5XAPC.js.map → chunk-MI3V2MAE.js.map} +0 -0
  674. /package/dist/{chunk-4LSLXBFN.js.map → chunk-MO3QJTVS.js.map} +0 -0
  675. /package/dist/{chunk-AAMPHDB2.js.map → chunk-MPTE57BZ.js.map} +0 -0
  676. /package/dist/{chunk-M6VAID7T.js.map → chunk-QBVRWGXD.js.map} +0 -0
  677. /package/dist/{chunk-4NO5MO2P.js.map → chunk-RIXW4HSE.js.map} +0 -0
  678. /package/dist/{chunk-YL3VEQTS.js.map → chunk-S7LPQXR5.js.map} +0 -0
  679. /package/dist/{chunk-QDVIMN57.js.map → chunk-TDPHZWJI.js.map} +0 -0
  680. /package/dist/{chunk-IQMDGAMB.js.map → chunk-WLEGSKKE.js.map} +0 -0
  681. /package/dist/{chunk-MBZ4UOWF.js.map → chunk-WTOG3CC6.js.map} +0 -0
  682. /package/dist/{chunk-VQONUZE4.js.map → chunk-X6CO4WIX.js.map} +0 -0
  683. /package/dist/{chunk-ENFWBFBI.js.map → chunk-XLJ4D4FI.js.map} +0 -0
  684. /package/dist/{chunk-QWWDG5B7.js.map → chunk-XTNAIM7X.js.map} +0 -0
  685. /package/dist/{chunk-X6SZPGL5.js.map → chunk-YNAJUTYC.js.map} +0 -0
  686. /package/dist/{chunk-VOVRWIBC.js.map → chunk-YSACCMUB.js.map} +0 -0
  687. /package/dist/{cli-7JW54ZTA.js.map → cli-IFXU5XNZ.js.map} +0 -0
  688. /package/dist/{cli-7Z7BD23R.js.map → cli-MZSWFSTW.js.map} +0 -0
  689. /package/dist/{cli-HFLU5QTD.js.map → cli-O3WXOFNS.js.map} +0 -0
  690. /package/dist/{cli-KT5X4J74.js.map → cli-RQJUQJEP.js.map} +0 -0
  691. /package/dist/{cli-XRF7WFE5.js.map → cli-ZGYSHJP7.js.map} +0 -0
  692. /package/dist/{control-plane-DGLF4MBB.js.map → control-plane-3TII2JGM.js.map} +0 -0
  693. /package/dist/{cp-hub-upload-7YESYCVS.js.map → cp-hub-upload-3W7Z4BMT.js.map} +0 -0
  694. /package/dist/{custody-client-P7SCEDU2.js.map → custody-client-KYEZET6C.js.map} +0 -0
  695. /package/dist/{deploy-hetzner-FOCNRRB2.js.map → deploy-hetzner-EO5PFKBG.js.map} +0 -0
  696. /package/dist/{dist-2CAWJQT5.js.map → dist-3AR6L5MF.js.map} +0 -0
  697. /package/dist/{dist-54VRDCUU.js.map → dist-4GHNQ2AK.js.map} +0 -0
  698. /package/dist/{dist-36WLI6E2.js.map → dist-BFH537FO.js.map} +0 -0
  699. /package/dist/{dist-63YBVZW4.js.map → dist-ETGTZQUT.js.map} +0 -0
  700. /package/dist/{dist-CBPQZPQN.js.map → dist-H2CSUDEI.js.map} +0 -0
  701. /package/dist/{dist-FHPNYDCF.js.map → dist-IABCQB5D.js.map} +0 -0
  702. /package/dist/{dist-MITAKWKQ.js.map → dist-JJZ3NZRO.js.map} +0 -0
  703. /package/dist/{dist-E4VLIH3H.js.map → dist-RPBA2EL5.js.map} +0 -0
  704. /package/dist/{dist-TJJ6KBNZ.js.map → dist-URWWHI3X.js.map} +0 -0
  705. /package/dist/{dist-XSAPZOEG.js.map → dist-V224SH3Z.js.map} +0 -0
  706. /package/dist/{host-reach-drainer-XFLSMTSX.js.map → host-reach-drainer-NYN3YXHG.js.map} +0 -0
  707. /package/dist/{hub-OMGLWQEV.js.map → host-session-YP5RKV6T.js.map} +0 -0
  708. /package/dist/{hub-adopt-IYZ3WXYN.js.map → hub-OWUC4IGW.js.map} +0 -0
  709. /package/dist/{hub-api-client-WOZ2BQ6H.js.map → hub-adopt-HYXFUPPO.js.map} +0 -0
  710. /package/dist/{prepare-OOZF37J6.js.map → hub-api-client-BI3E37CF.js.map} +0 -0
  711. /package/dist/{hub-docker-target-IQHX6OYX.js.map → hub-docker-target-6ODSK7ZE.js.map} +0 -0
  712. /package/dist/{plugin-update-2ACFHFUI.js.map → plugin-update-LI3QDA4K.js.map} +0 -0
  713. /package/dist/{prepared-custody-E7CSZJ6V.js.map → prepare-MYFNDJPP.js.map} +0 -0
  714. /package/dist/{prepared-state-FO74QUCP-PZLOM6HD.js.map → prepared-custody-WSHX6XTQ.js.map} +0 -0
  715. /package/dist/{registry-X33JZU6B.js.map → prepared-state-FO74QUCP-M4Q2X3KN.js.map} +0 -0
  716. /package/dist/{publish-credentials-TO5IIW2T.js.map → publish-credentials-FCEQSIPE.js.map} +0 -0
  717. /package/dist/{relay-7D5NOFKS.js.map → registry-GG23NEBF.js.map} +0 -0
  718. /package/dist/{remote-docker-share-YADHIHXV.js.map → relay-YUOIK3HN.js.map} +0 -0
  719. /package/dist/{tool-grant-push-7G2QAN3J.js.map → tool-grant-push-A2JYLJVF.js.map} +0 -0
  720. /package/runtime/hub/apps/hub/.next/static/{o9_g9S5JH-r8bfNfmPa5H → QDhlg7V_fEVGv_NfM2cEJ}/_buildManifest.js +0 -0
  721. /package/runtime/hub/apps/hub/.next/static/{o9_g9S5JH-r8bfNfmPa5H → QDhlg7V_fEVGv_NfM2cEJ}/_clientMiddlewareManifest.js +0 -0
  722. /package/runtime/hub/apps/hub/.next/static/{o9_g9S5JH-r8bfNfmPa5H → QDhlg7V_fEVGv_NfM2cEJ}/_ssgManifest.js +0 -0
@@ -3726,11 +3726,11 @@ var init_base = __esm({
3726
3726
  "use strict";
3727
3727
  import_node_tty = __toESM(require("tty"), 1);
3728
3728
  hasColors = import_node_tty.default?.WriteStream?.prototype?.hasColors?.() ?? false;
3729
- format = (open4, close) => {
3729
+ format = (open6, close) => {
3730
3730
  if (!hasColors) {
3731
3731
  return (input) => input;
3732
3732
  }
3733
- const openCode = `\x1B[${open4}m`;
3733
+ const openCode = `\x1B[${open6}m`;
3734
3734
  const closeCode = `\x1B[${close}m`;
3735
3735
  return (input) => {
3736
3736
  const string = input + "";
@@ -4035,15 +4035,15 @@ var require_windows = __commonJS({
4035
4035
  }
4036
4036
  return false;
4037
4037
  }
4038
- function checkStat(stat20, path6, options) {
4039
- if (!stat20.isSymbolicLink() && !stat20.isFile()) {
4038
+ function checkStat(stat24, path6, options) {
4039
+ if (!stat24.isSymbolicLink() && !stat24.isFile()) {
4040
4040
  return false;
4041
4041
  }
4042
4042
  return checkPathExt(path6, options);
4043
4043
  }
4044
4044
  function isexe(path6, options, cb) {
4045
- fs2.stat(path6, function(er, stat20) {
4046
- cb(er, er ? false : checkStat(stat20, path6, options));
4045
+ fs2.stat(path6, function(er, stat24) {
4046
+ cb(er, er ? false : checkStat(stat24, path6, options));
4047
4047
  });
4048
4048
  }
4049
4049
  function sync(path6, options) {
@@ -4060,20 +4060,20 @@ var require_mode = __commonJS({
4060
4060
  isexe.sync = sync;
4061
4061
  var fs2 = require("fs");
4062
4062
  function isexe(path6, options, cb) {
4063
- fs2.stat(path6, function(er, stat20) {
4064
- cb(er, er ? false : checkStat(stat20, options));
4063
+ fs2.stat(path6, function(er, stat24) {
4064
+ cb(er, er ? false : checkStat(stat24, options));
4065
4065
  });
4066
4066
  }
4067
4067
  function sync(path6, options) {
4068
4068
  return checkStat(fs2.statSync(path6), options);
4069
4069
  }
4070
- function checkStat(stat20, options) {
4071
- return stat20.isFile() && checkMode(stat20, options);
4070
+ function checkStat(stat24, options) {
4071
+ return stat24.isFile() && checkMode(stat24, options);
4072
4072
  }
4073
- function checkMode(stat20, options) {
4074
- var mod = stat20.mode;
4075
- var uid = stat20.uid;
4076
- var gid = stat20.gid;
4073
+ function checkMode(stat24, options) {
4074
+ var mod = stat24.mode;
4075
+ var uid = stat24.uid;
4076
+ var gid = stat24.gid;
4077
4077
  var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
4078
4078
  var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
4079
4079
  var u2 = parseInt("100", 8);
@@ -11401,329 +11401,6 @@ var init_execa = __esm({
11401
11401
  }
11402
11402
  });
11403
11403
 
11404
- // ../core/dist/index.js
11405
- function dockerField(box, key) {
11406
- if (box.docker && box.docker[key] !== void 0) return box.docker[key];
11407
- return box[key];
11408
- }
11409
- function agentConfigVolume(box, agent) {
11410
- const map = dockerField(box, "agentConfigVolumes");
11411
- const fromMap = map?.[agent];
11412
- if (fromMap !== void 0) return fromMap;
11413
- if (agent === "claude") return dockerField(box, "claudeConfigVolume");
11414
- if (agent === "codex") return dockerField(box, "codexConfigVolume");
11415
- if (agent === "opencode") return dockerField(box, "opencodeConfigVolume");
11416
- return void 0;
11417
- }
11418
- function agentPushExcludes(spec, path6, target) {
11419
- return [
11420
- ...path6.allowDatabases ? [] : LIVE_DATABASE_EXCLUDES,
11421
- ...path6.exclude ?? [],
11422
- // An agent with no credential (`credential` absent) contributes nothing
11423
- // here: there is no file to keep out of a shared snapshot.
11424
- ...target === "snapshot" && spec.credential ? [spec.credential.boxRelPath] : []
11425
- ];
11426
- }
11427
- function resolveAgentInstall(install, settings) {
11428
- const key = install.alternatesFrom;
11429
- const chosen = key ? settings?.[key] : void 0;
11430
- const alt = typeof chosen === "string" ? install.alternates?.[chosen] : void 0;
11431
- return alt ?? install;
11432
- }
11433
- function modelAuthSourceId(s) {
11434
- return s.kind === "agent" ? s.agent : `env:${s.envKey}`;
11435
- }
11436
- function modelAuthEnvKey(id) {
11437
- return id.startsWith("env:") ? id.slice(4) : void 0;
11438
- }
11439
- function agentDirPrelude(agentDirs, credsSubdir) {
11440
- return [
11441
- `install -d -o ${BOX_USER} -g ${BOX_USER} ${agentDirs.join(" ")}`,
11442
- // Omitted for an agent that declares no `credential`: it gets no subpath of
11443
- // the shared credentials volume, so creating a dir there would reserve a
11444
- // mount point nothing will ever mount.
11445
- ...credsSubdir === void 0 ? [] : [
11446
- `mkdir -p ${BOX_CREDS_DIR}/${credsSubdir}`,
11447
- `chown -R ${BOX_USER}:${BOX_USER} ${BOX_CREDS_DIR} 2>/dev/null || true`
11448
- ]
11449
- ];
11450
- }
11451
- function substitutePlaceholders(text, context, onWarn) {
11452
- return text.replace(PLACEHOLDER_RE, (match, name) => {
11453
- if (!PLACEHOLDER_SET.has(name)) return match;
11454
- const value = context[name];
11455
- if (value === void 0) {
11456
- onWarn?.(`placeholder {{${name}}} has no value in this context \u2014 left untouched`);
11457
- return match;
11458
- }
11459
- return value;
11460
- });
11461
- }
11462
- function applyReplacements(content, opts) {
11463
- let out = content;
11464
- if (opts.env) {
11465
- out = substitutePlaceholders(out, opts.context, opts.onWarn);
11466
- }
11467
- for (const rule of opts.rules ?? []) {
11468
- const to = substitutePlaceholders(rule.to, opts.context, opts.onWarn);
11469
- if (rule.regex) {
11470
- let re;
11471
- try {
11472
- re = new RegExp(rule.from, rule.flags ?? "g");
11473
- } catch (err) {
11474
- throw new ReplaceError(
11475
- `invalid regex "${rule.from}": ${err instanceof Error ? err.message : String(err)}`
11476
- );
11477
- }
11478
- out = out.replace(re, to);
11479
- } else {
11480
- out = out.split(rule.from).join(to);
11481
- }
11482
- }
11483
- return out;
11484
- }
11485
- function deriveBoxHost(ctx) {
11486
- if (ctx.AGENTBOX_BOX_HOST === void 0 && ctx.AGENTBOX_BOX_NAME !== void 0) {
11487
- ctx.AGENTBOX_BOX_HOST = `${ctx.AGENTBOX_BOX_NAME}.localhost`;
11488
- }
11489
- return ctx;
11490
- }
11491
- function resolveRuleRefs(refs, replacements2, where) {
11492
- const out = [];
11493
- for (const name of refs) {
11494
- const set = replacements2[name];
11495
- if (set === void 0) {
11496
- const known = Object.keys(replacements2);
11497
- throw new ReplaceError(
11498
- `${where}: unknown replacements rule-set "${name}"` + (known.length > 0 ? ` (known: ${known.join(", ")})` : " (none declared)")
11499
- );
11500
- }
11501
- out.push(...set);
11502
- }
11503
- return out;
11504
- }
11505
- function promptId(topic, payload) {
11506
- const digest = (0, import_crypto.createHash)("sha256").update(topic).update(" ").update(JSON.stringify(payload) ?? "null").digest("hex").slice(0, 12);
11507
- return `${topic}:${digest}`;
11508
- }
11509
- function decodeMultiAnswer(value) {
11510
- const seen = /* @__PURE__ */ new Set();
11511
- for (const part of value.split(PROMPT_MULTI_SEPARATOR)) {
11512
- const v = part.trim();
11513
- if (v.length > 0) seen.add(v);
11514
- }
11515
- return [...seen];
11516
- }
11517
- function isAgentActivityState(v) {
11518
- return typeof v === "string" && AGENT_ACTIVITY_STATES.includes(v);
11519
- }
11520
- function parseAgentStatusEntry(raw) {
11521
- if (raw === null || typeof raw !== "object") return null;
11522
- const o2 = raw;
11523
- if (!isAgentActivityState(o2.state)) return null;
11524
- const entry = {
11525
- state: o2.state,
11526
- updatedAt: typeof o2.updatedAt === "string" ? o2.updatedAt : null,
11527
- sessionRunning: o2.sessionRunning === true
11528
- };
11529
- if (typeof o2.sessionTitle === "string" && o2.sessionTitle.length > 0) {
11530
- entry.sessionTitle = o2.sessionTitle;
11531
- }
11532
- const plan = o2.plan;
11533
- if (plan && typeof plan === "object" && typeof plan.plan === "string") {
11534
- entry.plan = {
11535
- plan: plan.plan,
11536
- capturedAt: typeof plan.capturedAt === "string" ? plan.capturedAt : ""
11537
- };
11538
- }
11539
- const question = o2.question;
11540
- if (question && typeof question === "object" && Array.isArray(question.questions)) {
11541
- entry.question = {
11542
- questions: question.questions,
11543
- capturedAt: typeof question.capturedAt === "string" ? question.capturedAt : ""
11544
- };
11545
- }
11546
- return entry;
11547
- }
11548
- function normalizeAgentStatus(raw) {
11549
- if (raw === null || typeof raw !== "object") return {};
11550
- const o2 = raw;
11551
- const out = {};
11552
- for (const key of LEGACY_AGENT_STATUS_KEYS) {
11553
- const entry = parseAgentStatusEntry(o2[key]);
11554
- if (entry) out[key] = entry;
11555
- }
11556
- const agents = o2.agents;
11557
- if (agents !== null && typeof agents === "object") {
11558
- for (const [id, body] of Object.entries(agents)) {
11559
- if (id.length === 0) continue;
11560
- const entry = parseAgentStatusEntry(body);
11561
- if (entry) out[id] = entry;
11562
- }
11563
- }
11564
- return out;
11565
- }
11566
- function pickPrimaryAgent(map) {
11567
- const entries = Object.entries(map).map(([agent, entry]) => ({ agent, entry }));
11568
- if (entries.length === 0) return null;
11569
- const busy = entries.find((e) => e.entry.state === "working" || e.entry.state === "compacting");
11570
- if (busy) return busy;
11571
- entries.sort((a2, b) => parseTime(b.entry.updatedAt) - parseTime(a2.entry.updatedAt));
11572
- return entries[0] ?? null;
11573
- }
11574
- function parseTime(iso) {
11575
- if (!iso) return 0;
11576
- const t = Date.parse(iso);
11577
- return Number.isNaN(t) ? 0 : t;
11578
- }
11579
- function parseDownloadKind(method) {
11580
- return method.split(".")[1] ?? "workspace";
11581
- }
11582
- function resolveHostPath(workspacePath, hostPath) {
11583
- if ((0, import_path.isAbsolute)(hostPath)) return hostPath;
11584
- if (hostPath === "~") return (0, import_os.homedir)();
11585
- if (hostPath.startsWith("~/")) return (0, import_path.join)((0, import_os.homedir)(), hostPath.slice(2));
11586
- return workspacePath ? (0, import_path.resolve)(workspacePath, hostPath) : (0, import_path.resolve)(hostPath);
11587
- }
11588
- async function realpathSafe(p) {
11589
- try {
11590
- return await (0, import_promises12.realpath)(p);
11591
- } catch {
11592
- return (0, import_path2.resolve)(p);
11593
- }
11594
- }
11595
- function isInside(child, parent) {
11596
- const c3 = (0, import_path2.resolve)(child);
11597
- const p = (0, import_path2.resolve)(parent);
11598
- if (c3 === p) return true;
11599
- return c3.startsWith(p + import_path2.sep);
11600
- }
11601
- async function realpathDeepestExisting(p) {
11602
- let cur = (0, import_path2.resolve)(p);
11603
- const tail = [];
11604
- for (; ; ) {
11605
- try {
11606
- const real = await (0, import_promises12.realpath)(cur);
11607
- return tail.length > 0 ? (0, import_path2.resolve)(real, ...tail.reverse()) : real;
11608
- } catch (err) {
11609
- if (err.code !== "ENOENT") return (0, import_path2.resolve)(p);
11610
- const parent = (0, import_path2.dirname)(cur);
11611
- if (parent === cur) return (0, import_path2.resolve)(p);
11612
- tail.push((0, import_path2.basename)(cur));
11613
- cur = parent;
11614
- }
11615
- }
11616
- }
11617
- async function isContainedInWorkspace(hostPath, workspacePath) {
11618
- if (!workspacePath) return false;
11619
- if (!(0, import_path2.isAbsolute)(hostPath)) return false;
11620
- if ((0, import_path2.normalize)(hostPath).split(import_path2.sep).includes("..")) return false;
11621
- const wsReal = await realpathSafe(workspacePath);
11622
- const real = await realpathDeepestExisting(hostPath);
11623
- return isInside(real, wsReal);
11624
- }
11625
- function looksLikeSecret(hostPath) {
11626
- const segs = (0, import_path2.normalize)(hostPath).split(import_path2.sep).filter(Boolean);
11627
- for (const seg of segs) {
11628
- if (SECRET_DIR_SEGMENTS.has(seg)) return true;
11629
- }
11630
- for (let i2 = 0; i2 + 1 < segs.length; i2++) {
11631
- if (segs[i2] === ".config" && segs[i2 + 1] === "gh") return true;
11632
- }
11633
- const base = (0, import_path2.basename)(hostPath);
11634
- if (SECRET_BASENAMES.has(base)) return true;
11635
- return SECRET_BASENAME_PATTERNS.some((re) => re.test(base));
11636
- }
11637
- function isScratchBranch(branch) {
11638
- return !!branch && branch.startsWith(SCRATCH_BRANCH_PREFIX);
11639
- }
11640
- function isSanctionedPushBranch(branch, sanctionedBranch) {
11641
- if (isScratchBranch(branch)) return true;
11642
- return isResolvedBranch(branch ?? "") && !!sanctionedBranch && branch === sanctionedBranch;
11643
- }
11644
- function resolveRemote(remote) {
11645
- return remote ?? "origin";
11646
- }
11647
- function resolveLandDest(src, as) {
11648
- return as && as.length > 0 ? as : src;
11649
- }
11650
- function landRefspec(src, dest, force) {
11651
- return `${force ? "+" : ""}${src}:refs/heads/${dest}`;
11652
- }
11653
- function upstreamRef(remote, branch) {
11654
- return `${remote}/${branch}`;
11655
- }
11656
- function remoteTrackingRef(remote, branch) {
11657
- return `refs/remotes/${remote}/${branch}`;
11658
- }
11659
- function isResolvedBranch(s) {
11660
- return s.length > 0 && s !== "HEAD";
11661
- }
11662
- function sanitizeGitArgs(args) {
11663
- return Array.isArray(args) ? args.filter((a2) => typeof a2 === "string") : [];
11664
- }
11665
- var import_crypto, import_os, import_path, import_promises12, import_path2, LIVE_DATABASE_EXCLUDES, BOX_USER, BOX_HOME, BOX_CREDS_DIR, BOX_ASSET_DIR, SETUP_GUIDE_PATH, IDENTITY_RULES_SENTINEL, PLACEHOLDER_KEYS, PLACEHOLDER_SET, ReplaceError, PLACEHOLDER_RE, PROMPT_MULTI_SEPARATOR, AGENT_ACTIVITY_STATES, LEGACY_AGENT_STATUS_KEYS, SECRET_DIR_SEGMENTS, SECRET_BASENAMES, SECRET_BASENAME_PATTERNS, SCRATCH_BRANCH_PREFIX;
11666
- var init_dist = __esm({
11667
- "../core/dist/index.js"() {
11668
- "use strict";
11669
- import_crypto = require("crypto");
11670
- import_os = require("os");
11671
- import_path = require("path");
11672
- import_promises12 = require("fs/promises");
11673
- import_path2 = require("path");
11674
- LIVE_DATABASE_EXCLUDES = ["*.sqlite*", "*.db", "*.db-*"];
11675
- BOX_USER = "vscode";
11676
- BOX_HOME = "/home/vscode";
11677
- BOX_CREDS_DIR = `${BOX_HOME}/.agentbox-creds`;
11678
- BOX_ASSET_DIR = "/usr/local/share/agentbox";
11679
- SETUP_GUIDE_PATH = `${BOX_ASSET_DIR}/setup-guide.md`;
11680
- IDENTITY_RULES_SENTINEL = "agentbox:identity-rules";
11681
- PLACEHOLDER_KEYS = [
11682
- "AGENTBOX_BOX_NAME",
11683
- "AGENTBOX_BOX_ID",
11684
- "AGENTBOX_BOX_KIND",
11685
- "AGENTBOX_HOST_WORKSPACE",
11686
- "AGENTBOX_PROJECT_ROOT",
11687
- // Convenience: the host this box is reachable at. Derived from
11688
- // AGENTBOX_BOX_NAME as `<box-name>.localhost` when not set explicitly (the
11689
- // portless host for docker/hetzner). Public-URL cloud providers
11690
- // (vercel/daytona/e2b) set it explicitly at boot to the real preview host
11691
- // (e.g. `<sub>.vercel.run`), which then wins over the derived fallback.
11692
- "AGENTBOX_BOX_HOST"
11693
- ];
11694
- PLACEHOLDER_SET = new Set(PLACEHOLDER_KEYS);
11695
- ReplaceError = class extends Error {
11696
- constructor(message) {
11697
- super(message);
11698
- this.name = "ReplaceError";
11699
- }
11700
- };
11701
- PLACEHOLDER_RE = /\{\{\s*([A-Z0-9_]+)\s*\}\}/g;
11702
- PROMPT_MULTI_SEPARATOR = ",";
11703
- AGENT_ACTIVITY_STATES = [
11704
- "working",
11705
- "idle",
11706
- "waiting",
11707
- "end-plan",
11708
- "question",
11709
- "compacting",
11710
- "error",
11711
- "unknown"
11712
- ];
11713
- LEGACY_AGENT_STATUS_KEYS = ["claude", "codex", "opencode"];
11714
- SECRET_DIR_SEGMENTS = /* @__PURE__ */ new Set([".ssh", ".aws", ".gnupg"]);
11715
- SECRET_BASENAMES = /* @__PURE__ */ new Set(["credentials", ".npmrc", ".netrc", ".pgpass", ".htpasswd"]);
11716
- SECRET_BASENAME_PATTERNS = [
11717
- /^\.env(\..+)?$/,
11718
- // .env, .env.local, .env.production
11719
- /\.(pem|key|pfx|p12|keystore|jks)$/i,
11720
- /^id_(rsa|dsa|ecdsa|ed25519)$/
11721
- // private SSH keys (not the .pub)
11722
- ];
11723
- SCRATCH_BRANCH_PREFIX = "agentbox/";
11724
- }
11725
- });
11726
-
11727
11404
  // ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js
11728
11405
  var require_identity = __commonJS({
11729
11406
  "../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js"(exports2) {
@@ -19139,26 +18816,26 @@ async function findProjectRoot(cwd) {
19139
18816
  const start = await canonicalize(cwd);
19140
18817
  let dir = start;
19141
18818
  for (let i2 = 0; i2 < 64; i2++) {
19142
- if (await fileExists((0, import_path3.join)(dir, WORKSPACE_CONFIG_BASENAME))) {
18819
+ if (await fileExists((0, import_path.join)(dir, WORKSPACE_CONFIG_BASENAME))) {
19143
18820
  return { root: dir, hasAgentboxYaml: true };
19144
18821
  }
19145
- const parent = (0, import_path3.dirname)(dir);
18822
+ const parent = (0, import_path.dirname)(dir);
19146
18823
  if (parent === dir) break;
19147
18824
  dir = parent;
19148
18825
  }
19149
18826
  return { root: start, hasAgentboxYaml: false };
19150
18827
  }
19151
18828
  async function canonicalize(p) {
19152
- const abs = (0, import_path3.resolve)(p);
18829
+ const abs = (0, import_path.resolve)(p);
19153
18830
  try {
19154
- return await (0, import_promises13.realpath)(abs);
18831
+ return await (0, import_promises12.realpath)(abs);
19155
18832
  } catch {
19156
18833
  return abs;
19157
18834
  }
19158
18835
  }
19159
18836
  async function fileExists(p) {
19160
18837
  try {
19161
- const st = await (0, import_promises13.stat)(p);
18838
+ const st = await (0, import_promises12.stat)(p);
19162
18839
  return st.isFile();
19163
18840
  } catch {
19164
18841
  return false;
@@ -19166,25 +18843,25 @@ async function fileExists(p) {
19166
18843
  }
19167
18844
  function hashProjectPath(absPath) {
19168
18845
  const normalised = absPath.length > 1 && absPath.endsWith("/") ? absPath.slice(0, -1) : absPath;
19169
- return (0, import_crypto2.createHash)("sha1").update(normalised).digest("hex").slice(0, 16);
18846
+ return (0, import_crypto.createHash)("sha1").update(normalised).digest("hex").slice(0, 16);
19170
18847
  }
19171
18848
  function sanitizeMnemonic(raw) {
19172
18849
  return raw.toLowerCase().replace(/-/g, "_").replace(/[^a-z0-9_]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").slice(0, 32) || "unnamed";
19173
18850
  }
19174
18851
  function projectDirSegment(absPath) {
19175
- return `${hashProjectPath(absPath)}-${sanitizeMnemonic((0, import_path3.basename)(absPath))}`;
18852
+ return `${hashProjectPath(absPath)}-${sanitizeMnemonic((0, import_path.basename)(absPath))}`;
19176
18853
  }
19177
18854
  function projectConfigDir(absPath) {
19178
- return (0, import_path3.join)(PROJECTS_DIR, projectDirSegment(absPath));
18855
+ return (0, import_path.join)(PROJECTS_DIR, projectDirSegment(absPath));
19179
18856
  }
19180
18857
  function projectConfigFile(absPath) {
19181
- return (0, import_path3.join)(projectConfigDir(absPath), "config.yaml");
18858
+ return (0, import_path.join)(projectConfigDir(absPath), "config.yaml");
19182
18859
  }
19183
18860
  function projectMetaFile(absPath) {
19184
- return (0, import_path3.join)(projectConfigDir(absPath), "meta.json");
18861
+ return (0, import_path.join)(projectConfigDir(absPath), "meta.json");
19185
18862
  }
19186
18863
  function workspaceConfigFile(workspacePath) {
19187
- return (0, import_path3.join)(workspacePath, WORKSPACE_CONFIG_BASENAME);
18864
+ return (0, import_path.join)(workspacePath, WORKSPACE_CONFIG_BASENAME);
19188
18865
  }
19189
18866
  async function configPathFor(scope, cwd) {
19190
18867
  if (scope === "global") return GLOBAL_CONFIG_FILE;
@@ -19193,10 +18870,10 @@ async function configPathFor(scope, cwd) {
19193
18870
  return workspaceConfigFile(root.root);
19194
18871
  }
19195
18872
  function projectToolsFile(absPath) {
19196
- return (0, import_path3.join)(projectConfigDir(absPath), "tools.yaml");
18873
+ return (0, import_path.join)(projectConfigDir(absPath), "tools.yaml");
19197
18874
  }
19198
18875
  function projectCarryFile(absPath) {
19199
- return (0, import_path3.join)(projectConfigDir(absPath), "carry.yaml");
18876
+ return (0, import_path.join)(projectConfigDir(absPath), "carry.yaml");
19200
18877
  }
19201
18878
  function isSetting(v) {
19202
18879
  if (!v || typeof v !== "object") return false;
@@ -19630,7 +19307,7 @@ function collectWarning(into, message) {
19630
19307
  async function loadOptionalUserConfig(path6, warnings) {
19631
19308
  let text;
19632
19309
  try {
19633
- text = await (0, import_promises14.readFile)(path6, "utf8");
19310
+ text = await (0, import_promises13.readFile)(path6, "utf8");
19634
19311
  } catch (err) {
19635
19312
  if (err.code === "ENOENT") return {};
19636
19313
  throw err;
@@ -19641,7 +19318,7 @@ async function loadProjectAgentboxDefaults(workspacePath, warnings = []) {
19641
19318
  const path6 = workspaceConfigFile(workspacePath);
19642
19319
  let text;
19643
19320
  try {
19644
- text = await (0, import_promises14.readFile)(path6, "utf8");
19321
+ text = await (0, import_promises13.readFile)(path6, "utf8");
19645
19322
  } catch (err) {
19646
19323
  if (err.code === "ENOENT") return {};
19647
19324
  throw err;
@@ -19820,12 +19497,12 @@ function resolveDaytonaRegion(cfg) {
19820
19497
  async function withFileLock(path6, fn, opts = {}) {
19821
19498
  const staleMs = opts.staleMs ?? LOCK_STALE_MS;
19822
19499
  const lockPath = `${path6}.lock`;
19823
- await (0, import_promises15.mkdir)((0, import_path4.dirname)(path6), { recursive: true });
19500
+ await (0, import_promises14.mkdir)((0, import_path2.dirname)(path6), { recursive: true });
19824
19501
  const deadline = Date.now() + (opts.acquireTimeoutMs ?? LOCK_ACQUIRE_TIMEOUT_MS);
19825
19502
  let held = false;
19826
19503
  while (!held) {
19827
19504
  try {
19828
- const fh = await (0, import_promises15.open)(lockPath, "wx");
19505
+ const fh = await (0, import_promises14.open)(lockPath, "wx");
19829
19506
  await fh.writeFile(`${String(process.pid)}
19830
19507
  `);
19831
19508
  await fh.close();
@@ -19833,22 +19510,22 @@ async function withFileLock(path6, fn, opts = {}) {
19833
19510
  } catch (err) {
19834
19511
  if (err.code !== "EEXIST") throw err;
19835
19512
  try {
19836
- const st = await (0, import_promises15.stat)(lockPath);
19513
+ const st = await (0, import_promises14.stat)(lockPath);
19837
19514
  if (Date.now() - st.mtimeMs > staleMs) {
19838
- await (0, import_promises15.rm)(lockPath, { force: true });
19515
+ await (0, import_promises14.rm)(lockPath, { force: true });
19839
19516
  continue;
19840
19517
  }
19841
19518
  } catch {
19842
19519
  continue;
19843
19520
  }
19844
19521
  if (Date.now() >= deadline) break;
19845
- await (0, import_promises16.setTimeout)(LOCK_RETRY_MS);
19522
+ await (0, import_promises15.setTimeout)(LOCK_RETRY_MS);
19846
19523
  }
19847
19524
  }
19848
19525
  try {
19849
19526
  return await fn();
19850
19527
  } finally {
19851
- if (held) await (0, import_promises15.rm)(lockPath, { force: true }).catch(() => {
19528
+ if (held) await (0, import_promises14.rm)(lockPath, { force: true }).catch(() => {
19852
19529
  });
19853
19530
  }
19854
19531
  }
@@ -19914,7 +19591,7 @@ async function unsetConfigValue(scope, key, cwd) {
19914
19591
  async function listProjectsConfigured() {
19915
19592
  let entries;
19916
19593
  try {
19917
- entries = await (0, import_promises18.readdir)(PROJECTS_DIR);
19594
+ entries = await (0, import_promises17.readdir)(PROJECTS_DIR);
19918
19595
  } catch (err) {
19919
19596
  if (err.code === "ENOENT") return [];
19920
19597
  throw err;
@@ -19950,10 +19627,10 @@ async function pruneOrphanProjectConfigs(opts = {}) {
19950
19627
  const keep = new Set(opts.protectedPaths ?? []);
19951
19628
  const removed = [];
19952
19629
  for (const entry of await listProjectsConfigured()) {
19953
- if (!(0, import_path5.isAbsolute)(entry.originalPath) || keep.has(entry.originalPath)) continue;
19630
+ if (!(0, import_path3.isAbsolute)(entry.originalPath) || keep.has(entry.originalPath)) continue;
19954
19631
  let missing = false;
19955
19632
  try {
19956
- await (0, import_promises17.stat)(entry.originalPath);
19633
+ await (0, import_promises16.stat)(entry.originalPath);
19957
19634
  } catch (err) {
19958
19635
  if (err.code === "ENOENT") missing = true;
19959
19636
  }
@@ -19961,7 +19638,7 @@ async function pruneOrphanProjectConfigs(opts = {}) {
19961
19638
  removed.push({ hash: entry.hash, originalPath: entry.originalPath });
19962
19639
  if (!dryRun) {
19963
19640
  try {
19964
- await (0, import_promises17.rm)((0, import_path5.join)(PROJECTS_DIR, entry.dirName), { recursive: true, force: true });
19641
+ await (0, import_promises16.rm)((0, import_path3.join)(PROJECTS_DIR, entry.dirName), { recursive: true, force: true });
19965
19642
  } catch {
19966
19643
  }
19967
19644
  }
@@ -19971,23 +19648,23 @@ async function pruneOrphanProjectConfigs(opts = {}) {
19971
19648
  async function bumpProjectGcCounter() {
19972
19649
  let prior = 0;
19973
19650
  try {
19974
- const parsed = JSON.parse(await (0, import_promises17.readFile)(PROJECT_GC_COUNTER_FILE, "utf8"));
19651
+ const parsed = JSON.parse(await (0, import_promises16.readFile)(PROJECT_GC_COUNTER_FILE, "utf8"));
19975
19652
  if (typeof parsed.creates === "number" && Number.isFinite(parsed.creates)) {
19976
19653
  prior = parsed.creates;
19977
19654
  }
19978
19655
  } catch {
19979
19656
  }
19980
19657
  const next = prior + 1;
19981
- await (0, import_promises17.mkdir)(PROJECTS_DIR, { recursive: true });
19658
+ await (0, import_promises16.mkdir)(PROJECTS_DIR, { recursive: true });
19982
19659
  const tmp = `${PROJECT_GC_COUNTER_FILE}.tmp-${process.pid.toString()}-${Date.now().toString(36)}`;
19983
- await (0, import_promises17.writeFile)(tmp, JSON.stringify({ creates: next }) + "\n", { encoding: "utf8", mode: 420 });
19984
- await (0, import_promises17.rename)(tmp, PROJECT_GC_COUNTER_FILE);
19660
+ await (0, import_promises16.writeFile)(tmp, JSON.stringify({ creates: next }) + "\n", { encoding: "utf8", mode: 420 });
19661
+ await (0, import_promises16.rename)(tmp, PROJECT_GC_COUNTER_FILE);
19985
19662
  return next;
19986
19663
  }
19987
19664
  async function readMeta(dirName) {
19988
19665
  const metaPath = `${PROJECTS_DIR}/${dirName}/meta.json`;
19989
19666
  try {
19990
- const text = await (0, import_promises17.readFile)(metaPath, "utf8");
19667
+ const text = await (0, import_promises16.readFile)(metaPath, "utf8");
19991
19668
  const parsed = JSON.parse(text);
19992
19669
  if (typeof parsed["originalPath"] !== "string") return null;
19993
19670
  return {
@@ -20005,7 +19682,7 @@ async function readMeta(dirName) {
20005
19682
  }
20006
19683
  async function fileExists2(p) {
20007
19684
  try {
20008
- const st = await (0, import_promises17.stat)(p);
19685
+ const st = await (0, import_promises16.stat)(p);
20009
19686
  return st.isFile();
20010
19687
  } catch {
20011
19688
  return false;
@@ -20029,7 +19706,7 @@ function parseDocBody(text, label) {
20029
19706
  async function readExistingDoc(path6) {
20030
19707
  let text;
20031
19708
  try {
20032
- text = await (0, import_promises17.readFile)(path6, "utf8");
19709
+ text = await (0, import_promises16.readFile)(path6, "utf8");
20033
19710
  } catch (err) {
20034
19711
  if (err.code === "ENOENT") return {};
20035
19712
  throw err;
@@ -20074,11 +19751,11 @@ function unsetLeaf(doc, key) {
20074
19751
  return true;
20075
19752
  }
20076
19753
  async function atomicWriteYaml(path6, doc) {
20077
- await (0, import_promises17.mkdir)((0, import_path5.dirname)(path6), { recursive: true });
19754
+ await (0, import_promises16.mkdir)((0, import_path3.dirname)(path6), { recursive: true });
20078
19755
  const text = Object.keys(doc).length === 0 ? "# managed by agentbox config \u2014 empty\n" : (0, import_yaml3.stringify)(doc);
20079
19756
  const tmp = `${path6}.tmp-${process.pid.toString()}-${Date.now().toString(36)}`;
20080
- await (0, import_promises17.writeFile)(tmp, text, { encoding: "utf8", mode: 420 });
20081
- await (0, import_promises17.rename)(tmp, path6);
19757
+ await (0, import_promises16.writeFile)(tmp, text, { encoding: "utf8", mode: 420 });
19758
+ await (0, import_promises16.rename)(tmp, path6);
20082
19759
  }
20083
19760
  async function registerProject(absPath, opts = {}) {
20084
19761
  await touchProjectMeta(absPath, opts.originUrl);
@@ -20086,12 +19763,12 @@ async function registerProject(absPath, opts = {}) {
20086
19763
  async function unregisterProject(hash) {
20087
19764
  const entry = (await listProjectsConfigured()).find((e) => e.hash === hash);
20088
19765
  if (!entry) return false;
20089
- await (0, import_promises17.rm)((0, import_path5.join)(PROJECTS_DIR, entry.dirName), { recursive: true, force: true });
19766
+ await (0, import_promises16.rm)((0, import_path3.join)(PROJECTS_DIR, entry.dirName), { recursive: true, force: true });
20090
19767
  return true;
20091
19768
  }
20092
19769
  async function touchProjectMeta(absPath, originUrl) {
20093
19770
  const metaPath = projectMetaFile(absPath);
20094
- await (0, import_promises17.mkdir)((0, import_path5.dirname)(metaPath), { recursive: true });
19771
+ await (0, import_promises16.mkdir)((0, import_path3.dirname)(metaPath), { recursive: true });
20095
19772
  await withFileLock(
20096
19773
  metaPath,
20097
19774
  async () => {
@@ -20113,7 +19790,7 @@ async function touchProjectMeta(absPath, originUrl) {
20113
19790
  }
20114
19791
  async function readMetaFile(metaPath) {
20115
19792
  try {
20116
- const parsed = JSON.parse(await (0, import_promises17.readFile)(metaPath, "utf8"));
19793
+ const parsed = JSON.parse(await (0, import_promises16.readFile)(metaPath, "utf8"));
20117
19794
  return parsed && typeof parsed === "object" ? parsed : {};
20118
19795
  } catch {
20119
19796
  return {};
@@ -20121,8 +19798,8 @@ async function readMetaFile(metaPath) {
20121
19798
  }
20122
19799
  async function writeMetaFile(metaPath, doc) {
20123
19800
  const tmp = `${metaPath}.tmp-${process.pid.toString()}-${Date.now().toString(36)}`;
20124
- await (0, import_promises17.writeFile)(tmp, JSON.stringify(doc, null, 2) + "\n", { encoding: "utf8", mode: 420 });
20125
- await (0, import_promises17.rename)(tmp, metaPath);
19801
+ await (0, import_promises16.writeFile)(tmp, JSON.stringify(doc, null, 2) + "\n", { encoding: "utf8", mode: 420 });
19802
+ await (0, import_promises16.rename)(tmp, metaPath);
20126
19803
  }
20127
19804
  async function recordProjectLastUsed(absPath, used) {
20128
19805
  const provider = used.provider?.trim();
@@ -20149,7 +19826,7 @@ async function recordProjectLastUsed(absPath, used) {
20149
19826
  async function readCarryGrant(projectRoot) {
20150
19827
  let text;
20151
19828
  try {
20152
- text = await (0, import_promises19.readFile)(projectCarryFile(projectRoot), "utf8");
19829
+ text = await (0, import_promises18.readFile)(projectCarryFile(projectRoot), "utf8");
20153
19830
  } catch {
20154
19831
  return void 0;
20155
19832
  }
@@ -20171,18 +19848,18 @@ async function readCarryGrant(projectRoot) {
20171
19848
  }
20172
19849
  async function writeCarryGrant(projectRoot, grant) {
20173
19850
  const file = projectCarryFile(projectRoot);
20174
- await (0, import_promises19.mkdir)((0, import_path6.dirname)(file), { recursive: true });
19851
+ await (0, import_promises18.mkdir)((0, import_path4.dirname)(file), { recursive: true });
20175
19852
  const header = "# agentbox carry grant \u2014 the file list you approved for this project.\n# An agentbox.yaml `carry:` entry is a request until it is approved here.\n# Change the list and the next create asks again; `--carry ask` re-asks now.\n";
20176
- await (0, import_promises19.writeFile)(file, header + (0, import_yaml4.stringify)({ ...grant }), "utf8");
19853
+ await (0, import_promises18.writeFile)(file, header + (0, import_yaml4.stringify)({ ...grant }), "utf8");
20177
19854
  }
20178
19855
  async function removeCarryGrant(projectRoot) {
20179
19856
  const file = projectCarryFile(projectRoot);
20180
19857
  try {
20181
- await (0, import_promises19.readFile)(file, "utf8");
19858
+ await (0, import_promises18.readFile)(file, "utf8");
20182
19859
  } catch {
20183
19860
  return false;
20184
19861
  }
20185
- await (0, import_promises19.rm)(file, { force: true });
19862
+ await (0, import_promises18.rm)(file, { force: true });
20186
19863
  return true;
20187
19864
  }
20188
19865
  async function loadGrantedTools(cwd, opts = {}) {
@@ -20208,7 +19885,7 @@ async function resolveProjectToolsFile(cwd) {
20208
19885
  async function readToolsFile(file) {
20209
19886
  let raw;
20210
19887
  try {
20211
- raw = await (0, import_promises20.readFile)(file, "utf8");
19888
+ raw = await (0, import_promises19.readFile)(file, "utf8");
20212
19889
  } catch {
20213
19890
  return [];
20214
19891
  }
@@ -20250,7 +19927,7 @@ async function removeToolGrant(file, name) {
20250
19927
  return true;
20251
19928
  }
20252
19929
  async function persist(file, grants) {
20253
- await (0, import_promises20.mkdir)((0, import_path7.dirname)(file), { recursive: true });
19930
+ await (0, import_promises19.mkdir)((0, import_path5.dirname)(file), { recursive: true });
20254
19931
  const tools = {};
20255
19932
  for (const g of grants.sort((a2, b) => a2.name.localeCompare(b.name))) {
20256
19933
  const rest = { bin: g.bin, source: g.source };
@@ -20261,7 +19938,7 @@ async function persist(file, grants) {
20261
19938
  tools[g.name] = rest;
20262
19939
  }
20263
19940
  const header = "# agentbox host-tool grants \u2014 written by `agentbox tools` and by approved\n# in-box `agentbox-ctl tool request` calls. The relay reads only this file;\n# an agentbox.yaml `tools:` entry is a request until it is approved here.\n";
20264
- await (0, import_promises20.writeFile)(file, header + (0, import_yaml5.stringify)({ tools }), "utf8");
19941
+ await (0, import_promises19.writeFile)(file, header + (0, import_yaml5.stringify)({ tools }), "utf8");
20265
19942
  }
20266
19943
  function isValidToolName(name) {
20267
19944
  return /^[a-zA-Z0-9][a-zA-Z0-9._+-]{0,63}$/.test(name);
@@ -20274,30 +19951,30 @@ function stringArray(v) {
20274
19951
  function isGrantSource(v) {
20275
19952
  return v === "builtin" || v === "cli" || v === "yaml" || v === "request";
20276
19953
  }
20277
- var import_fs, import_crypto2, import_promises13, import_os2, import_path3, import_yaml, import_promises14, import_yaml2, import_promises15, import_path4, import_promises16, import_promises17, import_path5, import_yaml3, import_promises18, import_promises19, import_path6, import_yaml4, import_promises20, import_path7, import_yaml5, AGENT_KINDS, AGENT_KIND_NAMES, STATE_DIR, GLOBAL_CONFIG_FILE, PROJECTS_DIR, AGENTS_FILE, WORKSPACE_CONFIG_BASENAME, GLOBAL_TOOLS_FILE, REMOTE_DOCKER, PROVIDERS, PROVIDER_NAMES, CLOUD_PROVIDER_NAMES, HUB_ROUTABLE_PROVIDER_NAMES, BUILT_IN_DEFAULTS, BUILTIN_KEY_REGISTRY, KEY_REGISTRY, REGISTRY_BY_KEY, UserConfigError, RENAMED_KEYS, BRANCHES, warningSink, DAYTONA_VM_REGION, LOCK_STALE_MS, LOCK_ACQUIRE_TIMEOUT_MS, LOCK_RETRY_MS, PROJECT_GC_COUNTER_FILE, CURRENT_CONFIG_SCHEMA, META_LOCK, BUILTIN_GH_GRANT;
20278
- var init_dist2 = __esm({
19954
+ var import_fs, import_crypto, import_promises12, import_os, import_path, import_yaml, import_promises13, import_yaml2, import_promises14, import_path2, import_promises15, import_promises16, import_path3, import_yaml3, import_promises17, import_promises18, import_path4, import_yaml4, import_promises19, import_path5, import_yaml5, AGENT_KINDS, AGENT_KIND_NAMES, STATE_DIR, GLOBAL_CONFIG_FILE, PROJECTS_DIR, AGENTS_FILE, WORKSPACE_CONFIG_BASENAME, GLOBAL_TOOLS_FILE, REMOTE_DOCKER, PROVIDERS, PROVIDER_NAMES, CLOUD_PROVIDER_NAMES, HUB_ROUTABLE_PROVIDER_NAMES, BUILT_IN_DEFAULTS, BUILTIN_KEY_REGISTRY, KEY_REGISTRY, REGISTRY_BY_KEY, UserConfigError, RENAMED_KEYS, BRANCHES, warningSink, DAYTONA_VM_REGION, LOCK_STALE_MS, LOCK_ACQUIRE_TIMEOUT_MS, LOCK_RETRY_MS, PROJECT_GC_COUNTER_FILE, CURRENT_CONFIG_SCHEMA, META_LOCK, BUILTIN_GH_GRANT;
19955
+ var init_dist = __esm({
20279
19956
  "../config/dist/index.js"() {
20280
19957
  "use strict";
20281
19958
  import_fs = require("fs");
20282
- import_crypto2 = require("crypto");
20283
- import_promises13 = require("fs/promises");
20284
- import_os2 = require("os");
20285
- import_path3 = require("path");
19959
+ import_crypto = require("crypto");
19960
+ import_promises12 = require("fs/promises");
19961
+ import_os = require("os");
19962
+ import_path = require("path");
20286
19963
  import_yaml = __toESM(require_dist(), 1);
20287
- import_promises14 = require("fs/promises");
19964
+ import_promises13 = require("fs/promises");
20288
19965
  import_yaml2 = __toESM(require_dist(), 1);
20289
- import_promises15 = require("fs/promises");
20290
- import_path4 = require("path");
20291
- import_promises16 = require("timers/promises");
20292
- import_promises17 = require("fs/promises");
20293
- import_path5 = require("path");
19966
+ import_promises14 = require("fs/promises");
19967
+ import_path2 = require("path");
19968
+ import_promises15 = require("timers/promises");
19969
+ import_promises16 = require("fs/promises");
19970
+ import_path3 = require("path");
20294
19971
  import_yaml3 = __toESM(require_dist(), 1);
19972
+ import_promises17 = require("fs/promises");
20295
19973
  import_promises18 = require("fs/promises");
20296
- import_promises19 = require("fs/promises");
20297
- import_path6 = require("path");
19974
+ import_path4 = require("path");
20298
19975
  import_yaml4 = __toESM(require_dist(), 1);
20299
- import_promises20 = require("fs/promises");
20300
- import_path7 = require("path");
19976
+ import_promises19 = require("fs/promises");
19977
+ import_path5 = require("path");
20301
19978
  import_yaml5 = __toESM(require_dist(), 1);
20302
19979
  AGENT_KINDS = [
20303
19980
  {
@@ -20387,12 +20064,12 @@ var init_dist2 = __esm({
20387
20064
  { id: "example", defaultSessionName: "example", hasSkipPermissions: false }
20388
20065
  ];
20389
20066
  AGENT_KIND_NAMES = AGENT_KINDS.map((a2) => a2.id);
20390
- STATE_DIR = (0, import_path3.join)((0, import_os2.homedir)(), ".agentbox");
20391
- GLOBAL_CONFIG_FILE = (0, import_path3.join)(STATE_DIR, "config.yaml");
20392
- PROJECTS_DIR = (0, import_path3.join)(STATE_DIR, "projects");
20393
- AGENTS_FILE = (0, import_path3.join)(STATE_DIR, "agents.json");
20067
+ STATE_DIR = (0, import_path.join)((0, import_os.homedir)(), ".agentbox");
20068
+ GLOBAL_CONFIG_FILE = (0, import_path.join)(STATE_DIR, "config.yaml");
20069
+ PROJECTS_DIR = (0, import_path.join)(STATE_DIR, "projects");
20070
+ AGENTS_FILE = (0, import_path.join)(STATE_DIR, "agents.json");
20394
20071
  WORKSPACE_CONFIG_BASENAME = "agentbox.yaml";
20395
- GLOBAL_TOOLS_FILE = (0, import_path3.join)(STATE_DIR, "tools.yaml");
20072
+ GLOBAL_TOOLS_FILE = (0, import_path.join)(STATE_DIR, "tools.yaml");
20396
20073
  REMOTE_DOCKER = "remote-docker";
20397
20074
  PROVIDERS = [
20398
20075
  {
@@ -21316,7 +20993,7 @@ var init_dist2 = __esm({
21316
20993
  LOCK_STALE_MS = 15e3;
21317
20994
  LOCK_ACQUIRE_TIMEOUT_MS = 2e4;
21318
20995
  LOCK_RETRY_MS = 25;
21319
- PROJECT_GC_COUNTER_FILE = (0, import_path5.join)(PROJECTS_DIR, ".gc.json");
20996
+ PROJECT_GC_COUNTER_FILE = (0, import_path3.join)(PROJECTS_DIR, ".gc.json");
21320
20997
  CURRENT_CONFIG_SCHEMA = 1;
21321
20998
  META_LOCK = { staleMs: 2e3, acquireTimeoutMs: 5e3 };
21322
20999
  BUILTIN_GH_GRANT = {
@@ -21327,6 +21004,329 @@ var init_dist2 = __esm({
21327
21004
  }
21328
21005
  });
21329
21006
 
21007
+ // ../core/dist/index.js
21008
+ function dockerField(box, key) {
21009
+ if (box.docker && box.docker[key] !== void 0) return box.docker[key];
21010
+ return box[key];
21011
+ }
21012
+ function agentConfigVolume(box, agent) {
21013
+ const map = dockerField(box, "agentConfigVolumes");
21014
+ const fromMap = map?.[agent];
21015
+ if (fromMap !== void 0) return fromMap;
21016
+ if (agent === "claude") return dockerField(box, "claudeConfigVolume");
21017
+ if (agent === "codex") return dockerField(box, "codexConfigVolume");
21018
+ if (agent === "opencode") return dockerField(box, "opencodeConfigVolume");
21019
+ return void 0;
21020
+ }
21021
+ function agentPushExcludes(spec, path6, target) {
21022
+ return [
21023
+ ...path6.allowDatabases ? [] : LIVE_DATABASE_EXCLUDES,
21024
+ ...path6.exclude ?? [],
21025
+ // An agent with no credential (`credential` absent) contributes nothing
21026
+ // here: there is no file to keep out of a shared snapshot.
21027
+ ...target === "snapshot" && spec.credential ? [spec.credential.boxRelPath] : []
21028
+ ];
21029
+ }
21030
+ function resolveAgentInstall(install, settings) {
21031
+ const key = install.alternatesFrom;
21032
+ const chosen = key ? settings?.[key] : void 0;
21033
+ const alt = typeof chosen === "string" ? install.alternates?.[chosen] : void 0;
21034
+ return alt ?? install;
21035
+ }
21036
+ function modelAuthSourceId(s) {
21037
+ return s.kind === "agent" ? s.agent : `env:${s.envKey}`;
21038
+ }
21039
+ function modelAuthEnvKey(id) {
21040
+ return id.startsWith("env:") ? id.slice(4) : void 0;
21041
+ }
21042
+ function agentDirPrelude(agentDirs, credsSubdir) {
21043
+ return [
21044
+ `install -d -o ${BOX_USER} -g ${BOX_USER} ${agentDirs.join(" ")}`,
21045
+ // Omitted for an agent that declares no `credential`: it gets no subpath of
21046
+ // the shared credentials volume, so creating a dir there would reserve a
21047
+ // mount point nothing will ever mount.
21048
+ ...credsSubdir === void 0 ? [] : [
21049
+ `mkdir -p ${BOX_CREDS_DIR}/${credsSubdir}`,
21050
+ `chown -R ${BOX_USER}:${BOX_USER} ${BOX_CREDS_DIR} 2>/dev/null || true`
21051
+ ]
21052
+ ];
21053
+ }
21054
+ function substitutePlaceholders(text, context, onWarn) {
21055
+ return text.replace(PLACEHOLDER_RE, (match, name) => {
21056
+ if (!PLACEHOLDER_SET.has(name)) return match;
21057
+ const value = context[name];
21058
+ if (value === void 0) {
21059
+ onWarn?.(`placeholder {{${name}}} has no value in this context \u2014 left untouched`);
21060
+ return match;
21061
+ }
21062
+ return value;
21063
+ });
21064
+ }
21065
+ function applyReplacements(content, opts) {
21066
+ let out = content;
21067
+ if (opts.env) {
21068
+ out = substitutePlaceholders(out, opts.context, opts.onWarn);
21069
+ }
21070
+ for (const rule of opts.rules ?? []) {
21071
+ const to = substitutePlaceholders(rule.to, opts.context, opts.onWarn);
21072
+ if (rule.regex) {
21073
+ let re;
21074
+ try {
21075
+ re = new RegExp(rule.from, rule.flags ?? "g");
21076
+ } catch (err) {
21077
+ throw new ReplaceError(
21078
+ `invalid regex "${rule.from}": ${err instanceof Error ? err.message : String(err)}`
21079
+ );
21080
+ }
21081
+ out = out.replace(re, to);
21082
+ } else {
21083
+ out = out.split(rule.from).join(to);
21084
+ }
21085
+ }
21086
+ return out;
21087
+ }
21088
+ function deriveBoxHost(ctx) {
21089
+ if (ctx.AGENTBOX_BOX_HOST === void 0 && ctx.AGENTBOX_BOX_NAME !== void 0) {
21090
+ ctx.AGENTBOX_BOX_HOST = `${ctx.AGENTBOX_BOX_NAME}.localhost`;
21091
+ }
21092
+ return ctx;
21093
+ }
21094
+ function resolveRuleRefs(refs, replacements2, where) {
21095
+ const out = [];
21096
+ for (const name of refs) {
21097
+ const set = replacements2[name];
21098
+ if (set === void 0) {
21099
+ const known = Object.keys(replacements2);
21100
+ throw new ReplaceError(
21101
+ `${where}: unknown replacements rule-set "${name}"` + (known.length > 0 ? ` (known: ${known.join(", ")})` : " (none declared)")
21102
+ );
21103
+ }
21104
+ out.push(...set);
21105
+ }
21106
+ return out;
21107
+ }
21108
+ function promptId(topic, payload) {
21109
+ const digest = (0, import_crypto2.createHash)("sha256").update(topic).update(" ").update(JSON.stringify(payload) ?? "null").digest("hex").slice(0, 12);
21110
+ return `${topic}:${digest}`;
21111
+ }
21112
+ function decodeMultiAnswer(value) {
21113
+ const seen = /* @__PURE__ */ new Set();
21114
+ for (const part of value.split(PROMPT_MULTI_SEPARATOR)) {
21115
+ const v = part.trim();
21116
+ if (v.length > 0) seen.add(v);
21117
+ }
21118
+ return [...seen];
21119
+ }
21120
+ function isAgentActivityState(v) {
21121
+ return typeof v === "string" && AGENT_ACTIVITY_STATES.includes(v);
21122
+ }
21123
+ function parseAgentStatusEntry(raw) {
21124
+ if (raw === null || typeof raw !== "object") return null;
21125
+ const o2 = raw;
21126
+ if (!isAgentActivityState(o2.state)) return null;
21127
+ const entry = {
21128
+ state: o2.state,
21129
+ updatedAt: typeof o2.updatedAt === "string" ? o2.updatedAt : null,
21130
+ sessionRunning: o2.sessionRunning === true
21131
+ };
21132
+ if (typeof o2.sessionTitle === "string" && o2.sessionTitle.length > 0) {
21133
+ entry.sessionTitle = o2.sessionTitle;
21134
+ }
21135
+ const plan = o2.plan;
21136
+ if (plan && typeof plan === "object" && typeof plan.plan === "string") {
21137
+ entry.plan = {
21138
+ plan: plan.plan,
21139
+ capturedAt: typeof plan.capturedAt === "string" ? plan.capturedAt : ""
21140
+ };
21141
+ }
21142
+ const question = o2.question;
21143
+ if (question && typeof question === "object" && Array.isArray(question.questions)) {
21144
+ entry.question = {
21145
+ questions: question.questions,
21146
+ capturedAt: typeof question.capturedAt === "string" ? question.capturedAt : ""
21147
+ };
21148
+ }
21149
+ return entry;
21150
+ }
21151
+ function normalizeAgentStatus(raw) {
21152
+ if (raw === null || typeof raw !== "object") return {};
21153
+ const o2 = raw;
21154
+ const out = {};
21155
+ for (const key of LEGACY_AGENT_STATUS_KEYS) {
21156
+ const entry = parseAgentStatusEntry(o2[key]);
21157
+ if (entry) out[key] = entry;
21158
+ }
21159
+ const agents = o2.agents;
21160
+ if (agents !== null && typeof agents === "object") {
21161
+ for (const [id, body] of Object.entries(agents)) {
21162
+ if (id.length === 0) continue;
21163
+ const entry = parseAgentStatusEntry(body);
21164
+ if (entry) out[id] = entry;
21165
+ }
21166
+ }
21167
+ return out;
21168
+ }
21169
+ function pickPrimaryAgent(map) {
21170
+ const entries = Object.entries(map).map(([agent, entry]) => ({ agent, entry }));
21171
+ if (entries.length === 0) return null;
21172
+ const busy = entries.find((e) => e.entry.state === "working" || e.entry.state === "compacting");
21173
+ if (busy) return busy;
21174
+ entries.sort((a2, b) => parseTime(b.entry.updatedAt) - parseTime(a2.entry.updatedAt));
21175
+ return entries[0] ?? null;
21176
+ }
21177
+ function parseTime(iso) {
21178
+ if (!iso) return 0;
21179
+ const t = Date.parse(iso);
21180
+ return Number.isNaN(t) ? 0 : t;
21181
+ }
21182
+ function parseDownloadKind(method) {
21183
+ return method.split(".")[1] ?? "workspace";
21184
+ }
21185
+ function resolveHostPath(workspacePath, hostPath) {
21186
+ if ((0, import_path6.isAbsolute)(hostPath)) return hostPath;
21187
+ if (hostPath === "~") return (0, import_os2.homedir)();
21188
+ if (hostPath.startsWith("~/")) return (0, import_path6.join)((0, import_os2.homedir)(), hostPath.slice(2));
21189
+ return workspacePath ? (0, import_path6.resolve)(workspacePath, hostPath) : (0, import_path6.resolve)(hostPath);
21190
+ }
21191
+ async function realpathSafe(p) {
21192
+ try {
21193
+ return await (0, import_promises20.realpath)(p);
21194
+ } catch {
21195
+ return (0, import_path7.resolve)(p);
21196
+ }
21197
+ }
21198
+ function isInside(child, parent) {
21199
+ const c3 = (0, import_path7.resolve)(child);
21200
+ const p = (0, import_path7.resolve)(parent);
21201
+ if (c3 === p) return true;
21202
+ return c3.startsWith(p + import_path7.sep);
21203
+ }
21204
+ async function realpathDeepestExisting(p) {
21205
+ let cur = (0, import_path7.resolve)(p);
21206
+ const tail = [];
21207
+ for (; ; ) {
21208
+ try {
21209
+ const real = await (0, import_promises20.realpath)(cur);
21210
+ return tail.length > 0 ? (0, import_path7.resolve)(real, ...tail.reverse()) : real;
21211
+ } catch (err) {
21212
+ if (err.code !== "ENOENT") return (0, import_path7.resolve)(p);
21213
+ const parent = (0, import_path7.dirname)(cur);
21214
+ if (parent === cur) return (0, import_path7.resolve)(p);
21215
+ tail.push((0, import_path7.basename)(cur));
21216
+ cur = parent;
21217
+ }
21218
+ }
21219
+ }
21220
+ async function isContainedInWorkspace(hostPath, workspacePath) {
21221
+ if (!workspacePath) return false;
21222
+ if (!(0, import_path7.isAbsolute)(hostPath)) return false;
21223
+ if ((0, import_path7.normalize)(hostPath).split(import_path7.sep).includes("..")) return false;
21224
+ const wsReal = await realpathSafe(workspacePath);
21225
+ const real = await realpathDeepestExisting(hostPath);
21226
+ return isInside(real, wsReal);
21227
+ }
21228
+ function looksLikeSecret(hostPath) {
21229
+ const segs = (0, import_path7.normalize)(hostPath).split(import_path7.sep).filter(Boolean);
21230
+ for (const seg of segs) {
21231
+ if (SECRET_DIR_SEGMENTS.has(seg)) return true;
21232
+ }
21233
+ for (let i2 = 0; i2 + 1 < segs.length; i2++) {
21234
+ if (segs[i2] === ".config" && segs[i2 + 1] === "gh") return true;
21235
+ }
21236
+ const base = (0, import_path7.basename)(hostPath);
21237
+ if (SECRET_BASENAMES.has(base)) return true;
21238
+ return SECRET_BASENAME_PATTERNS.some((re) => re.test(base));
21239
+ }
21240
+ function isScratchBranch(branch) {
21241
+ return !!branch && branch.startsWith(SCRATCH_BRANCH_PREFIX);
21242
+ }
21243
+ function isSanctionedPushBranch(branch, sanctionedBranch) {
21244
+ if (isScratchBranch(branch)) return true;
21245
+ return isResolvedBranch(branch ?? "") && !!sanctionedBranch && branch === sanctionedBranch;
21246
+ }
21247
+ function resolveRemote(remote) {
21248
+ return remote ?? "origin";
21249
+ }
21250
+ function resolveLandDest(src, as) {
21251
+ return as && as.length > 0 ? as : src;
21252
+ }
21253
+ function landRefspec(src, dest, force) {
21254
+ return `${force ? "+" : ""}${src}:refs/heads/${dest}`;
21255
+ }
21256
+ function upstreamRef(remote, branch) {
21257
+ return `${remote}/${branch}`;
21258
+ }
21259
+ function remoteTrackingRef(remote, branch) {
21260
+ return `refs/remotes/${remote}/${branch}`;
21261
+ }
21262
+ function isResolvedBranch(s) {
21263
+ return s.length > 0 && s !== "HEAD";
21264
+ }
21265
+ function sanitizeGitArgs(args) {
21266
+ return Array.isArray(args) ? args.filter((a2) => typeof a2 === "string") : [];
21267
+ }
21268
+ var import_crypto2, import_os2, import_path6, import_promises20, import_path7, LIVE_DATABASE_EXCLUDES, BOX_USER, BOX_HOME, BOX_CREDS_DIR, BOX_ASSET_DIR, SETUP_GUIDE_PATH, IDENTITY_RULES_SENTINEL, PLACEHOLDER_KEYS, PLACEHOLDER_SET, ReplaceError, PLACEHOLDER_RE, PROMPT_MULTI_SEPARATOR, AGENT_ACTIVITY_STATES, LEGACY_AGENT_STATUS_KEYS, SECRET_DIR_SEGMENTS, SECRET_BASENAMES, SECRET_BASENAME_PATTERNS, SCRATCH_BRANCH_PREFIX;
21269
+ var init_dist2 = __esm({
21270
+ "../core/dist/index.js"() {
21271
+ "use strict";
21272
+ import_crypto2 = require("crypto");
21273
+ import_os2 = require("os");
21274
+ import_path6 = require("path");
21275
+ import_promises20 = require("fs/promises");
21276
+ import_path7 = require("path");
21277
+ LIVE_DATABASE_EXCLUDES = ["*.sqlite*", "*.db", "*.db-*"];
21278
+ BOX_USER = "vscode";
21279
+ BOX_HOME = "/home/vscode";
21280
+ BOX_CREDS_DIR = `${BOX_HOME}/.agentbox-creds`;
21281
+ BOX_ASSET_DIR = "/usr/local/share/agentbox";
21282
+ SETUP_GUIDE_PATH = `${BOX_ASSET_DIR}/setup-guide.md`;
21283
+ IDENTITY_RULES_SENTINEL = "agentbox:identity-rules";
21284
+ PLACEHOLDER_KEYS = [
21285
+ "AGENTBOX_BOX_NAME",
21286
+ "AGENTBOX_BOX_ID",
21287
+ "AGENTBOX_BOX_KIND",
21288
+ "AGENTBOX_HOST_WORKSPACE",
21289
+ "AGENTBOX_PROJECT_ROOT",
21290
+ // Convenience: the host this box is reachable at. Derived from
21291
+ // AGENTBOX_BOX_NAME as `<box-name>.localhost` when not set explicitly (the
21292
+ // portless host for docker/hetzner). Public-URL cloud providers
21293
+ // (vercel/daytona/e2b) set it explicitly at boot to the real preview host
21294
+ // (e.g. `<sub>.vercel.run`), which then wins over the derived fallback.
21295
+ "AGENTBOX_BOX_HOST"
21296
+ ];
21297
+ PLACEHOLDER_SET = new Set(PLACEHOLDER_KEYS);
21298
+ ReplaceError = class extends Error {
21299
+ constructor(message) {
21300
+ super(message);
21301
+ this.name = "ReplaceError";
21302
+ }
21303
+ };
21304
+ PLACEHOLDER_RE = /\{\{\s*([A-Z0-9_]+)\s*\}\}/g;
21305
+ PROMPT_MULTI_SEPARATOR = ",";
21306
+ AGENT_ACTIVITY_STATES = [
21307
+ "working",
21308
+ "idle",
21309
+ "waiting",
21310
+ "end-plan",
21311
+ "question",
21312
+ "compacting",
21313
+ "error",
21314
+ "unknown"
21315
+ ];
21316
+ LEGACY_AGENT_STATUS_KEYS = ["claude", "codex", "opencode"];
21317
+ SECRET_DIR_SEGMENTS = /* @__PURE__ */ new Set([".ssh", ".aws", ".gnupg"]);
21318
+ SECRET_BASENAMES = /* @__PURE__ */ new Set(["credentials", ".npmrc", ".netrc", ".pgpass", ".htpasswd"]);
21319
+ SECRET_BASENAME_PATTERNS = [
21320
+ /^\.env(\..+)?$/,
21321
+ // .env, .env.local, .env.production
21322
+ /\.(pem|key|pfx|p12|keystore|jks)$/i,
21323
+ /^id_(rsa|dsa|ecdsa|ed25519)$/
21324
+ // private SSH keys (not the .pub)
21325
+ ];
21326
+ SCRATCH_BRANCH_PREFIX = "agentbox/";
21327
+ }
21328
+ });
21329
+
21330
21330
  // ../agent-registry/dist/index.js
21331
21331
  var dist_exports2 = {};
21332
21332
  __export(dist_exports2, {
@@ -21708,25 +21708,25 @@ var init_dist3 = __esm({
21708
21708
  "../agent-registry/dist/index.js"() {
21709
21709
  "use strict";
21710
21710
  import_path8 = require("path");
21711
- init_dist2();
21712
21711
  init_dist();
21713
- import_path9 = require("path");
21714
21712
  init_dist2();
21713
+ import_path9 = require("path");
21715
21714
  init_dist();
21716
- init_dist();
21717
- import_path10 = require("path");
21718
21715
  init_dist2();
21716
+ init_dist2();
21717
+ import_path10 = require("path");
21719
21718
  init_dist();
21720
- import_path11 = require("path");
21721
21719
  init_dist2();
21720
+ import_path11 = require("path");
21722
21721
  init_dist();
21723
- import_path12 = require("path");
21724
21722
  init_dist2();
21723
+ import_path12 = require("path");
21725
21724
  init_dist();
21725
+ init_dist2();
21726
21726
  import_fs2 = require("fs");
21727
21727
  import_promises21 = require("fs/promises");
21728
21728
  import_path13 = require("path");
21729
- init_dist2();
21729
+ init_dist();
21730
21730
  CLAUDE_BOX_DIR = `${BOX_HOME}/.claude`;
21731
21731
  SEED_SETUP_SKILL = `if [ -f ${SETUP_GUIDE_PATH} ]; then install -d -o ${BOX_USER} -g ${BOX_USER} ${CLAUDE_BOX_DIR}/skills && install -d -o ${BOX_USER} -g ${BOX_USER} ${CLAUDE_BOX_DIR}/skills/agentbox-setup && install -o ${BOX_USER} -g ${BOX_USER} -m 0644 ${SETUP_GUIDE_PATH} ${CLAUDE_BOX_DIR}/skills/agentbox-setup/SKILL.md; fi`;
21732
21732
  claudeSpec = {
@@ -22746,6 +22746,7 @@ __export(dist_exports3, {
22746
22746
  AGENTBOX_HUB_SSH_ALIAS: () => AGENTBOX_HUB_SSH_ALIAS,
22747
22747
  AGENTS_STATIC_BOX_DIR: () => AGENTS_STATIC_BOX_DIR,
22748
22748
  AGENT_SEED_MARKER: () => AGENT_SEED_MARKER,
22749
+ AGENT_SESSION_ENV_VARS: () => AGENT_SESSION_ENV_VARS,
22749
22750
  AGENT_SYNC_SPECS: () => AGENT_SYNC_SPECS,
22750
22751
  AgentInstallError: () => AgentInstallError,
22751
22752
  BACKUP_GITIGNORE_ENTRY: () => BACKUP_GITIGNORE_ENTRY,
@@ -22829,6 +22830,7 @@ __export(dist_exports3, {
22829
22830
  botDir: () => botDir,
22830
22831
  botWorkspaceRoot: () => botWorkspaceRoot,
22831
22832
  boxGitCheckout: () => boxGitCheckout,
22833
+ boxGitCurrentBranch: () => boxGitCurrentBranch,
22832
22834
  boxGitNewBranch: () => boxGitNewBranch,
22833
22835
  boxGitPull: () => boxGitPull,
22834
22836
  boxGitPush: () => boxGitPush,
@@ -23043,6 +23045,7 @@ __export(dist_exports3, {
23043
23045
  scpDownload: () => scpDownload,
23044
23046
  scpUpload: () => scpUpload,
23045
23047
  scratchBranchName: () => scratchBranchName,
23048
+ scrubAgentSessionEnv: () => scrubAgentSessionEnv,
23046
23049
  secretsEnvPath: () => secretsEnvPath,
23047
23050
  seedAgentsVolume: () => seedAgentsVolume,
23048
23051
  seedExcludeTarArgs: () => seedExcludeTarArgs,
@@ -24189,6 +24192,12 @@ function scratchBranchName(name) {
24189
24192
  function boxGitCheckout(provider, box, branch, extraArgs = []) {
24190
24193
  return run(provider, box, ["git", "checkout", branch, ...extraArgs]);
24191
24194
  }
24195
+ async function boxGitCurrentBranch(provider, box) {
24196
+ const r = await run(provider, box, ["git", "symbolic-ref", "--quiet", "--short", "HEAD"]).catch(
24197
+ () => void 0
24198
+ );
24199
+ return r?.exitCode === 0 ? r.stdout.trim() || void 0 : void 0;
24200
+ }
24192
24201
  function boxGitNewBranch(provider, box, name, from) {
24193
24202
  const argv = ["git", "checkout", "-b", scratchBranchName(name)];
24194
24203
  if (from && from.trim()) argv.push(from.trim());
@@ -24472,6 +24481,11 @@ function resolveCliEntry() {
24472
24481
  }
24473
24482
  return null;
24474
24483
  }
24484
+ function scrubAgentSessionEnv(env) {
24485
+ const out = { ...env };
24486
+ for (const key of [...AGENT_SESSION_ENV_VARS, "TMUX", "TMUX_PANE"]) delete out[key];
24487
+ return out;
24488
+ }
24475
24489
  function stagedRuntimeRootCandidates(self) {
24476
24490
  const candidates = [];
24477
24491
  const override2 = process.env[RUNTIME_ROOT_ENV];
@@ -24699,7 +24713,9 @@ async function spawnHub(hubServer, cliEntry, log, portlessEnabled, exposedEnv) {
24699
24713
  detached: true,
24700
24714
  stdio: ["ignore", logFd, logFd],
24701
24715
  env: {
24702
- ...process.env,
24716
+ // A hub started from inside an agent session must not pass that session's
24717
+ // identity to the managers it runs.
24718
+ ...scrubAgentSessionEnv(process.env),
24703
24719
  // The staged hub is a production Next build; force production so server.ts
24704
24720
  // takes the standalone path (dev mode would load webpack, which the
24705
24721
  // standalone build prunes).
@@ -25885,7 +25901,7 @@ function makeSyncContext(init) {
25885
25901
  }
25886
25902
  async function resolveConfiguredSettings(agent) {
25887
25903
  try {
25888
- const { agentSettingsFor: agentSettingsFor2 } = await Promise.resolve().then(() => (init_dist2(), dist_exports));
25904
+ const { agentSettingsFor: agentSettingsFor2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
25889
25905
  return await agentSettingsFor2(agent);
25890
25906
  } catch {
25891
25907
  return void 0;
@@ -26046,17 +26062,17 @@ function buildHostEnvFindArgs(patterns) {
26046
26062
  ")"
26047
26063
  ];
26048
26064
  }
26049
- async function findEnvFilesForTar(workspaceDir, patterns) {
26065
+ async function findEnvFilesForTar(workspaceDir2, patterns) {
26050
26066
  if (patterns.length === 0) return [];
26051
26067
  const found = await execa("find", buildHostEnvFindArgs(patterns).slice(1), {
26052
- cwd: workspaceDir,
26068
+ cwd: workspaceDir2,
26053
26069
  reject: false
26054
26070
  });
26055
26071
  if (found.exitCode !== 0) return [];
26056
26072
  return String(found.stdout).split("\0").filter((p) => p.length > 0);
26057
26073
  }
26058
- async function scanHostEnvFiles(workspaceDir, patterns) {
26059
- const raw = await findEnvFilesForTar(workspaceDir, patterns);
26074
+ async function scanHostEnvFiles(workspaceDir2, patterns) {
26075
+ const raw = await findEnvFilesForTar(workspaceDir2, patterns);
26060
26076
  return raw.map((p) => p.replace(/^\.\//, "")).filter((p) => p.length > 0);
26061
26077
  }
26062
26078
  async function pushEnvFiles(ctx, transport, patterns) {
@@ -26694,8 +26710,8 @@ async function resolveBotBundle(projectRoot, bot, stamp) {
26694
26710
  }
26695
26711
  const dir = (0, import_path34.join)(base, chosen);
26696
26712
  const manifest = await readBackupManifest(dir);
26697
- const workspaceDir = (0, import_path34.join)(dir, "workspace");
26698
- if (!(await (0, import_promises44.lstat)(workspaceDir).catch(() => null))?.isDirectory()) {
26713
+ const workspaceDir2 = (0, import_path34.join)(dir, "workspace");
26714
+ if (!(await (0, import_promises44.lstat)(workspaceDir2).catch(() => null))?.isDirectory()) {
26699
26715
  throw new Error(`${dir}: the backup has no workspace/ directory`);
26700
26716
  }
26701
26717
  const stateDir = (0, import_path34.join)(dir, "state");
@@ -26705,7 +26721,7 @@ async function resolveBotBundle(projectRoot, bot, stamp) {
26705
26721
  bot: manifest.bot,
26706
26722
  stamp: chosen,
26707
26723
  manifest,
26708
- workspaceDir,
26724
+ workspaceDir: workspaceDir2,
26709
26725
  ...hasState ? { stateDir } : {}
26710
26726
  };
26711
26727
  }
@@ -28362,7 +28378,7 @@ async function listAvailableSources(spec, env = process.env) {
28362
28378
  }
28363
28379
  return out;
28364
28380
  }
28365
- var import_promises22, import_os3, import_path14, import_promises23, import_promises24, import_path15, import_child_process, import_fs3, import_os4, import_path16, import_fs4, import_os5, import_path17, import_fs5, import_promises25, import_os6, import_path18, import_promises26, import_promises27, import_path19, import_promises28, import_os7, import_crypto3, import_fs6, import_promises29, import_net, import_os8, import_path20, import_fs7, import_os9, import_path21, import_fs8, import_http, import_net2, import_path22, import_promises30, import_url, import_child_process2, import_fs9, import_promises31, import_os10, import_path23, import_promises32, import_url2, import_fs10, import_path24, import_url3, import_promises33, import_os11, import_path25, import_promises34, import_os12, import_path26, import_promises35, import_promises36, import_os13, import_path27, import_promises37, import_os14, import_path28, import_promises38, import_os15, import_path29, import_os16, import_promises39, import_os17, import_path30, import_promises40, import_os18, import_path31, import_promises41, import_path32, import_promises42, import_crypto4, import_promises43, import_path33, import_promises44, import_path34, import_crypto5, import_promises45, import_path35, import_promises46, import_os19, import_path36, import_promises47, import_path37, import_promises48, import_crypto6, import_promises49, import_os20, import_path38, import_promises50, import_os21, import_path39, import_crypto7, import_fs11, import_promises51, import_os22, import_path40, import_path41, import_promises52, import_os23, import_path42, import_promises53, import_path43, import_meta, STATE_DIR2, STATE_FILE, EMPTY2, LOCK_STALE_MS2, LOCK_ACQUIRE_TIMEOUT_MS2, LOCK_RETRY_MS2, GitWorktreeError, AGENTBOX_HUB_SSH_ALIAS, INCLUDE_BEGIN, INCLUDE_END, EXPOSED_HUB_PROFILE, PLUGINS_FILE, SUPPORTED_SDK_API_VERSIONS, PLUGINS_FILE_VERSION, EMPTY22, LOCK_STALE_MS22, LOCK_ACQUIRE_TIMEOUT_MS22, LOCK_RETRY_MS22, FALLBACK_CAPABILITIES, HOST, SshTunnelManager, OPEN_INBOUND_SOURCES, BOX_WORKSPACE, activePublisher, FALLBACK_RELAY_PORT, RELAY_PORT_ENV, override, RUNTIME_ROOT_ENV, CLI_RUNTIME_DIR_ENV, activePortless, dockerContext, STATE_DIR22, HUB_PID_FILE, RELAY_PID_FILE, HUB_LOG_FILE, HUB_TOKEN_FILE, HOST2, LOOPBACK_HOST, NODE_MIN, CP_DIR, activeRefresher, AGENT_SYNC_SPECS, SEED_MARKER, CLAUDE_HOST_BACKUP, MAX_CREDENTIAL_BYTES, DEFAULT_CAPS, PULL_CATEGORIES, SKILL_EXCLUDE_PREFIXES, CONTAINER_PLUGINS_PREFIX, CLAUDE_BOX_CONFIG_DIR, CODEX_BOX_CONFIG_DIR, OPENCODE_BOX_DATA_DIR, CLAUDE_PULL_DIR_CATEGORIES, CODEX_PULL_ITEMS, OPENCODE_PULL_DATA_ITEMS, OPENCODE_PULL_CONFIG_ITEMS, CLAUDE_REGISTRY_FILES, AGENT_SEED_MARKER, AgentInstallError, DEFAULT_ENV_PATTERNS, ENV_PRUNE_DIRS, BOX_HOME2, BOX_CLAUDE_PROJECT_DIR, NON_REGULAR_TOKEN, MODULES, BOTS_DIR_REL, BACKUP_GITIGNORE_ENTRY, STAMP_RE, DEFAULT_BACKUP_KEEP, SOURCE_READ_TIMEOUT_MS, WORKSPACE_EXCLUDE_DIR_NAMES, GIT_MODE_EXCLUDE_DIRS, REMOTE_TAR, MAX_PAYLOAD_BYTES, BoxProbeError, FILELIST_NAME, BOX_WORKFLOWS_DIR, BOX_DYNAMIC_SYNC_MANIFEST, BOX_MEMORY_DIR, SET_NAMES, STAGE_WRITABLE_CHMOD, STAGE_NO_SPECIALS, AGENTS_STATIC_BOX_DIR, DOCKER_CONTEXT_FILE_MAP, BOX_IMAGE_REGISTRY, HUB_WORKER_CLONE_PREFIX, DEFAULT_CP_EXCLUDES, DENYLIST_DEST_PREFIXES, DENYLIST_DEST_EXACT, CARRY_TOPIC, CARRY_GRANT_TOPIC, CARRY_NON_INTERACTIVE_HINT, MODEL_AUTH_TOPIC, MODEL_AUTH_SETTING, MODEL_AUTH_NONE;
28381
+ var import_promises22, import_os3, import_path14, import_promises23, import_promises24, import_path15, import_child_process, import_fs3, import_os4, import_path16, import_fs4, import_os5, import_path17, import_fs5, import_promises25, import_os6, import_path18, import_promises26, import_promises27, import_path19, import_promises28, import_os7, import_crypto3, import_fs6, import_promises29, import_net, import_os8, import_path20, import_fs7, import_os9, import_path21, import_fs8, import_http, import_net2, import_path22, import_promises30, import_url, import_child_process2, import_fs9, import_promises31, import_os10, import_path23, import_promises32, import_url2, import_fs10, import_path24, import_url3, import_promises33, import_os11, import_path25, import_promises34, import_os12, import_path26, import_promises35, import_promises36, import_os13, import_path27, import_promises37, import_os14, import_path28, import_promises38, import_os15, import_path29, import_os16, import_promises39, import_os17, import_path30, import_promises40, import_os18, import_path31, import_promises41, import_path32, import_promises42, import_crypto4, import_promises43, import_path33, import_promises44, import_path34, import_crypto5, import_promises45, import_path35, import_promises46, import_os19, import_path36, import_promises47, import_path37, import_promises48, import_crypto6, import_promises49, import_os20, import_path38, import_promises50, import_os21, import_path39, import_crypto7, import_fs11, import_promises51, import_os22, import_path40, import_path41, import_promises52, import_os23, import_path42, import_promises53, import_path43, import_meta, STATE_DIR2, STATE_FILE, EMPTY2, LOCK_STALE_MS2, LOCK_ACQUIRE_TIMEOUT_MS2, LOCK_RETRY_MS2, GitWorktreeError, AGENTBOX_HUB_SSH_ALIAS, INCLUDE_BEGIN, INCLUDE_END, EXPOSED_HUB_PROFILE, PLUGINS_FILE, SUPPORTED_SDK_API_VERSIONS, PLUGINS_FILE_VERSION, EMPTY22, LOCK_STALE_MS22, LOCK_ACQUIRE_TIMEOUT_MS22, LOCK_RETRY_MS22, FALLBACK_CAPABILITIES, HOST, SshTunnelManager, OPEN_INBOUND_SOURCES, BOX_WORKSPACE, activePublisher, FALLBACK_RELAY_PORT, RELAY_PORT_ENV, override, AGENT_SESSION_ENV_VARS, RUNTIME_ROOT_ENV, CLI_RUNTIME_DIR_ENV, activePortless, dockerContext, STATE_DIR22, HUB_PID_FILE, RELAY_PID_FILE, HUB_LOG_FILE, HUB_TOKEN_FILE, HOST2, LOOPBACK_HOST, NODE_MIN, CP_DIR, activeRefresher, AGENT_SYNC_SPECS, SEED_MARKER, CLAUDE_HOST_BACKUP, MAX_CREDENTIAL_BYTES, DEFAULT_CAPS, PULL_CATEGORIES, SKILL_EXCLUDE_PREFIXES, CONTAINER_PLUGINS_PREFIX, CLAUDE_BOX_CONFIG_DIR, CODEX_BOX_CONFIG_DIR, OPENCODE_BOX_DATA_DIR, CLAUDE_PULL_DIR_CATEGORIES, CODEX_PULL_ITEMS, OPENCODE_PULL_DATA_ITEMS, OPENCODE_PULL_CONFIG_ITEMS, CLAUDE_REGISTRY_FILES, AGENT_SEED_MARKER, AgentInstallError, DEFAULT_ENV_PATTERNS, ENV_PRUNE_DIRS, BOX_HOME2, BOX_CLAUDE_PROJECT_DIR, NON_REGULAR_TOKEN, MODULES, BOTS_DIR_REL, BACKUP_GITIGNORE_ENTRY, STAMP_RE, DEFAULT_BACKUP_KEEP, SOURCE_READ_TIMEOUT_MS, WORKSPACE_EXCLUDE_DIR_NAMES, GIT_MODE_EXCLUDE_DIRS, REMOTE_TAR, MAX_PAYLOAD_BYTES, BoxProbeError, FILELIST_NAME, BOX_WORKFLOWS_DIR, BOX_DYNAMIC_SYNC_MANIFEST, BOX_MEMORY_DIR, SET_NAMES, STAGE_WRITABLE_CHMOD, STAGE_NO_SPECIALS, AGENTS_STATIC_BOX_DIR, DOCKER_CONTEXT_FILE_MAP, BOX_IMAGE_REGISTRY, HUB_WORKER_CLONE_PREFIX, DEFAULT_CP_EXCLUDES, DENYLIST_DEST_PREFIXES, DENYLIST_DEST_EXACT, CARRY_TOPIC, CARRY_GRANT_TOPIC, CARRY_NON_INTERACTIVE_HINT, MODEL_AUTH_TOPIC, MODEL_AUTH_SETTING, MODEL_AUTH_NONE;
28366
28382
  var init_dist4 = __esm({
28367
28383
  "../sandbox-core/dist/index.js"() {
28368
28384
  "use strict";
@@ -28380,7 +28396,7 @@ var init_dist4 = __esm({
28380
28396
  import_fs4 = require("fs");
28381
28397
  import_os5 = require("os");
28382
28398
  import_path17 = require("path");
28383
- init_dist2();
28399
+ init_dist();
28384
28400
  import_fs5 = require("fs");
28385
28401
  import_promises25 = require("fs/promises");
28386
28402
  import_os6 = require("os");
@@ -28400,7 +28416,7 @@ var init_dist4 = __esm({
28400
28416
  import_os8 = require("os");
28401
28417
  import_path20 = require("path");
28402
28418
  init_execa();
28403
- init_dist();
28419
+ init_dist2();
28404
28420
  import_fs7 = require("fs");
28405
28421
  import_os9 = require("os");
28406
28422
  import_path21 = require("path");
@@ -28423,13 +28439,13 @@ var init_dist4 = __esm({
28423
28439
  import_promises33 = require("fs/promises");
28424
28440
  import_os11 = require("os");
28425
28441
  import_path25 = require("path");
28426
- init_dist();
28442
+ init_dist2();
28427
28443
  import_promises34 = require("fs/promises");
28428
28444
  import_os12 = require("os");
28429
28445
  import_path26 = require("path");
28430
- init_dist();
28446
+ init_dist2();
28431
28447
  import_promises35 = require("fs/promises");
28432
- init_dist();
28448
+ init_dist2();
28433
28449
  init_dist3();
28434
28450
  import_promises36 = require("fs/promises");
28435
28451
  import_os13 = require("os");
@@ -28440,10 +28456,10 @@ var init_dist4 = __esm({
28440
28456
  import_promises38 = require("fs/promises");
28441
28457
  import_os15 = require("os");
28442
28458
  import_path29 = require("path");
28443
- init_dist();
28444
- init_dist();
28459
+ init_dist2();
28460
+ init_dist2();
28445
28461
  import_os16 = require("os");
28446
- init_dist();
28462
+ init_dist2();
28447
28463
  import_promises39 = require("fs/promises");
28448
28464
  import_os17 = require("os");
28449
28465
  import_path30 = require("path");
@@ -28461,12 +28477,12 @@ var init_dist4 = __esm({
28461
28477
  init_execa();
28462
28478
  import_promises44 = require("fs/promises");
28463
28479
  import_path34 = require("path");
28464
- init_dist();
28480
+ init_dist2();
28465
28481
  import_crypto5 = require("crypto");
28466
28482
  import_promises45 = require("fs/promises");
28467
28483
  import_path35 = require("path");
28468
28484
  init_execa();
28469
- init_dist();
28485
+ init_dist2();
28470
28486
  import_promises46 = require("fs/promises");
28471
28487
  import_os19 = require("os");
28472
28488
  import_path36 = require("path");
@@ -28483,22 +28499,22 @@ var init_dist4 = __esm({
28483
28499
  import_os21 = require("os");
28484
28500
  import_path39 = require("path");
28485
28501
  init_execa();
28486
- init_dist();
28502
+ init_dist2();
28487
28503
  import_crypto7 = require("crypto");
28488
28504
  import_fs11 = require("fs");
28489
28505
  import_promises51 = require("fs/promises");
28490
28506
  import_os22 = require("os");
28491
28507
  import_path40 = require("path");
28492
28508
  import_path41 = require("path");
28493
- init_dist();
28509
+ init_dist2();
28494
28510
  import_promises52 = require("fs/promises");
28495
28511
  import_os23 = require("os");
28496
28512
  import_path42 = require("path");
28497
- init_dist2();
28498
28513
  init_dist();
28514
+ init_dist2();
28499
28515
  import_promises53 = require("fs/promises");
28500
28516
  import_path43 = require("path");
28501
- init_dist();
28517
+ init_dist2();
28502
28518
  import_meta = {};
28503
28519
  STATE_DIR2 = (0, import_path14.join)((0, import_os3.homedir)(), ".agentbox");
28504
28520
  STATE_FILE = (0, import_path14.join)(STATE_DIR2, "state.json");
@@ -28805,6 +28821,25 @@ var init_dist4 = __esm({
28805
28821
  FALLBACK_RELAY_PORT = 8787;
28806
28822
  RELAY_PORT_ENV = "AGENTBOX_RELAY_PORT";
28807
28823
  override = null;
28824
+ AGENT_SESSION_ENV_VARS = [
28825
+ "CLAUDECODE",
28826
+ "CLAUDE_PID",
28827
+ "CLAUDE_CODE_SESSION_ID",
28828
+ "CLAUDE_CODE_BRIDGE_SESSION_ID",
28829
+ "CLAUDE_CODE_CHILD_SESSION",
28830
+ "CLAUDE_CODE_ENTRYPOINT",
28831
+ "CLAUDE_CODE_EXECPATH",
28832
+ "CLAUDE_CODE_MESSAGING_SOCKET",
28833
+ "CLAUDE_CODE_MESSAGING_TOKEN",
28834
+ "CLAUDE_CODE_SESSION_ATTENDED",
28835
+ "CLAUDE_CODE_SESSION_KIND",
28836
+ "CLAUDE_AGENTS_SELECT",
28837
+ "CLAUDE_BG_BACKEND",
28838
+ "CLAUDE_BG_SOCKET_TOKENS_PATH",
28839
+ "CODEX_THREAD_ID",
28840
+ "AGENTBOX_MANAGER",
28841
+ "AGENTBOX_WORKSPACE"
28842
+ ];
28808
28843
  RUNTIME_ROOT_ENV = "AGENTBOX_RUNTIME_ROOT";
28809
28844
  CLI_RUNTIME_DIR_ENV = "AGENTBOX_CLI_RUNTIME_DIR";
28810
28845
  STATE_DIR22 = (0, import_path23.join)((0, import_os10.homedir)(), ".agentbox");
@@ -29013,13 +29048,13 @@ function isConnectionLevelError(err) {
29013
29048
  const msg = err instanceof Error ? err.message : String(err);
29014
29049
  return /\b(ECONNREFUSED|ENOTFOUND|EHOSTUNREACH|ECONNRESET|EPIPE)\b/.test(msg);
29015
29050
  }
29016
- var import_node_http2, import_node_https2, import_promises65, BACKOFF_BASE_MS, BACKOFF_MAX_MS, REQUEST_TIMEOUT_MS, FAST_REQUEST_TIMEOUT_MS, FAST_MODE_DECAY_POLLS, STOPPED_TICK_MS, CONNECTION_LEVEL_CODES, CloudBoxPoller, CloudBoxPollers;
29051
+ var import_node_http2, import_node_https2, import_promises69, BACKOFF_BASE_MS, BACKOFF_MAX_MS, REQUEST_TIMEOUT_MS, FAST_REQUEST_TIMEOUT_MS, FAST_MODE_DECAY_POLLS, STOPPED_TICK_MS, CONNECTION_LEVEL_CODES, CloudBoxPoller, CloudBoxPollers;
29017
29052
  var init_cloud_poller = __esm({
29018
29053
  "src/cloud-poller.ts"() {
29019
29054
  "use strict";
29020
29055
  import_node_http2 = require("http");
29021
29056
  import_node_https2 = require("https");
29022
- import_promises65 = require("timers/promises");
29057
+ import_promises69 = require("timers/promises");
29023
29058
  BACKOFF_BASE_MS = 1500;
29024
29059
  BACKOFF_MAX_MS = 3e4;
29025
29060
  REQUEST_TIMEOUT_MS = 25e3;
@@ -29185,12 +29220,12 @@ var init_cloud_poller = __esm({
29185
29220
  if (this.currentBackoffMs === 0 && this.fastModePolls > 0) {
29186
29221
  this.fastModePolls -= 1;
29187
29222
  }
29188
- if (this.currentBackoffMs === 0) await (0, import_promises65.setTimeout)(STOPPED_TICK_MS);
29223
+ if (this.currentBackoffMs === 0) await (0, import_promises69.setTimeout)(STOPPED_TICK_MS);
29189
29224
  }
29190
29225
  }
29191
29226
  async backoff() {
29192
29227
  this.currentBackoffMs = this.currentBackoffMs === 0 ? BACKOFF_BASE_MS : Math.min(this.currentBackoffMs * 2, BACKOFF_MAX_MS);
29193
- await (0, import_promises65.setTimeout)(this.currentBackoffMs);
29228
+ await (0, import_promises69.setTimeout)(this.currentBackoffMs);
29194
29229
  }
29195
29230
  async tryRecoverPreviewUrl() {
29196
29231
  if (!this.deps.recoverPreviewUrl) return;
@@ -29339,13 +29374,14 @@ var DEFAULT_RELAY_PORT = 8787;
29339
29374
  var DEFAULT_BOX_RELAY_PORT = 8788;
29340
29375
  var RELAY_EVENT_RING_SIZE = 1e3;
29341
29376
 
29342
- // src/server.ts
29343
- var import_node_child_process12 = require("child_process");
29344
- var import_node_fs13 = require("fs");
29345
- var import_node_http3 = require("http");
29377
+ // src/timeline-hooks.ts
29378
+ init_dist4();
29346
29379
 
29347
- // src/host-actions.ts
29348
- init_execa();
29380
+ // src/gh.ts
29381
+ var import_node_child_process6 = require("child_process");
29382
+ var import_node_fs6 = require("fs");
29383
+ var import_node_os4 = require("os");
29384
+ init_dist4();
29349
29385
 
29350
29386
  // src/git-pat.ts
29351
29387
  function parseGitRemote(origin) {
@@ -29396,20 +29432,7 @@ function ghHostFromRemote(origin) {
29396
29432
  return { host, aliasable: parsed.scheme !== "https" && parsed.scheme !== "http" };
29397
29433
  }
29398
29434
 
29399
- // src/host-actions.ts
29400
- var import_node_fs8 = require("fs");
29401
- var import_promises55 = require("fs/promises");
29402
- var import_node_os6 = require("os");
29403
- var import_node_path8 = require("path");
29404
- var import_node_url3 = require("url");
29405
- init_dist();
29406
- init_dist4();
29407
-
29408
29435
  // src/gh.ts
29409
- var import_node_child_process6 = require("child_process");
29410
- var import_node_fs6 = require("fs");
29411
- var import_node_os4 = require("os");
29412
- init_dist4();
29413
29436
  var GH_BLOCKED = [
29414
29437
  {
29415
29438
  pattern: /^auth\s+(token|refresh)\b/i,
@@ -29747,11 +29770,689 @@ function refuseCheckoutByDefault(op) {
29747
29770
  };
29748
29771
  }
29749
29772
 
29750
- // src/host-initiated.ts
29773
+ // src/workspaces/manager.ts
29751
29774
  var import_node_crypto = require("crypto");
29775
+ var import_promises55 = require("fs/promises");
29776
+ var import_node_os5 = require("os");
29777
+ var import_node_path8 = require("path");
29778
+ init_dist();
29779
+ init_dist4();
29780
+
29781
+ // src/workspaces/workspace-store.ts
29782
+ var import_promises54 = require("fs/promises");
29783
+ var import_node_path7 = require("path");
29784
+ init_dist();
29785
+
29786
+ // src/workspaces/types.ts
29787
+ var import_node_path6 = require("path");
29788
+ init_dist4();
29789
+ var WORKSPACES_DIR = (0, import_node_path6.join)(STATE_DIR2, "workspaces");
29790
+
29791
+ // src/workspaces/workspace-store.ts
29792
+ var WORKSPACE_LOCK = { staleMs: 2e3, acquireTimeoutMs: 5e3 };
29793
+ function workspaceDir(id, root) {
29794
+ return (0, import_node_path7.join)(WORKSPACES_DIR, root ? projectDirSegment(root) : id);
29795
+ }
29796
+ function workspaceFile(dir) {
29797
+ return (0, import_node_path7.join)(dir, "workspace.json");
29798
+ }
29799
+ function tasksFile(dir) {
29800
+ return (0, import_node_path7.join)(dir, "tasks.json");
29801
+ }
29802
+ function timelineFile(dir) {
29803
+ return (0, import_node_path7.join)(dir, "timeline.jsonl");
29804
+ }
29805
+ function managersFile(dir) {
29806
+ return (0, import_node_path7.join)(dir, "managers.json");
29807
+ }
29808
+ function legacyManagerFiles(dir) {
29809
+ return { rec: (0, import_node_path7.join)(dir, "manager.json"), exit: (0, import_node_path7.join)(dir, "manager.exit") };
29810
+ }
29811
+ async function resolveWorkspaceDir(id) {
29812
+ let entries;
29813
+ try {
29814
+ entries = await (0, import_promises54.readdir)(WORKSPACES_DIR);
29815
+ } catch (err) {
29816
+ if (err.code === "ENOENT") return null;
29817
+ throw err;
29818
+ }
29819
+ for (const name of entries) {
29820
+ const m = /^([0-9a-f]{16})(?:-.+)?$/.exec(name);
29821
+ if (m && m[1] === id) return (0, import_node_path7.join)(WORKSPACES_DIR, name);
29822
+ }
29823
+ return null;
29824
+ }
29825
+ async function canonicalWorkspaceRoot(absPath) {
29826
+ const resolved = await (0, import_promises54.realpath)(absPath).catch(() => absPath);
29827
+ return resolved.length > 1 && resolved.endsWith("/") ? resolved.slice(0, -1) : resolved;
29828
+ }
29829
+ async function listWorkspaces() {
29830
+ let entries;
29831
+ try {
29832
+ entries = await (0, import_promises54.readdir)(WORKSPACES_DIR);
29833
+ } catch (err) {
29834
+ if (err.code === "ENOENT") return [];
29835
+ throw err;
29836
+ }
29837
+ const out = [];
29838
+ for (const name of entries) {
29839
+ if (!/^[0-9a-f]{16}(?:-.+)?$/.test(name)) continue;
29840
+ try {
29841
+ const raw = await (0, import_promises54.readFile)(workspaceFile((0, import_node_path7.join)(WORKSPACES_DIR, name)), "utf8");
29842
+ out.push(JSON.parse(raw));
29843
+ } catch {
29844
+ }
29845
+ }
29846
+ out.sort((a2, b) => a2.name.localeCompare(b.name));
29847
+ return out;
29848
+ }
29849
+ function findWorkspaceContaining(records, absPath) {
29850
+ const target = absPath.length > 1 && absPath.endsWith("/") ? absPath.slice(0, -1) : absPath;
29851
+ let best = null;
29852
+ for (const rec of records) {
29853
+ if (target !== rec.root && !target.startsWith(`${rec.root}/`)) continue;
29854
+ if (!best || rec.root.length > best.root.length) best = rec;
29855
+ }
29856
+ return best;
29857
+ }
29858
+
29859
+ // src/workspaces/manager.ts
29860
+ var SESSION_HEAD_BYTES = 256 * 1024;
29861
+ var SESSION_FIRST_LINE_MAX = 4 * 1024 * 1024;
29862
+ var SESSION_INDEX_BYTES = 1024 * 1024;
29863
+ var RESUME_ARGV = {
29864
+ claude: (id) => ["--resume", id],
29865
+ codex: (id) => ["resume", id]
29866
+ };
29867
+ var RESUMABLE_MANAGER_AGENTS = Object.keys(RESUME_ARGV);
29868
+ var DEFAULT_RESUMABLE_AGENT = RESUMABLE_MANAGER_AGENTS[0] ?? "claude";
29869
+ function newManagerId() {
29870
+ return (0, import_node_crypto.randomBytes)(8).toString("hex");
29871
+ }
29872
+ async function dirFor(wsId) {
29873
+ return await resolveWorkspaceDir(wsId) ?? workspaceDir(wsId);
29874
+ }
29875
+ async function readManagerFile(dir) {
29876
+ try {
29877
+ const parsed = JSON.parse(await (0, import_promises55.readFile)(managersFile(dir), "utf8"));
29878
+ return Array.isArray(parsed.managers) ? parsed.managers : [];
29879
+ } catch (err) {
29880
+ if (err.code === "ENOENT") return null;
29881
+ return [];
29882
+ }
29883
+ }
29884
+ async function readLegacyManager(dir, wsId) {
29885
+ const files = legacyManagerFiles(dir);
29886
+ let legacy;
29887
+ try {
29888
+ legacy = JSON.parse(await (0, import_promises55.readFile)(files.rec, "utf8"));
29889
+ } catch {
29890
+ return null;
29891
+ }
29892
+ if (typeof legacy.agent !== "string" || typeof legacy.cwd !== "string") return null;
29893
+ let lastExit = legacy.lastExit;
29894
+ let exitConsumed = false;
29895
+ if (lastExit === void 0) {
29896
+ lastExit = await readExitFile(files.exit);
29897
+ exitConsumed = lastExit !== void 0;
29898
+ }
29899
+ const at = legacy.startedAt ?? (/* @__PURE__ */ new Date()).toISOString();
29900
+ const record = {
29901
+ id: newManagerId(),
29902
+ workspaceId: wsId,
29903
+ agent: legacy.agent,
29904
+ kind: "hub",
29905
+ cwd: legacy.cwd,
29906
+ tmuxSession: legacy.tmuxSession ?? `agentbox-manager-${wsId}`,
29907
+ ...legacy.argv ? { argv: legacy.argv } : {},
29908
+ ...legacy.sessionId ? { sessionId: legacy.sessionId } : {},
29909
+ boxIds: [],
29910
+ boxJobIds: [],
29911
+ createdAt: at,
29912
+ lastSeenAt: legacy.stoppedAt ?? at,
29913
+ startedAt: at,
29914
+ ...legacy.stoppedAt ? { stoppedAt: legacy.stoppedAt } : {},
29915
+ ...lastExit === void 0 ? {} : { lastExit }
29916
+ };
29917
+ return { record, exitConsumed };
29918
+ }
29919
+ async function readExitFile(file) {
29920
+ const raw = await (0, import_promises55.readFile)(file, "utf8").catch(() => "");
29921
+ const n2 = Number.parseInt(raw.trim(), 10);
29922
+ return Number.isNaN(n2) ? void 0 : n2;
29923
+ }
29924
+ async function writeManagerFile(dir, managers) {
29925
+ const final = managersFile(dir);
29926
+ await (0, import_promises55.mkdir)(dir, { recursive: true });
29927
+ const tmp = `${final}.tmp.${String(process.pid)}.${Date.now().toString(36)}`;
29928
+ const doc = { version: 1, managers };
29929
+ await (0, import_promises55.writeFile)(tmp, JSON.stringify(doc, null, 2) + "\n", "utf8");
29930
+ await (0, import_promises55.rename)(tmp, final);
29931
+ }
29932
+ async function updateManagers(wsId, fn) {
29933
+ const dir = await dirFor(wsId);
29934
+ return withFileLock(
29935
+ managersFile(dir),
29936
+ async () => {
29937
+ const current = await readManagerFile(dir);
29938
+ const legacy = current === null ? await readLegacyManager(dir, wsId) : null;
29939
+ const { managers, result } = await fn(current ?? (legacy ? [legacy.record] : []));
29940
+ await writeManagerFile(dir, managers);
29941
+ if (legacy) {
29942
+ const files = legacyManagerFiles(dir);
29943
+ await (0, import_promises55.rm)(files.rec, { force: true }).catch(() => {
29944
+ });
29945
+ if (legacy.exitConsumed) await (0, import_promises55.rm)(files.exit, { force: true }).catch(() => {
29946
+ });
29947
+ }
29948
+ return result;
29949
+ },
29950
+ WORKSPACE_LOCK
29951
+ );
29952
+ }
29953
+ async function readManagers(wsId) {
29954
+ const dir = await resolveWorkspaceDir(wsId);
29955
+ if (!dir) return [];
29956
+ const current = await readManagerFile(dir);
29957
+ if (current !== null) return current;
29958
+ if (await (0, import_promises55.stat)(legacyManagerFiles(dir).rec).catch(() => null) === null) return [];
29959
+ return updateManagers(wsId, (managers) => ({ managers, result: managers }));
29960
+ }
29961
+ async function allManagers() {
29962
+ const out = [];
29963
+ for (const ws of await listWorkspaces()) out.push(...await readManagers(ws.id));
29964
+ return out;
29965
+ }
29966
+ async function managerIdForTarget(target, opts = {}) {
29967
+ const hit = (await allManagers()).find(
29968
+ (m) => (opts.workspaceId === void 0 || m.workspaceId === opts.workspaceId) && ("boxId" in target ? m.boxIds.includes(target.boxId) : m.boxJobIds.includes(target.boxJobId))
29969
+ );
29970
+ return hit?.id;
29971
+ }
29972
+ var MANAGER_SEEN_WINDOW_MS = 30 * 60 * 1e3;
29973
+ var TURN_READ_CHUNK = 4 * 1024 * 1024;
29974
+
29975
+ // src/workspaces/push-stat.ts
29976
+ init_execa();
29977
+ var PUSH_STAT_TIMEOUT_MS = 2e3;
29978
+ var DEFAULT_BRANCH_REFS = [
29979
+ "refs/remotes/origin/main",
29980
+ "refs/remotes/origin/master",
29981
+ "refs/heads/main",
29982
+ "refs/heads/master"
29983
+ ];
29984
+ function parseShortstat(out) {
29985
+ const num = (re) => Number(re.exec(out)?.[1] ?? 0);
29986
+ return {
29987
+ filesChanged: num(/(\d+) files? changed/u),
29988
+ additions: num(/(\d+) insertions?\(\+\)/u),
29989
+ deletions: num(/(\d+) deletions?\(-\)/u)
29990
+ };
29991
+ }
29992
+ function pushedRef(branch, opts) {
29993
+ const remote = opts.remote ?? "origin";
29994
+ if (opts.hostOnly || !/^[A-Za-z0-9._-]+$/u.test(remote)) return `refs/heads/${branch}`;
29995
+ return `refs/remotes/${remote}/${branch}`;
29996
+ }
29997
+ function gitWithin(repo, deadline) {
29998
+ return async (args) => {
29999
+ const left = deadline - Date.now();
30000
+ if (left <= 0) return void 0;
30001
+ try {
30002
+ const r = await execa("git", ["-C", repo, ...args], { reject: false, timeout: left });
30003
+ return r.exitCode === 0 ? r.stdout.trim() : void 0;
30004
+ } catch {
30005
+ return void 0;
30006
+ }
30007
+ };
30008
+ }
30009
+ function tipWith(git, ref) {
30010
+ return git(["rev-parse", "--verify", "--quiet", `${ref}^{commit}`]).then((s) => s || void 0);
30011
+ }
30012
+ function readRefTip(repo, ref, timeoutMs = PUSH_STAT_TIMEOUT_MS) {
30013
+ return tipWith(gitWithin(repo, Date.now() + timeoutMs), ref);
30014
+ }
30015
+ async function defaultBranchBase(git, tip) {
30016
+ const head = await git(["symbolic-ref", "--quiet", "refs/remotes/origin/HEAD"]);
30017
+ for (const ref of [...head ? [head] : [], ...DEFAULT_BRANCH_REFS]) {
30018
+ if (!await tipWith(git, ref)) continue;
30019
+ return git(["merge-base", ref, tip]);
30020
+ }
30021
+ return void 0;
30022
+ }
30023
+ async function isAncestor(git, before, after) {
30024
+ return await git(["merge-base", "--is-ancestor", before, after]) !== void 0;
30025
+ }
30026
+ async function pushLineStat(input) {
30027
+ const git = gitWithin(input.repo, Date.now() + (input.timeoutMs ?? PUSH_STAT_TIMEOUT_MS));
30028
+ const after = await tipWith(git, input.ref) ?? await tipWith(git, `refs/heads/${input.branch}`);
30029
+ if (!after) return void 0;
30030
+ const base = input.before && (input.before === after || await isAncestor(git, input.before, after)) ? input.before : await defaultBranchBase(git, after);
30031
+ if (!base || base === after) return void 0;
30032
+ const out = await git(["diff", "--shortstat", `${base}..${after}`]);
30033
+ if (out === void 0) return void 0;
30034
+ const { additions, deletions } = parseShortstat(out);
30035
+ return additions + deletions > 0 ? { additions, deletions } : void 0;
30036
+ }
30037
+
30038
+ // src/workspaces/task-store.ts
30039
+ var import_promises56 = require("fs/promises");
30040
+ init_dist();
30041
+ async function tasksPathFor(wsId, root) {
30042
+ const dir = await resolveWorkspaceDir(wsId) ?? workspaceDir(wsId, root);
30043
+ return tasksFile(dir);
30044
+ }
30045
+ async function readTasks(wsId) {
30046
+ try {
30047
+ const raw = await (0, import_promises56.readFile)(await tasksPathFor(wsId), "utf8");
30048
+ const parsed = JSON.parse(raw);
30049
+ return Array.isArray(parsed.tasks) ? parsed.tasks : [];
30050
+ } catch {
30051
+ return [];
30052
+ }
30053
+ }
30054
+
30055
+ // src/workspaces/timeline-pr.ts
30056
+ var GH_PR_JSON_FIELDS = [
30057
+ "number",
30058
+ "title",
30059
+ "url",
30060
+ "headRefName",
30061
+ "baseRefName",
30062
+ "state",
30063
+ "mergedAt",
30064
+ "closedAt",
30065
+ "createdAt",
30066
+ "additions",
30067
+ "deletions",
30068
+ "statusCheckRollup",
30069
+ "mergeStateStatus",
30070
+ "autoMergeRequest",
30071
+ "mergedBy",
30072
+ "author"
30073
+ ].join(",");
30074
+ function prEventKey(repo, number, kind) {
30075
+ return `pr:${repo}#${String(number)}:${kind}`;
30076
+ }
30077
+ function parsePrUrl(url) {
30078
+ const m = /https?:\/\/[^/\s]+\/([^/\s]+)\/([^/\s]+)\/pull\/(\d+)/u.exec(url);
30079
+ if (!m) return null;
30080
+ return { repo: `${m[1]}/${m[2]}`, number: Number(m[3]), url: m[0] };
30081
+ }
30082
+ var FAILED = /* @__PURE__ */ new Set([
30083
+ "FAILURE",
30084
+ "ERROR",
30085
+ "TIMED_OUT",
30086
+ "CANCELLED",
30087
+ "ACTION_REQUIRED",
30088
+ "STARTUP_FAILURE"
30089
+ ]);
30090
+ var PASSED = /* @__PURE__ */ new Set(["SUCCESS", "NEUTRAL", "SKIPPED"]);
30091
+ function checksOf(rollup) {
30092
+ if (!rollup || rollup.length === 0) return "none";
30093
+ let pending = false;
30094
+ for (const c3 of rollup) {
30095
+ const verdict = (c3.conclusion ?? c3.state ?? "").toUpperCase();
30096
+ if (FAILED.has(verdict)) return "fail";
30097
+ if (c3.status && c3.status.toUpperCase() !== "COMPLETED") pending = true;
30098
+ else if (!PASSED.has(verdict)) pending = true;
30099
+ }
30100
+ return pending ? "pending" : "pass";
30101
+ }
30102
+ function isPrReady(pr) {
30103
+ if (pr.state !== "OPEN") return false;
30104
+ if (checksOf(pr.statusCheckRollup) !== "pass") return false;
30105
+ return pr.mergeStateStatus === "CLEAN" || pr.mergeStateStatus === "HAS_HOOKS";
30106
+ }
30107
+ function timelinePrOf(pr, repo) {
30108
+ return {
30109
+ repo,
30110
+ number: pr.number,
30111
+ title: pr.title,
30112
+ url: pr.url,
30113
+ base: pr.baseRefName,
30114
+ head: pr.headRefName,
30115
+ ...typeof pr.additions === "number" ? { additions: pr.additions } : {},
30116
+ ...typeof pr.deletions === "number" ? { deletions: pr.deletions } : {},
30117
+ checks: checksOf(pr.statusCheckRollup),
30118
+ ...pr.mergeStateStatus ? { mergeState: pr.mergeStateStatus } : {},
30119
+ autoMerge: Boolean(pr.autoMergeRequest),
30120
+ ...pr.mergedBy?.login ? { mergedBy: pr.mergedBy.login } : {}
30121
+ };
30122
+ }
30123
+ function prTimelineEvents(pr, repo, base, nowIso = (/* @__PURE__ */ new Date()).toISOString()) {
30124
+ const tpr = timelinePrOf(pr, repo);
30125
+ const common2 = { ...base, branch: base.branch ?? pr.headRefName, pr: tpr };
30126
+ const out = [
30127
+ {
30128
+ ...common2,
30129
+ type: "pr.opened",
30130
+ at: pr.createdAt ?? nowIso,
30131
+ key: prEventKey(repo, pr.number, "opened")
30132
+ }
30133
+ ];
30134
+ if (pr.state === "MERGED") {
30135
+ out.push({
30136
+ ...common2,
30137
+ type: "pr.merged",
30138
+ at: pr.mergedAt ?? nowIso,
30139
+ key: prEventKey(repo, pr.number, "merged")
30140
+ });
30141
+ } else if (pr.state === "CLOSED") {
30142
+ out.push({
30143
+ ...common2,
30144
+ type: "pr.closed",
30145
+ at: pr.closedAt ?? nowIso,
30146
+ key: prEventKey(repo, pr.number, "closed")
30147
+ });
30148
+ } else if (isPrReady(pr)) {
30149
+ out.push({
30150
+ ...common2,
30151
+ type: "pr.ready",
30152
+ at: nowIso,
30153
+ key: prEventKey(repo, pr.number, "ready")
30154
+ });
30155
+ }
30156
+ return out;
30157
+ }
30158
+
30159
+ // src/workspaces/timeline-store.ts
30160
+ var import_node_crypto2 = require("crypto");
30161
+ var import_promises57 = require("fs/promises");
30162
+ init_dist();
30163
+ var TIMELINE_MAX_LINES = 5e3;
30164
+ var TIMELINE_KEEP_LINES = 4e3;
30165
+ var TIMELINE_RETENTION_MS = 90 * 24 * 60 * 60 * 1e3;
30166
+ function newTimelineEventId(ms = Date.now()) {
30167
+ return `${ms.toString(36).padStart(9, "0")}-${(0, import_node_crypto2.randomBytes)(3).toString("hex")}`;
30168
+ }
30169
+ var indexes = /* @__PURE__ */ new Map();
30170
+ function emptyIndex(ino = 0) {
30171
+ return { ino, offset: 0, lines: 0, oldestMs: Number.POSITIVE_INFINITY, keys: /* @__PURE__ */ new Set() };
30172
+ }
30173
+ function absorb(idx, line) {
30174
+ if (!line.trim()) return;
30175
+ try {
30176
+ const ev = JSON.parse(line);
30177
+ idx.lines += 1;
30178
+ const at = typeof ev.at === "string" ? Date.parse(ev.at) : Number.NaN;
30179
+ if (!Number.isNaN(at) && at < idx.oldestMs) idx.oldestMs = at;
30180
+ if (typeof ev.key === "string") idx.keys.add(ev.key);
30181
+ } catch {
30182
+ }
30183
+ }
30184
+ async function indexOf(file) {
30185
+ let st;
30186
+ try {
30187
+ st = await (0, import_promises57.stat)(file);
30188
+ } catch {
30189
+ indexes.delete(file);
30190
+ return emptyIndex();
30191
+ }
30192
+ let idx = indexes.get(file);
30193
+ if (!idx || idx.ino !== st.ino || st.size < idx.offset) {
30194
+ idx = emptyIndex(st.ino);
30195
+ indexes.set(file, idx);
30196
+ }
30197
+ if (st.size === idx.offset) return idx;
30198
+ const fh = await (0, import_promises57.open)(file, "r");
30199
+ try {
30200
+ const buf = Buffer.alloc(st.size - idx.offset);
30201
+ const { bytesRead } = await fh.read(buf, 0, buf.length, idx.offset);
30202
+ const text = buf.subarray(0, bytesRead).toString("utf8");
30203
+ const end = text.lastIndexOf("\n");
30204
+ if (end === -1) return idx;
30205
+ for (const line of text.slice(0, end).split("\n")) absorb(idx, line);
30206
+ idx.offset += Buffer.byteLength(text.slice(0, end + 1), "utf8");
30207
+ } finally {
30208
+ await fh.close();
30209
+ }
30210
+ return idx;
30211
+ }
30212
+ function parseLines(raw) {
30213
+ const out = [];
30214
+ for (const line of raw.split("\n")) {
30215
+ if (!line.trim()) continue;
30216
+ try {
30217
+ const ev = JSON.parse(line);
30218
+ if (typeof ev.id === "string" && typeof ev.at === "string" && typeof ev.type === "string") {
30219
+ out.push(ev);
30220
+ }
30221
+ } catch {
30222
+ continue;
30223
+ }
30224
+ }
30225
+ return out;
30226
+ }
30227
+ function byTime(a2, b) {
30228
+ if (a2.at !== b.at) return a2.at < b.at ? -1 : 1;
30229
+ return a2.id < b.id ? -1 : a2.id > b.id ? 1 : 0;
30230
+ }
30231
+ async function compact(file, now) {
30232
+ const raw = await (0, import_promises57.readFile)(file, "utf8").catch(() => "");
30233
+ const kept = parseLines(raw).filter((ev) => {
30234
+ const at = Date.parse(ev.at);
30235
+ return Number.isNaN(at) || now - at <= TIMELINE_RETENTION_MS;
30236
+ }).sort(byTime).slice(-TIMELINE_KEEP_LINES);
30237
+ const tmp = `${file}.tmp.${String(process.pid)}.${Date.now().toString(36)}`;
30238
+ await (0, import_promises57.writeFile)(tmp, kept.map((ev) => JSON.stringify(ev)).join("\n") + (kept.length ? "\n" : ""));
30239
+ await (0, import_promises57.rename)(tmp, file);
30240
+ indexes.delete(file);
30241
+ }
30242
+ async function fileFor(wsId) {
30243
+ const dir = await resolveWorkspaceDir(wsId);
30244
+ return dir ? timelineFile(dir) : null;
30245
+ }
30246
+ async function appendTimelineEvent(wsId, input, now = Date.now) {
30247
+ const file = await fileFor(wsId);
30248
+ if (!file) return null;
30249
+ return withFileLock(
30250
+ file,
30251
+ async () => {
30252
+ const idx = await indexOf(file);
30253
+ if (input.key && idx.keys.has(input.key)) return null;
30254
+ const ms = now();
30255
+ const ev = {
30256
+ ...input,
30257
+ id: input.id ?? newTimelineEventId(ms),
30258
+ at: input.at ?? new Date(ms).toISOString()
30259
+ };
30260
+ await (0, import_promises57.appendFile)(file, JSON.stringify(ev) + "\n", "utf8");
30261
+ const after = await indexOf(file);
30262
+ if (after.lines > TIMELINE_MAX_LINES || Number.isFinite(after.oldestMs) && ms - after.oldestMs > TIMELINE_RETENTION_MS) {
30263
+ await compact(file, ms);
30264
+ }
30265
+ return ev;
30266
+ },
30267
+ WORKSPACE_LOCK
30268
+ );
30269
+ }
30270
+ async function recordTimelineEvent(wsId, input) {
30271
+ try {
30272
+ return await appendTimelineEvent(wsId, input);
30273
+ } catch (err) {
30274
+ console.warn(
30275
+ `[timeline] could not record ${input.type} in ${wsId}: ${err instanceof Error ? err.message : String(err)}`
30276
+ );
30277
+ return null;
30278
+ }
30279
+ }
30280
+ async function workspaceForPath(path6) {
30281
+ if (!path6) return null;
30282
+ const records = await listWorkspaces();
30283
+ if (records.length === 0) return null;
30284
+ return findWorkspaceContaining(records, await canonicalWorkspaceRoot(path6));
30285
+ }
30286
+
30287
+ // src/timeline-hooks.ts
30288
+ async function boxTaskIds(wsId, boxId) {
30289
+ const tasks = await readTasks(wsId).catch(() => []);
30290
+ return tasks.filter((t) => t.boxId === boxId).map((t) => t.id);
30291
+ }
30292
+ async function recordBoxGitPush(ctx, origin, result, stat24) {
30293
+ if (result.exitCode !== 0 || origin.hostInitiated || origin.hostOnly) return;
30294
+ try {
30295
+ const ws = await workspaceForPath(ctx.hostPath);
30296
+ if (!ws) return;
30297
+ const [taskIds, managerId, diff] = await Promise.all([
30298
+ boxTaskIds(ws.id, ctx.boxId),
30299
+ managerIdForTarget({ boxId: ctx.boxId }, { workspaceId: ws.id }),
30300
+ stat24 ? pushLineStat(stat24) : void 0
30301
+ ]);
30302
+ await recordTimelineEvent(ws.id, {
30303
+ type: "git.push",
30304
+ actor: "box",
30305
+ boxId: ctx.boxId,
30306
+ ...ctx.boxName ? { boxName: ctx.boxName } : {},
30307
+ ...ctx.branch ? { branch: ctx.branch } : {},
30308
+ ...managerId ? { managerId } : {},
30309
+ ...taskIds.length ? { taskIds } : {},
30310
+ ...diff ?? {}
30311
+ });
30312
+ } catch {
30313
+ }
30314
+ }
30315
+ var MERGE_VALUE_FLAGS = /* @__PURE__ */ new Set([
30316
+ "-b",
30317
+ "--body",
30318
+ "-F",
30319
+ "--body-file",
30320
+ "-t",
30321
+ "--subject",
30322
+ "-A",
30323
+ "--author-email",
30324
+ "--match-head-commit",
30325
+ "-R",
30326
+ "--repo"
30327
+ ]);
30328
+ function prMergeTarget(rest) {
30329
+ for (let i2 = 0; i2 < rest.length; i2++) {
30330
+ const arg = rest[i2] ?? "";
30331
+ if (MERGE_VALUE_FLAGS.has(arg)) {
30332
+ i2++;
30333
+ continue;
30334
+ }
30335
+ if (!arg.startsWith("-")) return arg;
30336
+ }
30337
+ return void 0;
30338
+ }
30339
+ function prMergeRepo(rest) {
30340
+ for (let i2 = 0; i2 < rest.length; i2++) {
30341
+ const arg = rest[i2] ?? "";
30342
+ if (arg === "-R" || arg === "--repo") return rest[i2 + 1] || void 0;
30343
+ if (arg.startsWith("--repo=")) return arg.slice("--repo=".length) || void 0;
30344
+ if (arg.startsWith("-R") && arg.length > 2) return arg.slice(2);
30345
+ if (MERGE_VALUE_FLAGS.has(arg)) i2++;
30346
+ }
30347
+ return void 0;
30348
+ }
30349
+ function prViewArgs(lead, target, repo) {
30350
+ return [
30351
+ ...lead,
30352
+ "pr",
30353
+ "view",
30354
+ target,
30355
+ ...repo ? ["--repo", repo] : [],
30356
+ "--json",
30357
+ GH_PR_JSON_FIELDS
30358
+ ];
30359
+ }
30360
+ async function recordBoxGhResult(ctx, args, result) {
30361
+ if (result.exitCode !== 0) return;
30362
+ const verb = ghVerbArgv(args);
30363
+ if (verb[0] !== "pr" || verb[1] !== "create" && verb[1] !== "merge") return;
30364
+ try {
30365
+ const ws = await workspaceForPath(ctx.hostPath);
30366
+ if (!ws) return;
30367
+ const target = verb[1] === "create" ? parsePrUrl(result.stdout)?.url : prMergeTarget(verb.slice(2)) ?? ctx.branch;
30368
+ if (!target) return;
30369
+ const lead = args.slice(0, args.length - verb.length);
30370
+ const ghTarget = await resolveGhTarget(ctx.originUrl);
30371
+ if (ghTarget.error) return;
30372
+ const repo = verb[1] === "merge" ? prMergeRepo(verb.slice(2)) : void 0;
30373
+ const run5 = ghRunContext(ctx.hostPath, ctx.originUrl, prViewArgs(lead, target, repo));
30374
+ const view = await runHostGh(run5.args, run5.cwd, { host: ghTarget.host, timeoutMs: 2e4 });
30375
+ if (view.exitCode !== 0) return;
30376
+ const pr = JSON.parse(view.stdout);
30377
+ const parsed = parsePrUrl(pr.url);
30378
+ if (!parsed) return;
30379
+ const [taskIds, managerId] = await Promise.all([
30380
+ boxTaskIds(ws.id, ctx.boxId),
30381
+ managerIdForTarget({ boxId: ctx.boxId }, { workspaceId: ws.id })
30382
+ ]);
30383
+ const events = prTimelineEvents(pr, parsed.repo, {
30384
+ actor: "box",
30385
+ boxId: ctx.boxId,
30386
+ ...ctx.boxName ? { boxName: ctx.boxName } : {},
30387
+ ...managerId ? { managerId } : {},
30388
+ ...taskIds.length ? { taskIds } : {}
30389
+ });
30390
+ for (const ev of events) {
30391
+ if (ev.type === "pr.ready") continue;
30392
+ await recordTimelineEvent(ws.id, ev);
30393
+ }
30394
+ } catch {
30395
+ }
30396
+ }
30397
+ function jobAgent(job) {
30398
+ if (job.noAgent) return void 0;
30399
+ return job.agent === "claude-code" ? "claude" : job.agent;
30400
+ }
30401
+ async function recordCreateJobTimeline(job) {
30402
+ if (job.kind === "prepare") return;
30403
+ if (job.status !== "done" && job.status !== "failed") return;
30404
+ try {
30405
+ const ws = await workspaceForPath(job.createOpts.workspace);
30406
+ if (!ws) return;
30407
+ const box = job.boxId ? (await readState().catch(() => null))?.boxes.find((b) => b.id === job.boxId) : void 0;
30408
+ const [tasks, byJob, byBox] = await Promise.all([
30409
+ readTasks(ws.id).catch(() => []),
30410
+ managerIdForTarget({ boxJobId: job.id }, { workspaceId: ws.id }),
30411
+ job.boxId ? managerIdForTarget({ boxId: job.boxId }, { workspaceId: ws.id }) : Promise.resolve(void 0)
30412
+ ]);
30413
+ const taskIds = tasks.filter((t) => t.boxJobId === job.id || job.boxId !== void 0 && t.boxId === job.boxId).map((t) => t.id);
30414
+ const managerId = byJob ?? byBox;
30415
+ const name = box?.name ?? (job.boxName || job.createOpts.name);
30416
+ const branch = box?.gitWorktrees?.[0]?.branch ?? box?.cloud?.workspaceBranch;
30417
+ const agent = jobAgent(job);
30418
+ const ready = job.status === "done";
30419
+ await recordTimelineEvent(ws.id, {
30420
+ type: ready ? "box.ready" : "box.failed",
30421
+ actor: "hub",
30422
+ key: `job:${job.id}:${ready ? "ready" : "failed"}`,
30423
+ ...job.boxId ? { boxId: job.boxId } : {},
30424
+ ...name ? { boxName: name } : {},
30425
+ ...agent ? { agent } : {},
30426
+ ...branch ? { branch } : {},
30427
+ ...job.createOpts.fromBranch ? { base: job.createOpts.fromBranch } : {},
30428
+ ...managerId ? { managerId } : {},
30429
+ ...taskIds.length ? { taskIds } : {},
30430
+ ...!ready && job.reason ? { text: job.reason.slice(0, 500) } : {}
30431
+ });
30432
+ } catch {
30433
+ }
30434
+ }
30435
+
30436
+ // src/server.ts
30437
+ var import_node_child_process12 = require("child_process");
30438
+ var import_node_fs13 = require("fs");
30439
+ var import_node_http3 = require("http");
30440
+
30441
+ // src/host-actions.ts
30442
+ init_execa();
30443
+ var import_node_fs8 = require("fs");
30444
+ var import_promises59 = require("fs/promises");
30445
+ var import_node_os7 = require("os");
30446
+ var import_node_path11 = require("path");
30447
+ var import_node_url3 = require("url");
30448
+ init_dist2();
30449
+ init_dist4();
30450
+
30451
+ // src/host-initiated.ts
30452
+ var import_node_crypto3 = require("crypto");
29752
30453
  var DEFAULT_TTL_MS = 12e4;
29753
30454
  function hashRpcParams(params) {
29754
- return (0, import_node_crypto.createHash)("sha256").update(canonicalJson(params)).digest("hex");
30455
+ return (0, import_node_crypto3.createHash)("sha256").update(canonicalJson(params)).digest("hex");
29755
30456
  }
29756
30457
  function canonicalJson(v) {
29757
30458
  if (v === null) return "null";
@@ -29775,7 +30476,7 @@ var HostInitiatedTokens = class {
29775
30476
  * params (no current call sites use this).
29776
30477
  */
29777
30478
  mint(boxId, method, paramsHash, ttlMs = DEFAULT_TTL_MS) {
29778
- const token = (0, import_node_crypto.randomBytes)(32).toString("hex");
30479
+ const token = (0, import_node_crypto3.randomBytes)(32).toString("hex");
29779
30480
  this.store.set(token, { boxId, method, paramsHash, expiresAt: Date.now() + ttlMs });
29780
30481
  return token;
29781
30482
  }
@@ -29869,14 +30570,14 @@ function buildCpArgv(opts) {
29869
30570
  // src/cp-cache-capture.ts
29870
30571
  var import_node_child_process7 = require("child_process");
29871
30572
  var import_node_fs7 = require("fs");
29872
- var import_promises54 = require("fs/promises");
29873
- var import_node_os5 = require("os");
29874
- var import_node_path6 = require("path");
30573
+ var import_promises58 = require("fs/promises");
30574
+ var import_node_os6 = require("os");
30575
+ var import_node_path9 = require("path");
29875
30576
  var import_node_http = require("http");
29876
30577
  var import_node_https = require("https");
29877
30578
 
29878
30579
  // src/cp-cache.ts
29879
- var import_node_crypto2 = require("crypto");
30580
+ var import_node_crypto4 = require("crypto");
29880
30581
  function cpCachePrefix(opts) {
29881
30582
  const slug = (opts.projectSlug ?? "").trim();
29882
30583
  return slug.length > 0 ? `projects/${slug}/cp` : `boxes/${opts.boxId}/cp`;
@@ -29888,7 +30589,7 @@ function cpCacheKeyInput(source) {
29888
30589
  return `rel:${rel}`;
29889
30590
  }
29890
30591
  function cpCacheKey(source) {
29891
- return (0, import_node_crypto2.createHash)("sha256").update(cpCacheKeyInput(source)).digest("hex").slice(0, 32);
30592
+ return (0, import_node_crypto4.createHash)("sha256").update(cpCacheKeyInput(source)).digest("hex").slice(0, 32);
29892
30593
  }
29893
30594
  function cpCacheTarPath(prefix, source) {
29894
30595
  return `${prefix}/${cpCacheKey(source)}.tar`;
@@ -29933,12 +30634,12 @@ async function captureCpCacheEntry(absPath, prefix, deps, requestPath = absPath)
29933
30634
  const maxBytes = deps.maxBytes ?? DEFAULT_MAX_CACHE_BYTES;
29934
30635
  let workDir;
29935
30636
  try {
29936
- const info = await (0, import_promises54.stat)(absPath);
29937
- const dir = await (0, import_promises54.mkdtemp)((0, import_node_path6.join)((0, import_node_os5.tmpdir)(), "agentbox-cp-cache-"));
30637
+ const info = await (0, import_promises58.stat)(absPath);
30638
+ const dir = await (0, import_promises58.mkdtemp)((0, import_node_path9.join)((0, import_node_os6.tmpdir)(), "agentbox-cp-cache-"));
29938
30639
  workDir = dir;
29939
- const tarPath = (0, import_node_path6.join)(dir, "entry.tar");
29940
- await run2("tar", ["-cf", tarPath, "-C", (0, import_node_path6.dirname)(absPath), (0, import_node_path6.basename)(absPath)], TAR_TIMEOUT_MS);
29941
- const tarInfo = await (0, import_promises54.stat)(tarPath);
30640
+ const tarPath = (0, import_node_path9.join)(dir, "entry.tar");
30641
+ await run2("tar", ["-cf", tarPath, "-C", (0, import_node_path9.dirname)(absPath), (0, import_node_path9.basename)(absPath)], TAR_TIMEOUT_MS);
30642
+ const tarInfo = await (0, import_promises58.stat)(tarPath);
29942
30643
  if (tarInfo.size > maxBytes) {
29943
30644
  log(
29944
30645
  `cp cache: skipping ${absPath} \u2014 ${String(tarInfo.size)} bytes exceeds the hub's ${String(maxBytes)}-byte limit`
@@ -29950,7 +30651,7 @@ async function captureCpCacheEntry(absPath, prefix, deps, requestPath = absPath)
29950
30651
  isDir: info.isDirectory(),
29951
30652
  capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
29952
30653
  size: tarInfo.size,
29953
- capturedOn: (0, import_node_os5.hostname)()
30654
+ capturedOn: (0, import_node_os6.hostname)()
29954
30655
  };
29955
30656
  const base = deps.controlPlaneUrl.replace(/\/+$/, "");
29956
30657
  await putBlob(
@@ -29971,7 +30672,7 @@ async function captureCpCacheEntry(absPath, prefix, deps, requestPath = absPath)
29971
30672
  );
29972
30673
  return false;
29973
30674
  } finally {
29974
- if (workDir) await (0, import_promises54.rm)(workDir, { recursive: true, force: true }).catch(() => {
30675
+ if (workDir) await (0, import_promises58.rm)(workDir, { recursive: true, force: true }).catch(() => {
29975
30676
  });
29976
30677
  }
29977
30678
  }
@@ -30049,7 +30750,7 @@ function putJson(url, body, token) {
30049
30750
  }
30050
30751
 
30051
30752
  // src/prompts.ts
30052
- var import_node_crypto3 = require("crypto");
30753
+ var import_node_crypto5 = require("crypto");
30053
30754
  var PendingPrompts = class {
30054
30755
  entries = /* @__PURE__ */ new Map();
30055
30756
  autoApprove = null;
@@ -30252,7 +30953,7 @@ async function askPrompt(prompts, subscribers, boxId, params, opts) {
30252
30953
  if (prompts.consumeAutoApprove(boxId, params)) {
30253
30954
  return { answer: "y" };
30254
30955
  }
30255
- const ev = { id: (0, import_node_crypto3.randomUUID)(), ...params };
30956
+ const ev = { id: (0, import_node_crypto5.randomUUID)(), ...params };
30256
30957
  const promise = prompts.add(boxId, ev);
30257
30958
  subscribers.broadcast(boxId, "prompt-ask", ev);
30258
30959
  if (opts?.ttlMs !== void 0 && opts.ttlMs > 0) {
@@ -30279,11 +30980,11 @@ function isPromptAnswerBody(v) {
30279
30980
  }
30280
30981
 
30281
30982
  // src/host-actions.ts
30282
- init_dist2();
30983
+ init_dist();
30283
30984
 
30284
30985
  // src/host-tools.ts
30285
- var import_node_path7 = require("path");
30286
- init_dist2();
30986
+ var import_node_path10 = require("path");
30987
+ init_dist();
30287
30988
 
30288
30989
  // src/host-exec.ts
30289
30990
  var import_node_child_process8 = require("child_process");
@@ -30372,7 +31073,7 @@ var CREDENTIAL_ARGV_PATTERNS = [
30372
31073
  function refuseCredentialArgv(name, args, bin) {
30373
31074
  const joined = args.join(" ");
30374
31075
  const candidates = [`${name} ${joined}`];
30375
- const binName = bin ? (0, import_node_path7.basename)(bin) : void 0;
31076
+ const binName = bin ? (0, import_node_path10.basename)(bin) : void 0;
30376
31077
  if (binName && binName !== name) candidates.push(`${binName} ${joined}`);
30377
31078
  for (const re of CREDENTIAL_ARGV_PATTERNS) {
30378
31079
  if (candidates.some((c3) => re.test(c3))) {
@@ -30504,7 +31205,7 @@ function renderToolList(grants) {
30504
31205
  }
30505
31206
 
30506
31207
  // src/safe-transfer.ts
30507
- init_dist();
31208
+ init_dist2();
30508
31209
  async function canAutoApproveTransfer(input) {
30509
31210
  if (!input.enabled) return false;
30510
31211
  if (!input.workspacePath || input.hostPaths.length === 0) return false;
@@ -30529,7 +31230,7 @@ function recordAgents(box) {
30529
31230
  }
30530
31231
 
30531
31232
  // src/open-link.ts
30532
- var import_node_crypto4 = require("crypto");
31233
+ var import_node_crypto6 = require("crypto");
30533
31234
  init_dist4();
30534
31235
 
30535
31236
  // src/browser-open-budget.ts
@@ -30595,7 +31296,7 @@ var browserOpenBudget = new BrowserOpenBudget();
30595
31296
  var OPEN_LINK_TTL_MS = 9e4;
30596
31297
  async function offerBrowserOpen(deps, url) {
30597
31298
  const budget = deps.budget ?? browserOpenBudget;
30598
- const open4 = deps.openHost ?? openOnHost;
31299
+ const open6 = deps.openHost ?? openOnHost;
30599
31300
  const decision = budget.decide(deps.boxId, url, deps.autoApproveSafe);
30600
31301
  if (decision.action === "drop") return "dropped";
30601
31302
  if (decision.action === "open") budget.record(deps.boxId, url);
@@ -30610,7 +31311,7 @@ async function offerBrowserOpen(deps, url) {
30610
31311
  };
30611
31312
  if (decision.action === "open" && !deps.controlPlane && deps.subscribers.count(deps.boxId) === 0) {
30612
31313
  deps.prompts.noteAutoApprove(deps.boxId, promptEvent, decision.reason);
30613
- open4(url);
31314
+ open6(url);
30614
31315
  return "opened-locally";
30615
31316
  }
30616
31317
  if (decision.action !== "open" && deps.prompts.consumeAutoApprove(deps.boxId, promptEvent)) {
@@ -30619,10 +31320,10 @@ async function offerBrowserOpen(deps, url) {
30619
31320
  deps.log?.(`browser.open: auto-approved but nothing here can open it (control box): ${url}`);
30620
31321
  return "unclaimed";
30621
31322
  }
30622
- open4(url);
31323
+ open6(url);
30623
31324
  return "opened-locally";
30624
31325
  }
30625
- const ev = { id: (0, import_node_crypto4.randomUUID)(), ...promptEvent };
31326
+ const ev = { id: (0, import_node_crypto6.randomUUID)(), ...promptEvent };
30626
31327
  const settled = deps.prompts.add(deps.boxId, ev);
30627
31328
  const timer = setTimeout(() => {
30628
31329
  if (deps.prompts.resolve(ev.id, "n", true)) {
@@ -30644,7 +31345,7 @@ async function offerBrowserOpen(deps, url) {
30644
31345
  deps.log?.(`browser.open: approved but no client opened it (control box): ${url}`);
30645
31346
  return "unclaimed";
30646
31347
  }
30647
- open4(url);
31348
+ open6(url);
30648
31349
  return "opened-after-answer";
30649
31350
  }
30650
31351
 
@@ -30766,7 +31467,21 @@ async function executeCloudAction(action, deps) {
30766
31467
  };
30767
31468
  }
30768
31469
  if (action.method === "git.push" || action.method === "git.fetch") {
30769
- return runGitRpc(action, deps);
31470
+ const push = { hostInitiated: false };
31471
+ return runGitRpc(action, deps, push).then((result) => {
31472
+ if (action.method === "git.push" && result.exitCode === 0) {
31473
+ const hostOnly = Boolean(action.params?.hostOnly);
31474
+ void cloudTimelineContext(deps).then(
31475
+ (ctx) => ctx ? recordBoxGitPush(
31476
+ ctx,
31477
+ { hostInitiated: push.hostInitiated, hostOnly },
31478
+ result,
31479
+ push.stat
31480
+ ) : void 0
31481
+ );
31482
+ }
31483
+ return result;
31484
+ });
30770
31485
  }
30771
31486
  if (action.method === "cp.toHost" || action.method === "cp.fromHost") {
30772
31487
  return runCpRpc(action, deps);
@@ -30781,7 +31496,16 @@ async function executeCloudAction(action, deps) {
30781
31496
  return runBrowserOpenMirror(action, deps);
30782
31497
  }
30783
31498
  if (action.method === "gh.exec") {
30784
- return runGhExecRpc(action, deps);
31499
+ return runGhExecRpc(action, deps).then((result) => {
31500
+ if (result.exitCode === 0) {
31501
+ const raw = action.params?.args;
31502
+ const args = Array.isArray(raw) ? raw.filter((a2) => typeof a2 === "string") : [];
31503
+ void cloudTimelineContext(deps).then(
31504
+ (ctx) => ctx ? recordBoxGhResult(ctx, args, result) : void 0
31505
+ );
31506
+ }
31507
+ return result;
31508
+ });
30785
31509
  }
30786
31510
  if (action.method.startsWith("tool.")) {
30787
31511
  return runToolRpc(action, deps);
@@ -31001,6 +31725,20 @@ function cloudHandleOf(lookup) {
31001
31725
  ...lookup.sandboxClass ? { sandboxClass: lookup.sandboxClass } : {}
31002
31726
  };
31003
31727
  }
31728
+ async function cloudTimelineContext(deps) {
31729
+ try {
31730
+ const lookup = await lookupCloudBox(deps.boxId);
31731
+ return {
31732
+ boxId: deps.boxId,
31733
+ ...deps.boxName ? { boxName: deps.boxName } : {},
31734
+ hostPath: lookup.workspacePath,
31735
+ ...lookup.sanctionedBranch ? { branch: lookup.sanctionedBranch } : {},
31736
+ ...deps.originUrl ? { originUrl: deps.originUrl } : {}
31737
+ };
31738
+ } catch {
31739
+ return null;
31740
+ }
31741
+ }
31004
31742
  async function lookupCloudBox(boxId) {
31005
31743
  const state = await readState();
31006
31744
  const hit = findBox(boxId, state);
@@ -31295,20 +32033,20 @@ async function resolveHostGitRepo(workspacePath, deps, remoteName) {
31295
32033
  );
31296
32034
  }
31297
32035
  const origin = httpsOriginForScratchPush(rawOrigin);
31298
- const dir = await (0, import_promises55.mkdtemp)((0, import_node_path8.join)((0, import_node_os6.tmpdir)(), "agentbox-git-scratch-"));
32036
+ const dir = await (0, import_promises59.mkdtemp)((0, import_node_path11.join)((0, import_node_os7.tmpdir)(), "agentbox-git-scratch-"));
31299
32037
  const init = await execa("git", ["-C", dir, "init", "--quiet"], { reject: false });
31300
32038
  if ((init.exitCode ?? 1) !== 0) {
31301
- await (0, import_promises55.rm)(dir, { recursive: true, force: true });
32039
+ await (0, import_promises59.rm)(dir, { recursive: true, force: true });
31302
32040
  throw new Error(`could not initialize a scratch git repo: ${init.stderr ?? ""}`);
31303
32041
  }
31304
32042
  return {
31305
32043
  dir,
31306
32044
  remote: origin,
31307
32045
  scratch: true,
31308
- cleanup: () => (0, import_promises55.rm)(dir, { recursive: true, force: true })
32046
+ cleanup: () => (0, import_promises59.rm)(dir, { recursive: true, force: true })
31309
32047
  };
31310
32048
  }
31311
- async function runGitRpc(action, deps) {
32049
+ async function runGitRpc(action, deps, trace = { hostInitiated: false }) {
31312
32050
  const params = action.params ?? {};
31313
32051
  const lookup = await lookupCloudBox(deps.boxId);
31314
32052
  const backend = await resolveCloudBackend(deps.backendName);
@@ -31343,8 +32081,8 @@ async function runGitRpc(action, deps) {
31343
32081
  };
31344
32082
  }
31345
32083
  const dest = resolveLandDest(branch, params.as);
31346
- const stageSave = await (0, import_promises55.mkdtemp)((0, import_node_path8.join)((0, import_node_os6.tmpdir)(), "agentbox-git-save-"));
31347
- const hostBundleSave = (0, import_node_path8.join)(stageSave, "op.bundle");
32084
+ const stageSave = await (0, import_promises59.mkdtemp)((0, import_node_path11.join)((0, import_node_os7.tmpdir)(), "agentbox-git-save-"));
32085
+ const hostBundleSave = (0, import_node_path11.join)(stageSave, "op.bundle");
31348
32086
  const remoteBundleSave = "/tmp/agentbox-rpc-save.bundle";
31349
32087
  try {
31350
32088
  const make = await backend.exec(
@@ -31379,7 +32117,7 @@ ${landed.stdout ?? ""}`,
31379
32117
  stderr: landed.stderr ?? ""
31380
32118
  };
31381
32119
  } finally {
31382
- await (0, import_promises55.rm)(stageSave, { recursive: true, force: true });
32120
+ await (0, import_promises59.rm)(stageSave, { recursive: true, force: true });
31383
32121
  await backend.exec(handle, `rm -f ${shellQuote(remoteBundleSave)}`).catch(() => {
31384
32122
  });
31385
32123
  }
@@ -31407,6 +32145,7 @@ ${landed.stdout ?? ""}`,
31407
32145
  "git.push",
31408
32146
  incomingHashGit
31409
32147
  ) ?? false);
32148
+ trace.hostInitiated = hostInitiatedOk;
31410
32149
  if (action.method === "git.push" && !bypassPushGate && tokenClaimedGit && !hostInitiatedOk) {
31411
32150
  return {
31412
32151
  exitCode: 10,
@@ -31475,8 +32214,8 @@ ${landed.stdout ?? ""}`,
31475
32214
  `git.${action.method === "git.push" ? "push" : "fetch"}: no host checkout for box ${deps.boxId}; using a scratch repo against ${repo.remote}`
31476
32215
  );
31477
32216
  }
31478
- const stage = await (0, import_promises55.mkdtemp)((0, import_node_path8.join)((0, import_node_os6.tmpdir)(), "agentbox-git-rpc-"));
31479
- const hostBundle = (0, import_node_path8.join)(stage, "op.bundle");
32217
+ const stage = await (0, import_promises59.mkdtemp)((0, import_node_path11.join)((0, import_node_os7.tmpdir)(), "agentbox-git-rpc-"));
32218
+ const hostBundle = (0, import_node_path11.join)(stage, "op.bundle");
31480
32219
  const remoteBundle = "/tmp/agentbox-rpc.bundle";
31481
32220
  try {
31482
32221
  if (action.method === "git.push") {
@@ -31491,6 +32230,11 @@ ${landed.stdout ?? ""}`,
31491
32230
  stderr: `bundle create failed: ${make.stderr || make.stdout}`
31492
32231
  };
31493
32232
  }
32233
+ if (!repo.scratch && !trace.hostInitiated) {
32234
+ const ref = pushedRef(branch, { remote: remoteName });
32235
+ const before = await readRefTip(repo.dir, ref);
32236
+ trace.stat = { repo: repo.dir, ref, branch, ...before ? { before } : {} };
32237
+ }
31494
32238
  await backend.downloadFile(handle, remoteBundle, hostBundle);
31495
32239
  const fetch2 = await execa(
31496
32240
  "git",
@@ -31575,7 +32319,7 @@ relay: post-push in-box origin/upstream sync threw: ${err instanceof Error ? err
31575
32319
  stderr: sandboxFetch.stderr
31576
32320
  };
31577
32321
  } finally {
31578
- await (0, import_promises55.rm)(stage, { recursive: true, force: true });
32322
+ await (0, import_promises59.rm)(stage, { recursive: true, force: true });
31579
32323
  await repo.cleanup().catch(() => {
31580
32324
  });
31581
32325
  await backend.exec(handle, `rm -f ${shellQuote(remoteBundle)}`).catch(() => {
@@ -31589,7 +32333,7 @@ function shellQuote(arg) {
31589
32333
  }
31590
32334
 
31591
32335
  // src/host-action-queue.ts
31592
- var import_node_crypto5 = require("crypto");
32336
+ var import_node_crypto7 = require("crypto");
31593
32337
  var DEFAULT_HOST_ACTION_MAX_AGE_MS = 15 * 60 * 1e3;
31594
32338
  var HostActionQueue = class {
31595
32339
  map = /* @__PURE__ */ new Map();
@@ -31607,7 +32351,7 @@ var HostActionQueue = class {
31607
32351
  * is open" semantics).
31608
32352
  */
31609
32353
  enqueue(boxId, method, params) {
31610
- const id = (0, import_node_crypto5.randomUUID)();
32354
+ const id = (0, import_node_crypto7.randomUUID)();
31611
32355
  const action = {
31612
32356
  id,
31613
32357
  boxId,
@@ -31673,7 +32417,7 @@ var HostActionQueue = class {
31673
32417
  };
31674
32418
 
31675
32419
  // src/host-reach.ts
31676
- var import_node_crypto6 = require("crypto");
32420
+ var import_node_crypto8 = require("crypto");
31677
32421
  var DEFAULT_HOST_REACH_TIMEOUT_MS = 6e4;
31678
32422
  var HostReachQueue = class {
31679
32423
  map = /* @__PURE__ */ new Map();
@@ -31709,7 +32453,7 @@ var HostReachQueue = class {
31709
32453
  * normal, expected state (a closed laptop), not an error condition.
31710
32454
  */
31711
32455
  request(boxId, method, params, opts = {}) {
31712
- const id = (0, import_node_crypto6.randomUUID)();
32456
+ const id = (0, import_node_crypto8.randomUUID)();
31713
32457
  const action = {
31714
32458
  id,
31715
32459
  boxId,
@@ -31973,10 +32717,10 @@ var HostReachQueue = class {
31973
32717
  // src/cp-cache-serve.ts
31974
32718
  var import_node_child_process9 = require("child_process");
31975
32719
  var import_node_fs9 = require("fs");
31976
- var import_promises56 = require("fs/promises");
31977
- var import_node_os7 = require("os");
31978
- var import_node_path9 = require("path");
31979
- var import_promises57 = require("stream/promises");
32720
+ var import_promises60 = require("fs/promises");
32721
+ var import_node_os8 = require("os");
32722
+ var import_node_path12 = require("path");
32723
+ var import_promises61 = require("stream/promises");
31980
32724
  var UNTAR_TIMEOUT_MS = 12e4;
31981
32725
  var CP_TIMEOUT_MS = 3e5;
31982
32726
  async function lookupCpCache(sources, deps) {
@@ -32016,7 +32760,7 @@ async function serveCpFromCache(params, resolved, deps) {
32016
32760
  }
32017
32761
  let workDir;
32018
32762
  try {
32019
- const dir = await (0, import_promises56.mkdtemp)((0, import_node_path9.join)((0, import_node_os7.tmpdir)(), "agentbox-cp-serve-"));
32763
+ const dir = await (0, import_promises60.mkdtemp)((0, import_node_path12.join)((0, import_node_os8.tmpdir)(), "agentbox-cp-serve-"));
32020
32764
  workDir = dir;
32021
32765
  const names = [];
32022
32766
  for (const entry of lookup.entries) {
@@ -32024,13 +32768,13 @@ async function serveCpFromCache(params, resolved, deps) {
32024
32768
  cpCacheTarPath(deps.cachePrefix, entry.sourcePath)
32025
32769
  );
32026
32770
  if (!found) return { exitCode: 69, stdout: "", stderr: "" };
32027
- const tarPath = (0, import_node_path9.join)(dir, `${names.length.toString()}.tar`);
32028
- await (0, import_promises57.pipeline)(found.data, (0, import_node_fs9.createWriteStream)(tarPath));
32771
+ const tarPath = (0, import_node_path12.join)(dir, `${names.length.toString()}.tar`);
32772
+ await (0, import_promises61.pipeline)(found.data, (0, import_node_fs9.createWriteStream)(tarPath));
32029
32773
  await run3("tar", ["-xf", tarPath, "-C", dir], UNTAR_TIMEOUT_MS);
32030
- await (0, import_promises56.rm)(tarPath, { force: true });
32031
- names.push((0, import_node_path9.basename)(entry.sourcePath));
32774
+ await (0, import_promises60.rm)(tarPath, { force: true });
32775
+ names.push((0, import_node_path12.basename)(entry.sourcePath));
32032
32776
  }
32033
- const staged = names.map((n2) => (0, import_node_path9.join)(dir, n2));
32777
+ const staged = names.map((n2) => (0, import_node_path12.join)(dir, n2));
32034
32778
  const absent = staged.filter((p) => !(0, import_node_fs9.existsSync)(p));
32035
32779
  if (absent.length > 0) {
32036
32780
  return {
@@ -32075,7 +32819,7 @@ ${age}
32075
32819
  `
32076
32820
  };
32077
32821
  } finally {
32078
- if (workDir) await (0, import_promises56.rm)(workDir, { recursive: true, force: true }).catch(() => {
32822
+ if (workDir) await (0, import_promises60.rm)(workDir, { recursive: true, force: true }).catch(() => {
32079
32823
  });
32080
32824
  }
32081
32825
  }
@@ -32094,13 +32838,13 @@ function runCapture(bin, args, cwd, timeout) {
32094
32838
  }
32095
32839
 
32096
32840
  // src/cp-outbox.ts
32097
- var import_node_crypto7 = require("crypto");
32841
+ var import_node_crypto9 = require("crypto");
32098
32842
  var import_node_child_process10 = require("child_process");
32099
32843
  var import_node_fs10 = require("fs");
32100
- var import_promises58 = require("fs/promises");
32101
- var import_node_os8 = require("os");
32102
- var import_node_path10 = require("path");
32103
- var import_promises59 = require("stream/promises");
32844
+ var import_promises62 = require("fs/promises");
32845
+ var import_node_os9 = require("os");
32846
+ var import_node_path13 = require("path");
32847
+ var import_promises63 = require("stream/promises");
32104
32848
  var PULL_TIMEOUT_MS = 3e5;
32105
32849
  var TAR_TIMEOUT_MS2 = 12e4;
32106
32850
  function cpOutboxPrefix(opts) {
@@ -32139,9 +32883,9 @@ async function parkCpOutbox(sources, dest, deps) {
32139
32883
  if (!deps.custody || !deps.cliEntry) return null;
32140
32884
  let workDir;
32141
32885
  try {
32142
- const dir = await (0, import_promises58.mkdtemp)((0, import_node_path10.join)((0, import_node_os8.tmpdir)(), "agentbox-cp-outbox-"));
32886
+ const dir = await (0, import_promises62.mkdtemp)((0, import_node_path13.join)((0, import_node_os9.tmpdir)(), "agentbox-cp-outbox-"));
32143
32887
  workDir = dir;
32144
- const stage = (0, import_node_path10.join)(dir, "payload");
32888
+ const stage = (0, import_node_path13.join)(dir, "payload");
32145
32889
  await run4("mkdir", ["-p", stage], TAR_TIMEOUT_MS2);
32146
32890
  for (const src of sources) {
32147
32891
  await runNode(
@@ -32150,16 +32894,16 @@ async function parkCpOutbox(sources, dest, deps) {
32150
32894
  PULL_TIMEOUT_MS
32151
32895
  );
32152
32896
  }
32153
- const names = await (0, import_promises58.readdir)(stage);
32897
+ const names = await (0, import_promises62.readdir)(stage);
32154
32898
  if (names.length === 0) return null;
32155
- const tarPath = (0, import_node_path10.join)(dir, "outbox.tar");
32899
+ const tarPath = (0, import_node_path13.join)(dir, "outbox.tar");
32156
32900
  await run4("tar", ["-cf", tarPath, "-C", stage, ...names], TAR_TIMEOUT_MS2);
32157
- const info = await (0, import_promises58.stat)(tarPath);
32901
+ const info = await (0, import_promises62.stat)(tarPath);
32158
32902
  if (info.size > deps.maxBytes) {
32159
32903
  log(`cp outbox: ${String(info.size)} bytes exceeds the ${String(deps.maxBytes)}-byte limit`);
32160
32904
  return null;
32161
32905
  }
32162
- const id = (0, import_node_crypto7.randomUUID)();
32906
+ const id = (0, import_node_crypto9.randomUUID)();
32163
32907
  const meta = {
32164
32908
  id,
32165
32909
  boxId: deps.boxId,
@@ -32187,46 +32931,46 @@ It will land them at ${dest} \u2014 behind the usual approval \u2014 the next ti
32187
32931
  log(`cp outbox: could not park: ${err instanceof Error ? err.message : String(err)}`);
32188
32932
  return null;
32189
32933
  } finally {
32190
- if (workDir) await (0, import_promises58.rm)(workDir, { recursive: true, force: true }).catch(() => {
32934
+ if (workDir) await (0, import_promises62.rm)(workDir, { recursive: true, force: true }).catch(() => {
32191
32935
  });
32192
32936
  }
32193
32937
  }
32194
32938
  async function landCpOutboxTar(tarFile, destAbs, opts) {
32195
- const asDirectory = opts.destEndsWithSlash || (0, import_node_fs10.existsSync)(destAbs) && (await (0, import_promises58.stat)(destAbs)).isDirectory();
32939
+ const asDirectory = opts.destEndsWithSlash || (0, import_node_fs10.existsSync)(destAbs) && (await (0, import_promises62.stat)(destAbs)).isDirectory();
32196
32940
  if (asDirectory) {
32197
32941
  await run4("mkdir", ["-p", destAbs], TAR_TIMEOUT_MS2);
32198
32942
  await run4("tar", ["-xf", tarFile, "-C", destAbs], TAR_TIMEOUT_MS2);
32199
32943
  return;
32200
32944
  }
32201
- await run4("mkdir", ["-p", (0, import_node_path10.dirname)(destAbs)], TAR_TIMEOUT_MS2);
32202
- const staging = await (0, import_promises58.mkdtemp)((0, import_node_path10.join)((0, import_node_path10.dirname)(destAbs), ".agentbox-cp-"));
32945
+ await run4("mkdir", ["-p", (0, import_node_path13.dirname)(destAbs)], TAR_TIMEOUT_MS2);
32946
+ const staging = await (0, import_promises62.mkdtemp)((0, import_node_path13.join)((0, import_node_path13.dirname)(destAbs), ".agentbox-cp-"));
32203
32947
  try {
32204
32948
  await run4("tar", ["-xf", tarFile, "-C", staging], TAR_TIMEOUT_MS2);
32205
- const members = await (0, import_promises58.readdir)(staging);
32949
+ const members = await (0, import_promises62.readdir)(staging);
32206
32950
  if (members.length === 1) {
32207
- if ((0, import_node_fs10.existsSync)(destAbs) && (await (0, import_promises58.stat)(destAbs)).isDirectory()) {
32208
- await (0, import_promises58.rm)(destAbs, { recursive: true, force: true });
32951
+ if ((0, import_node_fs10.existsSync)(destAbs) && (await (0, import_promises62.stat)(destAbs)).isDirectory()) {
32952
+ await (0, import_promises62.rm)(destAbs, { recursive: true, force: true });
32209
32953
  }
32210
- await (0, import_promises58.rename)((0, import_node_path10.join)(staging, members[0]), destAbs);
32954
+ await (0, import_promises62.rename)((0, import_node_path13.join)(staging, members[0]), destAbs);
32211
32955
  return;
32212
32956
  }
32213
32957
  await run4("mkdir", ["-p", destAbs], TAR_TIMEOUT_MS2);
32214
32958
  for (const m of members) {
32215
- const target = (0, import_node_path10.join)(destAbs, m);
32216
- if ((0, import_node_fs10.existsSync)(target) && (await (0, import_promises58.stat)(target)).isDirectory()) {
32217
- await (0, import_promises58.rm)(target, { recursive: true, force: true });
32959
+ const target = (0, import_node_path13.join)(destAbs, m);
32960
+ if ((0, import_node_fs10.existsSync)(target) && (await (0, import_promises62.stat)(target)).isDirectory()) {
32961
+ await (0, import_promises62.rm)(target, { recursive: true, force: true });
32218
32962
  }
32219
- await (0, import_promises58.rename)((0, import_node_path10.join)(staging, m), target);
32963
+ await (0, import_promises62.rename)((0, import_node_path13.join)(staging, m), target);
32220
32964
  }
32221
32965
  } finally {
32222
- await (0, import_promises58.rm)(staging, { recursive: true, force: true }).catch(() => {
32966
+ await (0, import_promises62.rm)(staging, { recursive: true, force: true }).catch(() => {
32223
32967
  });
32224
32968
  }
32225
32969
  }
32226
32970
  async function stageOutboxTar(data) {
32227
- const dir = await (0, import_promises58.mkdtemp)((0, import_node_path10.join)((0, import_node_os8.tmpdir)(), "agentbox-cp-land-"));
32228
- const tarPath = (0, import_node_path10.join)(dir, "payload.tar");
32229
- await (0, import_promises59.pipeline)(data, (0, import_node_fs10.createWriteStream)(tarPath));
32971
+ const dir = await (0, import_promises62.mkdtemp)((0, import_node_path13.join)((0, import_node_os9.tmpdir)(), "agentbox-cp-land-"));
32972
+ const tarPath = (0, import_node_path13.join)(dir, "payload.tar");
32973
+ await (0, import_promises63.pipeline)(data, (0, import_node_fs10.createWriteStream)(tarPath));
32230
32974
  return { dir, tarPath };
32231
32975
  }
32232
32976
  function run4(bin, args, timeout) {
@@ -32260,7 +33004,7 @@ var HubNotifier = class {
32260
33004
  };
32261
33005
 
32262
33006
  // src/notices.ts
32263
- var import_node_crypto8 = require("crypto");
33007
+ var import_node_crypto10 = require("crypto");
32264
33008
  var DEFAULT_NOTICE_TTL_MS = 66e4;
32265
33009
  var BoxNotices = class {
32266
33010
  constructor(subscribers) {
@@ -32283,7 +33027,7 @@ var BoxNotices = class {
32283
33027
  this.entries.delete(id);
32284
33028
  }
32285
33029
  }
32286
- const ev = { id: (0, import_node_crypto8.randomUUID)(), kind, message };
33030
+ const ev = { id: (0, import_node_crypto10.randomUUID)(), kind, message };
32287
33031
  const ttl = typeof ttlMs === "number" && ttlMs > 0 ? ttlMs : DEFAULT_NOTICE_TTL_MS;
32288
33032
  const timer = setTimeout(() => {
32289
33033
  if (this.entries.delete(ev.id)) {
@@ -32322,10 +33066,10 @@ var BoxNotices = class {
32322
33066
 
32323
33067
  // src/server.ts
32324
33068
  init_dist4();
32325
- init_dist();
33069
+ init_dist2();
32326
33070
 
32327
33071
  // src/github-app.ts
32328
- var import_node_crypto9 = require("crypto");
33072
+ var import_node_crypto11 = require("crypto");
32329
33073
  function loadGitHubAppConfig() {
32330
33074
  const appId = process.env.GITHUB_APP_ID;
32331
33075
  let key = process.env.GITHUB_APP_PRIVATE_KEY;
@@ -32348,7 +33092,7 @@ function appJwt(cfg, nowMs = Date.now()) {
32348
33092
  const header = b64url(JSON.stringify({ alg: "RS256", typ: "JWT" }));
32349
33093
  const payload = b64url(JSON.stringify({ iat: now - 60, exp: now + 540, iss: cfg.appId }));
32350
33094
  const signingInput = `${header}.${payload}`;
32351
- const signature = (0, import_node_crypto9.createSign)("RSA-SHA256").update(signingInput).sign(cfg.privateKeyPem);
33095
+ const signature = (0, import_node_crypto11.createSign)("RSA-SHA256").update(signingInput).sign(cfg.privateKeyPem);
32352
33096
  return `${signingInput}.${b64url(signature)}`;
32353
33097
  }
32354
33098
  var RENEW_BEFORE_MS = 5 * 60 * 1e3;
@@ -32500,7 +33244,7 @@ async function leaseTokenResult(leaser, reg) {
32500
33244
  }
32501
33245
 
32502
33246
  // src/permission.ts
32503
- var import_node_crypto10 = require("crypto");
33247
+ var import_node_crypto12 = require("crypto");
32504
33248
  async function gateApproval(deps, boxId, method, params, promptParams) {
32505
33249
  if (deps.mode === "block") {
32506
33250
  if (!deps.prompts || !deps.subscribers) return { kind: "deny" };
@@ -32521,7 +33265,7 @@ async function gateApproval(deps, boxId, method, params, promptParams) {
32521
33265
  });
32522
33266
  return { kind: "allow" };
32523
33267
  }
32524
- const promptId2 = (0, import_node_crypto10.randomUUID)();
33268
+ const promptId2 = (0, import_node_crypto12.randomUUID)();
32525
33269
  const ev = { id: promptId2, ...promptParams };
32526
33270
  await deps.store.createPrompt({
32527
33271
  id: promptId2,
@@ -32554,12 +33298,12 @@ function hostRepoUnavailableReason(worktree, boxId, op) {
32554
33298
  }
32555
33299
 
32556
33300
  // src/admin-gate.ts
32557
- var import_node_crypto11 = require("crypto");
33301
+ var import_node_crypto13 = require("crypto");
32558
33302
  function timingSafeEqualStr(a2, b) {
32559
33303
  const ab = Buffer.from(a2, "utf8");
32560
33304
  const bb = Buffer.from(b, "utf8");
32561
33305
  if (ab.length !== bb.length) return false;
32562
- return (0, import_node_crypto11.timingSafeEqual)(ab, bb);
33306
+ return (0, import_node_crypto13.timingSafeEqual)(ab, bb);
32563
33307
  }
32564
33308
  function adminGateAllows(isLoopback, bearer, adminToken) {
32565
33309
  if (isLoopback) return true;
@@ -32568,10 +33312,10 @@ function adminGateAllows(isLoopback, bearer, adminToken) {
32568
33312
  }
32569
33313
 
32570
33314
  // src/custody/routes.ts
32571
- var import_node_crypto13 = require("crypto");
33315
+ var import_node_crypto15 = require("crypto");
32572
33316
 
32573
33317
  // src/custody/store.ts
32574
- var import_node_crypto12 = require("crypto");
33318
+ var import_node_crypto14 = require("crypto");
32575
33319
  init_dist4();
32576
33320
  var CUSTODY_SCOPES = ["agents", "projects", "boxes", "prepared"];
32577
33321
  var CustodyTooLargeError = class extends Error {
@@ -32654,7 +33398,7 @@ function timingSafeEqualStr2(a2, b) {
32654
33398
  const ab = Buffer.from(a2, "utf8");
32655
33399
  const bb = Buffer.from(b, "utf8");
32656
33400
  if (ab.length !== bb.length) return false;
32657
- return (0, import_node_crypto13.timingSafeEqual)(ab, bb);
33401
+ return (0, import_node_crypto15.timingSafeEqual)(ab, bb);
32658
33402
  }
32659
33403
  async function handleCustodyRequest(req, deps) {
32660
33404
  if (!isCustodyPath(req.path)) return null;
@@ -32777,10 +33521,10 @@ async function handleCustodyBlobRequest(req, deps) {
32777
33521
  }
32778
33522
 
32779
33523
  // src/remote-boxes.ts
32780
- var import_node_crypto14 = require("crypto");
32781
- var import_promises60 = require("fs/promises");
32782
- var import_node_path11 = require("path");
32783
- var import_node_crypto15 = require("crypto");
33524
+ var import_node_crypto16 = require("crypto");
33525
+ var import_promises64 = require("fs/promises");
33526
+ var import_node_path14 = require("path");
33527
+ var import_node_crypto17 = require("crypto");
32784
33528
  var REMOTE_BOXES_PREFIX = "/remote/boxes";
32785
33529
  function isSafeJobId(id) {
32786
33530
  return id.length > 0 && id.length <= 128 && /^[A-Za-z0-9._-]+$/.test(id);
@@ -32792,7 +33536,7 @@ function timingSafeEqualStr3(a2, b) {
32792
33536
  const ab = Buffer.from(a2, "utf8");
32793
33537
  const bb = Buffer.from(b, "utf8");
32794
33538
  if (ab.length !== bb.length) return false;
32795
- return (0, import_node_crypto15.timingSafeEqual)(ab, bb);
33539
+ return (0, import_node_crypto17.timingSafeEqual)(ab, bb);
32796
33540
  }
32797
33541
  function parseJson(text) {
32798
33542
  if (text.length === 0) return {};
@@ -32834,7 +33578,7 @@ async function handleRemoteBoxesRequest(req, deps) {
32834
33578
  }
32835
33579
  };
32836
33580
  }
32837
- const id = (0, import_node_crypto14.randomUUID)();
33581
+ const id = (0, import_node_crypto16.randomUUID)();
32838
33582
  await store.enqueueCreateJob({
32839
33583
  id,
32840
33584
  status: "queued",
@@ -32917,7 +33661,7 @@ async function reapLocalBoxState(boxId, sandboxId, log) {
32917
33661
  const provider = record.provider;
32918
33662
  if (key && provider) {
32919
33663
  const sshDir = boxSshDirForProvider2(provider, key);
32920
- if (sshDir) await (0, import_promises60.rm)((0, import_node_path11.dirname)(sshDir), { recursive: true, force: true }).catch(() => {
33664
+ if (sshDir) await (0, import_promises64.rm)((0, import_node_path14.dirname)(sshDir), { recursive: true, force: true }).catch(() => {
32921
33665
  });
32922
33666
  }
32923
33667
  }
@@ -32928,25 +33672,25 @@ async function reapLocalBoxState(boxId, sandboxId, log) {
32928
33672
  }
32929
33673
 
32930
33674
  // src/job-log-tail.ts
32931
- var import_promises63 = require("fs/promises");
33675
+ var import_promises67 = require("fs/promises");
32932
33676
 
32933
33677
  // src/queue.ts
32934
33678
  var import_node_child_process11 = require("child_process");
32935
- var import_node_crypto16 = require("crypto");
32936
- var import_promises61 = require("fs/promises");
33679
+ var import_node_crypto18 = require("crypto");
33680
+ var import_promises65 = require("fs/promises");
32937
33681
  var import_node_fs12 = require("fs");
32938
- var import_node_path12 = require("path");
32939
- var import_promises62 = require("timers/promises");
32940
- init_dist2();
32941
- init_dist4();
33682
+ var import_node_path15 = require("path");
33683
+ var import_promises66 = require("timers/promises");
32942
33684
  init_dist();
32943
- var QUEUE_DIR = (0, import_node_path12.join)(STATE_DIR2, "queue");
33685
+ init_dist4();
33686
+ init_dist2();
33687
+ var QUEUE_DIR = (0, import_node_path15.join)(STATE_DIR2, "queue");
32944
33688
  var PREPARE_MAX_CONCURRENT_PER_PROVIDER = 1;
32945
33689
  async function loadQueueConfig() {
32946
33690
  const d = BUILT_IN_DEFAULTS.queue;
32947
33691
  let global3 = {};
32948
33692
  try {
32949
- global3 = parseUserConfig(await (0, import_promises61.readFile)(GLOBAL_CONFIG_FILE, "utf8"), GLOBAL_CONFIG_FILE);
33693
+ global3 = parseUserConfig(await (0, import_promises65.readFile)(GLOBAL_CONFIG_FILE, "utf8"), GLOBAL_CONFIG_FILE);
32950
33694
  } catch {
32951
33695
  }
32952
33696
  const q = global3.queue ?? {};
@@ -32958,15 +33702,15 @@ async function loadQueueConfig() {
32958
33702
  };
32959
33703
  }
32960
33704
  async function writeJob(job) {
32961
- await (0, import_promises61.mkdir)(QUEUE_DIR, { recursive: true });
32962
- const final = (0, import_node_path12.join)(QUEUE_DIR, `${job.id}.json`);
33705
+ await (0, import_promises65.mkdir)(QUEUE_DIR, { recursive: true });
33706
+ const final = (0, import_node_path15.join)(QUEUE_DIR, `${job.id}.json`);
32963
33707
  const tmp = `${final}.tmp.${String(process.pid)}.${String(Date.now())}`;
32964
- await (0, import_promises61.writeFile)(tmp, JSON.stringify(job, null, 2) + "\n", "utf8");
32965
- await (0, import_promises61.rename)(tmp, final);
33708
+ await (0, import_promises65.writeFile)(tmp, JSON.stringify(job, null, 2) + "\n", "utf8");
33709
+ await (0, import_promises65.rename)(tmp, final);
32966
33710
  }
32967
33711
  async function readJob(id) {
32968
33712
  try {
32969
- const raw = await (0, import_promises61.readFile)((0, import_node_path12.join)(QUEUE_DIR, `${id}.json`), "utf8");
33713
+ const raw = await (0, import_promises65.readFile)((0, import_node_path15.join)(QUEUE_DIR, `${id}.json`), "utf8");
32970
33714
  return JSON.parse(raw);
32971
33715
  } catch (err) {
32972
33716
  if (err.code === "ENOENT") return null;
@@ -32975,7 +33719,7 @@ async function readJob(id) {
32975
33719
  }
32976
33720
  async function deleteJob(id) {
32977
33721
  try {
32978
- await (0, import_promises61.unlink)((0, import_node_path12.join)(QUEUE_DIR, `${id}.json`));
33722
+ await (0, import_promises65.unlink)((0, import_node_path15.join)(QUEUE_DIR, `${id}.json`));
32979
33723
  } catch (err) {
32980
33724
  if (err.code !== "ENOENT") throw err;
32981
33725
  }
@@ -32983,7 +33727,7 @@ async function deleteJob(id) {
32983
33727
  async function loadQueue() {
32984
33728
  let entries;
32985
33729
  try {
32986
- entries = await (0, import_promises61.readdir)(QUEUE_DIR);
33730
+ entries = await (0, import_promises65.readdir)(QUEUE_DIR);
32987
33731
  } catch (err) {
32988
33732
  if (err.code === "ENOENT") return [];
32989
33733
  throw err;
@@ -32992,7 +33736,7 @@ async function loadQueue() {
32992
33736
  for (const name of entries) {
32993
33737
  if (!name.endsWith(".json")) continue;
32994
33738
  try {
32995
- const raw = await (0, import_promises61.readFile)((0, import_node_path12.join)(QUEUE_DIR, name), "utf8");
33739
+ const raw = await (0, import_promises65.readFile)((0, import_node_path15.join)(QUEUE_DIR, name), "utf8");
32996
33740
  out.push(JSON.parse(raw));
32997
33741
  } catch {
32998
33742
  }
@@ -33158,6 +33902,7 @@ function startQueueLoop(deps) {
33158
33902
  };
33159
33903
  await writeJob(failed);
33160
33904
  onStatusChange?.(failed);
33905
+ void recordCreateJobTimeline(failed);
33161
33906
  log(`queue: spawn for job ${updated.id} failed: ${msg}`);
33162
33907
  }
33163
33908
  }
@@ -33196,6 +33941,7 @@ function startQueueLoop(deps) {
33196
33941
  };
33197
33942
  await writeJob(failed);
33198
33943
  onStatusChange?.(failed);
33944
+ void recordCreateJobTimeline(failed);
33199
33945
  log(`queue: spawn for foreground job ${updated.id} failed: ${msg}`);
33200
33946
  }
33201
33947
  }
@@ -33235,6 +33981,7 @@ function startQueueLoop(deps) {
33235
33981
  };
33236
33982
  await writeJob(failed);
33237
33983
  onStatusChange?.(failed);
33984
+ void recordCreateJobTimeline(failed);
33238
33985
  log(`queue: spawn for prepare job ${updated.id} failed: ${msg}`);
33239
33986
  }
33240
33987
  }
@@ -33278,6 +34025,7 @@ async function recoverOrphanedWorkers(log, onChange, requirePid = false) {
33278
34025
  };
33279
34026
  await writeJob(failed);
33280
34027
  onChange?.(failed);
34028
+ void recordCreateJobTimeline(failed);
33281
34029
  log(`queue: recovered orphan job ${j.id} (pid ${String(j.pid ?? "?")} not alive) -> failed`);
33282
34030
  }
33283
34031
  }
@@ -33423,7 +34171,7 @@ async function defaultSpawnWorker(job) {
33423
34171
  `AGENTBOX_CLI_ENTRY not set or missing (${String(entry)}); cannot spawn queue worker`
33424
34172
  );
33425
34173
  }
33426
- await (0, import_promises61.mkdir)((0, import_node_path12.join)(STATE_DIR2, "logs"), { recursive: true });
34174
+ await (0, import_promises65.mkdir)((0, import_node_path15.join)(STATE_DIR2, "logs"), { recursive: true });
33427
34175
  const fd = (0, import_node_fs12.openSync)(job.logPath, "a");
33428
34176
  const command = job.kind === "prepare" ? "_run-queued-prepare" : "_run-queued-job";
33429
34177
  const child = (0, import_node_child_process11.spawn)(process.execPath, [entry, command, job.id], {
@@ -33439,9 +34187,9 @@ async function defaultSpawnWorker(job) {
33439
34187
  }
33440
34188
  return typeof child.pid === "number" ? child.pid : null;
33441
34189
  }
33442
- var QUEUE_LOGS_DIR = (0, import_node_path12.join)(STATE_DIR2, "logs");
34190
+ var QUEUE_LOGS_DIR = (0, import_node_path15.join)(STATE_DIR2, "logs");
33443
34191
  function queueLogPath(id) {
33444
- return (0, import_node_path12.join)(QUEUE_LOGS_DIR, `queue-${id}.log`);
34192
+ return (0, import_node_path15.join)(QUEUE_LOGS_DIR, `queue-${id}.log`);
33445
34193
  }
33446
34194
 
33447
34195
  // src/job-log-tail.ts
@@ -33452,7 +34200,7 @@ async function readCreateJobLog(id, offset) {
33452
34200
  const path6 = queueLogPath(id);
33453
34201
  let size;
33454
34202
  try {
33455
- size = (await (0, import_promises63.stat)(path6)).size;
34203
+ size = (await (0, import_promises67.stat)(path6)).size;
33456
34204
  } catch {
33457
34205
  return { lines: [], offset: from };
33458
34206
  }
@@ -33460,7 +34208,7 @@ async function readCreateJobLog(id, offset) {
33460
34208
  if (size <= start) return { lines: [], offset: start };
33461
34209
  const len = Math.min(size - start, MAX_BYTES_PER_READ);
33462
34210
  const buf = Buffer.alloc(len);
33463
- const fh = await (0, import_promises63.open)(path6, "r");
34211
+ const fh = await (0, import_promises67.open)(path6, "r");
33464
34212
  try {
33465
34213
  await fh.read(buf, 0, len, start);
33466
34214
  } finally {
@@ -33480,7 +34228,7 @@ async function readCreateJobLog(id, offset) {
33480
34228
  }
33481
34229
 
33482
34230
  // src/store/store-rpc-routes.ts
33483
- var import_node_crypto17 = require("crypto");
34231
+ var import_node_crypto19 = require("crypto");
33484
34232
 
33485
34233
  // src/store/store-rpc.ts
33486
34234
  function isStoreRpcMethod(method) {
@@ -33567,7 +34315,7 @@ function timingSafeEqualStr4(a2, b) {
33567
34315
  const ab = Buffer.from(a2, "utf8");
33568
34316
  const bb = Buffer.from(b, "utf8");
33569
34317
  if (ab.length !== bb.length) return false;
33570
- return (0, import_node_crypto17.timingSafeEqual)(ab, bb);
34318
+ return (0, import_node_crypto19.timingSafeEqual)(ab, bb);
33571
34319
  }
33572
34320
  function parseJson2(text) {
33573
34321
  if (text.length === 0) return null;
@@ -33601,7 +34349,7 @@ async function handleStoreRpcRequest(req, deps) {
33601
34349
  }
33602
34350
 
33603
34351
  // src/server.ts
33604
- init_dist2();
34352
+ init_dist();
33605
34353
 
33606
34354
  // src/registry.ts
33607
34355
  var BoxRegistry = class {
@@ -33777,20 +34525,20 @@ async function defaultRunPropagate(agent, sourceBoxId) {
33777
34525
  }
33778
34526
 
33779
34527
  // src/status-store.ts
33780
- var import_promises64 = require("fs/promises");
33781
- var import_node_os9 = require("os");
33782
- var import_node_path13 = require("path");
33783
- init_dist();
34528
+ var import_promises68 = require("fs/promises");
34529
+ var import_node_os10 = require("os");
34530
+ var import_node_path16 = require("path");
34531
+ init_dist2();
33784
34532
  function sanitizeMnemonic2(raw) {
33785
34533
  return raw.toLowerCase().replace(/-/g, "_").replace(/[^a-z0-9_]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").slice(0, 32) || "unnamed";
33786
34534
  }
33787
34535
  function boxRunDirFor(boxId, name, projectIndex) {
33788
34536
  const mnemonic = sanitizeMnemonic2(name);
33789
34537
  const segment = typeof projectIndex === "number" && Number.isFinite(projectIndex) && projectIndex > 0 ? `${boxId}-${String(projectIndex)}-${mnemonic}` : `${boxId}-${mnemonic}`;
33790
- return (0, import_node_path13.join)((0, import_node_os9.homedir)(), ".agentbox", "boxes", segment);
34538
+ return (0, import_node_path16.join)((0, import_node_os10.homedir)(), ".agentbox", "boxes", segment);
33791
34539
  }
33792
34540
  function boxStatusPathFor(boxId, name, projectIndex) {
33793
- return (0, import_node_path13.join)(boxRunDirFor(boxId, name, projectIndex), "status.json");
34541
+ return (0, import_node_path16.join)(boxRunDirFor(boxId, name, projectIndex), "status.json");
33794
34542
  }
33795
34543
  function isValidBoxStatus(payload) {
33796
34544
  if (typeof payload !== "object" || payload === null) return false;
@@ -33819,11 +34567,11 @@ var BoxStatusStore = class {
33819
34567
  const target = boxStatusPathFor(boxId, name, projectIndex);
33820
34568
  const tmp = `${target}.${String(process.pid)}.tmp`;
33821
34569
  try {
33822
- await (0, import_promises64.mkdir)(boxRunDirFor(boxId, name, projectIndex), { recursive: true });
33823
- await (0, import_promises64.writeFile)(tmp, JSON.stringify(status), "utf8");
33824
- await (0, import_promises64.rename)(tmp, target);
34570
+ await (0, import_promises68.mkdir)(boxRunDirFor(boxId, name, projectIndex), { recursive: true });
34571
+ await (0, import_promises68.writeFile)(tmp, JSON.stringify(status), "utf8");
34572
+ await (0, import_promises68.rename)(tmp, target);
33825
34573
  } catch {
33826
- await (0, import_promises64.rm)(tmp, { force: true }).catch(() => {
34574
+ await (0, import_promises68.rm)(tmp, { force: true }).catch(() => {
33827
34575
  });
33828
34576
  }
33829
34577
  }
@@ -34592,6 +35340,7 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
34592
35340
  send(res, result2.exitCode === 0 ? 200 : 500, result2);
34593
35341
  return;
34594
35342
  }
35343
+ let pushHostInitiated = false;
34595
35344
  if (body.method === "git.push") {
34596
35345
  const hostOnlyParams = body.params;
34597
35346
  if (hostOnlyParams?.hostOnly) {
@@ -34620,6 +35369,7 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
34620
35369
  const tokenClaimed = typeof params?.hostInitiated === "string";
34621
35370
  const incomingHash = hashRpcParams(params);
34622
35371
  const hostInitiatedOk = !bypassPushGate && tokenClaimed && hostInitiatedTokens.consume(params?.hostInitiated, reg.boxId, "git.push", incomingHash);
35372
+ pushHostInitiated = hostInitiatedOk;
34623
35373
  if (!bypassPushGate && tokenClaimed && !hostInitiatedOk) {
34624
35374
  send(res, 500, {
34625
35375
  exitCode: 10,
@@ -34650,11 +35400,29 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
34650
35400
  }
34651
35401
  }
34652
35402
  }
34653
- const result = await handleGitRpc(
34654
- reg,
34655
- body.method,
34656
- body.params
34657
- );
35403
+ const pushParams = body.params;
35404
+ const pushTree = body.method === "git.push" ? resolveWorktree(reg, pushParams?.path ?? "/workspace") : void 0;
35405
+ const pushBranch = pushTree ? pushTree.sanctionedBranch ?? pushTree.branch : void 0;
35406
+ const pushStat = pushTree && pushBranch && !pushHostInitiated ? {
35407
+ repo: pushTree.hostMainRepo,
35408
+ ref: pushedRef(pushBranch, { remote: resolveRemote(pushParams?.remote) }),
35409
+ branch: pushBranch
35410
+ } : void 0;
35411
+ const pushBefore = pushStat ? await readRefTip(pushStat.repo, pushStat.ref) : void 0;
35412
+ const result = await handleGitRpc(reg, body.method, pushParams);
35413
+ if (body.method === "git.push" && result.exitCode === 0 && pushTree) {
35414
+ void recordBoxGitPush(
35415
+ {
35416
+ boxId: reg.boxId,
35417
+ boxName: reg.name,
35418
+ hostPath: pushTree.hostMainRepo,
35419
+ ...pushBranch ? { branch: pushBranch } : {}
35420
+ },
35421
+ { hostInitiated: pushHostInitiated, hostOnly: Boolean(pushParams?.hostOnly) },
35422
+ result,
35423
+ pushStat ? { ...pushStat, ...pushBefore ? { before: pushBefore } : {} } : void 0
35424
+ );
35425
+ }
34658
35426
  const status = result.exitCode === 0 ? 200 : 500;
34659
35427
  send(res, status, result);
34660
35428
  return;
@@ -34815,13 +35583,28 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
34815
35583
  return;
34816
35584
  }
34817
35585
  if (body.method === "gh.exec") {
35586
+ const ghParams = body.params;
34818
35587
  const result = await handleGhExecRpc(
34819
35588
  reg,
34820
- body.params,
35589
+ ghParams,
34821
35590
  prompts,
34822
35591
  subscribers,
34823
35592
  hostInitiatedTokens
34824
35593
  );
35594
+ const ghTree = result.exitCode === 0 ? resolveWorktree(reg, ghParams?.path ?? "/workspace") : void 0;
35595
+ if (ghTree) {
35596
+ void recordBoxGhResult(
35597
+ {
35598
+ boxId: reg.boxId,
35599
+ boxName: reg.name,
35600
+ hostPath: ghTree.hostMainRepo,
35601
+ branch: ghTree.sanctionedBranch ?? ghTree.branch,
35602
+ ...reg.originUrl ? { originUrl: reg.originUrl } : {}
35603
+ },
35604
+ Array.isArray(ghParams?.args) ? ghParams.args.filter((a2) => typeof a2 === "string") : [],
35605
+ result
35606
+ );
35607
+ }
34825
35608
  const status = result.exitCode === 0 ? 200 : 500;
34826
35609
  send(res, status, result);
34827
35610
  return;
@@ -35827,8 +36610,8 @@ async function startRelayServer(opts) {
35827
36610
 
35828
36611
  // src/autopause.ts
35829
36612
  var import_node_child_process13 = require("child_process");
35830
- var import_promises66 = require("fs/promises");
35831
- init_dist2();
36613
+ var import_promises70 = require("fs/promises");
36614
+ init_dist();
35832
36615
  init_dist4();
35833
36616
  function selectBoxesToPause(entries, cfg) {
35834
36617
  if (!cfg.enabled) return [];
@@ -35848,7 +36631,7 @@ async function loadAutopauseConfig() {
35848
36631
  const d = BUILT_IN_DEFAULTS.autopause;
35849
36632
  let global3 = {};
35850
36633
  try {
35851
- global3 = parseUserConfig(await (0, import_promises66.readFile)(GLOBAL_CONFIG_FILE, "utf8"), GLOBAL_CONFIG_FILE);
36634
+ global3 = parseUserConfig(await (0, import_promises70.readFile)(GLOBAL_CONFIG_FILE, "utf8"), GLOBAL_CONFIG_FILE);
35852
36635
  } catch {
35853
36636
  }
35854
36637
  const a2 = global3.autopause ?? {};
@@ -36046,8 +36829,8 @@ async function pauseContainer(name) {
36046
36829
  }
36047
36830
 
36048
36831
  // src/cloud-keepalive.ts
36049
- var import_promises67 = require("fs/promises");
36050
- init_dist2();
36832
+ var import_promises71 = require("fs/promises");
36833
+ init_dist();
36051
36834
  init_dist4();
36052
36835
  function selectBoxesToRenew(entries, windowMs, now) {
36053
36836
  const out = [];
@@ -36273,7 +37056,7 @@ async function defaultFallbackCreateTimeoutMs(backend) {
36273
37056
  const fallback = BUILT_IN_DEFAULTS.box.vercelTimeoutMs;
36274
37057
  try {
36275
37058
  const global3 = parseUserConfig(
36276
- await (0, import_promises67.readFile)(GLOBAL_CONFIG_FILE, "utf8"),
37059
+ await (0, import_promises71.readFile)(GLOBAL_CONFIG_FILE, "utf8"),
36277
37060
  GLOBAL_CONFIG_FILE
36278
37061
  );
36279
37062
  const v = global3.box?.vercelTimeoutMs;
@@ -36483,10 +37266,10 @@ function startRetentionLoop(deps) {
36483
37266
  }
36484
37267
 
36485
37268
  // src/host-reach-poller.ts
36486
- var import_node_crypto18 = require("crypto");
37269
+ var import_node_crypto20 = require("crypto");
36487
37270
  var import_node_http4 = require("http");
36488
37271
  var import_node_https3 = require("https");
36489
- var import_promises68 = require("timers/promises");
37272
+ var import_promises72 = require("timers/promises");
36490
37273
 
36491
37274
  // src/sse-read.ts
36492
37275
  var SseFrameReader = class {
@@ -36546,7 +37329,7 @@ var HostReachPoller = class {
36546
37329
  * restarted relay from the one that took an action and never came back — and
36547
37330
  * re-offer that orphaned work instead of leaving the box waiting forever.
36548
37331
  */
36549
- pollerId = (0, import_node_crypto18.randomUUID)();
37332
+ pollerId = (0, import_node_crypto20.randomUUID)();
36550
37333
  /** Set while a drain is in flight, so only one runs at a time. */
36551
37334
  drainingOutbox = false;
36552
37335
  /** Epoch ms of the last drain, for the periodic re-check. */
@@ -36638,7 +37421,7 @@ var HostReachPoller = class {
36638
37421
  this.backoffMs === 0 ? BACKOFF_BASE_MS2 : this.backoffMs * 2,
36639
37422
  BACKOFF_MAX_MS2
36640
37423
  );
36641
- await (0, import_promises68.setTimeout)(this.backoffMs);
37424
+ await (0, import_promises72.setTimeout)(this.backoffMs);
36642
37425
  }
36643
37426
  }
36644
37427
  }
@@ -36869,10 +37652,10 @@ var HostReachPoller = class {
36869
37652
  };
36870
37653
 
36871
37654
  // src/cp-outbox-drain.ts
36872
- var import_promises69 = require("fs/promises");
37655
+ var import_promises73 = require("fs/promises");
36873
37656
  var import_node_http5 = require("http");
36874
37657
  var import_node_https4 = require("https");
36875
- init_dist();
37658
+ init_dist2();
36876
37659
  var REQUEST_TIMEOUT_MS3 = 3e5;
36877
37660
  async function drainCpOutbox(deps) {
36878
37661
  const base = deps.controlPlaneUrl.replace(/\/+$/, "");
@@ -36914,7 +37697,7 @@ async function drainCpOutbox(deps) {
36914
37697
  `host-reach: could not land the parked copy from ${owner.name} (left on the hub): ${err instanceof Error ? err.message : String(err)}`
36915
37698
  );
36916
37699
  } finally {
36917
- if (stagedDir) await (0, import_promises69.rm)(stagedDir, { recursive: true, force: true }).catch(() => {
37700
+ if (stagedDir) await (0, import_promises73.rm)(stagedDir, { recursive: true, force: true }).catch(() => {
36918
37701
  });
36919
37702
  }
36920
37703
  }