@madarco/agentbox 0.31.3 → 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 (732) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +2 -0
  3. package/dist/_cloud-attach-6RKS3MAP.js +31 -0
  4. package/dist/{chunk-E2RPG54S.js → chunk-27S7QLDF.js} +3 -3
  5. package/dist/{chunk-EZPCCJPE.js → chunk-2APGFWEU.js} +24 -24
  6. package/dist/{chunk-7PDYVJ2Q.js → chunk-3AYSA62C.js} +3 -3
  7. package/dist/{chunk-SHFU2KSY.js → chunk-3ISG5THX.js} +3 -3
  8. package/dist/{chunk-D67Q5MNA.js → chunk-3L2DIPRM.js} +2 -2
  9. package/dist/{chunk-GYUOXSUX.js → chunk-4FOXMGJ7.js} +4 -4
  10. package/dist/{chunk-VIB2FMJJ.js → chunk-5OKDSI6M.js} +44 -44
  11. package/dist/{chunk-QWUZJCF5.js → chunk-66GAYIJZ.js} +3253 -937
  12. package/dist/chunk-66GAYIJZ.js.map +1 -0
  13. package/dist/{chunk-Q3BHXL47.js → chunk-6XMOBI5V.js} +4 -4
  14. package/dist/{chunk-VNXWOWQ7.js → chunk-7QTBRHB7.js} +4 -4
  15. package/dist/{chunk-UWKJ3HIA.js → chunk-ANSPBIYG.js} +4 -4
  16. package/dist/{chunk-7N3CJNR5.js → chunk-AWFTAHGF.js} +20 -7
  17. package/dist/chunk-AWFTAHGF.js.map +1 -0
  18. package/dist/{chunk-EHLPIWRR.js → chunk-AWI2TSWS.js} +2 -2
  19. package/dist/{chunk-GZHJVCBG.js → chunk-CDRKQ5BH.js} +9 -9
  20. package/dist/{chunk-W7P2HHFI.js → chunk-CXAWPWGZ.js} +6 -6
  21. package/dist/{chunk-V5IMDVV5.js → chunk-EDJ6O6CI.js} +6 -6
  22. package/dist/{chunk-PYPIECDD.js → chunk-GSMQL4IJ.js} +17 -17
  23. package/dist/chunk-GVNKIACA.js +223 -0
  24. package/dist/chunk-GVNKIACA.js.map +1 -0
  25. package/dist/{chunk-DKUSSE5G.js → chunk-JWQYZ6V4.js} +2 -2
  26. package/dist/{chunk-WMILLMJZ.js → chunk-KOTW7QQW.js} +5 -5
  27. package/dist/{chunk-XHCGVCSA.js → chunk-L4KBYI3I.js} +5 -5
  28. package/dist/{chunk-BMZOMC6X.js → chunk-M2DWTQRF.js} +3 -3
  29. package/dist/{chunk-XLFQXROC.js → chunk-MB2K74BI.js} +165 -3
  30. package/dist/chunk-MB2K74BI.js.map +1 -0
  31. package/dist/{chunk-MKZHCLFJ.js → chunk-MI3V2MAE.js} +4 -4
  32. package/dist/{chunk-ZMNLEZJB.js → chunk-MO3QJTVS.js} +7 -7
  33. package/dist/{chunk-MBFN2XNU.js → chunk-MPTE57BZ.js} +6 -6
  34. package/dist/{chunk-ZK6KD7ME.js → chunk-PE5LPD23.js} +68 -25
  35. package/dist/chunk-PE5LPD23.js.map +1 -0
  36. package/dist/{chunk-RNYH5465.js → chunk-QBVRWGXD.js} +3 -3
  37. package/dist/{chunk-VEO6ZYQY.js → chunk-RIXW4HSE.js} +6 -6
  38. package/dist/{chunk-QER5WHBC.js → chunk-S7LPQXR5.js} +6 -6
  39. package/dist/{chunk-JS5DLUUX.js → chunk-TAZYSVLT.js} +26 -22
  40. package/dist/{chunk-JS5DLUUX.js.map → chunk-TAZYSVLT.js.map} +1 -1
  41. package/dist/{chunk-QTMUJETE.js → chunk-TDPHZWJI.js} +4 -4
  42. package/dist/{chunk-M42UQWVO.js → chunk-WLEGSKKE.js} +4 -4
  43. package/dist/{chunk-UENVVGWE.js → chunk-WTOG3CC6.js} +4 -4
  44. package/dist/{chunk-QB7XVOYW.js → chunk-X6CO4WIX.js} +4 -4
  45. package/dist/{chunk-744IB5WM.js → chunk-XLJ4D4FI.js} +4 -4
  46. package/dist/{chunk-FVBEUPVM.js → chunk-XNZ6UHTM.js} +27 -5
  47. package/dist/chunk-XNZ6UHTM.js.map +1 -0
  48. package/dist/{chunk-SZTHLJ5J.js → chunk-XTNAIM7X.js} +6 -6
  49. package/dist/{chunk-S3SJIWSU.js → chunk-YNAJUTYC.js} +7 -7
  50. package/dist/{chunk-6GJDU3FN.js → chunk-YSACCMUB.js} +13 -13
  51. package/dist/{chunk-6RREIUAE.js → chunk-ZKOLV4ZN.js} +39 -4
  52. package/dist/chunk-ZKOLV4ZN.js.map +1 -0
  53. package/dist/{cli-JNOPYAUM.js → cli-IFXU5XNZ.js} +9 -9
  54. package/dist/{cli-I6TXLNRQ.js → cli-MZSWFSTW.js} +9 -9
  55. package/dist/{cli-VU2ALT6L.js → cli-O3WXOFNS.js} +8 -8
  56. package/dist/{cli-YYXO4WX5.js → cli-RQJUQJEP.js} +8 -8
  57. package/dist/{cli-W2WNV64V.js → cli-ZGYSHJP7.js} +9 -9
  58. package/dist/cloud-backends.js +5 -5
  59. package/dist/{control-plane-JUAINN2X.js → control-plane-3TII2JGM.js} +20 -20
  60. package/dist/{cp-hub-upload-VHU5TBHQ.js → cp-hub-upload-3W7Z4BMT.js} +7 -7
  61. package/dist/{custody-client-5OHF3SEX.js → custody-client-KYEZET6C.js} +5 -5
  62. package/dist/{deploy-hetzner-RTQW3B7P.js → deploy-hetzner-EO5PFKBG.js} +9 -9
  63. package/dist/{dist-H4FFY5TX.js → dist-3AR6L5MF.js} +8 -8
  64. package/dist/{dist-5HJBDLJP.js → dist-4GHNQ2AK.js} +8 -8
  65. package/dist/{dist-H72NQCKO.js → dist-BFH537FO.js} +9 -9
  66. package/dist/{dist-MBPDLQUR.js → dist-BUCKUE4V.js} +2 -2
  67. package/dist/{dist-64YIP2AZ.js → dist-ETGTZQUT.js} +256 -6
  68. package/dist/{dist-UGI5L7BN.js → dist-H2CSUDEI.js} +8 -8
  69. package/dist/{dist-7IANPBF4.js → dist-IABCQB5D.js} +8 -8
  70. package/dist/{dist-EDCGUXVI.js → dist-JJZ3NZRO.js} +10 -6
  71. package/dist/{dist-7RMVQOWJ.js → dist-RPBA2EL5.js} +8 -8
  72. package/dist/{dist-NJOKYHDI.js → dist-URWWHI3X.js} +9 -3
  73. package/dist/{dist-XWDFVTFR.js → dist-V224SH3Z.js} +7 -7
  74. package/dist/{host-reach-drainer-GTNLQWWM.js → host-reach-drainer-NYN3YXHG.js} +2 -2
  75. package/dist/host-session-YP5RKV6T.js +29 -0
  76. package/dist/hub-OWUC4IGW.js +39 -0
  77. package/dist/{hub-adopt-TVDMOZSP.js → hub-adopt-HYXFUPPO.js} +7 -7
  78. package/dist/{hub-api-client-RISAC6GB.js → hub-api-client-BI3E37CF.js} +4 -4
  79. package/dist/{hub-docker-target-QEALUMIZ.js → hub-docker-target-6ODSK7ZE.js} +14 -14
  80. package/dist/index.js +1224 -230
  81. package/dist/index.js.map +1 -1
  82. package/dist/{plugin-update-LG45ZFCU.js → plugin-update-LI3QDA4K.js} +5 -5
  83. package/dist/prepare-MYFNDJPP.js +45 -0
  84. package/dist/prepared-custody-WSHX6XTQ.js +39 -0
  85. package/dist/{prepared-state-FO74QUCP-SW3QMBW5.js → prepared-state-FO74QUCP-M4Q2X3KN.js} +4 -4
  86. package/dist/{publish-credentials-T7DDJVC4.js → publish-credentials-FCEQSIPE.js} +9 -9
  87. package/dist/{registry-UCFNYOAU.js → registry-GG23NEBF.js} +5 -5
  88. package/dist/relay-YUOIK3HN.js +22 -0
  89. package/dist/{remote-docker-share-SY7CWW5R.js → remote-docker-share-4Z4VVUPG.js} +11 -11
  90. package/dist/remote-docker-share-4Z4VVUPG.js.map +1 -0
  91. package/dist/{tool-grant-push-OJHLVAPZ.js → tool-grant-push-A2JYLJVF.js} +3 -3
  92. package/package.json +1 -1
  93. package/runtime/_shared/ctl.cjs +1046 -316
  94. package/runtime/digitalocean/ctl.cjs +1046 -316
  95. package/runtime/docker/packages/ctl/dist/bin.cjs +1046 -316
  96. package/runtime/e2b/ctl.cjs +1046 -316
  97. package/runtime/hetzner/ctl.cjs +1046 -316
  98. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  99. package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +24 -0
  100. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  101. package/runtime/hub/apps/hub/.next/routes-manifest.json +188 -0
  102. package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
  103. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js +2 -2
  104. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -1
  105. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -1
  106. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js +4 -4
  107. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -1
  108. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/agent/route.js.nft.json +1 -1
  109. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/backup/route.js +2 -2
  110. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/backup/route.js.nft.json +1 -1
  111. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -1
  112. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js +2 -2
  113. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js.nft.json +1 -1
  114. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/clone/route.js +2 -2
  115. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/clone/route.js.nft.json +1 -1
  116. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js +4 -4
  117. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -1
  118. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -1
  119. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/logs/route.js.nft.json +1 -1
  120. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +2 -2
  121. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -1
  122. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js +2 -2
  123. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -1
  124. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -1
  125. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js +2 -2
  126. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -1
  127. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -1
  128. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/upload/route.js +2 -2
  129. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/upload/route.js.nft.json +1 -1
  130. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js.nft.json +1 -1
  131. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/web/route.js.nft.json +1 -1
  132. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js +4 -4
  133. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -1
  134. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/checkpoints/route.js.nft.json +1 -1
  135. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/[...path]/route.js +3 -3
  136. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -1
  137. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -1
  138. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js +2 -2
  139. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -1
  140. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js +2 -2
  141. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -1
  142. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -1
  143. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -1
  144. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/route.js.nft.json +1 -1
  145. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route/app-paths-manifest.json +3 -0
  146. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route/build-manifest.json +9 -0
  147. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route/server-reference-manifest.json +4 -0
  148. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js +9 -0
  149. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js.map +5 -0
  150. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js.nft.json +1 -0
  151. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route_client-reference-manifest.js +3 -0
  152. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route/app-paths-manifest.json +3 -0
  153. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route/build-manifest.json +9 -0
  154. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route/server-reference-manifest.json +4 -0
  155. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js +10 -0
  156. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js.map +5 -0
  157. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js.nft.json +1 -0
  158. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route_client-reference-manifest.js +3 -0
  159. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route/app-paths-manifest.json +3 -0
  160. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route/build-manifest.json +9 -0
  161. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route/server-reference-manifest.json +4 -0
  162. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js +10 -0
  163. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js.map +5 -0
  164. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js.nft.json +1 -0
  165. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route_client-reference-manifest.js +3 -0
  166. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route/app-paths-manifest.json +3 -0
  167. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route/build-manifest.json +9 -0
  168. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route/server-reference-manifest.json +4 -0
  169. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js +9 -0
  170. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js.map +5 -0
  171. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js.nft.json +1 -0
  172. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route_client-reference-manifest.js +3 -0
  173. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route/app-paths-manifest.json +3 -0
  174. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route/build-manifest.json +9 -0
  175. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route/server-reference-manifest.json +4 -0
  176. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js +10 -0
  177. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js.map +5 -0
  178. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js.nft.json +1 -0
  179. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route_client-reference-manifest.js +3 -0
  180. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route/app-paths-manifest.json +3 -0
  181. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route/build-manifest.json +9 -0
  182. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route/server-reference-manifest.json +4 -0
  183. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js +9 -0
  184. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js.map +5 -0
  185. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js.nft.json +1 -0
  186. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route_client-reference-manifest.js +3 -0
  187. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route/app-paths-manifest.json +3 -0
  188. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route/build-manifest.json +9 -0
  189. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route/server-reference-manifest.json +4 -0
  190. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js +10 -0
  191. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js.map +5 -0
  192. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js.nft.json +1 -0
  193. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route_client-reference-manifest.js +3 -0
  194. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route/app-paths-manifest.json +3 -0
  195. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route/build-manifest.json +9 -0
  196. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route/server-reference-manifest.json +4 -0
  197. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js +10 -0
  198. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js.map +5 -0
  199. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js.nft.json +1 -0
  200. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route_client-reference-manifest.js +3 -0
  201. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -1
  202. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/bots/route.js.nft.json +1 -1
  203. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -1
  204. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/create-preflight/route.js +2 -2
  205. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/create-preflight/route.js.nft.json +1 -1
  206. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/restore/route.js +2 -2
  207. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/restore/route.js.nft.json +1 -1
  208. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -1
  209. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/seed/route.js.nft.json +1 -1
  210. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js +2 -2
  211. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -1
  212. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js +2 -2
  213. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -1
  214. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js +2 -2
  215. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -1
  216. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/size-check/route.js +2 -2
  217. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/size-check/route.js.nft.json +1 -1
  218. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -1
  219. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js +2 -2
  220. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js.nft.json +1 -1
  221. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/system/route.js.nft.json +1 -1
  222. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route/app-paths-manifest.json +3 -0
  223. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route/build-manifest.json +9 -0
  224. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route/server-reference-manifest.json +4 -0
  225. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js +10 -0
  226. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js.map +5 -0
  227. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js.nft.json +1 -0
  228. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route_client-reference-manifest.js +3 -0
  229. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route/app-paths-manifest.json +3 -0
  230. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route/build-manifest.json +9 -0
  231. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route/server-reference-manifest.json +4 -0
  232. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js +9 -0
  233. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js.map +5 -0
  234. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js.nft.json +1 -0
  235. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route_client-reference-manifest.js +3 -0
  236. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route/app-paths-manifest.json +3 -0
  237. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route/build-manifest.json +9 -0
  238. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route/server-reference-manifest.json +4 -0
  239. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js +9 -0
  240. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js.map +5 -0
  241. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js.nft.json +1 -0
  242. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route_client-reference-manifest.js +3 -0
  243. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route/app-paths-manifest.json +3 -0
  244. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route/build-manifest.json +9 -0
  245. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route/server-reference-manifest.json +4 -0
  246. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js +10 -0
  247. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js.map +5 -0
  248. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js.nft.json +1 -0
  249. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route_client-reference-manifest.js +3 -0
  250. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route/app-paths-manifest.json +3 -0
  251. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route/build-manifest.json +9 -0
  252. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route/server-reference-manifest.json +4 -0
  253. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js +10 -0
  254. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js.map +5 -0
  255. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js.nft.json +1 -0
  256. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route_client-reference-manifest.js +3 -0
  257. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route/app-paths-manifest.json +3 -0
  258. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route/build-manifest.json +9 -0
  259. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route/server-reference-manifest.json +4 -0
  260. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.js +9 -0
  261. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.js.map +5 -0
  262. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.js.nft.json +1 -0
  263. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route_client-reference-manifest.js +3 -0
  264. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route/app-paths-manifest.json +3 -0
  265. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route/build-manifest.json +9 -0
  266. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route/server-reference-manifest.json +4 -0
  267. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js +10 -0
  268. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js.map +5 -0
  269. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js.nft.json +1 -0
  270. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route_client-reference-manifest.js +3 -0
  271. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route/app-paths-manifest.json +3 -0
  272. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route/build-manifest.json +9 -0
  273. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route/server-reference-manifest.json +4 -0
  274. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js +10 -0
  275. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js.map +5 -0
  276. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js.nft.json +1 -0
  277. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route_client-reference-manifest.js +3 -0
  278. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route/app-paths-manifest.json +3 -0
  279. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route/build-manifest.json +9 -0
  280. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route/server-reference-manifest.json +4 -0
  281. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js +9 -0
  282. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js.map +5 -0
  283. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js.nft.json +1 -0
  284. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route_client-reference-manifest.js +3 -0
  285. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route/app-paths-manifest.json +3 -0
  286. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route/build-manifest.json +9 -0
  287. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route/server-reference-manifest.json +4 -0
  288. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js +10 -0
  289. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js.map +5 -0
  290. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js.nft.json +1 -0
  291. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route_client-reference-manifest.js +3 -0
  292. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route/app-paths-manifest.json +3 -0
  293. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route/build-manifest.json +9 -0
  294. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route/server-reference-manifest.json +4 -0
  295. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js +9 -0
  296. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js.map +5 -0
  297. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js.nft.json +1 -0
  298. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route_client-reference-manifest.js +3 -0
  299. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route/app-paths-manifest.json +3 -0
  300. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route/build-manifest.json +9 -0
  301. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route/server-reference-manifest.json +4 -0
  302. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js +10 -0
  303. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js.map +5 -0
  304. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js.nft.json +1 -0
  305. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route_client-reference-manifest.js +3 -0
  306. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route/app-paths-manifest.json +3 -0
  307. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route/build-manifest.json +9 -0
  308. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route/server-reference-manifest.json +4 -0
  309. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js +10 -0
  310. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js.map +5 -0
  311. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js.nft.json +1 -0
  312. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route_client-reference-manifest.js +3 -0
  313. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route/app-paths-manifest.json +3 -0
  314. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route/build-manifest.json +9 -0
  315. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route/server-reference-manifest.json +4 -0
  316. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js +10 -0
  317. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js.map +5 -0
  318. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js.nft.json +1 -0
  319. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route_client-reference-manifest.js +3 -0
  320. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route/app-paths-manifest.json +3 -0
  321. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route/build-manifest.json +9 -0
  322. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route/server-reference-manifest.json +4 -0
  323. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js +10 -0
  324. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js.map +5 -0
  325. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js.nft.json +1 -0
  326. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route_client-reference-manifest.js +3 -0
  327. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route/app-paths-manifest.json +3 -0
  328. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route/build-manifest.json +9 -0
  329. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route/server-reference-manifest.json +4 -0
  330. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js +10 -0
  331. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js.map +5 -0
  332. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js.nft.json +1 -0
  333. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route_client-reference-manifest.js +3 -0
  334. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  335. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  336. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
  337. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  338. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js.nft.json +1 -1
  339. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/web/route.js.nft.json +1 -1
  340. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page.js.nft.json +1 -1
  341. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page_client-reference-manifest.js +1 -1
  342. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  343. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  344. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
  345. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  346. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  347. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  348. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page.js.nft.json +1 -1
  349. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page_client-reference-manifest.js +1 -1
  350. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +1 -1
  351. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
  352. package/runtime/hub/apps/hub/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  353. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  354. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  355. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  356. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  357. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  358. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  359. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  360. package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  361. package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +24 -0
  362. package/runtime/hub/apps/hub/.next/server/chunks/00je_(dashboard)_api_v1_workspaces_[id]_tasks_[taskId]_assign_route_actions_1sufsej.js +3 -0
  363. package/runtime/hub/apps/hub/.next/server/chunks/00je_(dashboard)_api_v1_workspaces_[id]_tasks_[taskId]_done_route_actions_216dixx.js +3 -0
  364. 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
  365. 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
  366. package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_managers_sessions_route_actions_16dksub.js +3 -0
  367. package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_managers_start_route_actions_1g-vmis.js +3 -0
  368. package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_tasks_[taskId]_route_actions_03oih6y.js +3 -0
  369. package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_tasks_assign_route_actions_196zwo9.js +3 -0
  370. package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_tasks_reorder_route_actions_1zkcfk-.js +3 -0
  371. package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_workspaces_route_actions_12a7_y8.js +3 -0
  372. package/runtime/hub/apps/hub/.next/server/chunks/0web_next-internal_server_app_(dashboard)_api_v1_managers_[id]_route_actions_07cpyb_.js +3 -0
  373. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_attach_route_actions_0o-khw8.js +3 -0
  374. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_message_route_actions_0rjcqe5.js +3 -0
  375. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_notes_route_actions_1-mf4r_.js +3 -0
  376. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_resume_route_actions_0-cm1mu.js +3 -0
  377. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_stop_route_actions_16nrl1r.js +3 -0
  378. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_detect_route_actions_1sdbs-_.js +3 -0
  379. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_managers_route_actions_1sxymv0.js +3 -0
  380. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_rename_route_actions_0df5zi2.js +3 -0
  381. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_rescan_route_actions_1yra_w8.js +3 -0
  382. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_route_actions_1f56n_0.js +3 -0
  383. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_tasks_route_actions_1t-6quw.js +3 -0
  384. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_timeline_route_actions_0pbxblt.js +3 -0
  385. package/runtime/hub/apps/hub/.next/server/chunks/1viy_api_v1_workspaces_[id]_tasks_[taskId]_unassign_route_actions_18a1p_r.js +3 -0
  386. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-c97gb._.js +1 -1
  387. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0spnud2._.js → [root-of-the-server]__0-kl55b._.js} +1 -1
  388. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__074mxl5._.js → [root-of-the-server]__0-xlf9z._.js} +2 -2
  389. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__028ifqb._.js → [root-of-the-server]__0004tsz._.js} +2 -2
  390. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00bupbc._.js +1 -1
  391. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1cpr4qy._.js → [root-of-the-server]__0126167._.js} +1 -1
  392. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01fy5q0._.js +1 -1
  393. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02c077x._.js +3 -0
  394. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1ta1gr1._.js → [root-of-the-server]__02sueng._.js} +1 -1
  395. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0nndlre._.js → [root-of-the-server]__04-gm8c._.js} +2 -2
  396. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05uinnp._.js +1 -1
  397. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06wy8zz._.js +3 -0
  398. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__071c-t4._.js +3 -0
  399. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08jg8w8._.js +1 -1
  400. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09059m-._.js +1 -1
  401. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__092y7_z._.js +1 -1
  402. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09ti2-t._.js +3 -0
  403. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09y4pdw._.js +3 -0
  404. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_mog_h._.js +1 -1
  405. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a689u5._.js +3 -0
  406. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a8ere2._.js +3 -0
  407. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bzqrje._.js +3 -0
  408. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c_r3oe._.js +3 -0
  409. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cdoz9i._.js +1 -1
  410. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cmu4sk._.js +1 -1
  411. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cxjxz0._.js +1 -1
  412. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d27tlu._.js +3 -0
  413. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d3fx1z._.js +3 -0
  414. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dm5oqm._.js +1 -1
  415. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dy5g2k._.js +1 -1
  416. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0e1uaxg._.js +1 -1
  417. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0e6_t-d._.js +3 -0
  418. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ets4cd._.js +1 -1
  419. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f2u0ul._.js +1 -1
  420. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f9p_4f._.js +1 -1
  421. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f_jmq2._.js +1 -1
  422. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fksz_r._.js +1 -1
  423. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fpygqn._.js +3 -0
  424. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gym-rp._.js +1 -1
  425. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0hhlb2_._.js +1 -1
  426. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0i9phow._.js +1 -1
  427. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ikyoac._.js +1 -1
  428. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0j72bti._.js +1 -1
  429. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jb371p._.js +1 -1
  430. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jq6cdw._.js +3 -0
  431. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jt1d2s._.js +3 -0
  432. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0kcw8t0._.js +1 -1
  433. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0kdt9-i._.js +1 -1
  434. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0l27vs0._.js +1 -1
  435. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lc-j_n._.js +3 -0
  436. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lna-vq._.js +3 -0
  437. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0m5woxc._.js +1 -1
  438. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mi9xib._.js +3 -0
  439. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0muy7eg._.js +3 -0
  440. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nn0_b5._.js +3 -0
  441. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0no30or._.js +3 -0
  442. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0o3sjtx._.js +1 -1
  443. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0onk5r0._.js +1 -1
  444. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pik2ie._.js +3 -0
  445. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qde3vr._.js +1 -1
  446. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qt_r6a._.js +3 -0
  447. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ry8baf._.js +1 -1
  448. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sg4y_2._.js +3 -0
  449. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sgjn2j._.js +1 -1
  450. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0st6oln._.js +1 -1
  451. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0t0p64l._.js +1 -1
  452. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0tbl11-._.js +3 -0
  453. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ve_tqz._.js +1 -1
  454. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w4smfx._.js +3 -0
  455. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wo4sqj._.js +1 -1
  456. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wujjkl._.js +3 -0
  457. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xbu3yj._.js +3 -0
  458. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xl1-w6._.js +1 -1
  459. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yct1tu._.js +1 -1
  460. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yg67t0._.js +1 -1
  461. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ykw5oe._.js +3 -0
  462. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1c1rcl-._.js → [root-of-the-server]__0zznyx2._.js} +2 -2
  463. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1--u2xl._.js +3 -0
  464. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-8sj4i._.js +1 -1
  465. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10kmcrt._.js +3 -0
  466. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10l_-cd._.js +3 -0
  467. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10yfcvu._.js +1 -1
  468. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__112hqrh._.js +3 -0
  469. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11c-21i._.js +3 -0
  470. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11qbpq8._.js +3 -0
  471. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11s1mrd._.js +1 -1
  472. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__128w1nz._.js +3 -0
  473. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12b2kuv._.js +1 -1
  474. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12gbq5m._.js +1 -1
  475. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13nfpq5._.js +3 -0
  476. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13vl4-h._.js +1 -1
  477. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__153b7kv._.js +1 -1
  478. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__157kmse._.js +1 -1
  479. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16695dw._.js +1 -1
  480. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__166_uek._.js +3 -0
  481. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16o0ij7._.js +1 -1
  482. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__175lucf._.js +1 -1
  483. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17p53e3._.js +3 -0
  484. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17y9pmx._.js +3 -0
  485. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18ec5_t._.js +3 -0
  486. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18xpvkc._.js +1 -1
  487. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1925hyw._.js +3 -0
  488. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19ew1r2._.js +3 -0
  489. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19grunx._.js +1 -1
  490. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_4v0mh._.js +3 -0
  491. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_cbcl1._.js +1 -1
  492. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_wb2uh._.js +3 -0
  493. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_xgm2e._.js +3 -0
  494. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1an6-yb._.js +3 -0
  495. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1c0ex8m._.js +1 -1
  496. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1c1e08-._.js +3 -0
  497. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1c9f4uu._.js +1 -1
  498. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ci8hc2._.js +1 -1
  499. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cs6d52._.js +3 -0
  500. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d60scp._.js +3 -0
  501. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dicjoc._.js +3 -0
  502. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1diipl4._.js +3 -0
  503. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dp2exz._.js +1 -1
  504. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1epnstn._.js +1 -1
  505. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1fjnz2l._.js +3 -0
  506. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1g5wnt2._.js +1 -1
  507. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1g9v7bq._.js +1 -1
  508. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1gon0_4._.js +3 -0
  509. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h_59cs._.js +1 -1
  510. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h_q3sn._.js +3 -0
  511. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hlugb4._.js +1 -1
  512. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hux-70._.js +1 -1
  513. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i-7bnu._.js +3 -0
  514. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i_el2y._.js +3 -0
  515. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1j6clag._.js +1 -1
  516. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1k6q17t._.js +3 -0
  517. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1khvg39._.js +1 -1
  518. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lx9lyn._.js +3 -0
  519. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m36v6k._.js +1 -1
  520. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mgu19x._.js +3 -0
  521. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mhyrr5._.js +3 -0
  522. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mk_lpu._.js +3 -0
  523. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mt32fu._.js +1 -1
  524. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1n1_2tw._.js +1 -1
  525. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1na4sdw._.js +3 -0
  526. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ntihlm._.js +3 -0
  527. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1odu62n._.js +3 -0
  528. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q6xrlt._.js +2 -2
  529. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1r4x1-y._.js +3 -0
  530. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rjs_x0._.js +1 -1
  531. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rxud0j._.js +1 -1
  532. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1s5app0._.js +1 -1
  533. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sjz59l._.js +3 -0
  534. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1slo4q_._.js +1 -1
  535. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thrazp._.js +3 -0
  536. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1twtnwr._.js +1 -1
  537. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1txvsbk._.js +3 -0
  538. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1uch-60._.js +1 -1
  539. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1um2jum._.js +3 -0
  540. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1vnnuo1._.js +1 -1
  541. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wegvep._.js +3 -0
  542. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wi5roz._.js +1 -1
  543. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xa9oiv._.js +3 -0
  544. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ypmy86._.js +3 -0
  545. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zml9me._.js +1 -1
  546. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zrf_a6._.js +1 -1
  547. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__2019yzl._.js +3 -0
  548. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20jyxyo._.js +2 -2
  549. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20ybhif._.js +1 -1
  550. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20zl5fr._.js +1 -1
  551. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__212dyoi._.js +1 -1
  552. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__218oup-._.js +1 -1
  553. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__21abvx9._.js +3 -0
  554. package/runtime/hub/apps/hub/.next/server/chunks/_0907rw0._.js +2 -1
  555. package/runtime/hub/apps/hub/.next/server/chunks/_0mcxq5g._.js +1 -1
  556. package/runtime/hub/apps/hub/.next/server/chunks/_0vg6gvw._.js +41 -41
  557. package/runtime/hub/apps/hub/.next/server/chunks/apps_hub_app_(dashboard)_api_v1_lib_openapi_ts_1yokmzt._.js +1 -1
  558. package/runtime/hub/apps/hub/.next/server/chunks/apps_hub_app_(dashboard)_api_v1_lib_validate_ts_16dhbzz._.js +1 -1
  559. package/runtime/hub/apps/hub/.next/server/chunks/packages_agent-registry_dist_index_1ze3mqq.js +28 -19
  560. package/runtime/hub/apps/hub/.next/server/chunks/packages_relay_dist_control-plane_03a-9aj.js +6 -6
  561. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__03-x9xy._.js +1 -1
  562. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1jqga8h._.js +1 -1
  563. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r2xlss._.js +2 -1
  564. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_14-qzbg._.js +26 -26
  565. package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_agent-registry_dist_index_0z476w4.js +26 -17
  566. package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_relay_dist_control-plane_0ve-wz4.js +1 -1
  567. package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +24 -0
  568. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  569. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  570. package/runtime/hub/apps/hub/.next/static/chunks/{31e1wjin30i__.css → 03_fxfc3849ms.css} +1 -1
  571. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/[id]/[action]/route.ts +4 -2
  572. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.ts +6 -4
  573. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/route.ts +2 -1
  574. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/actor.ts +48 -0
  575. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/envelope.ts +5 -2
  576. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/openapi.ts +1687 -52
  577. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/validate.ts +527 -1
  578. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/attach/route.ts +26 -0
  579. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/message/route.ts +34 -0
  580. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/notes/route.ts +26 -0
  581. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/resume/route.ts +26 -0
  582. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/route.ts +34 -0
  583. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/stop/route.ts +23 -0
  584. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/detect/route.ts +33 -0
  585. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/route.ts +27 -0
  586. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/tasks/route.ts +30 -0
  587. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/managers/route.ts +19 -0
  588. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.ts +22 -0
  589. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.ts +61 -0
  590. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/rename/route.ts +25 -0
  591. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.ts +20 -0
  592. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/route.ts +34 -0
  593. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.ts +33 -0
  594. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.ts +23 -0
  595. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.ts +54 -0
  596. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.ts +25 -0
  597. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.ts +34 -0
  598. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.ts +33 -0
  599. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.ts +59 -0
  600. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.ts +25 -0
  601. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/route.ts +31 -0
  602. package/runtime/hub/apps/hub/{chunk-FQY5OEWX.js → chunk-2LE76CT3.js} +19 -6
  603. package/runtime/hub/apps/hub/{chunk-MIETKCV4.js → chunk-BR4WVGWJ.js} +3 -3
  604. package/runtime/hub/apps/hub/{chunk-KTWFE5BB.js → chunk-EVB2OTLU.js} +3312 -1032
  605. package/runtime/hub/apps/hub/{chunk-IDL7RJBP.js → chunk-FBNAIUXZ.js} +38 -3
  606. package/runtime/hub/apps/hub/{chunk-ORTYCJ2U.js → chunk-G2AEPH7C.js} +4 -4
  607. package/runtime/hub/apps/hub/{chunk-VNLPJ45F.js → chunk-JX5JUFSR.js} +9 -9
  608. package/runtime/hub/apps/hub/{chunk-PM2365RW.js → chunk-MD2UNTZR.js} +6 -6
  609. package/runtime/hub/apps/hub/{dist-4DVVLHK2.js → dist-3LDUYWPK.js} +8 -2
  610. package/runtime/hub/apps/hub/{dist-RWN4Z57N.js → dist-CJ6QFUFV.js} +5 -5
  611. package/runtime/hub/apps/hub/{dist-FM26NQ4V.js → dist-D36FTGG6.js} +1 -1
  612. package/runtime/hub/apps/hub/{dist-VF56FSKH.js → dist-GGLWLMY6.js} +6 -6
  613. package/runtime/hub/apps/hub/{dist-WA2LO2DU.js → dist-HLLYJGIT.js} +6 -6
  614. package/runtime/hub/apps/hub/{dist-OAS6A7E4.js → dist-IIQU4I42.js} +5 -5
  615. package/runtime/hub/apps/hub/{dist-3IYYT3II.js → dist-UFMCOK3W.js} +5 -5
  616. package/runtime/hub/apps/hub/{dist-LMXU56B2.js → dist-XUNBQ4WM.js} +5 -5
  617. package/runtime/hub/apps/hub/{dist-LOZYEDXA.js → dist-Y2263LMY.js} +8 -4
  618. package/runtime/hub/apps/hub/{dist-UPKSCLZ2.js → dist-YV4M6NJO.js} +5 -5
  619. package/runtime/hub/apps/hub/{hub-worker-6JAWRLP2.js → hub-worker-LJYEEAJL.js} +7 -7
  620. package/runtime/hub/apps/hub/lib/backend/background.ts +19 -0
  621. package/runtime/hub/apps/hub/lib/backend/box-facts.ts +97 -0
  622. package/runtime/hub/apps/hub/lib/backend/box-prs.ts +213 -0
  623. package/runtime/hub/apps/hub/lib/backend/deps.ts +99 -0
  624. package/runtime/hub/apps/hub/lib/backend/errors.ts +7 -0
  625. package/runtime/hub/apps/hub/lib/backend/github-prs.ts +302 -0
  626. package/runtime/hub/apps/hub/lib/backend/managers.ts +748 -0
  627. package/runtime/hub/apps/hub/lib/backend/timeline-lanes.ts +150 -0
  628. package/runtime/hub/apps/hub/lib/backend/timeline.ts +611 -0
  629. package/runtime/hub/apps/hub/lib/backend/workspaces.ts +439 -0
  630. package/runtime/hub/apps/hub/lib/boxes/backend-types.ts +355 -10
  631. package/runtime/hub/apps/hub/lib/boxes/postgres-source.ts +3 -0
  632. package/runtime/hub/apps/hub/lib/boxes/source.ts +18 -1
  633. package/runtime/hub/apps/hub/lib/boxes/types.ts +66 -0
  634. package/runtime/hub/apps/hub/lib/hub-backend.ts +114 -7
  635. package/runtime/hub/apps/hub/{prepared-state-FO74QUCP-QR6ZNI3Q.js → prepared-state-FO74QUCP-75UBPW5I.js} +3 -3
  636. package/runtime/hub/apps/hub/server.js +2033 -164
  637. package/runtime/hub/apps/hub/test/backend-managers-background.test.ts +336 -0
  638. package/runtime/hub/apps/hub/test/backend-managers.test.ts +493 -0
  639. package/runtime/hub/apps/hub/test/backend-workspaces.test.ts +208 -0
  640. package/runtime/hub/apps/hub/test/box-prs.test.ts +198 -0
  641. package/runtime/hub/apps/hub/test/timeline-lanes.test.ts +261 -0
  642. package/runtime/hub/apps/hub/test/timeline.test.ts +1185 -0
  643. package/runtime/hub/apps/hub/test/validate.test.ts +252 -0
  644. package/runtime/hub/apps/hub/tsconfig.tsbuildinfo +1 -1
  645. package/runtime/relay/bin.cjs +1419 -623
  646. package/runtime/vercel/ctl.cjs +1046 -316
  647. package/share/host-skills/agentbox-info/SKILL.md +25 -4
  648. package/dist/_cloud-attach-QB72ZV7T.js +0 -31
  649. package/dist/chunk-6RREIUAE.js.map +0 -1
  650. package/dist/chunk-7N3CJNR5.js.map +0 -1
  651. package/dist/chunk-FVBEUPVM.js.map +0 -1
  652. package/dist/chunk-QWUZJCF5.js.map +0 -1
  653. package/dist/chunk-XLFQXROC.js.map +0 -1
  654. package/dist/chunk-ZK6KD7ME.js.map +0 -1
  655. package/dist/hub-C5B3CRP6.js +0 -39
  656. package/dist/prepare-6JLTXX65.js +0 -45
  657. package/dist/prepared-custody-YVVTL2ZM.js +0 -39
  658. package/dist/relay-W73AIA35.js +0 -22
  659. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00o_3sf._.js +0 -3
  660. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08xwxyo._.js +0 -3
  661. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-mtsr6._.js +0 -3
  662. /package/dist/{_cloud-attach-QB72ZV7T.js.map → _cloud-attach-6RKS3MAP.js.map} +0 -0
  663. /package/dist/{chunk-E2RPG54S.js.map → chunk-27S7QLDF.js.map} +0 -0
  664. /package/dist/{chunk-EZPCCJPE.js.map → chunk-2APGFWEU.js.map} +0 -0
  665. /package/dist/{chunk-7PDYVJ2Q.js.map → chunk-3AYSA62C.js.map} +0 -0
  666. /package/dist/{chunk-SHFU2KSY.js.map → chunk-3ISG5THX.js.map} +0 -0
  667. /package/dist/{chunk-D67Q5MNA.js.map → chunk-3L2DIPRM.js.map} +0 -0
  668. /package/dist/{chunk-GYUOXSUX.js.map → chunk-4FOXMGJ7.js.map} +0 -0
  669. /package/dist/{chunk-VIB2FMJJ.js.map → chunk-5OKDSI6M.js.map} +0 -0
  670. /package/dist/{chunk-Q3BHXL47.js.map → chunk-6XMOBI5V.js.map} +0 -0
  671. /package/dist/{chunk-VNXWOWQ7.js.map → chunk-7QTBRHB7.js.map} +0 -0
  672. /package/dist/{chunk-UWKJ3HIA.js.map → chunk-ANSPBIYG.js.map} +0 -0
  673. /package/dist/{chunk-EHLPIWRR.js.map → chunk-AWI2TSWS.js.map} +0 -0
  674. /package/dist/{chunk-GZHJVCBG.js.map → chunk-CDRKQ5BH.js.map} +0 -0
  675. /package/dist/{chunk-W7P2HHFI.js.map → chunk-CXAWPWGZ.js.map} +0 -0
  676. /package/dist/{chunk-V5IMDVV5.js.map → chunk-EDJ6O6CI.js.map} +0 -0
  677. /package/dist/{chunk-PYPIECDD.js.map → chunk-GSMQL4IJ.js.map} +0 -0
  678. /package/dist/{chunk-DKUSSE5G.js.map → chunk-JWQYZ6V4.js.map} +0 -0
  679. /package/dist/{chunk-WMILLMJZ.js.map → chunk-KOTW7QQW.js.map} +0 -0
  680. /package/dist/{chunk-XHCGVCSA.js.map → chunk-L4KBYI3I.js.map} +0 -0
  681. /package/dist/{chunk-BMZOMC6X.js.map → chunk-M2DWTQRF.js.map} +0 -0
  682. /package/dist/{chunk-MKZHCLFJ.js.map → chunk-MI3V2MAE.js.map} +0 -0
  683. /package/dist/{chunk-ZMNLEZJB.js.map → chunk-MO3QJTVS.js.map} +0 -0
  684. /package/dist/{chunk-MBFN2XNU.js.map → chunk-MPTE57BZ.js.map} +0 -0
  685. /package/dist/{chunk-RNYH5465.js.map → chunk-QBVRWGXD.js.map} +0 -0
  686. /package/dist/{chunk-VEO6ZYQY.js.map → chunk-RIXW4HSE.js.map} +0 -0
  687. /package/dist/{chunk-QER5WHBC.js.map → chunk-S7LPQXR5.js.map} +0 -0
  688. /package/dist/{chunk-QTMUJETE.js.map → chunk-TDPHZWJI.js.map} +0 -0
  689. /package/dist/{chunk-M42UQWVO.js.map → chunk-WLEGSKKE.js.map} +0 -0
  690. /package/dist/{chunk-UENVVGWE.js.map → chunk-WTOG3CC6.js.map} +0 -0
  691. /package/dist/{chunk-QB7XVOYW.js.map → chunk-X6CO4WIX.js.map} +0 -0
  692. /package/dist/{chunk-744IB5WM.js.map → chunk-XLJ4D4FI.js.map} +0 -0
  693. /package/dist/{chunk-SZTHLJ5J.js.map → chunk-XTNAIM7X.js.map} +0 -0
  694. /package/dist/{chunk-S3SJIWSU.js.map → chunk-YNAJUTYC.js.map} +0 -0
  695. /package/dist/{chunk-6GJDU3FN.js.map → chunk-YSACCMUB.js.map} +0 -0
  696. /package/dist/{cli-I6TXLNRQ.js.map → cli-IFXU5XNZ.js.map} +0 -0
  697. /package/dist/{cli-JNOPYAUM.js.map → cli-MZSWFSTW.js.map} +0 -0
  698. /package/dist/{cli-VU2ALT6L.js.map → cli-O3WXOFNS.js.map} +0 -0
  699. /package/dist/{cli-W2WNV64V.js.map → cli-RQJUQJEP.js.map} +0 -0
  700. /package/dist/{cli-YYXO4WX5.js.map → cli-ZGYSHJP7.js.map} +0 -0
  701. /package/dist/{control-plane-JUAINN2X.js.map → control-plane-3TII2JGM.js.map} +0 -0
  702. /package/dist/{cp-hub-upload-VHU5TBHQ.js.map → cp-hub-upload-3W7Z4BMT.js.map} +0 -0
  703. /package/dist/{custody-client-5OHF3SEX.js.map → custody-client-KYEZET6C.js.map} +0 -0
  704. /package/dist/{deploy-hetzner-RTQW3B7P.js.map → deploy-hetzner-EO5PFKBG.js.map} +0 -0
  705. /package/dist/{dist-64YIP2AZ.js.map → dist-3AR6L5MF.js.map} +0 -0
  706. /package/dist/{dist-5HJBDLJP.js.map → dist-4GHNQ2AK.js.map} +0 -0
  707. /package/dist/{dist-7IANPBF4.js.map → dist-BFH537FO.js.map} +0 -0
  708. /package/dist/{dist-EDCGUXVI.js.map → dist-BUCKUE4V.js.map} +0 -0
  709. /package/dist/{dist-H4FFY5TX.js.map → dist-ETGTZQUT.js.map} +0 -0
  710. /package/dist/{dist-H72NQCKO.js.map → dist-H2CSUDEI.js.map} +0 -0
  711. /package/dist/{dist-MBPDLQUR.js.map → dist-IABCQB5D.js.map} +0 -0
  712. /package/dist/{dist-NJOKYHDI.js.map → dist-JJZ3NZRO.js.map} +0 -0
  713. /package/dist/{dist-7RMVQOWJ.js.map → dist-RPBA2EL5.js.map} +0 -0
  714. /package/dist/{dist-UGI5L7BN.js.map → dist-URWWHI3X.js.map} +0 -0
  715. /package/dist/{dist-XWDFVTFR.js.map → dist-V224SH3Z.js.map} +0 -0
  716. /package/dist/{host-reach-drainer-GTNLQWWM.js.map → host-reach-drainer-NYN3YXHG.js.map} +0 -0
  717. /package/dist/{hub-C5B3CRP6.js.map → host-session-YP5RKV6T.js.map} +0 -0
  718. /package/dist/{hub-adopt-TVDMOZSP.js.map → hub-OWUC4IGW.js.map} +0 -0
  719. /package/dist/{hub-api-client-RISAC6GB.js.map → hub-adopt-HYXFUPPO.js.map} +0 -0
  720. /package/dist/{prepare-6JLTXX65.js.map → hub-api-client-BI3E37CF.js.map} +0 -0
  721. /package/dist/{hub-docker-target-QEALUMIZ.js.map → hub-docker-target-6ODSK7ZE.js.map} +0 -0
  722. /package/dist/{plugin-update-LG45ZFCU.js.map → plugin-update-LI3QDA4K.js.map} +0 -0
  723. /package/dist/{prepared-custody-YVVTL2ZM.js.map → prepare-MYFNDJPP.js.map} +0 -0
  724. /package/dist/{prepared-state-FO74QUCP-SW3QMBW5.js.map → prepared-custody-WSHX6XTQ.js.map} +0 -0
  725. /package/dist/{registry-UCFNYOAU.js.map → prepared-state-FO74QUCP-M4Q2X3KN.js.map} +0 -0
  726. /package/dist/{publish-credentials-T7DDJVC4.js.map → publish-credentials-FCEQSIPE.js.map} +0 -0
  727. /package/dist/{relay-W73AIA35.js.map → registry-GG23NEBF.js.map} +0 -0
  728. /package/dist/{remote-docker-share-SY7CWW5R.js.map → relay-YUOIK3HN.js.map} +0 -0
  729. /package/dist/{tool-grant-push-OJHLVAPZ.js.map → tool-grant-push-A2JYLJVF.js.map} +0 -0
  730. /package/runtime/hub/apps/hub/.next/static/{kg0mtyaaNMvU3P8p7nLPa → QDhlg7V_fEVGv_NfM2cEJ}/_buildManifest.js +0 -0
  731. /package/runtime/hub/apps/hub/.next/static/{kg0mtyaaNMvU3P8p7nLPa → QDhlg7V_fEVGv_NfM2cEJ}/_clientMiddlewareManifest.js +0 -0
  732. /package/runtime/hub/apps/hub/.next/static/{kg0mtyaaNMvU3P8p7nLPa → 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, {
@@ -21363,16 +21363,19 @@ function buildModelAuthScript() {
21363
21363
  // ingest" rather than a failed import.
21364
21364
  `if ! node -e ${sq(MODEL_AUTH_IS_CODEX_LOGIN)} "$auth"; then echo "openclaw-model-auth: $auth is not a Codex ChatGPT login"; exit 0; fi`,
21365
21365
  'seen=$(sha256sum "$auth" | cut -d" " -f1)',
21366
+ `codex_trusted() { openclaw plugins inspect codex --json 2>/dev/null | node -e ${sq(MODEL_AUTH_PLUGIN_TRUSTED)}; }`,
21367
+ // The plugin owns both the import command and the harness the default
21368
+ // model runs on. Before the marker gate, so an imported box whose plugin
21369
+ // lost its record is repaired rather than skipped. `--force` because the
21370
+ // untrusted case leaves the directory behind.
21371
+ "if ! codex_trusted; then",
21372
+ ' echo "openclaw-model-auth: installing the @openclaw/codex plugin"',
21373
+ " openclaw plugins install clawhub:@openclaw/codex --force || exit 0",
21374
+ "fi",
21366
21375
  'if [ -f "$marker" ] && [ "$(cat "$marker")" = "$seen" ]; then',
21367
21376
  ' echo "openclaw-model-auth: this Codex login is already imported"',
21368
21377
  " exit 0",
21369
21378
  "fi",
21370
- // The plugin owns both the import command and the harness the default
21371
- // model runs on.
21372
- `if [ ! -d ${sq(`${OPENCLAW_BOX_DIR}/extensions/codex`)} ]; then`,
21373
- ' echo "openclaw-model-auth: installing the @openclaw/codex plugin"',
21374
- " openclaw plugins install clawhub:@openclaw/codex || exit 0",
21375
- "fi",
21376
21379
  'echo "openclaw-model-auth: importing the Codex login into the OpenClaw auth store"',
21377
21380
  // `--no-backup --force`: the pre-migration archive would snapshot a state
21378
21381
  // dir that is fresh on the boot this runs, and the migration report is
@@ -21380,6 +21383,11 @@ function buildModelAuthScript() {
21380
21383
  `if openclaw migrate apply codex --from ${sq(home)} --include-secrets --item auth:openai --yes --no-backup --force; then`,
21381
21384
  ' printf %s "$seen" > "$marker" && chmod 600 "$marker"',
21382
21385
  "fi",
21386
+ // The one record loss observed happened across the import, not the install.
21387
+ "if ! codex_trusted; then",
21388
+ ' echo "openclaw-model-auth: the @openclaw/codex plugin lost its install record; reinstalling"',
21389
+ " openclaw plugins install clawhub:@openclaw/codex --force || true",
21390
+ "fi",
21383
21391
  "exit 0"
21384
21392
  ].join("\n");
21385
21393
  }
@@ -21695,30 +21703,30 @@ function builtinAgentIds() {
21695
21703
  function findAgentSpec(id) {
21696
21704
  return AGENT_SPECS.find((s) => s.id === id || s.aliases.includes(id));
21697
21705
  }
21698
- var import_path8, import_path9, import_path10, import_path11, import_path12, import_fs2, import_promises21, import_path13, CLAUDE_BOX_DIR, SEED_SETUP_SKILL, claudeSpec, CODEX_BOX_DIR, CODEX_HOOKS_PATH, codexSpec, EXAMPLE_BOX_DIR, exampleSpec, OPENCLAW_BOX_DIR, OPENCLAW_XDG_SUBPATH, OPENCLAW_XDG_BOX_DIR, OPENCLAW_XDG_LINK, GATEWAY_PORT, AGENTBOX_SKILLS_DIR, BAKED_SETUP_SKILL, BAKED_IDENTITY_SKILL, IDENTITY_SENTINEL, WORKSPACE_YAML, BOX_FACTS, AGENTBOX_CTX_DIR, CTX_SENTINEL, MERGE_PROGRAM_PATH, CTX_REL_PATH, OPENCLAW_CONFIG_MERGE_PROGRAM, IDENTITY_NUDGE_TEXT, MODEL_AUTH_MARKER, MODEL_AUTH_IS_CODEX_LOGIN, openclawSpec, IMPORT_JS, OPENCODE_BOX_DIR, OPENCODE_PLUGIN_PATH, opencodeSpec, PI_BOX_DIR, PI_EXTENSION_PATH, piSpec, SUPPORTED_AGENT_API_VERSIONS, AGENTS_FILE_VERSION, EMPTY, REQUIRED_SPEC_FIELDS, RECIPE_KINDS, RUN_AS, BUILTIN_AGENT_SPECS, AGENT_SPECS;
21706
+ var import_path8, import_path9, import_path10, import_path11, import_path12, import_fs2, import_promises21, import_path13, CLAUDE_BOX_DIR, SEED_SETUP_SKILL, claudeSpec, CODEX_BOX_DIR, CODEX_HOOKS_PATH, codexSpec, EXAMPLE_BOX_DIR, exampleSpec, OPENCLAW_BOX_DIR, OPENCLAW_XDG_SUBPATH, OPENCLAW_XDG_BOX_DIR, OPENCLAW_XDG_LINK, GATEWAY_PORT, AGENTBOX_SKILLS_DIR, BAKED_SETUP_SKILL, BAKED_IDENTITY_SKILL, IDENTITY_SENTINEL, WORKSPACE_YAML, BOX_FACTS, AGENTBOX_CTX_DIR, CTX_SENTINEL, MERGE_PROGRAM_PATH, CTX_REL_PATH, OPENCLAW_CONFIG_MERGE_PROGRAM, IDENTITY_NUDGE_TEXT, MODEL_AUTH_MARKER, MODEL_AUTH_PLUGIN_TRUSTED, MODEL_AUTH_IS_CODEX_LOGIN, openclawSpec, IMPORT_JS, OPENCODE_BOX_DIR, OPENCODE_PLUGIN_PATH, opencodeSpec, PI_BOX_DIR, PI_EXTENSION_PATH, piSpec, SUPPORTED_AGENT_API_VERSIONS, AGENTS_FILE_VERSION, EMPTY, REQUIRED_SPEC_FIELDS, RECIPE_KINDS, RUN_AS, BUILTIN_AGENT_SPECS, AGENT_SPECS;
21699
21707
  var init_dist3 = __esm({
21700
21708
  "../agent-registry/dist/index.js"() {
21701
21709
  "use strict";
21702
21710
  import_path8 = require("path");
21703
- init_dist2();
21704
21711
  init_dist();
21705
- import_path9 = require("path");
21706
21712
  init_dist2();
21713
+ import_path9 = require("path");
21707
21714
  init_dist();
21708
- init_dist();
21709
- import_path10 = require("path");
21710
21715
  init_dist2();
21716
+ init_dist2();
21717
+ import_path10 = require("path");
21711
21718
  init_dist();
21712
- import_path11 = require("path");
21713
21719
  init_dist2();
21720
+ import_path11 = require("path");
21714
21721
  init_dist();
21715
- import_path12 = require("path");
21716
21722
  init_dist2();
21723
+ import_path12 = require("path");
21717
21724
  init_dist();
21725
+ init_dist2();
21718
21726
  import_fs2 = require("fs");
21719
21727
  import_promises21 = require("fs/promises");
21720
21728
  import_path13 = require("path");
21721
- init_dist2();
21729
+ init_dist();
21722
21730
  CLAUDE_BOX_DIR = `${BOX_HOME}/.claude`;
21723
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`;
21724
21732
  claudeSpec = {
@@ -22098,6 +22106,11 @@ process.stdout.write(
22098
22106
  ""
22099
22107
  ].join("\n");
22100
22108
  MODEL_AUTH_MARKER = `${OPENCLAW_BOX_DIR}/.agentbox-model-auth.sha256`;
22109
+ MODEL_AUTH_PLUGIN_TRUSTED = `
22110
+ let j;
22111
+ try { const s = require('fs').readFileSync(0, 'utf8'); j = JSON.parse(s.slice(s.indexOf('{'))); } catch { process.exit(1); }
22112
+ process.exit(j?.plugin?.trust?.reason === 'trusted-official' ? 0 : 1);
22113
+ `;
22101
22114
  MODEL_AUTH_IS_CODEX_LOGIN = `
22102
22115
  const j = JSON.parse(require('fs').readFileSync(process.argv[1], 'utf8'));
22103
22116
  process.exit(typeof j?.tokens?.refresh_token === 'string' && j.tokens.refresh_token.length > 0 ? 0 : 1);
@@ -22733,6 +22746,7 @@ __export(dist_exports3, {
22733
22746
  AGENTBOX_HUB_SSH_ALIAS: () => AGENTBOX_HUB_SSH_ALIAS,
22734
22747
  AGENTS_STATIC_BOX_DIR: () => AGENTS_STATIC_BOX_DIR,
22735
22748
  AGENT_SEED_MARKER: () => AGENT_SEED_MARKER,
22749
+ AGENT_SESSION_ENV_VARS: () => AGENT_SESSION_ENV_VARS,
22736
22750
  AGENT_SYNC_SPECS: () => AGENT_SYNC_SPECS,
22737
22751
  AgentInstallError: () => AgentInstallError,
22738
22752
  BACKUP_GITIGNORE_ENTRY: () => BACKUP_GITIGNORE_ENTRY,
@@ -22816,6 +22830,7 @@ __export(dist_exports3, {
22816
22830
  botDir: () => botDir,
22817
22831
  botWorkspaceRoot: () => botWorkspaceRoot,
22818
22832
  boxGitCheckout: () => boxGitCheckout,
22833
+ boxGitCurrentBranch: () => boxGitCurrentBranch,
22819
22834
  boxGitNewBranch: () => boxGitNewBranch,
22820
22835
  boxGitPull: () => boxGitPull,
22821
22836
  boxGitPush: () => boxGitPush,
@@ -23030,6 +23045,7 @@ __export(dist_exports3, {
23030
23045
  scpDownload: () => scpDownload,
23031
23046
  scpUpload: () => scpUpload,
23032
23047
  scratchBranchName: () => scratchBranchName,
23048
+ scrubAgentSessionEnv: () => scrubAgentSessionEnv,
23033
23049
  secretsEnvPath: () => secretsEnvPath,
23034
23050
  seedAgentsVolume: () => seedAgentsVolume,
23035
23051
  seedExcludeTarArgs: () => seedExcludeTarArgs,
@@ -24176,6 +24192,12 @@ function scratchBranchName(name) {
24176
24192
  function boxGitCheckout(provider, box, branch, extraArgs = []) {
24177
24193
  return run(provider, box, ["git", "checkout", branch, ...extraArgs]);
24178
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
+ }
24179
24201
  function boxGitNewBranch(provider, box, name, from) {
24180
24202
  const argv = ["git", "checkout", "-b", scratchBranchName(name)];
24181
24203
  if (from && from.trim()) argv.push(from.trim());
@@ -24459,6 +24481,11 @@ function resolveCliEntry() {
24459
24481
  }
24460
24482
  return null;
24461
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
+ }
24462
24489
  function stagedRuntimeRootCandidates(self) {
24463
24490
  const candidates = [];
24464
24491
  const override2 = process.env[RUNTIME_ROOT_ENV];
@@ -24686,7 +24713,9 @@ async function spawnHub(hubServer, cliEntry, log, portlessEnabled, exposedEnv) {
24686
24713
  detached: true,
24687
24714
  stdio: ["ignore", logFd, logFd],
24688
24715
  env: {
24689
- ...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),
24690
24719
  // The staged hub is a production Next build; force production so server.ts
24691
24720
  // takes the standalone path (dev mode would load webpack, which the
24692
24721
  // standalone build prunes).
@@ -25872,7 +25901,7 @@ function makeSyncContext(init) {
25872
25901
  }
25873
25902
  async function resolveConfiguredSettings(agent) {
25874
25903
  try {
25875
- const { agentSettingsFor: agentSettingsFor2 } = await Promise.resolve().then(() => (init_dist2(), dist_exports));
25904
+ const { agentSettingsFor: agentSettingsFor2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
25876
25905
  return await agentSettingsFor2(agent);
25877
25906
  } catch {
25878
25907
  return void 0;
@@ -26033,17 +26062,17 @@ function buildHostEnvFindArgs(patterns) {
26033
26062
  ")"
26034
26063
  ];
26035
26064
  }
26036
- async function findEnvFilesForTar(workspaceDir, patterns) {
26065
+ async function findEnvFilesForTar(workspaceDir2, patterns) {
26037
26066
  if (patterns.length === 0) return [];
26038
26067
  const found = await execa("find", buildHostEnvFindArgs(patterns).slice(1), {
26039
- cwd: workspaceDir,
26068
+ cwd: workspaceDir2,
26040
26069
  reject: false
26041
26070
  });
26042
26071
  if (found.exitCode !== 0) return [];
26043
26072
  return String(found.stdout).split("\0").filter((p) => p.length > 0);
26044
26073
  }
26045
- async function scanHostEnvFiles(workspaceDir, patterns) {
26046
- const raw = await findEnvFilesForTar(workspaceDir, patterns);
26074
+ async function scanHostEnvFiles(workspaceDir2, patterns) {
26075
+ const raw = await findEnvFilesForTar(workspaceDir2, patterns);
26047
26076
  return raw.map((p) => p.replace(/^\.\//, "")).filter((p) => p.length > 0);
26048
26077
  }
26049
26078
  async function pushEnvFiles(ctx, transport, patterns) {
@@ -26681,8 +26710,8 @@ async function resolveBotBundle(projectRoot, bot, stamp) {
26681
26710
  }
26682
26711
  const dir = (0, import_path34.join)(base, chosen);
26683
26712
  const manifest = await readBackupManifest(dir);
26684
- const workspaceDir = (0, import_path34.join)(dir, "workspace");
26685
- 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()) {
26686
26715
  throw new Error(`${dir}: the backup has no workspace/ directory`);
26687
26716
  }
26688
26717
  const stateDir = (0, import_path34.join)(dir, "state");
@@ -26692,7 +26721,7 @@ async function resolveBotBundle(projectRoot, bot, stamp) {
26692
26721
  bot: manifest.bot,
26693
26722
  stamp: chosen,
26694
26723
  manifest,
26695
- workspaceDir,
26724
+ workspaceDir: workspaceDir2,
26696
26725
  ...hasState ? { stateDir } : {}
26697
26726
  };
26698
26727
  }
@@ -28349,7 +28378,7 @@ async function listAvailableSources(spec, env = process.env) {
28349
28378
  }
28350
28379
  return out;
28351
28380
  }
28352
- 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;
28353
28382
  var init_dist4 = __esm({
28354
28383
  "../sandbox-core/dist/index.js"() {
28355
28384
  "use strict";
@@ -28367,7 +28396,7 @@ var init_dist4 = __esm({
28367
28396
  import_fs4 = require("fs");
28368
28397
  import_os5 = require("os");
28369
28398
  import_path17 = require("path");
28370
- init_dist2();
28399
+ init_dist();
28371
28400
  import_fs5 = require("fs");
28372
28401
  import_promises25 = require("fs/promises");
28373
28402
  import_os6 = require("os");
@@ -28387,7 +28416,7 @@ var init_dist4 = __esm({
28387
28416
  import_os8 = require("os");
28388
28417
  import_path20 = require("path");
28389
28418
  init_execa();
28390
- init_dist();
28419
+ init_dist2();
28391
28420
  import_fs7 = require("fs");
28392
28421
  import_os9 = require("os");
28393
28422
  import_path21 = require("path");
@@ -28410,13 +28439,13 @@ var init_dist4 = __esm({
28410
28439
  import_promises33 = require("fs/promises");
28411
28440
  import_os11 = require("os");
28412
28441
  import_path25 = require("path");
28413
- init_dist();
28442
+ init_dist2();
28414
28443
  import_promises34 = require("fs/promises");
28415
28444
  import_os12 = require("os");
28416
28445
  import_path26 = require("path");
28417
- init_dist();
28446
+ init_dist2();
28418
28447
  import_promises35 = require("fs/promises");
28419
- init_dist();
28448
+ init_dist2();
28420
28449
  init_dist3();
28421
28450
  import_promises36 = require("fs/promises");
28422
28451
  import_os13 = require("os");
@@ -28427,10 +28456,10 @@ var init_dist4 = __esm({
28427
28456
  import_promises38 = require("fs/promises");
28428
28457
  import_os15 = require("os");
28429
28458
  import_path29 = require("path");
28430
- init_dist();
28431
- init_dist();
28459
+ init_dist2();
28460
+ init_dist2();
28432
28461
  import_os16 = require("os");
28433
- init_dist();
28462
+ init_dist2();
28434
28463
  import_promises39 = require("fs/promises");
28435
28464
  import_os17 = require("os");
28436
28465
  import_path30 = require("path");
@@ -28448,12 +28477,12 @@ var init_dist4 = __esm({
28448
28477
  init_execa();
28449
28478
  import_promises44 = require("fs/promises");
28450
28479
  import_path34 = require("path");
28451
- init_dist();
28480
+ init_dist2();
28452
28481
  import_crypto5 = require("crypto");
28453
28482
  import_promises45 = require("fs/promises");
28454
28483
  import_path35 = require("path");
28455
28484
  init_execa();
28456
- init_dist();
28485
+ init_dist2();
28457
28486
  import_promises46 = require("fs/promises");
28458
28487
  import_os19 = require("os");
28459
28488
  import_path36 = require("path");
@@ -28470,22 +28499,22 @@ var init_dist4 = __esm({
28470
28499
  import_os21 = require("os");
28471
28500
  import_path39 = require("path");
28472
28501
  init_execa();
28473
- init_dist();
28502
+ init_dist2();
28474
28503
  import_crypto7 = require("crypto");
28475
28504
  import_fs11 = require("fs");
28476
28505
  import_promises51 = require("fs/promises");
28477
28506
  import_os22 = require("os");
28478
28507
  import_path40 = require("path");
28479
28508
  import_path41 = require("path");
28480
- init_dist();
28509
+ init_dist2();
28481
28510
  import_promises52 = require("fs/promises");
28482
28511
  import_os23 = require("os");
28483
28512
  import_path42 = require("path");
28484
- init_dist2();
28485
28513
  init_dist();
28514
+ init_dist2();
28486
28515
  import_promises53 = require("fs/promises");
28487
28516
  import_path43 = require("path");
28488
- init_dist();
28517
+ init_dist2();
28489
28518
  import_meta = {};
28490
28519
  STATE_DIR2 = (0, import_path14.join)((0, import_os3.homedir)(), ".agentbox");
28491
28520
  STATE_FILE = (0, import_path14.join)(STATE_DIR2, "state.json");
@@ -28792,6 +28821,25 @@ var init_dist4 = __esm({
28792
28821
  FALLBACK_RELAY_PORT = 8787;
28793
28822
  RELAY_PORT_ENV = "AGENTBOX_RELAY_PORT";
28794
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
+ ];
28795
28843
  RUNTIME_ROOT_ENV = "AGENTBOX_RUNTIME_ROOT";
28796
28844
  CLI_RUNTIME_DIR_ENV = "AGENTBOX_CLI_RUNTIME_DIR";
28797
28845
  STATE_DIR22 = (0, import_path23.join)((0, import_os10.homedir)(), ".agentbox");
@@ -29000,13 +29048,13 @@ function isConnectionLevelError(err) {
29000
29048
  const msg = err instanceof Error ? err.message : String(err);
29001
29049
  return /\b(ECONNREFUSED|ENOTFOUND|EHOSTUNREACH|ECONNRESET|EPIPE)\b/.test(msg);
29002
29050
  }
29003
- 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;
29004
29052
  var init_cloud_poller = __esm({
29005
29053
  "src/cloud-poller.ts"() {
29006
29054
  "use strict";
29007
29055
  import_node_http2 = require("http");
29008
29056
  import_node_https2 = require("https");
29009
- import_promises65 = require("timers/promises");
29057
+ import_promises69 = require("timers/promises");
29010
29058
  BACKOFF_BASE_MS = 1500;
29011
29059
  BACKOFF_MAX_MS = 3e4;
29012
29060
  REQUEST_TIMEOUT_MS = 25e3;
@@ -29172,12 +29220,12 @@ var init_cloud_poller = __esm({
29172
29220
  if (this.currentBackoffMs === 0 && this.fastModePolls > 0) {
29173
29221
  this.fastModePolls -= 1;
29174
29222
  }
29175
- 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);
29176
29224
  }
29177
29225
  }
29178
29226
  async backoff() {
29179
29227
  this.currentBackoffMs = this.currentBackoffMs === 0 ? BACKOFF_BASE_MS : Math.min(this.currentBackoffMs * 2, BACKOFF_MAX_MS);
29180
- await (0, import_promises65.setTimeout)(this.currentBackoffMs);
29228
+ await (0, import_promises69.setTimeout)(this.currentBackoffMs);
29181
29229
  }
29182
29230
  async tryRecoverPreviewUrl() {
29183
29231
  if (!this.deps.recoverPreviewUrl) return;
@@ -29326,13 +29374,14 @@ var DEFAULT_RELAY_PORT = 8787;
29326
29374
  var DEFAULT_BOX_RELAY_PORT = 8788;
29327
29375
  var RELAY_EVENT_RING_SIZE = 1e3;
29328
29376
 
29329
- // src/server.ts
29330
- var import_node_child_process12 = require("child_process");
29331
- var import_node_fs13 = require("fs");
29332
- var import_node_http3 = require("http");
29377
+ // src/timeline-hooks.ts
29378
+ init_dist4();
29333
29379
 
29334
- // src/host-actions.ts
29335
- 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();
29336
29385
 
29337
29386
  // src/git-pat.ts
29338
29387
  function parseGitRemote(origin) {
@@ -29383,20 +29432,7 @@ function ghHostFromRemote(origin) {
29383
29432
  return { host, aliasable: parsed.scheme !== "https" && parsed.scheme !== "http" };
29384
29433
  }
29385
29434
 
29386
- // src/host-actions.ts
29387
- var import_node_fs8 = require("fs");
29388
- var import_promises55 = require("fs/promises");
29389
- var import_node_os6 = require("os");
29390
- var import_node_path8 = require("path");
29391
- var import_node_url3 = require("url");
29392
- init_dist();
29393
- init_dist4();
29394
-
29395
29435
  // src/gh.ts
29396
- var import_node_child_process6 = require("child_process");
29397
- var import_node_fs6 = require("fs");
29398
- var import_node_os4 = require("os");
29399
- init_dist4();
29400
29436
  var GH_BLOCKED = [
29401
29437
  {
29402
29438
  pattern: /^auth\s+(token|refresh)\b/i,
@@ -29734,11 +29770,689 @@ function refuseCheckoutByDefault(op) {
29734
29770
  };
29735
29771
  }
29736
29772
 
29737
- // src/host-initiated.ts
29773
+ // src/workspaces/manager.ts
29738
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");
29739
30453
  var DEFAULT_TTL_MS = 12e4;
29740
30454
  function hashRpcParams(params) {
29741
- 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");
29742
30456
  }
29743
30457
  function canonicalJson(v) {
29744
30458
  if (v === null) return "null";
@@ -29762,7 +30476,7 @@ var HostInitiatedTokens = class {
29762
30476
  * params (no current call sites use this).
29763
30477
  */
29764
30478
  mint(boxId, method, paramsHash, ttlMs = DEFAULT_TTL_MS) {
29765
- const token = (0, import_node_crypto.randomBytes)(32).toString("hex");
30479
+ const token = (0, import_node_crypto3.randomBytes)(32).toString("hex");
29766
30480
  this.store.set(token, { boxId, method, paramsHash, expiresAt: Date.now() + ttlMs });
29767
30481
  return token;
29768
30482
  }
@@ -29856,14 +30570,14 @@ function buildCpArgv(opts) {
29856
30570
  // src/cp-cache-capture.ts
29857
30571
  var import_node_child_process7 = require("child_process");
29858
30572
  var import_node_fs7 = require("fs");
29859
- var import_promises54 = require("fs/promises");
29860
- var import_node_os5 = require("os");
29861
- 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");
29862
30576
  var import_node_http = require("http");
29863
30577
  var import_node_https = require("https");
29864
30578
 
29865
30579
  // src/cp-cache.ts
29866
- var import_node_crypto2 = require("crypto");
30580
+ var import_node_crypto4 = require("crypto");
29867
30581
  function cpCachePrefix(opts) {
29868
30582
  const slug = (opts.projectSlug ?? "").trim();
29869
30583
  return slug.length > 0 ? `projects/${slug}/cp` : `boxes/${opts.boxId}/cp`;
@@ -29875,7 +30589,7 @@ function cpCacheKeyInput(source) {
29875
30589
  return `rel:${rel}`;
29876
30590
  }
29877
30591
  function cpCacheKey(source) {
29878
- 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);
29879
30593
  }
29880
30594
  function cpCacheTarPath(prefix, source) {
29881
30595
  return `${prefix}/${cpCacheKey(source)}.tar`;
@@ -29920,12 +30634,12 @@ async function captureCpCacheEntry(absPath, prefix, deps, requestPath = absPath)
29920
30634
  const maxBytes = deps.maxBytes ?? DEFAULT_MAX_CACHE_BYTES;
29921
30635
  let workDir;
29922
30636
  try {
29923
- const info = await (0, import_promises54.stat)(absPath);
29924
- 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-"));
29925
30639
  workDir = dir;
29926
- const tarPath = (0, import_node_path6.join)(dir, "entry.tar");
29927
- await run2("tar", ["-cf", tarPath, "-C", (0, import_node_path6.dirname)(absPath), (0, import_node_path6.basename)(absPath)], TAR_TIMEOUT_MS);
29928
- 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);
29929
30643
  if (tarInfo.size > maxBytes) {
29930
30644
  log(
29931
30645
  `cp cache: skipping ${absPath} \u2014 ${String(tarInfo.size)} bytes exceeds the hub's ${String(maxBytes)}-byte limit`
@@ -29937,7 +30651,7 @@ async function captureCpCacheEntry(absPath, prefix, deps, requestPath = absPath)
29937
30651
  isDir: info.isDirectory(),
29938
30652
  capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
29939
30653
  size: tarInfo.size,
29940
- capturedOn: (0, import_node_os5.hostname)()
30654
+ capturedOn: (0, import_node_os6.hostname)()
29941
30655
  };
29942
30656
  const base = deps.controlPlaneUrl.replace(/\/+$/, "");
29943
30657
  await putBlob(
@@ -29958,7 +30672,7 @@ async function captureCpCacheEntry(absPath, prefix, deps, requestPath = absPath)
29958
30672
  );
29959
30673
  return false;
29960
30674
  } finally {
29961
- 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(() => {
29962
30676
  });
29963
30677
  }
29964
30678
  }
@@ -30036,7 +30750,7 @@ function putJson(url, body, token) {
30036
30750
  }
30037
30751
 
30038
30752
  // src/prompts.ts
30039
- var import_node_crypto3 = require("crypto");
30753
+ var import_node_crypto5 = require("crypto");
30040
30754
  var PendingPrompts = class {
30041
30755
  entries = /* @__PURE__ */ new Map();
30042
30756
  autoApprove = null;
@@ -30239,7 +30953,7 @@ async function askPrompt(prompts, subscribers, boxId, params, opts) {
30239
30953
  if (prompts.consumeAutoApprove(boxId, params)) {
30240
30954
  return { answer: "y" };
30241
30955
  }
30242
- const ev = { id: (0, import_node_crypto3.randomUUID)(), ...params };
30956
+ const ev = { id: (0, import_node_crypto5.randomUUID)(), ...params };
30243
30957
  const promise = prompts.add(boxId, ev);
30244
30958
  subscribers.broadcast(boxId, "prompt-ask", ev);
30245
30959
  if (opts?.ttlMs !== void 0 && opts.ttlMs > 0) {
@@ -30266,11 +30980,11 @@ function isPromptAnswerBody(v) {
30266
30980
  }
30267
30981
 
30268
30982
  // src/host-actions.ts
30269
- init_dist2();
30983
+ init_dist();
30270
30984
 
30271
30985
  // src/host-tools.ts
30272
- var import_node_path7 = require("path");
30273
- init_dist2();
30986
+ var import_node_path10 = require("path");
30987
+ init_dist();
30274
30988
 
30275
30989
  // src/host-exec.ts
30276
30990
  var import_node_child_process8 = require("child_process");
@@ -30359,7 +31073,7 @@ var CREDENTIAL_ARGV_PATTERNS = [
30359
31073
  function refuseCredentialArgv(name, args, bin) {
30360
31074
  const joined = args.join(" ");
30361
31075
  const candidates = [`${name} ${joined}`];
30362
- const binName = bin ? (0, import_node_path7.basename)(bin) : void 0;
31076
+ const binName = bin ? (0, import_node_path10.basename)(bin) : void 0;
30363
31077
  if (binName && binName !== name) candidates.push(`${binName} ${joined}`);
30364
31078
  for (const re of CREDENTIAL_ARGV_PATTERNS) {
30365
31079
  if (candidates.some((c3) => re.test(c3))) {
@@ -30491,7 +31205,7 @@ function renderToolList(grants) {
30491
31205
  }
30492
31206
 
30493
31207
  // src/safe-transfer.ts
30494
- init_dist();
31208
+ init_dist2();
30495
31209
  async function canAutoApproveTransfer(input) {
30496
31210
  if (!input.enabled) return false;
30497
31211
  if (!input.workspacePath || input.hostPaths.length === 0) return false;
@@ -30516,7 +31230,7 @@ function recordAgents(box) {
30516
31230
  }
30517
31231
 
30518
31232
  // src/open-link.ts
30519
- var import_node_crypto4 = require("crypto");
31233
+ var import_node_crypto6 = require("crypto");
30520
31234
  init_dist4();
30521
31235
 
30522
31236
  // src/browser-open-budget.ts
@@ -30582,7 +31296,7 @@ var browserOpenBudget = new BrowserOpenBudget();
30582
31296
  var OPEN_LINK_TTL_MS = 9e4;
30583
31297
  async function offerBrowserOpen(deps, url) {
30584
31298
  const budget = deps.budget ?? browserOpenBudget;
30585
- const open4 = deps.openHost ?? openOnHost;
31299
+ const open6 = deps.openHost ?? openOnHost;
30586
31300
  const decision = budget.decide(deps.boxId, url, deps.autoApproveSafe);
30587
31301
  if (decision.action === "drop") return "dropped";
30588
31302
  if (decision.action === "open") budget.record(deps.boxId, url);
@@ -30597,7 +31311,7 @@ async function offerBrowserOpen(deps, url) {
30597
31311
  };
30598
31312
  if (decision.action === "open" && !deps.controlPlane && deps.subscribers.count(deps.boxId) === 0) {
30599
31313
  deps.prompts.noteAutoApprove(deps.boxId, promptEvent, decision.reason);
30600
- open4(url);
31314
+ open6(url);
30601
31315
  return "opened-locally";
30602
31316
  }
30603
31317
  if (decision.action !== "open" && deps.prompts.consumeAutoApprove(deps.boxId, promptEvent)) {
@@ -30606,10 +31320,10 @@ async function offerBrowserOpen(deps, url) {
30606
31320
  deps.log?.(`browser.open: auto-approved but nothing here can open it (control box): ${url}`);
30607
31321
  return "unclaimed";
30608
31322
  }
30609
- open4(url);
31323
+ open6(url);
30610
31324
  return "opened-locally";
30611
31325
  }
30612
- const ev = { id: (0, import_node_crypto4.randomUUID)(), ...promptEvent };
31326
+ const ev = { id: (0, import_node_crypto6.randomUUID)(), ...promptEvent };
30613
31327
  const settled = deps.prompts.add(deps.boxId, ev);
30614
31328
  const timer = setTimeout(() => {
30615
31329
  if (deps.prompts.resolve(ev.id, "n", true)) {
@@ -30631,7 +31345,7 @@ async function offerBrowserOpen(deps, url) {
30631
31345
  deps.log?.(`browser.open: approved but no client opened it (control box): ${url}`);
30632
31346
  return "unclaimed";
30633
31347
  }
30634
- open4(url);
31348
+ open6(url);
30635
31349
  return "opened-after-answer";
30636
31350
  }
30637
31351
 
@@ -30753,7 +31467,21 @@ async function executeCloudAction(action, deps) {
30753
31467
  };
30754
31468
  }
30755
31469
  if (action.method === "git.push" || action.method === "git.fetch") {
30756
- 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
+ });
30757
31485
  }
30758
31486
  if (action.method === "cp.toHost" || action.method === "cp.fromHost") {
30759
31487
  return runCpRpc(action, deps);
@@ -30768,7 +31496,16 @@ async function executeCloudAction(action, deps) {
30768
31496
  return runBrowserOpenMirror(action, deps);
30769
31497
  }
30770
31498
  if (action.method === "gh.exec") {
30771
- 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
+ });
30772
31509
  }
30773
31510
  if (action.method.startsWith("tool.")) {
30774
31511
  return runToolRpc(action, deps);
@@ -30988,6 +31725,20 @@ function cloudHandleOf(lookup) {
30988
31725
  ...lookup.sandboxClass ? { sandboxClass: lookup.sandboxClass } : {}
30989
31726
  };
30990
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
+ }
30991
31742
  async function lookupCloudBox(boxId) {
30992
31743
  const state = await readState();
30993
31744
  const hit = findBox(boxId, state);
@@ -31282,20 +32033,20 @@ async function resolveHostGitRepo(workspacePath, deps, remoteName) {
31282
32033
  );
31283
32034
  }
31284
32035
  const origin = httpsOriginForScratchPush(rawOrigin);
31285
- 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-"));
31286
32037
  const init = await execa("git", ["-C", dir, "init", "--quiet"], { reject: false });
31287
32038
  if ((init.exitCode ?? 1) !== 0) {
31288
- await (0, import_promises55.rm)(dir, { recursive: true, force: true });
32039
+ await (0, import_promises59.rm)(dir, { recursive: true, force: true });
31289
32040
  throw new Error(`could not initialize a scratch git repo: ${init.stderr ?? ""}`);
31290
32041
  }
31291
32042
  return {
31292
32043
  dir,
31293
32044
  remote: origin,
31294
32045
  scratch: true,
31295
- cleanup: () => (0, import_promises55.rm)(dir, { recursive: true, force: true })
32046
+ cleanup: () => (0, import_promises59.rm)(dir, { recursive: true, force: true })
31296
32047
  };
31297
32048
  }
31298
- async function runGitRpc(action, deps) {
32049
+ async function runGitRpc(action, deps, trace = { hostInitiated: false }) {
31299
32050
  const params = action.params ?? {};
31300
32051
  const lookup = await lookupCloudBox(deps.boxId);
31301
32052
  const backend = await resolveCloudBackend(deps.backendName);
@@ -31330,8 +32081,8 @@ async function runGitRpc(action, deps) {
31330
32081
  };
31331
32082
  }
31332
32083
  const dest = resolveLandDest(branch, params.as);
31333
- const stageSave = await (0, import_promises55.mkdtemp)((0, import_node_path8.join)((0, import_node_os6.tmpdir)(), "agentbox-git-save-"));
31334
- 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");
31335
32086
  const remoteBundleSave = "/tmp/agentbox-rpc-save.bundle";
31336
32087
  try {
31337
32088
  const make = await backend.exec(
@@ -31366,7 +32117,7 @@ ${landed.stdout ?? ""}`,
31366
32117
  stderr: landed.stderr ?? ""
31367
32118
  };
31368
32119
  } finally {
31369
- await (0, import_promises55.rm)(stageSave, { recursive: true, force: true });
32120
+ await (0, import_promises59.rm)(stageSave, { recursive: true, force: true });
31370
32121
  await backend.exec(handle, `rm -f ${shellQuote(remoteBundleSave)}`).catch(() => {
31371
32122
  });
31372
32123
  }
@@ -31394,6 +32145,7 @@ ${landed.stdout ?? ""}`,
31394
32145
  "git.push",
31395
32146
  incomingHashGit
31396
32147
  ) ?? false);
32148
+ trace.hostInitiated = hostInitiatedOk;
31397
32149
  if (action.method === "git.push" && !bypassPushGate && tokenClaimedGit && !hostInitiatedOk) {
31398
32150
  return {
31399
32151
  exitCode: 10,
@@ -31462,8 +32214,8 @@ ${landed.stdout ?? ""}`,
31462
32214
  `git.${action.method === "git.push" ? "push" : "fetch"}: no host checkout for box ${deps.boxId}; using a scratch repo against ${repo.remote}`
31463
32215
  );
31464
32216
  }
31465
- const stage = await (0, import_promises55.mkdtemp)((0, import_node_path8.join)((0, import_node_os6.tmpdir)(), "agentbox-git-rpc-"));
31466
- 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");
31467
32219
  const remoteBundle = "/tmp/agentbox-rpc.bundle";
31468
32220
  try {
31469
32221
  if (action.method === "git.push") {
@@ -31478,6 +32230,11 @@ ${landed.stdout ?? ""}`,
31478
32230
  stderr: `bundle create failed: ${make.stderr || make.stdout}`
31479
32231
  };
31480
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
+ }
31481
32238
  await backend.downloadFile(handle, remoteBundle, hostBundle);
31482
32239
  const fetch2 = await execa(
31483
32240
  "git",
@@ -31562,7 +32319,7 @@ relay: post-push in-box origin/upstream sync threw: ${err instanceof Error ? err
31562
32319
  stderr: sandboxFetch.stderr
31563
32320
  };
31564
32321
  } finally {
31565
- await (0, import_promises55.rm)(stage, { recursive: true, force: true });
32322
+ await (0, import_promises59.rm)(stage, { recursive: true, force: true });
31566
32323
  await repo.cleanup().catch(() => {
31567
32324
  });
31568
32325
  await backend.exec(handle, `rm -f ${shellQuote(remoteBundle)}`).catch(() => {
@@ -31576,7 +32333,7 @@ function shellQuote(arg) {
31576
32333
  }
31577
32334
 
31578
32335
  // src/host-action-queue.ts
31579
- var import_node_crypto5 = require("crypto");
32336
+ var import_node_crypto7 = require("crypto");
31580
32337
  var DEFAULT_HOST_ACTION_MAX_AGE_MS = 15 * 60 * 1e3;
31581
32338
  var HostActionQueue = class {
31582
32339
  map = /* @__PURE__ */ new Map();
@@ -31594,7 +32351,7 @@ var HostActionQueue = class {
31594
32351
  * is open" semantics).
31595
32352
  */
31596
32353
  enqueue(boxId, method, params) {
31597
- const id = (0, import_node_crypto5.randomUUID)();
32354
+ const id = (0, import_node_crypto7.randomUUID)();
31598
32355
  const action = {
31599
32356
  id,
31600
32357
  boxId,
@@ -31660,7 +32417,7 @@ var HostActionQueue = class {
31660
32417
  };
31661
32418
 
31662
32419
  // src/host-reach.ts
31663
- var import_node_crypto6 = require("crypto");
32420
+ var import_node_crypto8 = require("crypto");
31664
32421
  var DEFAULT_HOST_REACH_TIMEOUT_MS = 6e4;
31665
32422
  var HostReachQueue = class {
31666
32423
  map = /* @__PURE__ */ new Map();
@@ -31696,7 +32453,7 @@ var HostReachQueue = class {
31696
32453
  * normal, expected state (a closed laptop), not an error condition.
31697
32454
  */
31698
32455
  request(boxId, method, params, opts = {}) {
31699
- const id = (0, import_node_crypto6.randomUUID)();
32456
+ const id = (0, import_node_crypto8.randomUUID)();
31700
32457
  const action = {
31701
32458
  id,
31702
32459
  boxId,
@@ -31960,10 +32717,10 @@ var HostReachQueue = class {
31960
32717
  // src/cp-cache-serve.ts
31961
32718
  var import_node_child_process9 = require("child_process");
31962
32719
  var import_node_fs9 = require("fs");
31963
- var import_promises56 = require("fs/promises");
31964
- var import_node_os7 = require("os");
31965
- var import_node_path9 = require("path");
31966
- 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");
31967
32724
  var UNTAR_TIMEOUT_MS = 12e4;
31968
32725
  var CP_TIMEOUT_MS = 3e5;
31969
32726
  async function lookupCpCache(sources, deps) {
@@ -32003,7 +32760,7 @@ async function serveCpFromCache(params, resolved, deps) {
32003
32760
  }
32004
32761
  let workDir;
32005
32762
  try {
32006
- 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-"));
32007
32764
  workDir = dir;
32008
32765
  const names = [];
32009
32766
  for (const entry of lookup.entries) {
@@ -32011,13 +32768,13 @@ async function serveCpFromCache(params, resolved, deps) {
32011
32768
  cpCacheTarPath(deps.cachePrefix, entry.sourcePath)
32012
32769
  );
32013
32770
  if (!found) return { exitCode: 69, stdout: "", stderr: "" };
32014
- const tarPath = (0, import_node_path9.join)(dir, `${names.length.toString()}.tar`);
32015
- 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));
32016
32773
  await run3("tar", ["-xf", tarPath, "-C", dir], UNTAR_TIMEOUT_MS);
32017
- await (0, import_promises56.rm)(tarPath, { force: true });
32018
- 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));
32019
32776
  }
32020
- 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));
32021
32778
  const absent = staged.filter((p) => !(0, import_node_fs9.existsSync)(p));
32022
32779
  if (absent.length > 0) {
32023
32780
  return {
@@ -32062,7 +32819,7 @@ ${age}
32062
32819
  `
32063
32820
  };
32064
32821
  } finally {
32065
- 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(() => {
32066
32823
  });
32067
32824
  }
32068
32825
  }
@@ -32081,13 +32838,13 @@ function runCapture(bin, args, cwd, timeout) {
32081
32838
  }
32082
32839
 
32083
32840
  // src/cp-outbox.ts
32084
- var import_node_crypto7 = require("crypto");
32841
+ var import_node_crypto9 = require("crypto");
32085
32842
  var import_node_child_process10 = require("child_process");
32086
32843
  var import_node_fs10 = require("fs");
32087
- var import_promises58 = require("fs/promises");
32088
- var import_node_os8 = require("os");
32089
- var import_node_path10 = require("path");
32090
- 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");
32091
32848
  var PULL_TIMEOUT_MS = 3e5;
32092
32849
  var TAR_TIMEOUT_MS2 = 12e4;
32093
32850
  function cpOutboxPrefix(opts) {
@@ -32126,9 +32883,9 @@ async function parkCpOutbox(sources, dest, deps) {
32126
32883
  if (!deps.custody || !deps.cliEntry) return null;
32127
32884
  let workDir;
32128
32885
  try {
32129
- 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-"));
32130
32887
  workDir = dir;
32131
- const stage = (0, import_node_path10.join)(dir, "payload");
32888
+ const stage = (0, import_node_path13.join)(dir, "payload");
32132
32889
  await run4("mkdir", ["-p", stage], TAR_TIMEOUT_MS2);
32133
32890
  for (const src of sources) {
32134
32891
  await runNode(
@@ -32137,16 +32894,16 @@ async function parkCpOutbox(sources, dest, deps) {
32137
32894
  PULL_TIMEOUT_MS
32138
32895
  );
32139
32896
  }
32140
- const names = await (0, import_promises58.readdir)(stage);
32897
+ const names = await (0, import_promises62.readdir)(stage);
32141
32898
  if (names.length === 0) return null;
32142
- const tarPath = (0, import_node_path10.join)(dir, "outbox.tar");
32899
+ const tarPath = (0, import_node_path13.join)(dir, "outbox.tar");
32143
32900
  await run4("tar", ["-cf", tarPath, "-C", stage, ...names], TAR_TIMEOUT_MS2);
32144
- const info = await (0, import_promises58.stat)(tarPath);
32901
+ const info = await (0, import_promises62.stat)(tarPath);
32145
32902
  if (info.size > deps.maxBytes) {
32146
32903
  log(`cp outbox: ${String(info.size)} bytes exceeds the ${String(deps.maxBytes)}-byte limit`);
32147
32904
  return null;
32148
32905
  }
32149
- const id = (0, import_node_crypto7.randomUUID)();
32906
+ const id = (0, import_node_crypto9.randomUUID)();
32150
32907
  const meta = {
32151
32908
  id,
32152
32909
  boxId: deps.boxId,
@@ -32174,46 +32931,46 @@ It will land them at ${dest} \u2014 behind the usual approval \u2014 the next ti
32174
32931
  log(`cp outbox: could not park: ${err instanceof Error ? err.message : String(err)}`);
32175
32932
  return null;
32176
32933
  } finally {
32177
- 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(() => {
32178
32935
  });
32179
32936
  }
32180
32937
  }
32181
32938
  async function landCpOutboxTar(tarFile, destAbs, opts) {
32182
- 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();
32183
32940
  if (asDirectory) {
32184
32941
  await run4("mkdir", ["-p", destAbs], TAR_TIMEOUT_MS2);
32185
32942
  await run4("tar", ["-xf", tarFile, "-C", destAbs], TAR_TIMEOUT_MS2);
32186
32943
  return;
32187
32944
  }
32188
- await run4("mkdir", ["-p", (0, import_node_path10.dirname)(destAbs)], TAR_TIMEOUT_MS2);
32189
- 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-"));
32190
32947
  try {
32191
32948
  await run4("tar", ["-xf", tarFile, "-C", staging], TAR_TIMEOUT_MS2);
32192
- const members = await (0, import_promises58.readdir)(staging);
32949
+ const members = await (0, import_promises62.readdir)(staging);
32193
32950
  if (members.length === 1) {
32194
- if ((0, import_node_fs10.existsSync)(destAbs) && (await (0, import_promises58.stat)(destAbs)).isDirectory()) {
32195
- 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 });
32196
32953
  }
32197
- 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);
32198
32955
  return;
32199
32956
  }
32200
32957
  await run4("mkdir", ["-p", destAbs], TAR_TIMEOUT_MS2);
32201
32958
  for (const m of members) {
32202
- const target = (0, import_node_path10.join)(destAbs, m);
32203
- if ((0, import_node_fs10.existsSync)(target) && (await (0, import_promises58.stat)(target)).isDirectory()) {
32204
- 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 });
32205
32962
  }
32206
- 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);
32207
32964
  }
32208
32965
  } finally {
32209
- await (0, import_promises58.rm)(staging, { recursive: true, force: true }).catch(() => {
32966
+ await (0, import_promises62.rm)(staging, { recursive: true, force: true }).catch(() => {
32210
32967
  });
32211
32968
  }
32212
32969
  }
32213
32970
  async function stageOutboxTar(data) {
32214
- const dir = await (0, import_promises58.mkdtemp)((0, import_node_path10.join)((0, import_node_os8.tmpdir)(), "agentbox-cp-land-"));
32215
- const tarPath = (0, import_node_path10.join)(dir, "payload.tar");
32216
- 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));
32217
32974
  return { dir, tarPath };
32218
32975
  }
32219
32976
  function run4(bin, args, timeout) {
@@ -32247,7 +33004,7 @@ var HubNotifier = class {
32247
33004
  };
32248
33005
 
32249
33006
  // src/notices.ts
32250
- var import_node_crypto8 = require("crypto");
33007
+ var import_node_crypto10 = require("crypto");
32251
33008
  var DEFAULT_NOTICE_TTL_MS = 66e4;
32252
33009
  var BoxNotices = class {
32253
33010
  constructor(subscribers) {
@@ -32270,7 +33027,7 @@ var BoxNotices = class {
32270
33027
  this.entries.delete(id);
32271
33028
  }
32272
33029
  }
32273
- const ev = { id: (0, import_node_crypto8.randomUUID)(), kind, message };
33030
+ const ev = { id: (0, import_node_crypto10.randomUUID)(), kind, message };
32274
33031
  const ttl = typeof ttlMs === "number" && ttlMs > 0 ? ttlMs : DEFAULT_NOTICE_TTL_MS;
32275
33032
  const timer = setTimeout(() => {
32276
33033
  if (this.entries.delete(ev.id)) {
@@ -32309,10 +33066,10 @@ var BoxNotices = class {
32309
33066
 
32310
33067
  // src/server.ts
32311
33068
  init_dist4();
32312
- init_dist();
33069
+ init_dist2();
32313
33070
 
32314
33071
  // src/github-app.ts
32315
- var import_node_crypto9 = require("crypto");
33072
+ var import_node_crypto11 = require("crypto");
32316
33073
  function loadGitHubAppConfig() {
32317
33074
  const appId = process.env.GITHUB_APP_ID;
32318
33075
  let key = process.env.GITHUB_APP_PRIVATE_KEY;
@@ -32335,7 +33092,7 @@ function appJwt(cfg, nowMs = Date.now()) {
32335
33092
  const header = b64url(JSON.stringify({ alg: "RS256", typ: "JWT" }));
32336
33093
  const payload = b64url(JSON.stringify({ iat: now - 60, exp: now + 540, iss: cfg.appId }));
32337
33094
  const signingInput = `${header}.${payload}`;
32338
- 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);
32339
33096
  return `${signingInput}.${b64url(signature)}`;
32340
33097
  }
32341
33098
  var RENEW_BEFORE_MS = 5 * 60 * 1e3;
@@ -32487,7 +33244,7 @@ async function leaseTokenResult(leaser, reg) {
32487
33244
  }
32488
33245
 
32489
33246
  // src/permission.ts
32490
- var import_node_crypto10 = require("crypto");
33247
+ var import_node_crypto12 = require("crypto");
32491
33248
  async function gateApproval(deps, boxId, method, params, promptParams) {
32492
33249
  if (deps.mode === "block") {
32493
33250
  if (!deps.prompts || !deps.subscribers) return { kind: "deny" };
@@ -32508,7 +33265,7 @@ async function gateApproval(deps, boxId, method, params, promptParams) {
32508
33265
  });
32509
33266
  return { kind: "allow" };
32510
33267
  }
32511
- const promptId2 = (0, import_node_crypto10.randomUUID)();
33268
+ const promptId2 = (0, import_node_crypto12.randomUUID)();
32512
33269
  const ev = { id: promptId2, ...promptParams };
32513
33270
  await deps.store.createPrompt({
32514
33271
  id: promptId2,
@@ -32541,12 +33298,12 @@ function hostRepoUnavailableReason(worktree, boxId, op) {
32541
33298
  }
32542
33299
 
32543
33300
  // src/admin-gate.ts
32544
- var import_node_crypto11 = require("crypto");
33301
+ var import_node_crypto13 = require("crypto");
32545
33302
  function timingSafeEqualStr(a2, b) {
32546
33303
  const ab = Buffer.from(a2, "utf8");
32547
33304
  const bb = Buffer.from(b, "utf8");
32548
33305
  if (ab.length !== bb.length) return false;
32549
- return (0, import_node_crypto11.timingSafeEqual)(ab, bb);
33306
+ return (0, import_node_crypto13.timingSafeEqual)(ab, bb);
32550
33307
  }
32551
33308
  function adminGateAllows(isLoopback, bearer, adminToken) {
32552
33309
  if (isLoopback) return true;
@@ -32555,10 +33312,10 @@ function adminGateAllows(isLoopback, bearer, adminToken) {
32555
33312
  }
32556
33313
 
32557
33314
  // src/custody/routes.ts
32558
- var import_node_crypto13 = require("crypto");
33315
+ var import_node_crypto15 = require("crypto");
32559
33316
 
32560
33317
  // src/custody/store.ts
32561
- var import_node_crypto12 = require("crypto");
33318
+ var import_node_crypto14 = require("crypto");
32562
33319
  init_dist4();
32563
33320
  var CUSTODY_SCOPES = ["agents", "projects", "boxes", "prepared"];
32564
33321
  var CustodyTooLargeError = class extends Error {
@@ -32641,7 +33398,7 @@ function timingSafeEqualStr2(a2, b) {
32641
33398
  const ab = Buffer.from(a2, "utf8");
32642
33399
  const bb = Buffer.from(b, "utf8");
32643
33400
  if (ab.length !== bb.length) return false;
32644
- return (0, import_node_crypto13.timingSafeEqual)(ab, bb);
33401
+ return (0, import_node_crypto15.timingSafeEqual)(ab, bb);
32645
33402
  }
32646
33403
  async function handleCustodyRequest(req, deps) {
32647
33404
  if (!isCustodyPath(req.path)) return null;
@@ -32764,10 +33521,10 @@ async function handleCustodyBlobRequest(req, deps) {
32764
33521
  }
32765
33522
 
32766
33523
  // src/remote-boxes.ts
32767
- var import_node_crypto14 = require("crypto");
32768
- var import_promises60 = require("fs/promises");
32769
- var import_node_path11 = require("path");
32770
- 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");
32771
33528
  var REMOTE_BOXES_PREFIX = "/remote/boxes";
32772
33529
  function isSafeJobId(id) {
32773
33530
  return id.length > 0 && id.length <= 128 && /^[A-Za-z0-9._-]+$/.test(id);
@@ -32779,7 +33536,7 @@ function timingSafeEqualStr3(a2, b) {
32779
33536
  const ab = Buffer.from(a2, "utf8");
32780
33537
  const bb = Buffer.from(b, "utf8");
32781
33538
  if (ab.length !== bb.length) return false;
32782
- return (0, import_node_crypto15.timingSafeEqual)(ab, bb);
33539
+ return (0, import_node_crypto17.timingSafeEqual)(ab, bb);
32783
33540
  }
32784
33541
  function parseJson(text) {
32785
33542
  if (text.length === 0) return {};
@@ -32821,7 +33578,7 @@ async function handleRemoteBoxesRequest(req, deps) {
32821
33578
  }
32822
33579
  };
32823
33580
  }
32824
- const id = (0, import_node_crypto14.randomUUID)();
33581
+ const id = (0, import_node_crypto16.randomUUID)();
32825
33582
  await store.enqueueCreateJob({
32826
33583
  id,
32827
33584
  status: "queued",
@@ -32904,7 +33661,7 @@ async function reapLocalBoxState(boxId, sandboxId, log) {
32904
33661
  const provider = record.provider;
32905
33662
  if (key && provider) {
32906
33663
  const sshDir = boxSshDirForProvider2(provider, key);
32907
- 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(() => {
32908
33665
  });
32909
33666
  }
32910
33667
  }
@@ -32915,25 +33672,25 @@ async function reapLocalBoxState(boxId, sandboxId, log) {
32915
33672
  }
32916
33673
 
32917
33674
  // src/job-log-tail.ts
32918
- var import_promises63 = require("fs/promises");
33675
+ var import_promises67 = require("fs/promises");
32919
33676
 
32920
33677
  // src/queue.ts
32921
33678
  var import_node_child_process11 = require("child_process");
32922
- var import_node_crypto16 = require("crypto");
32923
- var import_promises61 = require("fs/promises");
33679
+ var import_node_crypto18 = require("crypto");
33680
+ var import_promises65 = require("fs/promises");
32924
33681
  var import_node_fs12 = require("fs");
32925
- var import_node_path12 = require("path");
32926
- var import_promises62 = require("timers/promises");
32927
- init_dist2();
32928
- init_dist4();
33682
+ var import_node_path15 = require("path");
33683
+ var import_promises66 = require("timers/promises");
32929
33684
  init_dist();
32930
- 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");
32931
33688
  var PREPARE_MAX_CONCURRENT_PER_PROVIDER = 1;
32932
33689
  async function loadQueueConfig() {
32933
33690
  const d = BUILT_IN_DEFAULTS.queue;
32934
33691
  let global3 = {};
32935
33692
  try {
32936
- 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);
32937
33694
  } catch {
32938
33695
  }
32939
33696
  const q = global3.queue ?? {};
@@ -32945,15 +33702,15 @@ async function loadQueueConfig() {
32945
33702
  };
32946
33703
  }
32947
33704
  async function writeJob(job) {
32948
- await (0, import_promises61.mkdir)(QUEUE_DIR, { recursive: true });
32949
- 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`);
32950
33707
  const tmp = `${final}.tmp.${String(process.pid)}.${String(Date.now())}`;
32951
- await (0, import_promises61.writeFile)(tmp, JSON.stringify(job, null, 2) + "\n", "utf8");
32952
- 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);
32953
33710
  }
32954
33711
  async function readJob(id) {
32955
33712
  try {
32956
- 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");
32957
33714
  return JSON.parse(raw);
32958
33715
  } catch (err) {
32959
33716
  if (err.code === "ENOENT") return null;
@@ -32962,7 +33719,7 @@ async function readJob(id) {
32962
33719
  }
32963
33720
  async function deleteJob(id) {
32964
33721
  try {
32965
- 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`));
32966
33723
  } catch (err) {
32967
33724
  if (err.code !== "ENOENT") throw err;
32968
33725
  }
@@ -32970,7 +33727,7 @@ async function deleteJob(id) {
32970
33727
  async function loadQueue() {
32971
33728
  let entries;
32972
33729
  try {
32973
- entries = await (0, import_promises61.readdir)(QUEUE_DIR);
33730
+ entries = await (0, import_promises65.readdir)(QUEUE_DIR);
32974
33731
  } catch (err) {
32975
33732
  if (err.code === "ENOENT") return [];
32976
33733
  throw err;
@@ -32979,7 +33736,7 @@ async function loadQueue() {
32979
33736
  for (const name of entries) {
32980
33737
  if (!name.endsWith(".json")) continue;
32981
33738
  try {
32982
- 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");
32983
33740
  out.push(JSON.parse(raw));
32984
33741
  } catch {
32985
33742
  }
@@ -33145,6 +33902,7 @@ function startQueueLoop(deps) {
33145
33902
  };
33146
33903
  await writeJob(failed);
33147
33904
  onStatusChange?.(failed);
33905
+ void recordCreateJobTimeline(failed);
33148
33906
  log(`queue: spawn for job ${updated.id} failed: ${msg}`);
33149
33907
  }
33150
33908
  }
@@ -33183,6 +33941,7 @@ function startQueueLoop(deps) {
33183
33941
  };
33184
33942
  await writeJob(failed);
33185
33943
  onStatusChange?.(failed);
33944
+ void recordCreateJobTimeline(failed);
33186
33945
  log(`queue: spawn for foreground job ${updated.id} failed: ${msg}`);
33187
33946
  }
33188
33947
  }
@@ -33222,6 +33981,7 @@ function startQueueLoop(deps) {
33222
33981
  };
33223
33982
  await writeJob(failed);
33224
33983
  onStatusChange?.(failed);
33984
+ void recordCreateJobTimeline(failed);
33225
33985
  log(`queue: spawn for prepare job ${updated.id} failed: ${msg}`);
33226
33986
  }
33227
33987
  }
@@ -33265,6 +34025,7 @@ async function recoverOrphanedWorkers(log, onChange, requirePid = false) {
33265
34025
  };
33266
34026
  await writeJob(failed);
33267
34027
  onChange?.(failed);
34028
+ void recordCreateJobTimeline(failed);
33268
34029
  log(`queue: recovered orphan job ${j.id} (pid ${String(j.pid ?? "?")} not alive) -> failed`);
33269
34030
  }
33270
34031
  }
@@ -33410,7 +34171,7 @@ async function defaultSpawnWorker(job) {
33410
34171
  `AGENTBOX_CLI_ENTRY not set or missing (${String(entry)}); cannot spawn queue worker`
33411
34172
  );
33412
34173
  }
33413
- 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 });
33414
34175
  const fd = (0, import_node_fs12.openSync)(job.logPath, "a");
33415
34176
  const command = job.kind === "prepare" ? "_run-queued-prepare" : "_run-queued-job";
33416
34177
  const child = (0, import_node_child_process11.spawn)(process.execPath, [entry, command, job.id], {
@@ -33426,9 +34187,9 @@ async function defaultSpawnWorker(job) {
33426
34187
  }
33427
34188
  return typeof child.pid === "number" ? child.pid : null;
33428
34189
  }
33429
- 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");
33430
34191
  function queueLogPath(id) {
33431
- 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`);
33432
34193
  }
33433
34194
 
33434
34195
  // src/job-log-tail.ts
@@ -33439,7 +34200,7 @@ async function readCreateJobLog(id, offset) {
33439
34200
  const path6 = queueLogPath(id);
33440
34201
  let size;
33441
34202
  try {
33442
- size = (await (0, import_promises63.stat)(path6)).size;
34203
+ size = (await (0, import_promises67.stat)(path6)).size;
33443
34204
  } catch {
33444
34205
  return { lines: [], offset: from };
33445
34206
  }
@@ -33447,7 +34208,7 @@ async function readCreateJobLog(id, offset) {
33447
34208
  if (size <= start) return { lines: [], offset: start };
33448
34209
  const len = Math.min(size - start, MAX_BYTES_PER_READ);
33449
34210
  const buf = Buffer.alloc(len);
33450
- const fh = await (0, import_promises63.open)(path6, "r");
34211
+ const fh = await (0, import_promises67.open)(path6, "r");
33451
34212
  try {
33452
34213
  await fh.read(buf, 0, len, start);
33453
34214
  } finally {
@@ -33467,7 +34228,7 @@ async function readCreateJobLog(id, offset) {
33467
34228
  }
33468
34229
 
33469
34230
  // src/store/store-rpc-routes.ts
33470
- var import_node_crypto17 = require("crypto");
34231
+ var import_node_crypto19 = require("crypto");
33471
34232
 
33472
34233
  // src/store/store-rpc.ts
33473
34234
  function isStoreRpcMethod(method) {
@@ -33554,7 +34315,7 @@ function timingSafeEqualStr4(a2, b) {
33554
34315
  const ab = Buffer.from(a2, "utf8");
33555
34316
  const bb = Buffer.from(b, "utf8");
33556
34317
  if (ab.length !== bb.length) return false;
33557
- return (0, import_node_crypto17.timingSafeEqual)(ab, bb);
34318
+ return (0, import_node_crypto19.timingSafeEqual)(ab, bb);
33558
34319
  }
33559
34320
  function parseJson2(text) {
33560
34321
  if (text.length === 0) return null;
@@ -33588,7 +34349,7 @@ async function handleStoreRpcRequest(req, deps) {
33588
34349
  }
33589
34350
 
33590
34351
  // src/server.ts
33591
- init_dist2();
34352
+ init_dist();
33592
34353
 
33593
34354
  // src/registry.ts
33594
34355
  var BoxRegistry = class {
@@ -33764,20 +34525,20 @@ async function defaultRunPropagate(agent, sourceBoxId) {
33764
34525
  }
33765
34526
 
33766
34527
  // src/status-store.ts
33767
- var import_promises64 = require("fs/promises");
33768
- var import_node_os9 = require("os");
33769
- var import_node_path13 = require("path");
33770
- 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();
33771
34532
  function sanitizeMnemonic2(raw) {
33772
34533
  return raw.toLowerCase().replace(/-/g, "_").replace(/[^a-z0-9_]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").slice(0, 32) || "unnamed";
33773
34534
  }
33774
34535
  function boxRunDirFor(boxId, name, projectIndex) {
33775
34536
  const mnemonic = sanitizeMnemonic2(name);
33776
34537
  const segment = typeof projectIndex === "number" && Number.isFinite(projectIndex) && projectIndex > 0 ? `${boxId}-${String(projectIndex)}-${mnemonic}` : `${boxId}-${mnemonic}`;
33777
- 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);
33778
34539
  }
33779
34540
  function boxStatusPathFor(boxId, name, projectIndex) {
33780
- 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");
33781
34542
  }
33782
34543
  function isValidBoxStatus(payload) {
33783
34544
  if (typeof payload !== "object" || payload === null) return false;
@@ -33806,11 +34567,11 @@ var BoxStatusStore = class {
33806
34567
  const target = boxStatusPathFor(boxId, name, projectIndex);
33807
34568
  const tmp = `${target}.${String(process.pid)}.tmp`;
33808
34569
  try {
33809
- await (0, import_promises64.mkdir)(boxRunDirFor(boxId, name, projectIndex), { recursive: true });
33810
- await (0, import_promises64.writeFile)(tmp, JSON.stringify(status), "utf8");
33811
- 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);
33812
34573
  } catch {
33813
- await (0, import_promises64.rm)(tmp, { force: true }).catch(() => {
34574
+ await (0, import_promises68.rm)(tmp, { force: true }).catch(() => {
33814
34575
  });
33815
34576
  }
33816
34577
  }
@@ -34579,6 +35340,7 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
34579
35340
  send(res, result2.exitCode === 0 ? 200 : 500, result2);
34580
35341
  return;
34581
35342
  }
35343
+ let pushHostInitiated = false;
34582
35344
  if (body.method === "git.push") {
34583
35345
  const hostOnlyParams = body.params;
34584
35346
  if (hostOnlyParams?.hostOnly) {
@@ -34607,6 +35369,7 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
34607
35369
  const tokenClaimed = typeof params?.hostInitiated === "string";
34608
35370
  const incomingHash = hashRpcParams(params);
34609
35371
  const hostInitiatedOk = !bypassPushGate && tokenClaimed && hostInitiatedTokens.consume(params?.hostInitiated, reg.boxId, "git.push", incomingHash);
35372
+ pushHostInitiated = hostInitiatedOk;
34610
35373
  if (!bypassPushGate && tokenClaimed && !hostInitiatedOk) {
34611
35374
  send(res, 500, {
34612
35375
  exitCode: 10,
@@ -34637,11 +35400,29 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
34637
35400
  }
34638
35401
  }
34639
35402
  }
34640
- const result = await handleGitRpc(
34641
- reg,
34642
- body.method,
34643
- body.params
34644
- );
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
+ }
34645
35426
  const status = result.exitCode === 0 ? 200 : 500;
34646
35427
  send(res, status, result);
34647
35428
  return;
@@ -34802,13 +35583,28 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
34802
35583
  return;
34803
35584
  }
34804
35585
  if (body.method === "gh.exec") {
35586
+ const ghParams = body.params;
34805
35587
  const result = await handleGhExecRpc(
34806
35588
  reg,
34807
- body.params,
35589
+ ghParams,
34808
35590
  prompts,
34809
35591
  subscribers,
34810
35592
  hostInitiatedTokens
34811
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
+ }
34812
35608
  const status = result.exitCode === 0 ? 200 : 500;
34813
35609
  send(res, status, result);
34814
35610
  return;
@@ -35814,8 +36610,8 @@ async function startRelayServer(opts) {
35814
36610
 
35815
36611
  // src/autopause.ts
35816
36612
  var import_node_child_process13 = require("child_process");
35817
- var import_promises66 = require("fs/promises");
35818
- init_dist2();
36613
+ var import_promises70 = require("fs/promises");
36614
+ init_dist();
35819
36615
  init_dist4();
35820
36616
  function selectBoxesToPause(entries, cfg) {
35821
36617
  if (!cfg.enabled) return [];
@@ -35835,7 +36631,7 @@ async function loadAutopauseConfig() {
35835
36631
  const d = BUILT_IN_DEFAULTS.autopause;
35836
36632
  let global3 = {};
35837
36633
  try {
35838
- 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);
35839
36635
  } catch {
35840
36636
  }
35841
36637
  const a2 = global3.autopause ?? {};
@@ -36033,8 +36829,8 @@ async function pauseContainer(name) {
36033
36829
  }
36034
36830
 
36035
36831
  // src/cloud-keepalive.ts
36036
- var import_promises67 = require("fs/promises");
36037
- init_dist2();
36832
+ var import_promises71 = require("fs/promises");
36833
+ init_dist();
36038
36834
  init_dist4();
36039
36835
  function selectBoxesToRenew(entries, windowMs, now) {
36040
36836
  const out = [];
@@ -36260,7 +37056,7 @@ async function defaultFallbackCreateTimeoutMs(backend) {
36260
37056
  const fallback = BUILT_IN_DEFAULTS.box.vercelTimeoutMs;
36261
37057
  try {
36262
37058
  const global3 = parseUserConfig(
36263
- await (0, import_promises67.readFile)(GLOBAL_CONFIG_FILE, "utf8"),
37059
+ await (0, import_promises71.readFile)(GLOBAL_CONFIG_FILE, "utf8"),
36264
37060
  GLOBAL_CONFIG_FILE
36265
37061
  );
36266
37062
  const v = global3.box?.vercelTimeoutMs;
@@ -36470,10 +37266,10 @@ function startRetentionLoop(deps) {
36470
37266
  }
36471
37267
 
36472
37268
  // src/host-reach-poller.ts
36473
- var import_node_crypto18 = require("crypto");
37269
+ var import_node_crypto20 = require("crypto");
36474
37270
  var import_node_http4 = require("http");
36475
37271
  var import_node_https3 = require("https");
36476
- var import_promises68 = require("timers/promises");
37272
+ var import_promises72 = require("timers/promises");
36477
37273
 
36478
37274
  // src/sse-read.ts
36479
37275
  var SseFrameReader = class {
@@ -36533,7 +37329,7 @@ var HostReachPoller = class {
36533
37329
  * restarted relay from the one that took an action and never came back — and
36534
37330
  * re-offer that orphaned work instead of leaving the box waiting forever.
36535
37331
  */
36536
- pollerId = (0, import_node_crypto18.randomUUID)();
37332
+ pollerId = (0, import_node_crypto20.randomUUID)();
36537
37333
  /** Set while a drain is in flight, so only one runs at a time. */
36538
37334
  drainingOutbox = false;
36539
37335
  /** Epoch ms of the last drain, for the periodic re-check. */
@@ -36625,7 +37421,7 @@ var HostReachPoller = class {
36625
37421
  this.backoffMs === 0 ? BACKOFF_BASE_MS2 : this.backoffMs * 2,
36626
37422
  BACKOFF_MAX_MS2
36627
37423
  );
36628
- await (0, import_promises68.setTimeout)(this.backoffMs);
37424
+ await (0, import_promises72.setTimeout)(this.backoffMs);
36629
37425
  }
36630
37426
  }
36631
37427
  }
@@ -36856,10 +37652,10 @@ var HostReachPoller = class {
36856
37652
  };
36857
37653
 
36858
37654
  // src/cp-outbox-drain.ts
36859
- var import_promises69 = require("fs/promises");
37655
+ var import_promises73 = require("fs/promises");
36860
37656
  var import_node_http5 = require("http");
36861
37657
  var import_node_https4 = require("https");
36862
- init_dist();
37658
+ init_dist2();
36863
37659
  var REQUEST_TIMEOUT_MS3 = 3e5;
36864
37660
  async function drainCpOutbox(deps) {
36865
37661
  const base = deps.controlPlaneUrl.replace(/\/+$/, "");
@@ -36901,7 +37697,7 @@ async function drainCpOutbox(deps) {
36901
37697
  `host-reach: could not land the parked copy from ${owner.name} (left on the hub): ${err instanceof Error ? err.message : String(err)}`
36902
37698
  );
36903
37699
  } finally {
36904
- 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(() => {
36905
37701
  });
36906
37702
  }
36907
37703
  }