@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
@@ -8,7 +8,7 @@ import {
8
8
  isRuntimeProviderName,
9
9
  loadProviderModuleByName,
10
10
  registrationProjectKey
11
- } from "./chunk-VNLPJ45F.js";
11
+ } from "./chunk-JX5JUFSR.js";
12
12
  import {
13
13
  baseFreshnessFromFingerprints,
14
14
  currentCloudBaseFingerprint,
@@ -18,13 +18,29 @@ import {
18
18
  openWebAppOnVncScreen,
19
19
  registerAgentCloudModule,
20
20
  resolveCloudCheckpoint
21
- } from "./chunk-MIETKCV4.js";
21
+ } from "./chunk-BR4WVGWJ.js";
22
22
  import {
23
23
  CONTAINER_USER,
24
24
  FsCustodyStore,
25
+ GH_PR_JSON_FIELDS,
26
+ MANAGER_SESSION_RE,
27
+ RESUMABLE_MANAGER_AGENTS,
28
+ TIMELINE_RETENTION_MS,
29
+ UNTITLED_SESSION,
30
+ addTask,
31
+ addWorkspace,
32
+ appendTimelineEvent,
33
+ assignTasks,
34
+ attachBackgroundSession,
35
+ attachBoxToManager,
36
+ backgroundFor,
37
+ buildManagerArgv,
38
+ canonicalWorkspaceRoot,
25
39
  clearRelayNotice,
40
+ createBackgroundSessionLookup,
26
41
  createCheckpoint,
27
42
  deleteJob,
43
+ detachBackgroundSession,
28
44
  enqueuePrepareJob,
29
45
  enqueueQueueJob,
30
46
  ensureBoxBrowserShowingApp,
@@ -32,35 +48,92 @@ import {
32
48
  extractCodexCredentials,
33
49
  extractOpencodeCredentials,
34
50
  extractVolumeAuthToBackup,
51
+ filterTasks,
52
+ findManager,
53
+ findManagerBySession,
54
+ findWorkspaceContaining,
35
55
  generateRelayToken,
36
56
  hashRpcParams,
57
+ isPrReady,
58
+ isResumableManagerAgent,
37
59
  isValidBoxStatus,
38
60
  listAllCheckpoints,
39
61
  listBoxes,
40
62
  listCheckpoints,
63
+ listResumableHostSessions,
64
+ listTmuxSessions,
65
+ listWorkspaces,
66
+ liveBackgroundSession,
41
67
  loadCarrySpec,
42
68
  loadQueue,
43
69
  makeStore,
70
+ managerSessionName,
71
+ managerStatus,
44
72
  mintHostInitiatedToken,
73
+ newManagerId,
45
74
  parseReplacementsSection,
75
+ parseShortstat,
76
+ patchManager,
77
+ patchTask,
78
+ prTimelineEvents,
79
+ processStartTime,
46
80
  pruneBoxes,
81
+ pushLineStat,
82
+ pushedRef,
47
83
  queueLogPath,
48
84
  readBoxStatus,
85
+ readCurrentBranch,
49
86
  readJob,
87
+ readManagerExit,
88
+ readManagers,
89
+ readReconciledManagers,
90
+ readReconciledTasks,
91
+ readRefTip,
92
+ readTasks,
93
+ readTimeline,
94
+ readWorkspace,
95
+ recordTimelineEvent,
50
96
  registerAgentSyncModule,
51
97
  registerBoxWithRelay,
52
98
  registrationToBoxRecord,
53
99
  removeCheckpoint,
100
+ removeManagerRecord,
54
101
  removeReplacementsSet,
102
+ removeTask,
103
+ removeWorkspace,
104
+ renameWorkspace,
105
+ reorderTasks,
106
+ rescanWorkspace,
55
107
  resolveVncViewerUrl,
108
+ resolveWorkspaceDir,
109
+ resumeManagerSession,
110
+ scanWorkspaceProjects,
111
+ sendKeysToManager,
112
+ sessionTitle,
113
+ sessionTurn,
56
114
  setCloudBackendLoader,
57
115
  setRelayNotice,
116
+ setTaskDone,
117
+ sortTasksByOrder,
118
+ stampFields,
119
+ startManagerSession,
58
120
  startRelayDaemon,
121
+ stopManagerSession,
59
122
  syncClaudeCredentials,
123
+ taskSummaryForBox,
124
+ terminalSessionFor,
125
+ timelineFile,
126
+ tmuxAvailable,
127
+ toManagerView,
128
+ toWorkspaceView,
129
+ unassignTasks,
130
+ upsertDetectedManager,
131
+ usesLegacySession,
60
132
  volumeExists,
133
+ workspaceForPath,
61
134
  writeQueueLoginCode
62
- } from "./chunk-KTWFE5BB.js";
63
- import "./chunk-PM2365RW.js";
135
+ } from "./chunk-EVB2OTLU.js";
136
+ import "./chunk-MD2UNTZR.js";
64
137
  import {
65
138
  AGENT_SYNC_SPECS,
66
139
  BOTS_DIR_REL,
@@ -73,6 +146,7 @@ import {
73
146
  backupAgentState,
74
147
  botWorkspaceRoot,
75
148
  boxGitCheckout,
149
+ boxGitCurrentBranch,
76
150
  boxGitNewBranch,
77
151
  boxGitPull,
78
152
  boxGitPush,
@@ -135,7 +209,7 @@ import {
135
209
  toFileRow,
136
210
  uploadWorkspaceToBox,
137
211
  writeBackupManifest
138
- } from "./chunk-IDL7RJBP.js";
212
+ } from "./chunk-FBNAIUXZ.js";
139
213
  import {
140
214
  execa
141
215
  } from "./chunk-EFW34I43.js";
@@ -154,7 +228,7 @@ import {
154
228
  resolveCreatePersistent,
155
229
  resolveRuleRefs,
156
230
  visibleAgentSpecs
157
- } from "./chunk-FQY5OEWX.js";
231
+ } from "./chunk-2LE76CT3.js";
158
232
  import {
159
233
  CLOUD_PROVIDER_NAMES,
160
234
  agentSettings,
@@ -184,8 +258,8 @@ import "./chunk-VWQNSZGI.js";
184
258
  import "./chunk-TZFWAJVB.js";
185
259
 
186
260
  // server.ts
187
- import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
188
- import { homedir as homedir11 } from "node:os";
261
+ import { existsSync as existsSync6, readFileSync as readFileSync3 } from "node:fs";
262
+ import { homedir as homedir12 } from "node:os";
189
263
  import path5 from "node:path";
190
264
  import next from "next";
191
265
 
@@ -660,10 +734,10 @@ async function stageClaudeJsonOnlyForUpload(opts = {}) {
660
734
  cleanup: makeCleanup([stageDir, tarballPath]),
661
735
  warnings: []
662
736
  };
663
- } catch (err) {
737
+ } catch (err3) {
664
738
  await rm2(stageDir, { recursive: true, force: true });
665
739
  if (tarballPath) await rm2(tarballPath, { force: true });
666
- throw err;
740
+ throw err3;
667
741
  }
668
742
  }
669
743
  async function stageClaudeStaticForUpload(opts = {}) {
@@ -723,10 +797,10 @@ async function stageClaudeStaticForUpload(opts = {}) {
723
797
  cleanup: makeCleanup([stageDir, tarballPath]),
724
798
  warnings: []
725
799
  };
726
- } catch (err) {
800
+ } catch (err3) {
727
801
  await rm2(stageDir, { recursive: true, force: true });
728
802
  if (tarballPath) await rm2(tarballPath, { force: true });
729
- throw err;
803
+ throw err3;
730
804
  }
731
805
  }
732
806
  async function stageClaudeCredentialsForUpload() {
@@ -763,9 +837,9 @@ async function seedClaudeJsonAtCreate(backend, handle, opts = {}) {
763
837
  return;
764
838
  }
765
839
  log("claude: _claude.json overlay seeded");
766
- } catch (err) {
840
+ } catch (err3) {
767
841
  log(
768
- `claude: _claude.json overlay failed (continuing): ${err instanceof Error ? err.message : String(err)}`
842
+ `claude: _claude.json overlay failed (continuing): ${err3 instanceof Error ? err3.message : String(err3)}`
769
843
  );
770
844
  } finally {
771
845
  if (staged) await staged.cleanup();
@@ -2073,9 +2147,9 @@ chmod 0644 "$OVR" 2>/dev/null || true`;
2073
2147
  else if (res.stdout.includes(CODEX_OVERRIDE_WROTE_MARKER))
2074
2148
  log("seeded Codex AGENTS.override.md");
2075
2149
  else log("codex AGENTS.override skipped: box-facts file absent");
2076
- } catch (err) {
2150
+ } catch (err3) {
2077
2151
  log(
2078
- `codex AGENTS.override seed failed (continuing): ${err instanceof Error ? err.message : String(err)}`
2152
+ `codex AGENTS.override seed failed (continuing): ${err3 instanceof Error ? err3.message : String(err3)}`
2079
2153
  );
2080
2154
  }
2081
2155
  }
@@ -2144,10 +2218,10 @@ async function stageCodexStaticForUpload(opts = {}) {
2144
2218
  cleanup: makeCleanup([stageDir, tarballPath]),
2145
2219
  warnings: []
2146
2220
  };
2147
- } catch (err) {
2221
+ } catch (err3) {
2148
2222
  await rm3(stageDir, { recursive: true, force: true });
2149
2223
  if (tarballPath) await rm3(tarballPath, { force: true });
2150
- throw err;
2224
+ throw err3;
2151
2225
  }
2152
2226
  }
2153
2227
  async function stageCodexCredentialsForUpload(opts = {}) {
@@ -2689,10 +2763,10 @@ async function registerInstalledAgentModules(opts = {}) {
2689
2763
  registerAgentSyncModule(m);
2690
2764
  out.loaded.push(m.id);
2691
2765
  }
2692
- } catch (err) {
2766
+ } catch (err3) {
2693
2767
  out.failed.push({
2694
2768
  packageName: record.packageName,
2695
- reason: err instanceof Error ? err.message : String(err)
2769
+ reason: err3 instanceof Error ? err3.message : String(err3)
2696
2770
  });
2697
2771
  }
2698
2772
  }
@@ -2710,12 +2784,1726 @@ function registerAllAgentModules() {
2710
2784
  // lib/hub-backend.ts
2711
2785
  import { execFile as execFile2 } from "node:child_process";
2712
2786
  import { randomUUID } from "node:crypto";
2713
- import { existsSync, readFileSync } from "node:fs";
2714
- import { chmod, mkdir as mkdir2, readdir as readdir4, stat as stat6, writeFile as writeFile6 } from "node:fs/promises";
2787
+ import { existsSync as existsSync2, readFileSync } from "node:fs";
2788
+ import { chmod, mkdir as mkdir2, readdir as readdir4, stat as stat9, writeFile as writeFile6 } from "node:fs/promises";
2715
2789
  import os2 from "node:os";
2716
2790
  import path4 from "node:path";
2717
2791
  import { promisify as promisify2 } from "node:util";
2718
2792
 
2793
+ // lib/backend/background.ts
2794
+ var pending = /* @__PURE__ */ new Set();
2795
+ function inBackground(work) {
2796
+ const p = Promise.resolve().then(work).then(
2797
+ () => void 0,
2798
+ () => void 0
2799
+ );
2800
+ pending.add(p);
2801
+ void p.then(() => pending.delete(p));
2802
+ }
2803
+
2804
+ // lib/backend/deps.ts
2805
+ async function reconcileContext(deps) {
2806
+ const [liveBoxIds, jobs] = await Promise.all([deps.liveBoxIds(), deps.jobs()]);
2807
+ return {
2808
+ liveBoxIds,
2809
+ jobs: jobs.map((j) => ({
2810
+ id: j.id,
2811
+ status: j.status,
2812
+ ...j.boxId ? { boxId: j.boxId } : {}
2813
+ }))
2814
+ };
2815
+ }
2816
+
2817
+ // lib/backend/github-prs.ts
2818
+ import { stat as stat5 } from "node:fs/promises";
2819
+ import { join as join9 } from "node:path";
2820
+ var GITHUB_SYNC_INTERVAL_MS = 6e4;
2821
+ var GH_TIMEOUT_MS = 3e4;
2822
+ var PR_LIST_LIMIT = 50;
2823
+ var defaultGhExec = async (args, opts) => {
2824
+ const r = await execa("gh", args, {
2825
+ ...opts?.cwd ? { cwd: opts.cwd } : {},
2826
+ reject: false,
2827
+ timeout: GH_TIMEOUT_MS
2828
+ });
2829
+ return {
2830
+ exitCode: typeof r.exitCode === "number" ? r.exitCode : 1,
2831
+ stdout: String(r.stdout ?? ""),
2832
+ stderr: String(r.stderr ?? "")
2833
+ };
2834
+ };
2835
+ function createGithubPrSync(deps, opts = {}) {
2836
+ const gh = deps.ghExec ?? defaultGhExec;
2837
+ const now = opts.now ?? Date.now;
2838
+ const interval = opts.intervalMs ?? GITHUB_SYNC_INTERVAL_MS;
2839
+ const states = /* @__PURE__ */ new Map();
2840
+ const repoByRoot = /* @__PURE__ */ new Map();
2841
+ const rootByProjectId = /* @__PURE__ */ new Map();
2842
+ let ghUser = null;
2843
+ const prStates = /* @__PURE__ */ new Map();
2844
+ let statesVersion = 0;
2845
+ async function currentUser2() {
2846
+ if (ghUser && (ghUser.login !== null || now() - ghUser.at < interval)) return ghUser.login;
2847
+ const r = await gh(["api", "user", "--jq", ".login"]).catch(() => null);
2848
+ const login = r && r.exitCode === 0 ? r.stdout.trim() || null : null;
2849
+ ghUser = { login, at: now() };
2850
+ return login;
2851
+ }
2852
+ async function repoOf(root) {
2853
+ if (repoByRoot.has(root)) return repoByRoot.get(root) ?? null;
2854
+ if (!await stat5(join9(root, ".git")).catch(() => null)) {
2855
+ repoByRoot.set(root, null);
2856
+ return null;
2857
+ }
2858
+ const r = await gh(["repo", "view", "--json", "nameWithOwner,url"], { cwd: root }).catch(
2859
+ () => null
2860
+ );
2861
+ let ref = null;
2862
+ if (r && r.exitCode === 0) {
2863
+ try {
2864
+ const parsed = JSON.parse(r.stdout);
2865
+ if (parsed.nameWithOwner) {
2866
+ const host2 = parsed.url ? new URL(parsed.url).host : "github.com";
2867
+ ref = {
2868
+ nameWithOwner: parsed.nameWithOwner,
2869
+ arg: host2 === "github.com" ? parsed.nameWithOwner : `${host2}/${parsed.nameWithOwner}`,
2870
+ webUrl: `https://${host2}/${parsed.nameWithOwner}`
2871
+ };
2872
+ }
2873
+ } catch {
2874
+ ref = null;
2875
+ }
2876
+ }
2877
+ if (r) {
2878
+ repoByRoot.set(root, ref);
2879
+ rootByProjectId.set(hashProjectPath(root), root);
2880
+ }
2881
+ return ref;
2882
+ }
2883
+ async function sync(ws) {
2884
+ const user = await currentUser2();
2885
+ if (user === null) return "unavailable";
2886
+ const roots = await scanWorkspaceProjects(ws.root);
2887
+ const repos = /* @__PURE__ */ new Map();
2888
+ for (const root of roots) {
2889
+ const ref = await repoOf(root);
2890
+ if (ref) repos.set(ref.nameWithOwner, ref);
2891
+ }
2892
+ if (repos.size === 0) return "unavailable";
2893
+ const [events, facts, tasks, workspaces] = await Promise.all([
2894
+ readTimeline(ws.id),
2895
+ deps.boxFacts ? deps.boxFacts().catch(() => []) : Promise.resolve([]),
2896
+ readTasks(ws.id).catch(() => []),
2897
+ listWorkspaces()
2898
+ ]);
2899
+ const boxes = facts.filter(
2900
+ (b) => findWorkspaceContaining(workspaces, b.projectRoot)?.id === ws.id
2901
+ );
2902
+ const known = /* @__PURE__ */ new Set();
2903
+ for (const b of boxes) for (const br of b.branches) known.add(br);
2904
+ for (const ev of events) if (ev.branch) known.add(ev.branch);
2905
+ const since = ws.createdAt.slice(0, 10);
2906
+ const floor = now() - TIMELINE_RETENTION_MS;
2907
+ let appended = 0;
2908
+ for (const ref of repos.values()) {
2909
+ const r = await gh([
2910
+ "pr",
2911
+ "list",
2912
+ "--repo",
2913
+ ref.arg,
2914
+ "--state",
2915
+ "all",
2916
+ "--limit",
2917
+ String(PR_LIST_LIMIT),
2918
+ "--search",
2919
+ `updated:>=${since}`,
2920
+ "--json",
2921
+ GH_PR_JSON_FIELDS
2922
+ ]).catch(() => null);
2923
+ if (!r || r.exitCode !== 0) continue;
2924
+ let prs;
2925
+ try {
2926
+ prs = JSON.parse(r.stdout);
2927
+ } catch {
2928
+ continue;
2929
+ }
2930
+ for (const pr of prs) {
2931
+ const prKey = `${ref.nameWithOwner}#${String(pr.number)}`;
2932
+ const live = pr.state === "MERGED" ? "merged" : pr.state === "CLOSED" ? "closed" : isPrReady(pr) ? "ready" : "open";
2933
+ if (prStates.get(prKey) !== live) {
2934
+ prStates.set(prKey, live);
2935
+ statesVersion += 1;
2936
+ }
2937
+ if (!known.has(pr.headRefName) && pr.author?.login !== user) continue;
2938
+ const box = boxes.find((b) => b.branches.includes(pr.headRefName));
2939
+ const seen = events.find((ev) => ev.branch === pr.headRefName && ev.boxId);
2940
+ const boxTaskIds = box ? tasks.filter((t) => t.boxId === box.id).map((t) => t.id) : void 0;
2941
+ const taskIds = boxTaskIds?.length ? boxTaskIds : seen?.taskIds;
2942
+ const base = {
2943
+ actor: "github",
2944
+ ...box ? { boxId: box.id, boxName: box.name } : {},
2945
+ ...!box && seen?.boxId ? { boxId: seen.boxId } : {},
2946
+ ...!box && seen?.boxName ? { boxName: seen.boxName } : {},
2947
+ ...seen?.managerId ? { managerId: seen.managerId } : {},
2948
+ ...taskIds?.length ? { taskIds } : {}
2949
+ };
2950
+ for (const ev of prTimelineEvents(
2951
+ pr,
2952
+ ref.nameWithOwner,
2953
+ base,
2954
+ new Date(now()).toISOString()
2955
+ )) {
2956
+ if (ev.at && Date.parse(ev.at) < floor) continue;
2957
+ if (await appendTimelineEvent(ws.id, ev).catch(() => null)) appended += 1;
2958
+ }
2959
+ }
2960
+ }
2961
+ if (appended > 0) deps.notify();
2962
+ return "ok";
2963
+ }
2964
+ function stateOf(wsId) {
2965
+ let st = states.get(wsId);
2966
+ if (!st) {
2967
+ st = { lastAt: 0, running: null, status: null, confirmed: false };
2968
+ states.set(wsId, st);
2969
+ }
2970
+ return st;
2971
+ }
2972
+ function run(ws) {
2973
+ const st = stateOf(ws.id);
2974
+ if (st.running) return st.running;
2975
+ st.running = sync(ws).catch(() => "unavailable").then((status) => {
2976
+ st.status = status;
2977
+ if (status === "ok") st.confirmed = true;
2978
+ st.lastAt = now();
2979
+ st.running = null;
2980
+ return status;
2981
+ });
2982
+ return st.running;
2983
+ }
2984
+ return {
2985
+ kick(ws) {
2986
+ const st = stateOf(ws.id);
2987
+ if (!st.running && now() - st.lastAt >= interval) void run(ws);
2988
+ return st.status ?? "syncing";
2989
+ },
2990
+ status(wsId) {
2991
+ return states.get(wsId)?.status ?? "syncing";
2992
+ },
2993
+ syncNow: run,
2994
+ prState(repo, number) {
2995
+ return prStates.get(`${repo}#${String(number)}`);
2996
+ },
2997
+ statesVersion: () => statesVersion,
2998
+ synced(wsId) {
2999
+ return states.get(wsId)?.confirmed ?? false;
3000
+ },
3001
+ webUrlForRoot(root) {
3002
+ return repoByRoot.get(root)?.webUrl;
3003
+ },
3004
+ webUrlForProject(projectId) {
3005
+ const root = rootByProjectId.get(projectId);
3006
+ return root === void 0 ? void 0 : repoByRoot.get(root)?.webUrl;
3007
+ },
3008
+ webUrlForRepo(nameWithOwner) {
3009
+ for (const ref of repoByRoot.values()) {
3010
+ if (ref?.nameWithOwner === nameWithOwner) return ref.webUrl;
3011
+ }
3012
+ return void 0;
3013
+ }
3014
+ };
3015
+ }
3016
+
3017
+ // lib/backend/timeline-lanes.ts
3018
+ var TRUNK = "trunk";
3019
+ var JOB_KEY = /^job:(.+):(?:created|ready|failed)$/u;
3020
+ var LIFECYCLE = /* @__PURE__ */ new Set(["box.started", "box.stopped"]);
3021
+ function kindOf(id) {
3022
+ if (id.startsWith("box:")) return "box";
3023
+ return id.startsWith("branch:") ? "branch" : "trunk";
3024
+ }
3025
+ function branchOf(row) {
3026
+ return row.pr?.head || row.branch || void 0;
3027
+ }
3028
+ function jobOf(row) {
3029
+ return "key" in row && row.key ? JOB_KEY.exec(row.key)?.[1] : void 0;
3030
+ }
3031
+ function oldestFirst(a, b) {
3032
+ if (a.at !== b.at) return a.at < b.at ? -1 : 1;
3033
+ return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
3034
+ }
3035
+ function assignLanes(items, live, boxes) {
3036
+ const asc = [...items].sort(oldestFirst);
3037
+ const boxOfJob = /* @__PURE__ */ new Map();
3038
+ for (const item of items) {
3039
+ const job = item.boxId ? jobOf(item) : void 0;
3040
+ if (job) boxOfJob.set(job, item.boxId);
3041
+ }
3042
+ const boxLaneOf = (row) => {
3043
+ const job = jobOf(row);
3044
+ const boxId = row.boxId ?? (job ? boxOfJob.get(job) : void 0);
3045
+ return boxId ? `box:${boxId}` : void 0;
3046
+ };
3047
+ const baseOf = /* @__PURE__ */ new Map();
3048
+ for (const item of asc) {
3049
+ const lane = item.base && item.type !== "box.branch" ? boxLaneOf(item) : void 0;
3050
+ if (lane && !baseOf.has(lane)) baseOf.set(lane, item.base);
3051
+ }
3052
+ const boxBranches = /* @__PURE__ */ new Set();
3053
+ for (const item of items) {
3054
+ if ((item.type === "box.created" || item.type === "box.ready") && item.branch) {
3055
+ boxBranches.add(item.branch);
3056
+ }
3057
+ }
3058
+ const trunkBranches = /* @__PURE__ */ new Set();
3059
+ for (const item of items) {
3060
+ for (const base of [item.type === "box.branch" ? void 0 : item.base, item.pr?.base]) {
3061
+ if (base && !boxBranches.has(base)) trunkBranches.add(base);
3062
+ }
3063
+ }
3064
+ const carrier = /* @__PURE__ */ new Map();
3065
+ const labels = /* @__PURE__ */ new Map();
3066
+ const carrierOf = (branch) => branch && !trunkBranches.has(branch) ? carrier.get(branch) : void 0;
3067
+ const laneOn = (branch, self) => {
3068
+ const lane = carrierOf(branch);
3069
+ return lane && lane !== self && lane.startsWith("box:") ? lane : TRUNK;
3070
+ };
3071
+ const laneIdOf = (row) => {
3072
+ const box = boxLaneOf(row);
3073
+ if (box) return box;
3074
+ const isPr = row.type.startsWith("pr.");
3075
+ if (isPr || row.type === "git.push") {
3076
+ const head = branchOf(row);
3077
+ const carried = head ? carrier.get(head) : void 0;
3078
+ if (carried) return carried;
3079
+ if (isPr && row.pr?.head) return `branch:${row.pr.head}`;
3080
+ }
3081
+ return TRUNK;
3082
+ };
3083
+ const stamp = (row, extra = {}) => {
3084
+ const id = laneIdOf(row);
3085
+ const lane = { id, kind: kindOf(id), ...extra };
3086
+ if (id === TRUNK) return lane;
3087
+ if (!labels.has(id)) lane.from = laneOn(baseOf.get(id) ?? row.pr?.base, id);
3088
+ const branch = branchOf(row);
3089
+ if (branch && branch !== labels.get(id)) lane.branch = branch;
3090
+ labels.set(id, branch ?? labels.get(id));
3091
+ if (row.type === "pr.merged" && carrierOf(row.pr?.base) !== id) {
3092
+ lane.into = laneOn(row.pr?.base, id);
3093
+ }
3094
+ if (branch && !trunkBranches.has(branch)) carrier.set(branch, id);
3095
+ return lane;
3096
+ };
3097
+ const newest = /* @__PURE__ */ new Map();
3098
+ const lastWork = /* @__PURE__ */ new Map();
3099
+ for (const item of asc) {
3100
+ item.lane = stamp(item);
3101
+ newest.set(item.lane.id, item);
3102
+ if (!LIFECYCLE.has(item.type)) lastWork.set(item.lane.id, item);
3103
+ }
3104
+ const liveLanes = /* @__PURE__ */ new Set();
3105
+ for (const row of live) {
3106
+ row.lane = stamp(row);
3107
+ if (row.lane.id === TRUNK) continue;
3108
+ row.lane.open = true;
3109
+ liveLanes.add(row.lane.id);
3110
+ }
3111
+ const facts = new Map(boxes.map((b) => [b.id, b]));
3112
+ for (const [id, item] of newest) {
3113
+ if (id === TRUNK) continue;
3114
+ if (liveLanes.has(id)) {
3115
+ item.lane.open = true;
3116
+ continue;
3117
+ }
3118
+ const fact = id.startsWith("box:") ? facts.get(id.slice("box:".length)) : void 0;
3119
+ if (!fact || item.type === "box.destroyed") continue;
3120
+ const done = lastWork.get(id)?.type;
3121
+ if (fact.state === "running" || done !== "pr.merged" && done !== "pr.closed") {
3122
+ item.lane.open = true;
3123
+ }
3124
+ }
3125
+ }
3126
+
3127
+ // lib/backend/timeline.ts
3128
+ var PLAN_WINDOW_MS = 10 * 60 * 1e3;
3129
+ var PLAN_MIN_TASKS = 3;
3130
+ var ASSIGN_STATUS_WINDOW_MS = 60 * 1e3;
3131
+ var DIFF_CACHE_MS = 60 * 1e3;
3132
+ var DIFF_TIMEOUT_MS = 3e3;
3133
+ var TIMELINE_DEFAULT_LIMIT = 100;
3134
+ function newestFirst(a, b) {
3135
+ if (a.at !== b.at) return a.at < b.at ? 1 : -1;
3136
+ return a.id < b.id ? 1 : a.id > b.id ? -1 : 0;
3137
+ }
3138
+ function taskIdsOf(ev) {
3139
+ if (ev.taskIds?.length) return ev.taskIds;
3140
+ return ev.task ? [ev.task.id] : [];
3141
+ }
3142
+ function prMatcher(events) {
3143
+ const repos = /* @__PURE__ */ new Map();
3144
+ for (const ev of events) {
3145
+ if (!ev.pr?.repo) continue;
3146
+ const set = repos.get(ev.pr.number) ?? /* @__PURE__ */ new Set();
3147
+ set.add(ev.pr.repo);
3148
+ repos.set(ev.pr.number, set);
3149
+ }
3150
+ return (a, b) => {
3151
+ if (!a || !b || a.number !== b.number) return false;
3152
+ if (a.repo && b.repo) return a.repo === b.repo;
3153
+ const known = a.repo || b.repo;
3154
+ const set = repos.get(a.number);
3155
+ return Boolean(known) && set?.size === 1 && set.has(known);
3156
+ };
3157
+ }
3158
+ function aggregateTimeline(events) {
3159
+ const asc = [...events].sort(newestFirst).reverse();
3160
+ const samePr = prMatcher(events);
3161
+ const drop = /* @__PURE__ */ new Set();
3162
+ const groups = [];
3163
+ const openGroup = /* @__PURE__ */ new Map();
3164
+ for (const ev of asc) {
3165
+ if (ev.type !== "task.created" || !ev.managerId || ev.turn === void 0) continue;
3166
+ const key = `${ev.managerId}|${String(ev.turn)}`;
3167
+ const group = openGroup.get(key);
3168
+ if (group && Date.parse(ev.at) - Date.parse(group[0].at) <= PLAN_WINDOW_MS) {
3169
+ group.push(ev);
3170
+ } else {
3171
+ const fresh = [ev];
3172
+ openGroup.set(key, fresh);
3173
+ groups.push(fresh);
3174
+ }
3175
+ }
3176
+ const plans = [];
3177
+ for (const group of groups) {
3178
+ if (group.length < PLAN_MIN_TASKS) continue;
3179
+ for (const ev of group) drop.add(ev.id);
3180
+ const first = group[0];
3181
+ const prompt = group.find((ev) => ev.prompt)?.prompt;
3182
+ const projects = new Set(group.map((ev) => ev.projectId));
3183
+ plans.push({
3184
+ id: first.id,
3185
+ at: first.at,
3186
+ type: "plan",
3187
+ actor: first.actor,
3188
+ managerId: first.managerId,
3189
+ turn: first.turn,
3190
+ ...prompt ? { prompt } : {},
3191
+ ...projects.size === 1 && first.projectId ? { projectId: first.projectId } : {},
3192
+ taskIds: group.flatMap(taskIdsOf),
3193
+ count: group.length
3194
+ });
3195
+ }
3196
+ const assignedAt = /* @__PURE__ */ new Map();
3197
+ for (const ev of asc) {
3198
+ if (ev.type === "task.assigned") {
3199
+ for (const id of taskIdsOf(ev)) assignedAt.set(id, Date.parse(ev.at));
3200
+ } else if (ev.type === "task.status" && ev.task?.to === "in_progress") {
3201
+ const at = assignedAt.get(ev.task.id);
3202
+ if (at !== void 0 && Date.parse(ev.at) - at <= ASSIGN_STATUS_WINDOW_MS) drop.add(ev.id);
3203
+ }
3204
+ }
3205
+ const messages = asc.filter((ev) => ev.type === "manager.message" && ev.pr);
3206
+ const items = [];
3207
+ for (const ev of asc) {
3208
+ if (drop.has(ev.id)) continue;
3209
+ if (ev.type === "pr.merged" && messages.some((m) => samePr(m.pr, ev.pr) && m.at <= ev.at)) {
3210
+ items.push({ ...ev, approvedByYou: true });
3211
+ } else {
3212
+ items.push(ev);
3213
+ }
3214
+ }
3215
+ return [...items, ...plans].sort(newestFirst);
3216
+ }
3217
+ function liveReadyItems(events, prState, synced = true) {
3218
+ const sorted = [...events].sort(newestFirst);
3219
+ const samePr = prMatcher(events);
3220
+ const finished = /* @__PURE__ */ new Set();
3221
+ for (const ev of sorted) {
3222
+ if ((ev.type === "pr.merged" || ev.type === "pr.closed") && ev.pr) {
3223
+ finished.add(`${ev.pr.repo}#${String(ev.pr.number)}`);
3224
+ }
3225
+ }
3226
+ const seen = /* @__PURE__ */ new Set();
3227
+ const out = [];
3228
+ for (const ev of sorted) {
3229
+ if (ev.type !== "pr.ready" || !ev.pr) continue;
3230
+ const key = `${ev.pr.repo}#${String(ev.pr.number)}`;
3231
+ if (finished.has(key) || seen.has(key)) continue;
3232
+ seen.add(key);
3233
+ const state = prState?.(ev.pr.repo, ev.pr.number);
3234
+ if (state ? state !== "ready" : !synced) continue;
3235
+ const approved = sorted.some((m) => m.type === "manager.message" && samePr(m.pr, ev.pr));
3236
+ out.push({
3237
+ id: `live:pr:${key}`,
3238
+ type: "pr.ready",
3239
+ at: ev.at,
3240
+ pr: ev.pr,
3241
+ ...ev.boxId ? { boxId: ev.boxId } : {},
3242
+ ...ev.boxName ? { boxName: ev.boxName } : {},
3243
+ ...ev.branch ? { branch: ev.branch } : {},
3244
+ ...ev.managerId ? { managerId: ev.managerId } : {},
3245
+ ...ev.taskIds?.length ? { taskIds: ev.taskIds } : {},
3246
+ awaiting: true,
3247
+ ...approved ? { approved: true } : {}
3248
+ });
3249
+ }
3250
+ return out;
3251
+ }
3252
+ function buildTimelineSummary(events, since, live, pendingApprovals) {
3253
+ let merged = 0;
3254
+ let additions = 0;
3255
+ let deletions = 0;
3256
+ let tasksDone = 0;
3257
+ for (const ev of events) {
3258
+ if (ev.at < since) continue;
3259
+ if (ev.type === "pr.merged") {
3260
+ merged += 1;
3261
+ additions += ev.pr?.additions ?? 0;
3262
+ deletions += ev.pr?.deletions ?? 0;
3263
+ } else if (ev.type === "task.status" && ev.task?.to === "done") {
3264
+ tasksDone += 1;
3265
+ }
3266
+ }
3267
+ const awaitingPrs = live.filter((l) => l.type === "pr.ready" && !l.approved).length;
3268
+ return {
3269
+ since,
3270
+ merged,
3271
+ additions,
3272
+ deletions,
3273
+ tasksDone,
3274
+ awaiting: awaitingPrs + pendingApprovals
3275
+ };
3276
+ }
3277
+ function repoUrlOfPrUrl(url) {
3278
+ return /^(https?:\/\/[^/?#]+\/[^/?#]+\/[^/?#]+)\/pull\/\d+\/?(?:[?#].*)?$/u.exec(url)?.[1];
3279
+ }
3280
+ function branchUrlOf(row, lookup) {
3281
+ const branch = row.pr?.head || row.branch;
3282
+ if (!branch) return void 0;
3283
+ const repoUrl = (row.pr?.url ? repoUrlOfPrUrl(row.pr.url) : void 0) ?? (row.pr?.repo ? lookup.repo(row.pr.repo) : void 0) ?? (row.projectId ? lookup.project(row.projectId) : void 0) ?? (row.boxId ? lookup.box(row.boxId) : void 0);
3284
+ if (!repoUrl) return void 0;
3285
+ try {
3286
+ return `${repoUrl}/tree/${branch.split("/").map(encodeURIComponent).join("/")}`;
3287
+ } catch {
3288
+ return void 0;
3289
+ }
3290
+ }
3291
+ function withBranchUrl(row, lookup) {
3292
+ const branchUrl = branchUrlOf(row, lookup);
3293
+ return branchUrl ? { ...row, branchUrl } : row;
3294
+ }
3295
+ function orNullAfter(p, ms) {
3296
+ return new Promise((resolve) => {
3297
+ const t = setTimeout(() => resolve(null), ms);
3298
+ t.unref?.();
3299
+ void p.then((v) => {
3300
+ clearTimeout(t);
3301
+ resolve(v);
3302
+ });
3303
+ });
3304
+ }
3305
+ function createTimelineBackend(deps, opts = {}) {
3306
+ const sync = opts.sync ?? createGithubPrSync(deps);
3307
+ const now = opts.now ?? Date.now;
3308
+ const diffTimeout = opts.diffTimeoutMs ?? DIFF_TIMEOUT_MS;
3309
+ const diffCache = /* @__PURE__ */ new Map();
3310
+ function diffOf(box) {
3311
+ if (!deps.boxDiffStat || box.state !== "running") return Promise.resolve(null);
3312
+ let hit = diffCache.get(box.id);
3313
+ if (!hit || now() - hit.at >= DIFF_CACHE_MS) {
3314
+ hit = { at: now(), value: deps.boxDiffStat(box).catch(() => null) };
3315
+ diffCache.set(box.id, hit);
3316
+ }
3317
+ return orNullAfter(hit.value, diffTimeout);
3318
+ }
3319
+ async function liveBoxItems(boxes, tasks, events) {
3320
+ const rows = await Promise.all(
3321
+ boxes.map(async (box) => {
3322
+ const mine = sortTasksByOrder(tasks.filter((t) => t.boxId === box.id));
3323
+ const current = mine.find((t) => t.status === "in_progress");
3324
+ if (!current) return null;
3325
+ return liveBoxItem(box, mine, current, events, await diffOf(box));
3326
+ })
3327
+ );
3328
+ return rows.filter((row) => row !== null);
3329
+ }
3330
+ function liveBoxItem(box, mine, current, events, diff) {
3331
+ const since = events.find(
3332
+ (ev) => ev.type === "task.assigned" && taskIdsOf(ev).includes(current.id) || ev.type === "box.created" && ev.boxId === box.id
3333
+ );
3334
+ return {
3335
+ id: `live:task:${box.id}`,
3336
+ type: "task.in_progress",
3337
+ at: since?.at ?? current.updatedAt,
3338
+ boxId: box.id,
3339
+ boxName: box.name,
3340
+ ...box.agent ? { agent: box.agent } : {},
3341
+ ...box.branches[0] ? { branch: box.branches[0] } : {},
3342
+ ...current.managerId ? { managerId: current.managerId } : {},
3343
+ task: { id: current.id, title: current.title },
3344
+ taskIds: mine.filter((t) => t.status !== "done").map((t) => t.id),
3345
+ ...diff ? diff : {}
3346
+ };
3347
+ }
3348
+ return {
3349
+ async getTimeline(wsId, q = {}) {
3350
+ const ws = await readWorkspace(wsId);
3351
+ if (!ws) return null;
3352
+ const github = q.sync === false ? sync.status(wsId) : sync.kick(ws);
3353
+ const [events, workspaces, facts, ctx] = await Promise.all([
3354
+ readTimeline(wsId),
3355
+ listWorkspaces(),
3356
+ deps.boxFacts ? deps.boxFacts().catch(() => []) : Promise.resolve([]),
3357
+ reconcileContext(deps)
3358
+ ]);
3359
+ const tasks = await readReconciledTasks(wsId, ctx);
3360
+ const boxes = facts.filter(
3361
+ (b) => findWorkspaceContaining(workspaces, b.projectRoot)?.id === wsId
3362
+ );
3363
+ const all = aggregateTimeline(events).map((i) => ({ ...i }));
3364
+ const live = [
3365
+ ...await liveBoxItems(boxes, tasks, events),
3366
+ ...liveReadyItems(events, (repo, n) => sync.prState(repo, n), sync.synced(wsId))
3367
+ ];
3368
+ assignLanes(all, live, boxes);
3369
+ let items = all;
3370
+ if (q.before) items = items.filter((i) => i.at < q.before);
3371
+ items = items.slice(0, q.limit ?? TIMELINE_DEFAULT_LIMIT);
3372
+ const factById = new Map(facts.map((b) => [b.id, b]));
3373
+ const lookup = {
3374
+ repo: (repo) => sync.webUrlForRepo(repo),
3375
+ project: (id) => sync.webUrlForProject(id),
3376
+ box: (id) => {
3377
+ const fact = factById.get(id);
3378
+ if (!fact) return void 0;
3379
+ return sync.webUrlForRoot(fact.projectRoot) ?? sync.webUrlForProject(fact.projectId);
3380
+ }
3381
+ };
3382
+ items = items.map((i) => withBranchUrl(i, lookup));
3383
+ const liveRows = live.map((l) => withBranchUrl(l, lookup));
3384
+ const boxIds = new Set(boxes.map((b) => b.id));
3385
+ const pending2 = (deps.pendingApprovalBoxIds?.() ?? []).filter((id) => boxIds.has(id)).length;
3386
+ return {
3387
+ items,
3388
+ live: liveRows,
3389
+ ...q.since ? { summary: buildTimelineSummary(events, q.since, liveRows, pending2) } : {},
3390
+ github
3391
+ };
3392
+ }
3393
+ };
3394
+ }
3395
+ async function boxEventBase(fact, wsId) {
3396
+ const tasks = await readTasks(wsId).catch(() => []);
3397
+ const taskIds = tasks.filter((t) => t.boxId === fact.id).map((t) => t.id);
3398
+ return {
3399
+ boxId: fact.id,
3400
+ boxName: fact.name,
3401
+ ...fact.agent ? { agent: fact.agent } : {},
3402
+ ...fact.branches[0] ? { branch: fact.branches[0] } : {},
3403
+ projectId: fact.projectId,
3404
+ ...taskIds.length ? { taskIds } : {}
3405
+ };
3406
+ }
3407
+ var HUMAN = { actor: "human" };
3408
+ async function stampInWorkspace(meta, wsId, stampFor) {
3409
+ if (meta?.session) return await stampFor(meta.session, wsId).catch(() => void 0) ?? HUMAN;
3410
+ const stamp = meta?.stamp;
3411
+ if (!stamp?.managerId) return stamp;
3412
+ const rec = await findManager(stamp.managerId).catch(() => null);
3413
+ return rec?.workspaceId === wsId ? stamp : HUMAN;
3414
+ }
3415
+ function withBoxTimeline(hub, seams) {
3416
+ const { deps } = seams;
3417
+ async function factOf(id) {
3418
+ if (!deps.boxFact || id.startsWith("job:")) return void 0;
3419
+ if ((await listWorkspaces()).length === 0) return void 0;
3420
+ return deps.boxFact(id);
3421
+ }
3422
+ async function pushStatBefore(fact, push2) {
3423
+ const boxBranch = fact?.branches[0];
3424
+ if (!fact || !boxBranch) return void 0;
3425
+ const branch = push2.hostOnly && push2.as ? push2.as : boxBranch;
3426
+ const ref = pushedRef(branch, push2);
3427
+ const before = await readRefTip(fact.projectRoot, ref);
3428
+ return { repo: fact.projectRoot, ref, branch, ...before ? { before } : {} };
3429
+ }
3430
+ async function recordAround(id, type, meta, op, { push: push2, branchSwitch = false } = {}) {
3431
+ const early = type === "box.destroyed" || push2 !== void 0 || branchSwitch;
3432
+ const before = early ? await factOf(id).catch(() => void 0) : void 0;
3433
+ const previous = before?.branches[0];
3434
+ const stat10 = push2 ? await pushStatBefore(before, push2).catch(() => void 0) : void 0;
3435
+ const res = await op();
3436
+ if (!res.ok) return res;
3437
+ inBackground(async () => {
3438
+ const after = branchSwitch ? await factOf(id) : void 0;
3439
+ if (branchSwitch && (!after?.branches[0] || after.branches[0] === previous)) return;
3440
+ const fact = after ?? before ?? (type === "box.destroyed" ? void 0 : await factOf(id));
3441
+ if (!fact) return;
3442
+ const ws = await workspaceForPath(fact.projectRoot);
3443
+ if (!ws) return;
3444
+ const [stamp, base, diff] = await Promise.all([
3445
+ stampInWorkspace(meta, ws.id, seams.stampFor),
3446
+ boxEventBase(fact, ws.id),
3447
+ stat10 ? pushLineStat(stat10) : void 0
3448
+ ]);
3449
+ await recordTimelineEvent(ws.id, {
3450
+ type,
3451
+ ...stampFields(stamp),
3452
+ ...base,
3453
+ ...diff ?? {},
3454
+ ...after && previous ? { base: previous } : {}
3455
+ });
3456
+ deps.notify();
3457
+ });
3458
+ return res;
3459
+ }
3460
+ const create = hub.create.bind(hub);
3461
+ const start = hub.start.bind(hub);
3462
+ const stop = hub.stop.bind(hub);
3463
+ const destroy = hub.destroy.bind(hub);
3464
+ const gitPush = hub.gitPush.bind(hub);
3465
+ const gitPushHost = hub.gitPushHost.bind(hub);
3466
+ const gitCheckout = hub.gitCheckout.bind(hub);
3467
+ const gitNewBranch = hub.gitNewBranch.bind(hub);
3468
+ hub.create = async (input, meta) => {
3469
+ const res = await create(input, meta);
3470
+ if (!res.ok || !input.projectId) return res;
3471
+ const projectId = input.projectId;
3472
+ inBackground(async () => {
3473
+ const ws = (await listWorkspaces()).find((w) => w.projectIds.includes(projectId));
3474
+ if (!ws) return;
3475
+ const named = input.managerId ? await seams.stampFor({ managerId: input.managerId }, ws.id).catch(() => void 0) : void 0;
3476
+ const stamp = named ?? await stampInWorkspace(meta, ws.id, seams.stampFor);
3477
+ const name = input.name?.trim();
3478
+ const branch = input.opts?.useBranch ?? (name ? `agentbox/${name}` : void 0);
3479
+ const base = input.fromBranch?.trim() || await deps.projectBranch?.(projectId).catch(() => void 0);
3480
+ await recordTimelineEvent(ws.id, {
3481
+ type: "box.created",
3482
+ ...stampFields(stamp),
3483
+ key: `job:${res.jobId}:created`,
3484
+ ...name ? { boxName: name } : {},
3485
+ ...input.agent !== "none" ? { agent: input.agent } : {},
3486
+ ...branch ? { branch } : {},
3487
+ ...base ? { base } : {},
3488
+ projectId
3489
+ });
3490
+ deps.notify();
3491
+ });
3492
+ return res;
3493
+ };
3494
+ hub.start = (id, meta) => recordAround(id, "box.started", meta, () => start(id, meta));
3495
+ hub.stop = (id, meta) => recordAround(id, "box.stopped", meta, () => stop(id, meta));
3496
+ hub.destroy = (id, o, meta) => recordAround(id, "box.destroyed", meta, () => destroy(id, o, meta));
3497
+ hub.gitPush = (id, input, meta) => recordAround(id, "git.push", meta, () => gitPush(id, input, meta), {
3498
+ push: { ...input?.remote ? { remote: input.remote } : {} }
3499
+ });
3500
+ hub.gitPushHost = (id, input, meta) => recordAround(id, "git.push", meta, () => gitPushHost(id, input, meta), {
3501
+ push: { hostOnly: true, ...input?.as ? { as: input.as } : {} }
3502
+ });
3503
+ hub.gitCheckout = (id, branch, args, meta) => args?.length ? gitCheckout(id, branch, args, meta) : recordAround(id, "box.branch", meta, () => gitCheckout(id, branch, args, meta), {
3504
+ branchSwitch: true
3505
+ });
3506
+ hub.gitNewBranch = (id, input, meta) => recordAround(id, "box.branch", meta, () => gitNewBranch(id, input, meta), {
3507
+ branchSwitch: true
3508
+ });
3509
+ return hub;
3510
+ }
3511
+
3512
+ // lib/backend/box-facts.ts
3513
+ var STATE_PROBE_TIMEOUT_MS = 3e3;
3514
+ function boxFactOf(b) {
3515
+ const root = b.projectRoot ?? b.workspacePath ?? b.id;
3516
+ const tree = b.gitWorktrees?.[0];
3517
+ const branches = [
3518
+ tree?.sanctionedBranch,
3519
+ tree?.branch,
3520
+ b.cloud?.sanctionedBranch,
3521
+ b.cloud?.workspaceBranch
3522
+ ].filter((x) => Boolean(x));
3523
+ const agent = b.lastAgent === "claude-code" ? "claude" : b.lastAgent;
3524
+ return {
3525
+ id: b.id,
3526
+ name: b.name,
3527
+ branches: [...new Set(branches)],
3528
+ ...b.state ? { state: b.state } : {},
3529
+ ...agent ? { agent } : {},
3530
+ projectRoot: root,
3531
+ projectId: hashProjectPath(root)
3532
+ };
3533
+ }
3534
+ function withTimeout(p, ms) {
3535
+ return new Promise((resolve) => {
3536
+ const t = setTimeout(() => resolve(void 0), ms);
3537
+ t.unref?.();
3538
+ p.then(
3539
+ (v) => {
3540
+ clearTimeout(t);
3541
+ resolve(v);
3542
+ },
3543
+ () => {
3544
+ clearTimeout(t);
3545
+ resolve(void 0);
3546
+ }
3547
+ );
3548
+ });
3549
+ }
3550
+ function createBoxFactSeams(src) {
3551
+ const recordOf = /* @__PURE__ */ new WeakMap();
3552
+ const remember = (fact, rec) => {
3553
+ recordOf.set(fact, rec);
3554
+ return fact;
3555
+ };
3556
+ return {
3557
+ async boxFacts() {
3558
+ return (await src.listBoxes()).map((b) => remember(boxFactOf(b), b));
3559
+ },
3560
+ async boxFact(id, opts) {
3561
+ const rec = await src.readBoxRecord(id);
3562
+ if (!rec) return void 0;
3563
+ let state;
3564
+ if (opts?.withState) {
3565
+ state = rec.provider && rec.provider !== "docker" ? rec.cloud?.lastState : await withTimeout(
3566
+ src.providerForBox(rec).then((p) => p.probeState(rec)),
3567
+ STATE_PROBE_TIMEOUT_MS
3568
+ );
3569
+ }
3570
+ return remember(boxFactOf(state ? { ...rec, state } : rec), rec);
3571
+ },
3572
+ async boxDiffStat(fact) {
3573
+ const box = recordOf.get(fact) ?? await src.readBoxRecord(fact.id);
3574
+ if (!box) return null;
3575
+ const provider = await src.providerForBox(box);
3576
+ const r = await provider.exec(box, ["git", "diff", "--shortstat"], { cwd: BOX_WORKSPACE });
3577
+ return r.exitCode === 0 ? parseShortstat(r.stdout) : null;
3578
+ }
3579
+ };
3580
+ }
3581
+
3582
+ // lib/backend/box-prs.ts
3583
+ import { stat as stat6 } from "node:fs/promises";
3584
+ var STATE_OF_EVENT = {
3585
+ "pr.opened": "open",
3586
+ "pr.ready": "ready",
3587
+ "pr.merged": "merged",
3588
+ "pr.closed": "closed"
3589
+ };
3590
+ var LOG_STATE_RANK = { merged: 3, closed: 2, ready: 1, open: 0 };
3591
+ function push(map, key, pr) {
3592
+ const list = map.get(key);
3593
+ if (!list) map.set(key, [pr]);
3594
+ else if (!list.includes(pr)) list.push(pr);
3595
+ }
3596
+ function indexTimelinePrs(events, prState) {
3597
+ const prs = /* @__PURE__ */ new Map();
3598
+ for (const ev of events) {
3599
+ const state = STATE_OF_EVENT[ev.type];
3600
+ if (!state || !ev.pr?.repo || typeof ev.pr.number !== "number") continue;
3601
+ const key = `${ev.pr.repo}#${String(ev.pr.number)}`;
3602
+ let row = prs.get(key);
3603
+ if (!row) {
3604
+ row = {
3605
+ pr: { repo: ev.pr.repo, number: ev.pr.number, state, firstAt: ev.at },
3606
+ logState: state,
3607
+ boxIds: /* @__PURE__ */ new Set(),
3608
+ branches: /* @__PURE__ */ new Set()
3609
+ };
3610
+ prs.set(key, row);
3611
+ }
3612
+ if (ev.at < row.pr.firstAt) row.pr.firstAt = ev.at;
3613
+ if (LOG_STATE_RANK[state] > LOG_STATE_RANK[row.logState]) row.logState = state;
3614
+ if (ev.pr.url && !row.pr.url) row.pr.url = ev.pr.url;
3615
+ if (ev.boxId) row.boxIds.add(ev.boxId);
3616
+ if (ev.pr.head) row.branches.add(ev.pr.head);
3617
+ if (ev.branch) row.branches.add(ev.branch);
3618
+ }
3619
+ const index = { byBoxId: /* @__PURE__ */ new Map(), byBranch: /* @__PURE__ */ new Map() };
3620
+ for (const row of prs.values()) {
3621
+ row.pr.state = prState?.(row.pr.repo, row.pr.number) ?? row.logState;
3622
+ for (const id of row.boxIds) push(index.byBoxId, id, row.pr);
3623
+ for (const br of row.branches) push(index.byBranch, br, row.pr);
3624
+ }
3625
+ return index;
3626
+ }
3627
+ function isActive(pr) {
3628
+ return pr.state === "open" || pr.state === "ready";
3629
+ }
3630
+ function pickBoxPr(candidates) {
3631
+ let best;
3632
+ for (const c of candidates) {
3633
+ if (!best) {
3634
+ best = c;
3635
+ continue;
3636
+ }
3637
+ if (isActive(c) !== isActive(best)) {
3638
+ if (isActive(c)) best = c;
3639
+ continue;
3640
+ }
3641
+ if (c.firstAt > best.firstAt || c.firstAt === best.firstAt && c.number > best.number) {
3642
+ best = c;
3643
+ }
3644
+ }
3645
+ if (!best) return void 0;
3646
+ return {
3647
+ repo: best.repo,
3648
+ number: best.number,
3649
+ ...best.url ? { url: best.url } : {},
3650
+ state: best.state
3651
+ };
3652
+ }
3653
+ function branchesOf(box) {
3654
+ const out = /* @__PURE__ */ new Set();
3655
+ if (box.branch) out.add(box.branch);
3656
+ for (const wt of box.gitWorktrees ?? []) if (wt.branch) out.add(wt.branch);
3657
+ return [...out];
3658
+ }
3659
+ function prForBox(box, indexes, wsId) {
3660
+ const byId = [];
3661
+ for (const idx2 of indexes.values()) byId.push(...idx2.byBoxId.get(box.id) ?? []);
3662
+ if (byId.length) return pickBoxPr(byId);
3663
+ const idx = wsId ? indexes.get(wsId) : void 0;
3664
+ if (!idx) return void 0;
3665
+ const byBranch = [];
3666
+ for (const br of branchesOf(box)) {
3667
+ for (const c of idx.byBranch.get(br) ?? []) if (!byBranch.includes(c)) byBranch.push(c);
3668
+ }
3669
+ return pickBoxPr(byBranch);
3670
+ }
3671
+ var NONE = () => void 0;
3672
+ function createBoxPrLookup(opts = {}) {
3673
+ const readEvents = opts.readEvents ?? ((wsId) => readTimeline(wsId));
3674
+ const cache2 = /* @__PURE__ */ new Map();
3675
+ async function indexOf(ws) {
3676
+ const dir = await resolveWorkspaceDir(ws.id);
3677
+ if (!dir) return null;
3678
+ const st = await stat6(timelineFile(dir)).catch(() => null);
3679
+ if (!st) {
3680
+ cache2.delete(ws.id);
3681
+ return null;
3682
+ }
3683
+ const stamp = `${String(st.mtimeMs)}:${String(st.size)}:${String(opts.sync?.statesVersion() ?? 0)}`;
3684
+ const hit = cache2.get(ws.id);
3685
+ if (hit?.stamp === stamp) return hit.index;
3686
+ const prState = opts.sync ? (repo, n) => opts.sync.prState(repo, n) : void 0;
3687
+ const index = indexTimelinePrs(await readEvents(ws.id), prState);
3688
+ cache2.set(ws.id, { stamp, index });
3689
+ return index;
3690
+ }
3691
+ return {
3692
+ async resolver(wsByProject) {
3693
+ try {
3694
+ const records = await listWorkspaces();
3695
+ if (records.length === 0) {
3696
+ cache2.clear();
3697
+ return NONE;
3698
+ }
3699
+ const indexes = /* @__PURE__ */ new Map();
3700
+ await Promise.all(
3701
+ records.map(async (ws) => {
3702
+ const idx = await indexOf(ws).catch(() => null);
3703
+ if (idx) indexes.set(ws.id, idx);
3704
+ })
3705
+ );
3706
+ const listed = new Set(records.map((r) => r.id));
3707
+ for (const id of cache2.keys()) if (!listed.has(id)) cache2.delete(id);
3708
+ if (indexes.size === 0) return NONE;
3709
+ return (box) => {
3710
+ const wsId = wsByProject.get(box.projectId) ?? (box.projectRoot ? findWorkspaceContaining(records, box.projectRoot)?.id : void 0);
3711
+ return prForBox(box, indexes, wsId);
3712
+ };
3713
+ } catch {
3714
+ return NONE;
3715
+ }
3716
+ }
3717
+ };
3718
+ }
3719
+
3720
+ // lib/backend/managers.ts
3721
+ import { stat as stat7 } from "node:fs/promises";
3722
+ import { homedir as homedir9, hostname as osHostname } from "node:os";
3723
+
3724
+ // lib/backend/errors.ts
3725
+ var TMUX_MISSING = "tmux is not installed on the hub host; a hub-run manager lives in a tmux session (brew install tmux)";
3726
+
3727
+ // lib/backend/managers.ts
3728
+ function err(message) {
3729
+ return { ok: false, error: message };
3730
+ }
3731
+ function invalid(message) {
3732
+ return { ok: false, error: message, invalid: true };
3733
+ }
3734
+ function messageOf(e) {
3735
+ return e instanceof Error ? e.message : String(e);
3736
+ }
3737
+ var BACKGROUND_STOP_NOTICE = "The Claude session keeps running in Claude's background daemon; only this hub's terminal for it was closed. End the session itself with `claude stop <id>`.";
3738
+ var TITLE_RETRY_MS = 10 * 60 * 1e3;
3739
+ function createManagerBackend(deps, opts) {
3740
+ const hostname = deps.hostname ?? osHostname;
3741
+ const probe = {
3742
+ hostname,
3743
+ ...deps.managerExec ? { exec: deps.managerExec } : {},
3744
+ ...deps.isPidAlive ? { isPidAlive: deps.isPidAlive } : {},
3745
+ ...deps.processStartTime ? { processStartTime: deps.processStartTime } : {}
3746
+ };
3747
+ function storeIsLocal(rec) {
3748
+ return rec.kind === "hub" || rec.host === hostname();
3749
+ }
3750
+ const lookupTitle = opts.sessionTitle ?? sessionTitle;
3751
+ const now = opts.now ?? Date.now;
3752
+ const titleMisses = /* @__PURE__ */ new Map();
3753
+ async function withTitle(raw) {
3754
+ let rec = raw;
3755
+ if (rec.title === UNTITLED_SESSION) {
3756
+ rec = { ...raw };
3757
+ delete rec.title;
3758
+ }
3759
+ if (rec.title || !rec.sessionId || !storeIsLocal(rec)) return rec;
3760
+ const sessionId = rec.sessionId;
3761
+ const miss = titleMisses.get(rec.id);
3762
+ if (miss && miss.sessionId === sessionId && now() - miss.at < TITLE_RETRY_MS) return rec;
3763
+ const title = await lookupTitle(rec.agent, rec.cwd, sessionId).catch(() => null);
3764
+ if (!title || title === UNTITLED_SESSION) {
3765
+ titleMisses.set(rec.id, { sessionId, at: now() });
3766
+ return rec;
3767
+ }
3768
+ titleMisses.delete(rec.id);
3769
+ await patchManager(
3770
+ rec.workspaceId,
3771
+ rec.id,
3772
+ (cur) => cur.sessionId === sessionId && (!cur.title || cur.title === UNTITLED_SESSION) ? { ...cur, title } : cur
3773
+ ).catch(() => null);
3774
+ return { ...rec, title };
3775
+ }
3776
+ const lookupBackground = opts.claudeBackground ?? createBackgroundSessionLookup(deps.managerExec ? { exec: deps.managerExec } : {});
3777
+ async function daemonSession(rec, fresh = false) {
3778
+ if (rec.agent !== "claude" || !rec.sessionId || !storeIsLocal(rec)) return void 0;
3779
+ return liveBackgroundSession(rec, await lookupBackground({ fresh }));
3780
+ }
3781
+ async function effectiveStatus(rec) {
3782
+ if (await daemonSession(rec)) return "running";
3783
+ return managerStatus(rec, probe);
3784
+ }
3785
+ function backgroundResumeRefusal(rec, s) {
3786
+ return `manager ${rec.id} is still running as a Claude background session (${s.id}); attach to it instead of resuming it`;
3787
+ }
3788
+ const lookupTurn = opts.sessionTurn ?? sessionTurn;
3789
+ async function managerStamp(rec) {
3790
+ const turn = rec.sessionId && storeIsLocal(rec) ? await lookupTurn(rec.agent, rec.cwd, rec.sessionId).catch(() => void 0) : void 0;
3791
+ return {
3792
+ actor: "manager",
3793
+ managerId: rec.id,
3794
+ ...turn ? { turn: turn.turn, ...turn.prompt ? { prompt: turn.prompt } : {} } : {}
3795
+ };
3796
+ }
3797
+ async function timelineStamp(ref, wsId) {
3798
+ const rec = "managerId" in ref ? await findManager(ref.managerId) : await findManagerBySession(ref.agent, ref.sessionId);
3799
+ if (!rec || wsId !== void 0 && rec.workspaceId !== wsId) return void 0;
3800
+ return managerStamp(rec);
3801
+ }
3802
+ async function recordManagerEvent(rec, type, meta) {
3803
+ await recordTimelineEvent(rec.workspaceId, {
3804
+ type,
3805
+ ...stampFields(await stampInWorkspace(meta, rec.workspaceId, timelineStamp)),
3806
+ managerId: rec.id,
3807
+ agent: rec.agent
3808
+ });
3809
+ }
3810
+ async function knownPr(wsId, number, repo) {
3811
+ const hits = (await readTimeline(wsId).catch(() => [])).filter(
3812
+ (ev) => ev.pr?.number === number && ev.pr.repo && (!repo || ev.pr.repo === repo)
3813
+ );
3814
+ const last = hits.at(-1)?.pr;
3815
+ if (last && new Set(hits.map((ev) => ev.pr.repo)).size === 1) return last;
3816
+ return { repo: repo ?? "", number, title: "", url: "", base: "", head: "" };
3817
+ }
3818
+ async function viewsOf(ws, ctx) {
3819
+ const records = await readReconciledManagers(ws.id, ctx);
3820
+ if (records.length === 0) return [];
3821
+ const tasks = await readTasks(ws.id);
3822
+ const snap = records.some(
3823
+ (r) => r.agent === "claude" && storeIsLocal(r)
3824
+ ) ? await lookupBackground() : void 0;
3825
+ const claimed = /* @__PURE__ */ new Set();
3826
+ for (const r of records) {
3827
+ claimed.add(managerSessionName(r.id));
3828
+ if (r.tmuxSession) claimed.add(r.tmuxSession);
3829
+ }
3830
+ return Promise.all(
3831
+ records.map(async (raw) => {
3832
+ const rec = await withTitle(raw);
3833
+ const local = snap !== void 0 && rec.agent === "claude" && storeIsLocal(rec);
3834
+ const background = local ? backgroundFor(rec, snap) : void 0;
3835
+ const inDaemon = local ? liveBackgroundSession(rec, snap) : void 0;
3836
+ const status = background || inDaemon ? "running" : await managerStatus(rec, probe);
3837
+ const own = managerSessionName(rec.id);
3838
+ const attachSession = background && snap?.managerTmux.some((t) => t.session === own) ? own : null;
3839
+ const terminalSession = local && snap && rec.kind === "external" && status === "running" ? terminalSessionFor(rec, snap, claimed) : void 0;
3840
+ const lastExit = status === "stopped" && rec.kind === "hub" && rec.lastExit === void 0 ? await readManagerExit(ws.id, rec.id, { legacy: usesLegacySession(rec) }) : void 0;
3841
+ return toManagerView(rec, {
3842
+ status,
3843
+ hostname: hostname(),
3844
+ workspaceName: ws.name,
3845
+ tasks,
3846
+ ...background ? { background, attachSession } : {},
3847
+ ...terminalSession ? { terminalSession } : {},
3848
+ ...lastExit === void 0 ? {} : { lastExit }
3849
+ });
3850
+ })
3851
+ );
3852
+ }
3853
+ async function viewOf(id) {
3854
+ const rec = await findManager(id);
3855
+ if (!rec) return null;
3856
+ const ws = await readWorkspace(rec.workspaceId);
3857
+ if (!ws) return null;
3858
+ return (await viewsOf(ws, await reconcileContext(deps))).find((m) => m.id === id) ?? null;
3859
+ }
3860
+ async function autoWorkspaceRefusal(cwd) {
3861
+ const home = await canonicalWorkspaceRoot(homedir9());
3862
+ const what = cwd === "/" ? "is the filesystem root" : cwd === home ? "is your home folder" : home.startsWith(`${cwd}/`) ? "contains your home folder" : null;
3863
+ if (what) {
3864
+ return `not creating a workspace at ${cwd}: it ${what}. Register the project folder instead: agentbox workspace add <project folder>`;
3865
+ }
3866
+ const st = await stat7(cwd).catch(() => null);
3867
+ if (!st?.isDirectory()) return `folder does not exist on this hub: ${cwd}`;
3868
+ return null;
3869
+ }
3870
+ async function legacyManagerFor(wsId, agent, cwd) {
3871
+ const candidates = (await readManagers(wsId)).filter(
3872
+ (m) => usesLegacySession(m) && !m.sessionId && m.agent === agent && m.cwd === cwd
3873
+ );
3874
+ const running = [];
3875
+ for (const m of candidates) {
3876
+ if (await managerStatus(m, probe) === "running") running.push(m.id);
3877
+ }
3878
+ return running.length === 1 ? running[0] : void 0;
3879
+ }
3880
+ async function trustedHint(managerId, cwd) {
3881
+ if (!managerId) return void 0;
3882
+ const rec = await findManager(managerId);
3883
+ if (!rec || rec.cwd !== cwd) return void 0;
3884
+ if (!rec.sessionId) return rec;
3885
+ if (rec.kind === "hub" && await managerStatus(rec, probe) === "running") return rec;
3886
+ return void 0;
3887
+ }
3888
+ async function findManagerByTmux(session) {
3889
+ for (const ws of await listWorkspaces()) {
3890
+ const hit = (await readManagers(ws.id)).find((m) => m.tmuxSession === session);
3891
+ if (hit) return hit;
3892
+ }
3893
+ return void 0;
3894
+ }
3895
+ async function tmuxHome(input, cwd) {
3896
+ const name = input.tmuxSession;
3897
+ if (!name || !MANAGER_SESSION_RE.test(name) || input.host !== hostname()) return void 0;
3898
+ const found = (await listTmuxSessions(deps.managerExec)).find((t) => t.session === name);
3899
+ if (!found) return void 0;
3900
+ const path6 = await canonicalWorkspaceRoot(found.path).catch(() => found.path);
3901
+ if (path6 !== cwd) return void 0;
3902
+ const owner = await findManager(name.slice("agentbox-manager-".length)) ?? await findManagerByTmux(name);
3903
+ if (owner) return owner.cwd === cwd ? { owner } : void 0;
3904
+ return { adopt: name };
3905
+ }
3906
+ function sortViews(views) {
3907
+ return [...views].sort((a, b) => {
3908
+ if (a.status !== b.status) return a.status === "running" ? -1 : 1;
3909
+ return b.lastSeenAt.localeCompare(a.lastSeenAt);
3910
+ });
3911
+ }
3912
+ async function answer(id) {
3913
+ const view = await viewOf(id);
3914
+ return view ? { ok: true, manager: view } : err(`unknown manager ${id}`);
3915
+ }
3916
+ return {
3917
+ async detectManager(input) {
3918
+ const cwd = await canonicalWorkspaceRoot(input.cwd);
3919
+ const home = await tmuxHome(input, cwd);
3920
+ const hinted = home?.owner ?? await trustedHint(input.managerId, cwd);
3921
+ const known = await findManagerBySession(input.agent, input.sessionId) ?? hinted ?? null;
3922
+ let ws = known ? await readWorkspace(known.workspaceId) : null;
3923
+ let workspaceCreated = false;
3924
+ if (!ws) {
3925
+ ws = findWorkspaceContaining(await listWorkspaces(), cwd);
3926
+ if (!ws) {
3927
+ const refusal = await autoWorkspaceRefusal(cwd);
3928
+ if (refusal) return invalid(refusal);
3929
+ try {
3930
+ ws = await addWorkspace(cwd);
3931
+ workspaceCreated = true;
3932
+ } catch (e) {
3933
+ return err(`could not register a workspace at ${cwd}: ${messageOf(e)}`);
3934
+ }
3935
+ }
3936
+ }
3937
+ const pidStartedAt = input.pid !== void 0 && input.host === hostname() ? await (deps.processStartTime ?? processStartTime)(input.pid).catch(() => void 0) : void 0;
3938
+ const managerId = hinted?.id ?? (known ? void 0 : await legacyManagerFor(ws.id, input.agent, cwd));
3939
+ const { manager, created, sessionChanged } = await upsertDetectedManager(ws.id, {
3940
+ agent: input.agent,
3941
+ sessionId: input.sessionId,
3942
+ cwd,
3943
+ ...input.pid !== void 0 ? { pid: input.pid } : {},
3944
+ ...pidStartedAt ? { pidStartedAt } : {},
3945
+ ...input.host ? { host: input.host } : {},
3946
+ ...managerId ? { managerId } : {},
3947
+ ...input.tmuxPane ? { tmuxPane: input.tmuxPane } : {},
3948
+ ...home?.adopt ? { tmuxSession: home.adopt } : {}
3949
+ });
3950
+ if (input.boxId) await attachBoxToManager(ws.id, manager.id, { boxId: input.boxId });
3951
+ else if (input.boxJobId) {
3952
+ await attachBoxToManager(ws.id, manager.id, { boxJobId: input.boxJobId });
3953
+ }
3954
+ if (created || sessionChanged) {
3955
+ await recordManagerEvent(manager, "manager.joined", { stamp: { actor: "manager" } });
3956
+ }
3957
+ deps.notify();
3958
+ const [view, workspace] = await Promise.all([viewOf(manager.id), opts.workspaceView(ws.id)]);
3959
+ if (!view || !workspace) return err("the manager was not written");
3960
+ return { ok: true, manager: view, workspace, created: created || workspaceCreated };
3961
+ },
3962
+ async listManagers(filter) {
3963
+ const all = await listWorkspaces();
3964
+ const wanted = filter?.workspaceId ? all.filter((w) => w.id === filter.workspaceId) : all;
3965
+ if (wanted.length === 0) return [];
3966
+ const ctx = await reconcileContext(deps);
3967
+ const views = (await Promise.all(wanted.map((ws) => viewsOf(ws, ctx)))).flat();
3968
+ return sortViews(filter?.status ? views.filter((v) => v.status === filter.status) : views);
3969
+ },
3970
+ getManager: viewOf,
3971
+ async listWorkspaceManagers(wsId) {
3972
+ const ws = await readWorkspace(wsId);
3973
+ if (!ws) return null;
3974
+ return sortViews(await viewsOf(ws, await reconcileContext(deps)));
3975
+ },
3976
+ async startManager(wsId, input, meta) {
3977
+ const ws = await readWorkspace(wsId);
3978
+ if (!ws) return err(`unknown workspace ${wsId}`);
3979
+ if (!await tmuxAvailable(deps.managerExec)) return err(TMUX_MISSING);
3980
+ if (input.sessionId && !isResumableManagerAgent(input.agent)) {
3981
+ return err(
3982
+ `session resume is only supported for ${RESUMABLE_MANAGER_AGENTS.join(", ")}, not ${input.agent}`
3983
+ );
3984
+ }
3985
+ if (input.sessionId) {
3986
+ const existing = await findManagerBySession(input.agent, input.sessionId);
3987
+ if (existing) {
3988
+ const inDaemon = await daemonSession(existing, true);
3989
+ if (inDaemon) return err(backgroundResumeRefusal(existing, inDaemon));
3990
+ try {
3991
+ if (input.restart && existing.kind === "hub" && await managerStatus(existing, probe) === "running") {
3992
+ await stopManagerSession(existing.workspaceId, existing.id, probe);
3993
+ }
3994
+ await resumeManagerSession(existing.workspaceId, existing.id, probe);
3995
+ } catch (e) {
3996
+ return err(messageOf(e));
3997
+ }
3998
+ await recordManagerEvent(existing, "manager.resumed", meta);
3999
+ deps.notify();
4000
+ return answer(existing.id);
4001
+ }
4002
+ }
4003
+ const at = (/* @__PURE__ */ new Date()).toISOString();
4004
+ const manager = {
4005
+ id: newManagerId(),
4006
+ workspaceId: ws.id,
4007
+ agent: input.agent,
4008
+ kind: "hub",
4009
+ cwd: ws.root,
4010
+ ...input.sessionId ? { sessionId: input.sessionId } : {},
4011
+ boxIds: [],
4012
+ boxJobIds: [],
4013
+ createdAt: at,
4014
+ lastSeenAt: at
4015
+ };
4016
+ try {
4017
+ await startManagerSession({
4018
+ wsId: ws.id,
4019
+ manager,
4020
+ argv: buildManagerArgv(input.agent, input.sessionId),
4021
+ ...deps.managerExec ? { exec: deps.managerExec } : {}
4022
+ });
4023
+ } catch (e) {
4024
+ return err(`could not start the manager: ${messageOf(e)}`);
4025
+ }
4026
+ await recordManagerEvent(manager, "manager.started", meta);
4027
+ deps.notify();
4028
+ return answer(manager.id);
4029
+ },
4030
+ async resumeManager(id, meta) {
4031
+ const rec = await findManager(id);
4032
+ if (!rec) return err(`unknown manager ${id}`);
4033
+ const inDaemon = await daemonSession(rec, true);
4034
+ if (inDaemon) return err(backgroundResumeRefusal(rec, inDaemon));
4035
+ if (!await tmuxAvailable(deps.managerExec)) return err(TMUX_MISSING);
4036
+ try {
4037
+ await resumeManagerSession(rec.workspaceId, id, probe);
4038
+ } catch (e) {
4039
+ return err(messageOf(e));
4040
+ }
4041
+ await recordManagerEvent(rec, "manager.resumed", meta);
4042
+ deps.notify();
4043
+ return answer(id);
4044
+ },
4045
+ async attachManager(id) {
4046
+ const rec = await findManager(id);
4047
+ if (!rec) return err(`unknown manager ${id}`);
4048
+ const snap = rec.agent === "claude" && storeIsLocal(rec) ? await lookupBackground({ fresh: true }) : void 0;
4049
+ const background = snap ? backgroundFor(rec, snap) : void 0;
4050
+ if (!background) {
4051
+ return err(
4052
+ snap && liveBackgroundSession(rec, snap) ? `manager ${id}'s Claude session may already be open in a terminal (an AgentBox tmux session in its folder, or a claude attach client); the hub attaches only to a session nothing shows` : `manager ${id} has no running Claude background session to attach to`
4053
+ );
4054
+ }
4055
+ if (!await tmuxAvailable(deps.managerExec)) return err(TMUX_MISSING);
4056
+ try {
4057
+ await attachBackgroundSession({
4058
+ wsId: rec.workspaceId,
4059
+ manager: rec,
4060
+ backgroundId: background.id,
4061
+ ...deps.managerExec ? { exec: deps.managerExec } : {}
4062
+ });
4063
+ } catch (e) {
4064
+ return err(`could not attach: ${messageOf(e)}`);
4065
+ }
4066
+ await lookupBackground({ fresh: true });
4067
+ deps.notify();
4068
+ return answer(id);
4069
+ },
4070
+ async stopManager(id, meta) {
4071
+ const rec = await findManager(id);
4072
+ if (!rec) return err(`unknown manager ${id}`);
4073
+ const inDaemon = await daemonSession(rec, true);
4074
+ if (inDaemon && rec.kind === "external") {
4075
+ await detachBackgroundSession(rec.workspaceId, id, deps.managerExec);
4076
+ await lookupBackground({ fresh: true });
4077
+ deps.notify();
4078
+ const view = await viewOf(id);
4079
+ return view ? { ok: true, manager: view, notice: BACKGROUND_STOP_NOTICE } : err(`unknown manager ${id}`);
4080
+ }
4081
+ const wasRunning = await managerStatus(rec, probe) === "running";
4082
+ try {
4083
+ await stopManagerSession(rec.workspaceId, id, probe);
4084
+ } catch (e) {
4085
+ return err(messageOf(e));
4086
+ }
4087
+ if (wasRunning) await recordManagerEvent(rec, "manager.stopped", meta);
4088
+ deps.notify();
4089
+ const stopped = await answer(id);
4090
+ return stopped.ok && inDaemon ? { ...stopped, notice: BACKGROUND_STOP_NOTICE } : stopped;
4091
+ },
4092
+ async removeManager(id, opts2 = {}) {
4093
+ const rec = await findManager(id);
4094
+ if (!rec) return err(`unknown manager ${id}`);
4095
+ if (!opts2.force && await effectiveStatus(rec) === "running") {
4096
+ return err(`manager ${id} is running; stop it before forgetting it (or force it)`);
4097
+ }
4098
+ await removeManagerRecord(rec.workspaceId, id);
4099
+ deps.notify();
4100
+ return { ok: true };
4101
+ },
4102
+ async listManagerSessions(wsId, agent) {
4103
+ const ws = await readWorkspace(wsId);
4104
+ if (!ws) return null;
4105
+ return listResumableHostSessions(ws.root, agent ?? "claude");
4106
+ },
4107
+ timelineStamp,
4108
+ async addManagerNote(id, input) {
4109
+ const rec = await findManager(id);
4110
+ if (!rec) return err(`unknown manager ${id}`);
4111
+ const event = await recordTimelineEvent(rec.workspaceId, {
4112
+ type: "manager.note",
4113
+ ...stampFields(await managerStamp(rec)),
4114
+ text: input.text,
4115
+ noteKind: input.kind ?? "note"
4116
+ });
4117
+ if (!event) return err(`the note for manager ${id} was not recorded`);
4118
+ deps.notify();
4119
+ return { ok: true, event };
4120
+ },
4121
+ async sendManagerMessage(id, input, meta) {
4122
+ const rec = await findManager(id);
4123
+ if (!rec) return err(`unknown manager ${id}`);
4124
+ const status = await managerStatus(rec, probe);
4125
+ let delivered;
4126
+ try {
4127
+ if (status === "running" && rec.kind === "hub") {
4128
+ await sendKeysToManager(
4129
+ { session: rec.tmuxSession ?? managerSessionName(rec.id) },
4130
+ input.text,
4131
+ deps.managerExec,
4132
+ opts.sleep
4133
+ );
4134
+ delivered = "session";
4135
+ } else if (status === "running") {
4136
+ if (!rec.tmuxPane || !storeIsLocal(rec)) {
4137
+ return {
4138
+ ok: false,
4139
+ code: "manager_unreachable",
4140
+ error: `manager ${id} runs in your terminal${rec.tmuxPane ? " on another machine" : " outside tmux"}, where the hub cannot type; paste the message into that session`
4141
+ };
4142
+ }
4143
+ await sendKeysToManager({ pane: rec.tmuxPane }, input.text, deps.managerExec, opts.sleep);
4144
+ delivered = "pane";
4145
+ } else {
4146
+ if (!await tmuxAvailable(deps.managerExec)) return err(TMUX_MISSING);
4147
+ await resumeManagerSession(rec.workspaceId, id, probe, { prompt: input.text });
4148
+ delivered = "resumed";
4149
+ }
4150
+ } catch (e) {
4151
+ return err(messageOf(e));
4152
+ }
4153
+ const [pr, stamp] = await Promise.all([
4154
+ input.prNumber !== void 0 ? knownPr(rec.workspaceId, input.prNumber, input.repo) : void 0,
4155
+ stampInWorkspace(meta, rec.workspaceId, timelineStamp)
4156
+ ]);
4157
+ const event = await recordTimelineEvent(rec.workspaceId, {
4158
+ type: "manager.message",
4159
+ ...stampFields(stamp),
4160
+ managerId: rec.id,
4161
+ text: input.text,
4162
+ ...pr ? { pr } : {}
4163
+ });
4164
+ deps.notify();
4165
+ const view = await viewOf(id);
4166
+ if (!view) return err(`unknown manager ${id}`);
4167
+ return { ok: true, delivered, manager: view, event };
4168
+ },
4169
+ async attachJob(managerId, jobId) {
4170
+ const rec = await findManager(managerId);
4171
+ if (!rec) return err(`unknown manager ${managerId}`);
4172
+ await attachBoxToManager(rec.workspaceId, managerId, { boxJobId: jobId });
4173
+ deps.notify();
4174
+ return { ok: true };
4175
+ },
4176
+ async managerByBox() {
4177
+ const out = /* @__PURE__ */ new Map();
4178
+ const all = await listWorkspaces();
4179
+ if (all.length === 0) return out;
4180
+ const ctx = await reconcileContext(deps);
4181
+ for (const ws of all) {
4182
+ for (const m of await readReconciledManagers(ws.id, ctx)) {
4183
+ for (const boxId of m.boxIds) out.set(boxId, m.id);
4184
+ for (const jobId of m.boxJobIds) out.set(jobId, m.id);
4185
+ }
4186
+ }
4187
+ return out;
4188
+ }
4189
+ };
4190
+ }
4191
+
4192
+ // lib/backend/workspaces.ts
4193
+ import { existsSync } from "node:fs";
4194
+ import { isAbsolute } from "node:path";
4195
+ import { statSync } from "node:fs";
4196
+ function err2(message) {
4197
+ return { ok: false, error: message };
4198
+ }
4199
+ function unknownWorkspace(id) {
4200
+ return err2(`unknown workspace ${id}`);
4201
+ }
4202
+ function createWorkspaceBackend(deps) {
4203
+ const reconcileContext2 = () => reconcileContext(deps);
4204
+ const probe = {
4205
+ ...deps.managerExec ? { exec: deps.managerExec } : {},
4206
+ ...deps.hostname ? { hostname: deps.hostname } : {},
4207
+ ...deps.isPidAlive ? { isPidAlive: deps.isPidAlive } : {},
4208
+ ...deps.processStartTime ? { processStartTime: deps.processStartTime } : {}
4209
+ };
4210
+ async function managerCounts(wsId) {
4211
+ const managers = await readManagers(wsId);
4212
+ const statuses = await Promise.all(managers.map((m) => managerStatus(m, probe)));
4213
+ return { running: statuses.filter((s) => s === "running").length, total: managers.length };
4214
+ }
4215
+ async function tasksOf(wsId, ctx) {
4216
+ return readReconciledTasks(wsId, ctx ?? await reconcileContext2());
4217
+ }
4218
+ async function viewOf(rec, ctx) {
4219
+ if (!rec) return null;
4220
+ const [tasks, managers] = await Promise.all([tasksOf(rec.id, ctx), managerCounts(rec.id)]);
4221
+ const base = toWorkspaceView(rec);
4222
+ return {
4223
+ ...base,
4224
+ taskCounts: {
4225
+ open: tasks.filter((t) => t.status !== "done").length,
4226
+ done: tasks.filter((t) => t.status === "done").length
4227
+ },
4228
+ managers
4229
+ };
4230
+ }
4231
+ async function managerRefusal(wsId, managerId) {
4232
+ if (!managerId) return null;
4233
+ const rec = await findManager(managerId);
4234
+ if (!rec) return `unknown manager ${managerId}`;
4235
+ if (rec.workspaceId !== wsId) {
4236
+ return `manager ${managerId} belongs to workspace ${rec.workspaceId}, not ${wsId}`;
4237
+ }
4238
+ return null;
4239
+ }
4240
+ async function record(wsId, input) {
4241
+ await recordTimelineEvent(wsId, input);
4242
+ }
4243
+ async function recordNote(wsId, meta, taskIds, kind = "note") {
4244
+ if (!meta?.note) return;
4245
+ await record(wsId, {
4246
+ type: "manager.note",
4247
+ ...stampFields(meta.stamp),
4248
+ text: meta.note,
4249
+ noteKind: kind,
4250
+ ...taskIds.length ? { taskIds } : {}
4251
+ });
4252
+ }
4253
+ async function taskBefore(wsId, taskId) {
4254
+ return (await readTasks(wsId).catch(() => [])).find((t) => t.id === taskId);
4255
+ }
4256
+ async function validateTarget(target) {
4257
+ if ("boxId" in target) {
4258
+ const live = await deps.liveBoxIds();
4259
+ return live.has(target.boxId) ? null : `unknown box ${target.boxId}`;
4260
+ }
4261
+ const job = (await deps.jobs()).find((j) => j.id === target.boxJobId);
4262
+ if (!job) return `unknown job ${target.boxJobId}`;
4263
+ if (job.kind === "prepare") return `job ${target.boxJobId} is an image bake, not a box create`;
4264
+ return null;
4265
+ }
4266
+ return {
4267
+ async listWorkspaces() {
4268
+ const recs = await listWorkspaces();
4269
+ if (recs.length === 0) return [];
4270
+ const ctx = await reconcileContext2();
4271
+ const views = await Promise.all(recs.map((r) => viewOf(r, ctx)));
4272
+ return views.filter((v) => v !== null);
4273
+ },
4274
+ async getWorkspace(id) {
4275
+ return viewOf(await readWorkspace(id));
4276
+ },
4277
+ async addWorkspace(input) {
4278
+ const path6 = input.path;
4279
+ if (!isAbsolute(path6)) return err2("an absolute path is required");
4280
+ if (!existsSync(path6) || !statSync(path6).isDirectory()) {
4281
+ return err2(`not a directory: ${path6}`);
4282
+ }
4283
+ try {
4284
+ const rec = await addWorkspace(path6, input.name ? { name: input.name } : {});
4285
+ deps.notify();
4286
+ const view = await viewOf(rec);
4287
+ return view ? { ok: true, workspace: view } : err2("workspace was not written");
4288
+ } catch (e) {
4289
+ return err2(e instanceof Error ? e.message : String(e));
4290
+ }
4291
+ },
4292
+ async rescanWorkspace(id) {
4293
+ const rec = await rescanWorkspace(id);
4294
+ if (!rec) return unknownWorkspace(id);
4295
+ deps.notify();
4296
+ const view = await viewOf(rec);
4297
+ return view ? { ok: true, workspace: view } : unknownWorkspace(id);
4298
+ },
4299
+ async renameWorkspace(id, name) {
4300
+ const rec = await renameWorkspace(id, name);
4301
+ if (!rec) return unknownWorkspace(id);
4302
+ deps.notify();
4303
+ const view = await viewOf(rec);
4304
+ return view ? { ok: true, workspace: view } : unknownWorkspace(id);
4305
+ },
4306
+ async removeWorkspace(id, opts = {}) {
4307
+ const rec = await readWorkspace(id);
4308
+ if (!rec) return unknownWorkspace(id);
4309
+ if (!opts.force && (await managerCounts(id)).running > 0) {
4310
+ return err2(
4311
+ "a manager of this workspace is running; stop it before removing the workspace (or force it)"
4312
+ );
4313
+ }
4314
+ await removeWorkspace(id);
4315
+ deps.notify();
4316
+ return { ok: true };
4317
+ },
4318
+ async listTasks(wsId, filter) {
4319
+ if (!await readWorkspace(wsId)) return null;
4320
+ return filterTasks(await tasksOf(wsId), filter);
4321
+ },
4322
+ async listAllTasks(filter) {
4323
+ const recs = await listWorkspaces();
4324
+ const wanted = filter?.workspaceId ? recs.filter((r) => r.id === filter.workspaceId) : recs;
4325
+ if (wanted.length === 0) return [];
4326
+ const ctx = await reconcileContext2();
4327
+ const lists = await Promise.all(
4328
+ wanted.map(async (r) => filterTasks(await tasksOf(r.id, ctx), filter))
4329
+ );
4330
+ return lists.flat();
4331
+ },
4332
+ async getTask(wsId, taskId) {
4333
+ return (await tasksOf(wsId)).find((t) => t.id === taskId) ?? null;
4334
+ },
4335
+ async addTask(wsId, input, meta) {
4336
+ if (!await readWorkspace(wsId)) return unknownWorkspace(wsId);
4337
+ const wrongManager = await managerRefusal(wsId, input.managerId);
4338
+ if (wrongManager) return { ok: false, error: wrongManager, invalid: true };
4339
+ if (input.boxId || input.boxJobId) {
4340
+ const bad = await validateTarget(
4341
+ input.boxId ? { boxId: input.boxId } : { boxJobId: input.boxJobId }
4342
+ );
4343
+ if (bad) return err2(bad);
4344
+ }
4345
+ try {
4346
+ const task = await addTask(wsId, input);
4347
+ await record(wsId, {
4348
+ type: "task.created",
4349
+ ...stampFields(meta?.stamp),
4350
+ ...!meta?.stamp?.managerId && task.managerId ? { managerId: task.managerId } : {},
4351
+ task: { id: task.id, title: task.title, to: task.status },
4352
+ taskIds: [task.id],
4353
+ ...task.projectId ? { projectId: task.projectId } : {},
4354
+ ...task.boxId ? { boxId: task.boxId } : {}
4355
+ });
4356
+ await recordNote(wsId, meta, [task.id]);
4357
+ deps.notify();
4358
+ return { ok: true, task };
4359
+ } catch (e) {
4360
+ return err2(e instanceof Error ? e.message : String(e));
4361
+ }
4362
+ },
4363
+ async updateTask(wsId, taskId, patch, meta) {
4364
+ if (!await readWorkspace(wsId)) return unknownWorkspace(wsId);
4365
+ const wrongManager = await managerRefusal(wsId, patch.managerId);
4366
+ if (wrongManager) return { ok: false, error: wrongManager, invalid: true };
4367
+ try {
4368
+ const prev = await taskBefore(wsId, taskId);
4369
+ const task = await patchTask(wsId, taskId, patch);
4370
+ if (!task) return err2(`unknown task ${taskId}`);
4371
+ if (prev && prev.status !== task.status) {
4372
+ await record(wsId, {
4373
+ type: "task.status",
4374
+ ...stampFields(meta?.stamp),
4375
+ task: { id: task.id, title: task.title, from: prev.status, to: task.status },
4376
+ taskIds: [task.id],
4377
+ ...task.boxId ? { boxId: task.boxId } : {}
4378
+ });
4379
+ }
4380
+ await recordNote(wsId, meta, [task.id]);
4381
+ deps.notify();
4382
+ return { ok: true, task };
4383
+ } catch (e) {
4384
+ return err2(e instanceof Error ? e.message : String(e));
4385
+ }
4386
+ },
4387
+ async completeTask(wsId, taskId, meta) {
4388
+ if (!await readWorkspace(wsId)) return unknownWorkspace(wsId);
4389
+ const prev = await taskBefore(wsId, taskId);
4390
+ const task = await setTaskDone(wsId, taskId);
4391
+ if (!task) return err2(`unknown task ${taskId}`);
4392
+ if (prev && prev.status !== "done") {
4393
+ await record(wsId, {
4394
+ type: "task.status",
4395
+ ...stampFields(meta?.stamp),
4396
+ task: { id: task.id, title: task.title, from: prev.status, to: "done" },
4397
+ taskIds: [task.id],
4398
+ ...task.boxId ? { boxId: task.boxId } : {}
4399
+ });
4400
+ }
4401
+ deps.notify();
4402
+ return { ok: true, task };
4403
+ },
4404
+ async removeTask(wsId, taskId, meta) {
4405
+ if (!await readWorkspace(wsId)) return unknownWorkspace(wsId);
4406
+ const prev = await taskBefore(wsId, taskId);
4407
+ if (!await removeTask(wsId, taskId)) return err2(`unknown task ${taskId}`);
4408
+ await record(wsId, {
4409
+ type: "task.removed",
4410
+ ...stampFields(meta?.stamp),
4411
+ task: { id: taskId, title: prev?.title ?? taskId, ...prev ? { from: prev.status } : {} },
4412
+ taskIds: [taskId]
4413
+ });
4414
+ deps.notify();
4415
+ return { ok: true };
4416
+ },
4417
+ async assignTasks(wsId, ids, target, meta) {
4418
+ if (!await readWorkspace(wsId)) return unknownWorkspace(wsId);
4419
+ const bad = await validateTarget(target);
4420
+ if (bad) return err2(bad);
4421
+ try {
4422
+ const tasks = await assignTasks(wsId, ids, target);
4423
+ deps.notify();
4424
+ inBackground(async () => {
4425
+ const box = "boxId" in target && deps.boxFact ? await deps.boxFact(target.boxId, { withState: true }).catch(() => void 0) : void 0;
4426
+ await record(wsId, {
4427
+ type: "task.assigned",
4428
+ ...stampFields(meta?.stamp),
4429
+ taskIds: tasks.map((t) => t.id),
4430
+ ...tasks.length === 1 ? { task: { id: tasks[0].id, title: tasks[0].title } } : {},
4431
+ ..."boxId" in target ? { boxId: target.boxId } : {},
4432
+ ...box ? { boxName: box.name } : {},
4433
+ ...box?.agent ? { agent: box.agent } : {},
4434
+ ...box?.branches[0] ? { branch: box.branches[0] } : {},
4435
+ // "Gave more work to a running box" rather than "planned into a new one".
4436
+ boxRunning: box?.state === "running"
4437
+ });
4438
+ await recordNote(wsId, meta, ids);
4439
+ deps.notify();
4440
+ });
4441
+ return { ok: true, tasks };
4442
+ } catch (e) {
4443
+ return err2(e instanceof Error ? e.message : String(e));
4444
+ }
4445
+ },
4446
+ async unassignTasks(wsId, ids, meta) {
4447
+ if (!await readWorkspace(wsId)) return unknownWorkspace(wsId);
4448
+ try {
4449
+ const tasks = await unassignTasks(wsId, ids);
4450
+ await record(wsId, {
4451
+ type: "task.unassigned",
4452
+ ...stampFields(meta?.stamp),
4453
+ taskIds: tasks.map((t) => t.id),
4454
+ ...tasks.length === 1 ? { task: { id: tasks[0].id, title: tasks[0].title } } : {}
4455
+ });
4456
+ deps.notify();
4457
+ return { ok: true, tasks };
4458
+ } catch (e) {
4459
+ return err2(e instanceof Error ? e.message : String(e));
4460
+ }
4461
+ },
4462
+ async reorderTasks(wsId, ids, meta) {
4463
+ if (!await readWorkspace(wsId)) return unknownWorkspace(wsId);
4464
+ try {
4465
+ const tasks = await reorderTasks(wsId, ids);
4466
+ await recordNote(wsId, meta, ids, "replan");
4467
+ deps.notify();
4468
+ return { ok: true, tasks };
4469
+ } catch (e) {
4470
+ return err2(e instanceof Error ? e.message : String(e));
4471
+ }
4472
+ },
4473
+ // ── hooks getData() calls, so the dashboard read stays in one place ──
4474
+ async workspaceIdByProject() {
4475
+ const out = /* @__PURE__ */ new Map();
4476
+ for (const ws of await listWorkspaces()) {
4477
+ for (const pid of ws.projectIds) out.set(pid, ws.id);
4478
+ }
4479
+ return out;
4480
+ },
4481
+ async taskSummaries() {
4482
+ const byBox = /* @__PURE__ */ new Map();
4483
+ const byJob = /* @__PURE__ */ new Map();
4484
+ const recs = await listWorkspaces();
4485
+ if (recs.length === 0) return { byBox, byJob };
4486
+ const ctx = await reconcileContext2();
4487
+ for (const ws of recs) {
4488
+ const tasks = await tasksOf(ws.id, ctx);
4489
+ for (const boxId of new Set(
4490
+ tasks.map((t) => t.boxId).filter((b) => Boolean(b))
4491
+ )) {
4492
+ const summary = taskSummaryForBox(tasks, { boxId });
4493
+ if (summary) byBox.set(boxId, summary);
4494
+ }
4495
+ for (const jobId of new Set(
4496
+ tasks.map((t) => t.boxJobId).filter((b) => Boolean(b))
4497
+ )) {
4498
+ const summary = taskSummaryForBox(tasks, { boxJobId: jobId });
4499
+ if (summary) byJob.set(jobId, summary);
4500
+ }
4501
+ }
4502
+ return { byBox, byJob };
4503
+ }
4504
+ };
4505
+ }
4506
+
2719
4507
  // lib/prompts/askers.ts
2720
4508
  function collectAsker() {
2721
4509
  const collected = [];
@@ -2883,9 +4671,9 @@ async function identityRules(dir, onLog) {
2883
4671
  const sets = parseReplacementsSection(text);
2884
4672
  if (!(IDENTITY_RULE_SET in sets)) return [];
2885
4673
  return resolveRuleRefs([IDENTITY_RULE_SET], sets, "clone");
2886
- } catch (err) {
4674
+ } catch (err3) {
2887
4675
  onLog?.(
2888
- `clone: ignoring the replacements: block (${err instanceof Error ? err.message : String(err)})`
4676
+ `clone: ignoring the replacements: block (${err3 instanceof Error ? err3.message : String(err3)})`
2889
4677
  );
2890
4678
  return [];
2891
4679
  }
@@ -2996,7 +4784,7 @@ function controlPlaneCreateRequest(input, repoUrl) {
2996
4784
 
2997
4785
  // lib/boxes/create-project.ts
2998
4786
  import { execFile } from "node:child_process";
2999
- import { mkdir, rm as rm4, stat as stat5, writeFile as writeFile5 } from "node:fs/promises";
4787
+ import { mkdir, rm as rm4, stat as stat8, writeFile as writeFile5 } from "node:fs/promises";
3000
4788
  import path3 from "node:path";
3001
4789
  import { promisify } from "node:util";
3002
4790
  var execFileAsync = promisify(execFile);
@@ -3018,7 +4806,7 @@ async function createProjectDir(input, deps = defaultDeps) {
3018
4806
  }
3019
4807
  const nameError = validateProjectName(input.name);
3020
4808
  if (nameError) return { ok: false, error: nameError };
3021
- const pst = await stat5(parent).catch(() => null);
4809
+ const pst = await stat8(parent).catch(() => null);
3022
4810
  if (!pst || !pst.isDirectory()) return { ok: false, error: `not a directory: ${parent}` };
3023
4811
  const enclosing = await findProjectRoot(parent);
3024
4812
  if (enclosing.hasAgentboxYaml) {
@@ -3028,20 +4816,20 @@ async function createProjectDir(input, deps = defaultDeps) {
3028
4816
  };
3029
4817
  }
3030
4818
  const target = path3.join(parent, input.name);
3031
- if (await stat5(target).catch(() => null))
4819
+ if (await stat8(target).catch(() => null))
3032
4820
  return { ok: false, error: `already exists: ${target}` };
3033
4821
  try {
3034
4822
  await mkdir(target);
3035
- } catch (err) {
3036
- return { ok: false, error: `cannot create ${target}: ${errorMessage(err)}` };
4823
+ } catch (err3) {
4824
+ return { ok: false, error: `cannot create ${target}: ${errorMessage(err3)}` };
3037
4825
  }
3038
4826
  if (input.git) {
3039
4827
  try {
3040
4828
  await initGitRepo(target, deps.execGit);
3041
- } catch (err) {
4829
+ } catch (err3) {
3042
4830
  await rm4(target, { recursive: true, force: true }).catch(() => {
3043
4831
  });
3044
- return { ok: false, error: `git init failed: ${errorMessage(err)}` };
4832
+ return { ok: false, error: `git init failed: ${errorMessage(err3)}` };
3045
4833
  }
3046
4834
  }
3047
4835
  const root = (await findProjectRoot(target)).root;
@@ -3060,13 +4848,13 @@ async function initGitRepo(dir, execGit) {
3060
4848
  await run(["-c", "user.name=AgentBox", "-c", "user.email=agentbox@localhost", ...commit]);
3061
4849
  }
3062
4850
  }
3063
- function errorMessage(err) {
3064
- if (err instanceof Error) {
3065
- const stderr = err.stderr;
4851
+ function errorMessage(err3) {
4852
+ if (err3 instanceof Error) {
4853
+ const stderr = err3.stderr;
3066
4854
  if (typeof stderr === "string" && stderr.trim()) return stderr.trim();
3067
- return err.message;
4855
+ return err3.message;
3068
4856
  }
3069
- return String(err);
4857
+ return String(err3);
3070
4858
  }
3071
4859
 
3072
4860
  // lib/hub-backend.ts
@@ -3347,7 +5135,7 @@ async function listProjects(boxes) {
3347
5135
  const newestByRoot = /* @__PURE__ */ new Map();
3348
5136
  for (const b of boxes) {
3349
5137
  const root = projectRootOf(b);
3350
- if (isHubWorkerClone(root) || !existsSync(root)) continue;
5138
+ if (isHubWorkerClone(root) || !existsSync2(root)) continue;
3351
5139
  const createdAt = Date.parse(b.createdAt) || Date.now();
3352
5140
  const existing = boxByRoot.get(root);
3353
5141
  if (!existing) boxByRoot.set(root, { root, provider: b.provider ?? "docker", createdAt });
@@ -3363,7 +5151,7 @@ async function listProjects(boxes) {
3363
5151
  const pathById = /* @__PURE__ */ new Map();
3364
5152
  const recordedOrigin = /* @__PURE__ */ new Map();
3365
5153
  for (const e of (await listProjectsConfigured()).filter(
3366
- (e2) => !isHubWorkerClone(e2.originalPath) && existsSync(e2.originalPath)
5154
+ (e2) => !isHubWorkerClone(e2.originalPath) && existsSync2(e2.originalPath)
3367
5155
  )) {
3368
5156
  const box = boxByRoot.get(e.originalPath);
3369
5157
  const newest = newestByRoot.get(e.originalPath);
@@ -3423,7 +5211,7 @@ async function resolveProjectPath(projectId) {
3423
5211
  for (const b of await listBoxes()) {
3424
5212
  const root = projectRootOf(b);
3425
5213
  if (hashProjectPath(root) !== projectId) continue;
3426
- if (isHubWorkerClone(root) || !existsSync(root)) return root;
5214
+ if (isHubWorkerClone(root) || !existsSync2(root)) return root;
3427
5215
  await registerProject(root).catch(() => {
3428
5216
  });
3429
5217
  return root;
@@ -3577,7 +5365,7 @@ var freshnessCache = /* @__PURE__ */ new Map();
3577
5365
  async function providerBaseFreshness(id) {
3578
5366
  if (id === "docker") {
3579
5367
  try {
3580
- const { evaluateDockerBaseFreshness } = await import("./dist-LOZYEDXA.js");
5368
+ const { evaluateDockerBaseFreshness } = await import("./dist-Y2263LMY.js");
3581
5369
  return await evaluateDockerBaseFreshness();
3582
5370
  } catch {
3583
5371
  return { state: "unknown" };
@@ -3646,7 +5434,7 @@ async function providerBakeDiff(id) {
3646
5434
  }
3647
5435
  }
3648
5436
  async function loadRemoteDockerHostViews() {
3649
- const rd = await import("./dist-LMXU56B2.js");
5437
+ const rd = await import("./dist-XUNBQ4WM.js");
3650
5438
  const prepared = rd.readPreparedState();
3651
5439
  const cfg = await loadEffectiveConfig(os2.homedir());
3652
5440
  const dflt = (cfg.effective.box.remoteDockerHost || "").trim();
@@ -3717,8 +5505,8 @@ function mapApproval(p) {
3717
5505
  }
3718
5506
  async function looksLikeProject(dir) {
3719
5507
  const [git, yaml] = await Promise.all([
3720
- stat6(path4.join(dir, ".git")).then(() => true).catch(() => false),
3721
- stat6(path4.join(dir, "agentbox.yaml")).then(() => true).catch(() => false)
5508
+ stat9(path4.join(dir, ".git")).then(() => true).catch(() => false),
5509
+ stat9(path4.join(dir, "agentbox.yaml")).then(() => true).catch(() => false)
3722
5510
  ]);
3723
5511
  return git || yaml;
3724
5512
  }
@@ -3726,7 +5514,7 @@ async function browseDirHost(dir) {
3726
5514
  try {
3727
5515
  const target = dir && dir.trim() ? dir.trim() : os2.homedir();
3728
5516
  if (!path4.isAbsolute(target)) return { ok: false, error: "an absolute path is required" };
3729
- const st = await stat6(target).catch(() => null);
5517
+ const st = await stat9(target).catch(() => null);
3730
5518
  if (!st || !st.isDirectory()) return { ok: false, error: `not a directory: ${target}` };
3731
5519
  const dirents = await readdir4(target, { withFileTypes: true });
3732
5520
  const entries = [];
@@ -3735,7 +5523,7 @@ async function browseDirHost(dir) {
3735
5523
  if (!d.isDirectory() && !d.isSymbolicLink()) continue;
3736
5524
  const full = path4.join(target, d.name);
3737
5525
  if (d.isSymbolicLink()) {
3738
- const ls = await stat6(full).catch(() => null);
5526
+ const ls = await stat9(full).catch(() => null);
3739
5527
  if (!ls || !ls.isDirectory()) continue;
3740
5528
  }
3741
5529
  entries.push({ name: d.name, path: full, isProject: await looksLikeProject(full) });
@@ -3743,8 +5531,8 @@ async function browseDirHost(dir) {
3743
5531
  entries.sort((a, b) => a.name.localeCompare(b.name));
3744
5532
  const parent = path4.dirname(target);
3745
5533
  return { ok: true, path: target, parent: parent === target ? null : parent, entries };
3746
- } catch (err) {
3747
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
5534
+ } catch (err3) {
5535
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
3748
5536
  }
3749
5537
  }
3750
5538
  var SHA_RE = /^[0-9a-f]{7,40}$/i;
@@ -3773,8 +5561,8 @@ async function branchListHost(repo) {
3773
5561
  branches.push(b);
3774
5562
  }
3775
5563
  return { ok: true, current: await hostBranchOf(repo), branches };
3776
- } catch (err) {
3777
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
5564
+ } catch (err3) {
5565
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
3778
5566
  }
3779
5567
  }
3780
5568
  async function verifyFromBranch(repo, ref) {
@@ -3850,11 +5638,11 @@ async function runLifecycle(id, op, hydrate) {
3850
5638
  const provider = await providerForBox(box);
3851
5639
  await op(box, provider);
3852
5640
  return { ok: true };
3853
- } catch (err) {
3854
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
5641
+ } catch (err3) {
5642
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
3855
5643
  }
3856
5644
  }
3857
- var errMsg = (err) => err instanceof Error ? err.message : String(err);
5645
+ var errMsg = (err3) => err3 instanceof Error ? err3.message : String(err3);
3858
5646
  async function hubWriteSshConfig(box, provider) {
3859
5647
  try {
3860
5648
  const cfg = await loadEffectiveConfig(box.workspacePath);
@@ -3864,8 +5652,8 @@ async function hubWriteSshConfig(box, provider) {
3864
5652
  cfg.effective.ssh.autoConfig,
3865
5653
  (m) => console.warn(`[hub] ${m}`)
3866
5654
  );
3867
- } catch (err) {
3868
- console.warn(`[hub] ssh-config write for ${box.name} failed: ${errMsg(err)}`);
5655
+ } catch (err3) {
5656
+ console.warn(`[hub] ssh-config write for ${box.name} failed: ${errMsg(err3)}`);
3869
5657
  }
3870
5658
  }
3871
5659
  async function resolveBoxProvider(id, hydrate) {
@@ -3900,8 +5688,8 @@ async function gitOp(id, fn, hydrate) {
3900
5688
  };
3901
5689
  }
3902
5690
  return { ok: true, stdout: r.stdout, stderr: r.stderr };
3903
- } catch (err) {
3904
- return { ok: false, error: errMsg(err) };
5691
+ } catch (err3) {
5692
+ return { ok: false, error: errMsg(err3) };
3905
5693
  }
3906
5694
  }
3907
5695
  async function sanctionBranch(box, branch) {
@@ -3938,9 +5726,9 @@ async function sanctionBranch(box, branch) {
3938
5726
  autoApproveSafeHostActions: box.autoApproveSafeHostActions,
3939
5727
  agent: box.agents?.[0] ?? box.lastAgent
3940
5728
  });
3941
- } catch (err) {
5729
+ } catch (err3) {
3942
5730
  console.warn(
3943
- `[hub] sanction ${branch} for ${box.name}: persisted, but the relay did not pick it up (${errMsg(err)}); pushes to ${branch} stay gated until \`agentbox relay restart\`.`
5731
+ `[hub] sanction ${branch} for ${box.name}: persisted, but the relay did not pick it up (${errMsg(err3)}); pushes to ${branch} stay gated until \`agentbox relay restart\`.`
3944
5732
  );
3945
5733
  }
3946
5734
  }
@@ -4255,9 +6043,37 @@ async function probeOpenTargets() {
4255
6043
  }
4256
6044
  function createHubBackend(handle) {
4257
6045
  const hydrate = (bid) => hydrateRegisteredBox(handle, bid);
6046
+ const backendDeps = {
6047
+ notify: () => handle.hubNotifier.notify(),
6048
+ async liveBoxIds() {
6049
+ const [local, registered] = await Promise.all([
6050
+ listBoxes().catch(() => []),
6051
+ handle.store.listBoxes().catch(() => [])
6052
+ ]);
6053
+ return /* @__PURE__ */ new Set([...local.map((b) => b.id), ...registered.map((r) => r.boxId)]);
6054
+ },
6055
+ jobs: () => loadQueue().catch(() => []),
6056
+ ...createBoxFactSeams({
6057
+ listBoxes: () => listBoxes(),
6058
+ readBoxRecord: async (id) => (await readState()).boxes.find((b) => b.id === id),
6059
+ providerForBox
6060
+ }),
6061
+ pendingApprovalBoxIds: () => handle.prompts.all().map((p) => p.boxId),
6062
+ async projectBranch(projectId) {
6063
+ const root = await resolveProjectPath(projectId);
6064
+ return root ? readCurrentBranch(root) : void 0;
6065
+ }
6066
+ };
6067
+ const workspaces = createWorkspaceBackend(backendDeps);
6068
+ const prSync = createGithubPrSync(backendDeps);
6069
+ const timeline = createTimelineBackend(backendDeps, { sync: prSync });
6070
+ const boxPrs = createBoxPrLookup({ sync: prSync });
6071
+ const managers = createManagerBackend(backendDeps, {
6072
+ workspaceView: (id) => workspaces.getWorkspace(id)
6073
+ });
4258
6074
  async function projectRepoUrl(projectId) {
4259
6075
  const path6 = await resolveProjectPath(projectId);
4260
- if (path6 && existsSync(path6)) {
6076
+ if (path6 && existsSync2(path6)) {
4261
6077
  const origin = await hostOriginOf(path6);
4262
6078
  if (origin) return origin;
4263
6079
  }
@@ -4296,11 +6112,24 @@ function createHubBackend(handle) {
4296
6112
  });
4297
6113
  return { ok: true, jobId: id };
4298
6114
  }
4299
- return {
6115
+ const hub = {
6116
+ ...workspaces,
6117
+ ...managers,
6118
+ ...timeline,
4300
6119
  // authMode is layered on by source.ts (an env-derived concern), so the host
4301
6120
  // backend produces everything else.
4302
6121
  async getData(opts) {
4303
6122
  const [listed, jobs] = await Promise.all([listBoxes(), loadQueue()]);
6123
+ const [workspaceViews, wsByProject, taskSummaries, managerByBox] = await Promise.all([
6124
+ workspaces.listWorkspaces().catch(() => []),
6125
+ workspaces.workspaceIdByProject().catch(() => /* @__PURE__ */ new Map()),
6126
+ workspaces.taskSummaries().catch(() => ({
6127
+ byBox: /* @__PURE__ */ new Map(),
6128
+ byJob: /* @__PURE__ */ new Map()
6129
+ })),
6130
+ managers.managerByBox().catch(() => /* @__PURE__ */ new Map())
6131
+ ]);
6132
+ const prOf = await boxPrs.resolver(wsByProject);
4304
6133
  if (opts?.live) await applyLiveCloudStates(listed);
4305
6134
  const liveIds = new Set(listed.map((b) => b.id));
4306
6135
  const liveSandboxIds = new Set(
@@ -4310,9 +6139,16 @@ function createHubBackend(handle) {
4310
6139
  for (const j of jobs) {
4311
6140
  if (j.kind === "prepare") continue;
4312
6141
  if (j.boxId && liveIds.has(j.boxId)) continue;
6142
+ const jobTasks = taskSummaries.byJob.get(j.id);
6143
+ const jobManager = managerByBox.get(j.id);
6144
+ const withTasks2 = (box) => ({
6145
+ ...box,
6146
+ ...jobTasks ? { tasks: jobTasks } : {},
6147
+ ...jobManager ? { managerId: jobManager } : {}
6148
+ });
4313
6149
  if (j.status === "queued" || j.status === "running")
4314
- jobBoxes.push(mapJobToBox(j, "creating"));
4315
- else if (j.status === "failed") jobBoxes.push(mapJobToBox(j, "error"));
6150
+ jobBoxes.push(withTasks2(mapJobToBox(j, "creating")));
6151
+ else if (j.status === "failed") jobBoxes.push(withTasks2(mapJobToBox(j, "error")));
4316
6152
  }
4317
6153
  const allRegistrations = await handle.store.listBoxes().catch(() => []);
4318
6154
  const registered = allRegistrations.filter(
@@ -4323,7 +6159,7 @@ function createHubBackend(handle) {
4323
6159
  const repoGrouped = /* @__PURE__ */ new Map();
4324
6160
  for (const b of listed) {
4325
6161
  const root = projectRootOf(b);
4326
- if (!isHubWorkerClone(root) && existsSync(root)) continue;
6162
+ if (!isHubWorkerClone(root) && existsSync2(root)) continue;
4327
6163
  const reg = regByBoxId.get(b.id);
4328
6164
  if (!reg) continue;
4329
6165
  const { id, repo } = registrationProjectKey(reg);
@@ -4364,16 +6200,33 @@ function createHubBackend(handle) {
4364
6200
  });
4365
6201
  }
4366
6202
  const hasGitOf = boxHasGitResolver();
6203
+ const withTasks = (box) => {
6204
+ const summary = taskSummaries.byBox.get(box.id);
6205
+ const managerId = managerByBox.get(box.id);
6206
+ const pr = prOf(box);
6207
+ return {
6208
+ ...box,
6209
+ ...summary ? { tasks: summary } : {},
6210
+ ...managerId ? { managerId } : {},
6211
+ ...pr ? { pr } : {}
6212
+ };
6213
+ };
4367
6214
  const listedBoxes = await Promise.all(
4368
6215
  listed.map(
4369
- async (b) => mapBox(b, repoGrouped.get(b.id), regByBoxId.get(b.id)?.originUrl, await hasGitOf(b))
6216
+ async (b) => withTasks(
6217
+ mapBox(b, repoGrouped.get(b.id), regByBoxId.get(b.id)?.originUrl, await hasGitOf(b))
6218
+ )
4370
6219
  )
4371
6220
  );
4372
6221
  return {
4373
6222
  user: currentUser(),
4374
6223
  github: LOCAL_GITHUB,
4375
- projects,
4376
- boxes: [...jobBoxes, ...listedBoxes, ...registeredBoxes],
6224
+ projects: projects.map((p) => {
6225
+ const wsId = wsByProject.get(p.id);
6226
+ return wsId ? { ...p, workspaceId: wsId } : p;
6227
+ }),
6228
+ workspaces: workspaceViews,
6229
+ boxes: [...jobBoxes, ...listedBoxes, ...registeredBoxes.map(withTasks)],
4377
6230
  // Block-mode approvals live in-process on the relay handle, not the Store.
4378
6231
  approvals: handle.prompts.all().map(mapApproval),
4379
6232
  providers: await withRemoteProviders(listProviders(jobs)),
@@ -4436,8 +6289,8 @@ function createHubBackend(handle) {
4436
6289
  }
4437
6290
  await deleteJob(jobId);
4438
6291
  return { ok: true };
4439
- } catch (err) {
4440
- return { ok: false, error: errMsg(err) };
6292
+ } catch (err3) {
6293
+ return { ok: false, error: errMsg(err3) };
4441
6294
  }
4442
6295
  }
4443
6296
  const box = await findOrHydrateBox(id, hydrate);
@@ -4450,8 +6303,8 @@ function createHubBackend(handle) {
4450
6303
  await provider.destroy(box, { keepSnapshot: opts?.keepSnapshot });
4451
6304
  await syncAgentboxSshConfig().catch(() => {
4452
6305
  });
4453
- } catch (err) {
4454
- return { ok: false, error: errMsg(err) };
6306
+ } catch (err3) {
6307
+ return { ok: false, error: errMsg(err3) };
4455
6308
  }
4456
6309
  await reapStoreState(handle, id);
4457
6310
  return { ok: true };
@@ -4466,8 +6319,8 @@ function createHubBackend(handle) {
4466
6319
  if (!box) return { ok: false, error: `box ${id} not found` };
4467
6320
  await setBoxDisplayName(id, displayName);
4468
6321
  return { ok: true };
4469
- } catch (err) {
4470
- return { ok: false, error: errMsg(err) };
6322
+ } catch (err3) {
6323
+ return { ok: false, error: errMsg(err3) };
4471
6324
  }
4472
6325
  },
4473
6326
  // Mirror POST /admin/prompts/answer's block branch, in-process: resolving
@@ -4494,7 +6347,7 @@ function createHubBackend(handle) {
4494
6347
  const refusal = persistentRefusal((input.provider ?? "docker").trim());
4495
6348
  if (refusal) return { ok: false, error: refusal };
4496
6349
  }
4497
- if (input.repoUrl || !workspace || !existsSync(workspace)) {
6350
+ if (input.repoUrl || !workspace || !existsSync2(workspace)) {
4498
6351
  return await createViaControlPlane(
4499
6352
  persistent === void 0 ? input : { ...input, opts: { ...input.opts, persistent } }
4500
6353
  );
@@ -4503,7 +6356,7 @@ function createHubBackend(handle) {
4503
6356
  const spec = parseProviderSpec(provider);
4504
6357
  if (spec.remoteHost) {
4505
6358
  const alias = spec.remoteHost;
4506
- const rd = await import("./dist-LMXU56B2.js");
6359
+ const rd = await import("./dist-XUNBQ4WM.js");
4507
6360
  if (!rd.getHostAlias(alias)) {
4508
6361
  return {
4509
6362
  ok: false,
@@ -4515,11 +6368,11 @@ function createHubBackend(handle) {
4515
6368
  return { ok: false, error: `unknown provider ${provider}` };
4516
6369
  } else {
4517
6370
  if (!isProviderConfigured(provider)) {
4518
- const hub = isHubRoutableProvider(provider) ? await resolveRemoteHub() : null;
4519
- if (hub) {
6371
+ const hub2 = isHubRoutableProvider(provider) ? await resolveRemoteHub() : null;
6372
+ if (hub2) {
4520
6373
  return {
4521
6374
  ok: false,
4522
- error: `create ${provider} boxes on the control box (${hub.url}) \u2014 this host mirrors its state`
6375
+ error: `create ${provider} boxes on the control box (${hub2.url}) \u2014 this host mirrors its state`
4523
6376
  };
4524
6377
  }
4525
6378
  return { ok: false, error: `provider ${provider} is not set up on this host` };
@@ -4561,8 +6414,8 @@ function createHubBackend(handle) {
4561
6414
  ...o.carryYes ? { carryYes: true } : {},
4562
6415
  ...o.borrowCredentials !== void 0 ? { borrowCredentials: o.borrowCredentials } : {}
4563
6416
  });
4564
- } catch (err) {
4565
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
6417
+ } catch (err3) {
6418
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
4566
6419
  }
4567
6420
  if (gated.cancelled) return { ok: false, error: "create cancelled" };
4568
6421
  if (gated.carryDeclined && !isHubWorkerClone(workspace)) {
@@ -4641,14 +6494,14 @@ function createHubBackend(handle) {
4641
6494
  });
4642
6495
  handle.pokeQueue();
4643
6496
  return { ok: true, jobId: job.id };
4644
- } catch (err) {
4645
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
6497
+ } catch (err3) {
6498
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
4646
6499
  }
4647
6500
  },
4648
6501
  async createPreflight(input) {
4649
6502
  const empty = { prompts: [], unavailable: [] };
4650
6503
  const workspace = input.projectId ? await resolveProjectPath(input.projectId) : null;
4651
- if (!workspace || !existsSync(workspace)) {
6504
+ if (!workspace || !existsSync2(workspace)) {
4652
6505
  return {
4653
6506
  prompts: [],
4654
6507
  unavailable: [
@@ -4673,11 +6526,11 @@ function createHubBackend(handle) {
4673
6526
  ...input.carryAsk ? { carryAsk: true } : {}
4674
6527
  });
4675
6528
  return { prompts: asker.collected, unavailable: res.unavailable };
4676
- } catch (err) {
6529
+ } catch (err3) {
4677
6530
  return {
4678
6531
  ...empty,
4679
6532
  unavailable: [
4680
- { topic: "carry", reason: err instanceof Error ? err.message : String(err) }
6533
+ { topic: "carry", reason: err3 instanceof Error ? err3.message : String(err3) }
4681
6534
  ]
4682
6535
  };
4683
6536
  }
@@ -4692,8 +6545,8 @@ function createHubBackend(handle) {
4692
6545
  }
4693
6546
  const res = await mod.setCredentials(fields);
4694
6547
  return res.ok ? { ok: true } : { ok: false, error: res.error ?? "invalid credentials" };
4695
- } catch (err) {
4696
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
6548
+ } catch (err3) {
6549
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
4697
6550
  }
4698
6551
  },
4699
6552
  async checkProviderSize(id, size) {
@@ -4733,8 +6586,8 @@ function createHubBackend(handle) {
4733
6586
  });
4734
6587
  handle.pokeQueue();
4735
6588
  return { ok: true, jobId: job.id };
4736
- } catch (err) {
4737
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
6589
+ } catch (err3) {
6590
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
4738
6591
  }
4739
6592
  });
4740
6593
  prepareEnqueueChain.set(
@@ -4754,13 +6607,13 @@ function createHubBackend(handle) {
4754
6607
  if (!absPath || !path4.isAbsolute(absPath)) {
4755
6608
  return { ok: false, error: "an absolute path is required" };
4756
6609
  }
4757
- const st = await stat6(absPath).catch(() => null);
6610
+ const st = await stat9(absPath).catch(() => null);
4758
6611
  if (!st || !st.isDirectory()) return { ok: false, error: `not a directory: ${absPath}` };
4759
6612
  const root = (await findProjectRoot(absPath)).root;
4760
6613
  await registerProject(root);
4761
6614
  return { ok: true, id: hashProjectPath(root), path: root };
4762
- } catch (err) {
4763
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
6615
+ } catch (err3) {
6616
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
4764
6617
  }
4765
6618
  },
4766
6619
  async createProject(input) {
@@ -4768,8 +6621,8 @@ function createHubBackend(handle) {
4768
6621
  if (!made.ok) return made;
4769
6622
  try {
4770
6623
  await registerProject(made.root);
4771
- } catch (err) {
4772
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
6624
+ } catch (err3) {
6625
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
4773
6626
  }
4774
6627
  return { ok: true, id: hashProjectPath(made.root), path: made.root };
4775
6628
  },
@@ -4785,8 +6638,8 @@ function createHubBackend(handle) {
4785
6638
  if (hasBox || hasJob) return { ok: false, error: "project has boxes; delete them first" };
4786
6639
  await unregisterProject(projectId);
4787
6640
  return { ok: true };
4788
- } catch (err) {
4789
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
6641
+ } catch (err3) {
6642
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
4790
6643
  }
4791
6644
  },
4792
6645
  browseDir: (dir) => browseDirHost(dir),
@@ -4886,7 +6739,10 @@ function createHubBackend(handle) {
4886
6739
  id,
4887
6740
  async (box, provider) => {
4888
6741
  const r = await boxGitCheckout(provider, box, branch, args);
4889
- if (r.exitCode === 0) await sanctionBranch(box, branch);
6742
+ if (r.exitCode === 0 && !args?.length) {
6743
+ const head = await boxGitCurrentBranch(provider, box);
6744
+ if (head) await sanctionBranch(box, head);
6745
+ }
4890
6746
  return r;
4891
6747
  },
4892
6748
  hydrate
@@ -4916,8 +6772,8 @@ function createHubBackend(handle) {
4916
6772
  error: (r.stderr || `git status exited ${String(r.exitCode)}`).trim()
4917
6773
  };
4918
6774
  return parseGitStatus(r.stdout);
4919
- } catch (err) {
4920
- return { ok: false, error: errMsg(err) };
6775
+ } catch (err3) {
6776
+ return { ok: false, error: errMsg(err3) };
4921
6777
  }
4922
6778
  },
4923
6779
  async webUrl(id) {
@@ -4936,8 +6792,8 @@ function createHubBackend(handle) {
4936
6792
  const values = await readServiceUrlFields(rp.provider, rp.box, fields);
4937
6793
  const signInUrl = serviceSignInUrl(url, values);
4938
6794
  return { ok: true, url, signInUrl, signInPending: signInUrl === null };
4939
- } catch (err) {
4940
- return { ok: false, error: errMsg(err) };
6795
+ } catch (err3) {
6796
+ return { ok: false, error: errMsg(err3) };
4941
6797
  }
4942
6798
  },
4943
6799
  async vncUrl(id, opts) {
@@ -4949,8 +6805,8 @@ function createHubBackend(handle) {
4949
6805
  if (why) return { ok: false, error: why };
4950
6806
  const url = await resolveVncViewerUrl(rp.box, rp.provider, opts ?? {});
4951
6807
  return { ok: true, url, ...opts?.ttl === void 0 ? {} : { ttl: opts.ttl } };
4952
- } catch (err) {
4953
- return { ok: false, error: errMsg(err) };
6808
+ } catch (err3) {
6809
+ return { ok: false, error: errMsg(err3) };
4954
6810
  }
4955
6811
  },
4956
6812
  // ── box service control ──
@@ -4990,8 +6846,8 @@ function createHubBackend(handle) {
4990
6846
  const results = await boxRestartServices(rp.provider, rp.box, names);
4991
6847
  const failed = results.filter((r) => r.result.exitCode !== 0).map((r) => r.name);
4992
6848
  return failed.length > 0 ? { ok: false, error: `failed to restart: ${failed.join(", ")}` } : { ok: true };
4993
- } catch (err) {
4994
- return { ok: false, error: errMsg(err) };
6849
+ } catch (err3) {
6850
+ return { ok: false, error: errMsg(err3) };
4995
6851
  }
4996
6852
  },
4997
6853
  // ── checkpoints (durable project assets) ──
@@ -5057,8 +6913,8 @@ function createHubBackend(handle) {
5057
6913
  if (noticeId) await clearRelayNotice(box.id, noticeId).catch(() => {
5058
6914
  });
5059
6915
  }
5060
- } catch (err) {
5061
- return { ok: false, error: errMsg(err) };
6916
+ } catch (err3) {
6917
+ return { ok: false, error: errMsg(err3) };
5062
6918
  }
5063
6919
  },
5064
6920
  async listCheckpoints(opts) {
@@ -5079,8 +6935,8 @@ function createHubBackend(handle) {
5079
6935
  async removeCheckpoint(opts) {
5080
6936
  try {
5081
6937
  return await removeCheckpointEverywhere(opts.project, opts.ref, opts.provider);
5082
- } catch (err) {
5083
- return { ok: false, error: errMsg(err) };
6938
+ } catch (err3) {
6939
+ return { ok: false, error: errMsg(err3) };
5084
6940
  }
5085
6941
  },
5086
6942
  // ── prune (fleet cleanup) ──
@@ -5142,8 +6998,8 @@ function createHubBackend(handle) {
5142
6998
  failed,
5143
6999
  reaped
5144
7000
  };
5145
- } catch (err) {
5146
- return { kind: "error", error: errMsg(err) };
7001
+ } catch (err3) {
7002
+ return { kind: "error", error: errMsg(err3) };
5147
7003
  }
5148
7004
  },
5149
7005
  // ── agent state ──
@@ -5168,8 +7024,8 @@ function createHubBackend(handle) {
5168
7024
  error: (r.stderr || r.stdout || `logs exited ${String(r.exitCode)}`).trim(),
5169
7025
  exitCode: r.exitCode
5170
7026
  };
5171
- } catch (err) {
5172
- return { ok: false, error: errMsg(err) };
7027
+ } catch (err3) {
7028
+ return { ok: false, error: errMsg(err3) };
5173
7029
  }
5174
7030
  },
5175
7031
  async boxLogAttach(id, opts) {
@@ -5203,8 +7059,8 @@ function createHubBackend(handle) {
5203
7059
  return { ok: false, error: "provider.buildAttach returned an empty argv" };
5204
7060
  }
5205
7061
  return { ok: true, argv: spec.argv, env: spec.env, cleanup: spec.cleanup };
5206
- } catch (err) {
5207
- return { ok: false, error: errMsg(err) };
7062
+ } catch (err3) {
7063
+ return { ok: false, error: errMsg(err3) };
5208
7064
  }
5209
7065
  },
5210
7066
  async openTargets() {
@@ -5223,8 +7079,8 @@ function createHubBackend(handle) {
5223
7079
  timeout: 2e4
5224
7080
  });
5225
7081
  return { ok: true };
5226
- } catch (err) {
5227
- const e = err;
7082
+ } catch (err3) {
7083
+ const e = err3;
5228
7084
  return { ok: false, error: cleanCliError(e) };
5229
7085
  }
5230
7086
  },
@@ -5234,7 +7090,7 @@ function createHubBackend(handle) {
5234
7090
  },
5235
7091
  async addRemoteDockerHost(alias, ssh, opts) {
5236
7092
  try {
5237
- const rd = await import("./dist-LMXU56B2.js");
7093
+ const rd = await import("./dist-XUNBQ4WM.js");
5238
7094
  const trimmedSsh = ssh.trim();
5239
7095
  if (!rd.isValidAlias(alias)) {
5240
7096
  return {
@@ -5277,13 +7133,13 @@ function createHubBackend(handle) {
5277
7133
  });
5278
7134
  }
5279
7135
  return { ok: true };
5280
- } catch (err) {
5281
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
7136
+ } catch (err3) {
7137
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
5282
7138
  }
5283
7139
  },
5284
7140
  async removeRemoteDockerHost(alias) {
5285
7141
  try {
5286
- const rd = await import("./dist-LMXU56B2.js");
7142
+ const rd = await import("./dist-XUNBQ4WM.js");
5287
7143
  rd.removeHostAlias(alias);
5288
7144
  rd.removePreparedHost(alias);
5289
7145
  const cfg = await loadEffectiveConfig(os2.homedir());
@@ -5295,13 +7151,13 @@ function createHubBackend(handle) {
5295
7151
  (b) => b.provider === "remote-docker" && typeof b.cloud?.sandboxId === "string" && b.cloud.sandboxId.startsWith(`${alias}/`)
5296
7152
  ).map((b) => b.name);
5297
7153
  return { ok: true, boxesAffected };
5298
- } catch (err) {
5299
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
7154
+ } catch (err3) {
7155
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
5300
7156
  }
5301
7157
  },
5302
7158
  async bakeRemoteDockerHost(alias) {
5303
7159
  try {
5304
- const rd = await import("./dist-LMXU56B2.js");
7160
+ const rd = await import("./dist-XUNBQ4WM.js");
5305
7161
  if (!rd.getHostAlias(alias)) return { ok: false, error: `no such host alias ${alias}` };
5306
7162
  const spec = `docker:${alias}`;
5307
7163
  const existing = (await loadQueue()).find(
@@ -5311,8 +7167,8 @@ function createHubBackend(handle) {
5311
7167
  const { job } = await enqueuePrepareJob({ providerName: spec });
5312
7168
  handle.pokeQueue();
5313
7169
  return { ok: true, jobId: job.id };
5314
- } catch (err) {
5315
- return { ok: false, error: err instanceof Error ? err.message : String(err) };
7170
+ } catch (err3) {
7171
+ return { ok: false, error: err3 instanceof Error ? err3.message : String(err3) };
5316
7172
  }
5317
7173
  },
5318
7174
  // ── workspace sync / clone ──
@@ -5337,8 +7193,8 @@ function createHubBackend(handle) {
5337
7193
  copied: result.copied,
5338
7194
  conflicts: result.conflicts
5339
7195
  };
5340
- } catch (err) {
5341
- return { ok: false, error: errMsg(err) };
7196
+ } catch (err3) {
7197
+ return { ok: false, error: errMsg(err3) };
5342
7198
  }
5343
7199
  },
5344
7200
  async backupBox(id, input) {
@@ -5379,8 +7235,8 @@ function createHubBackend(handle) {
5379
7235
  });
5380
7236
  state = true;
5381
7237
  databases = r.databases;
5382
- } catch (err) {
5383
- console.warn(`[hub] could not capture ${target.agent} state: ${errMsg(err)}`);
7238
+ } catch (err3) {
7239
+ console.warn(`[hub] could not capture ${target.agent} state: ${errMsg(err3)}`);
5384
7240
  }
5385
7241
  }
5386
7242
  }
@@ -5411,8 +7267,8 @@ function createHubBackend(handle) {
5411
7267
  pruned,
5412
7268
  wroteGitignore
5413
7269
  };
5414
- } catch (err) {
5415
- return { ok: false, error: errMsg(err) };
7270
+ } catch (err3) {
7271
+ return { ok: false, error: errMsg(err3) };
5416
7272
  }
5417
7273
  },
5418
7274
  async listBots(projectId) {
@@ -5420,8 +7276,8 @@ function createHubBackend(handle) {
5420
7276
  if (!root) return { ok: false, error: `unknown project ${projectId}` };
5421
7277
  try {
5422
7278
  return { ok: true, bots: await listBots(botWorkspaceRoot(root)) };
5423
- } catch (err) {
5424
- return { ok: false, error: errMsg(err) };
7279
+ } catch (err3) {
7280
+ return { ok: false, error: errMsg(err3) };
5425
7281
  }
5426
7282
  },
5427
7283
  async prepareRestore(projectId, input) {
@@ -5497,8 +7353,8 @@ function createHubBackend(handle) {
5497
7353
  agent,
5498
7354
  persistent
5499
7355
  };
5500
- } catch (err) {
5501
- return { ok: false, error: errMsg(err) };
7356
+ } catch (err3) {
7357
+ return { ok: false, error: errMsg(err3) };
5502
7358
  }
5503
7359
  },
5504
7360
  async prepareClone(id, input) {
@@ -5567,22 +7423,35 @@ function createHubBackend(handle) {
5567
7423
  ...persistent !== void 0 ? { persistent } : {},
5568
7424
  ...rp.box.borrowedCredentials?.length ? { borrowedCredentials: [...rp.box.borrowedCredentials] } : {}
5569
7425
  };
5570
- } catch (err) {
5571
- return { ok: false, error: errMsg(err) };
7426
+ } catch (err3) {
7427
+ return { ok: false, error: errMsg(err3) };
5572
7428
  }
5573
7429
  }
5574
7430
  };
7431
+ const createBox = hub.create;
7432
+ hub.create = async (input, meta) => {
7433
+ const res = await createBox(input, meta);
7434
+ if (res.ok && input.managerId) {
7435
+ const attached = await managers.attachJob(input.managerId, res.jobId).catch((e) => ({ ok: false, error: String(e) }));
7436
+ if (!attached.ok) console.warn(`[hub] create ${res.jobId}: ${attached.error}`);
7437
+ }
7438
+ return res;
7439
+ };
7440
+ return withBoxTimeline(hub, {
7441
+ deps: backendDeps,
7442
+ stampFor: (ref, wsId) => managers.timelineStamp(ref, wsId)
7443
+ });
5575
7444
  }
5576
7445
 
5577
7446
  // lib/host-carried.ts
5578
- import { existsSync as existsSync3, readdirSync, statSync } from "node:fs";
5579
- import { homedir as homedir10 } from "node:os";
5580
- import { join as join10 } from "node:path";
7447
+ import { existsSync as existsSync4, readdirSync, statSync as statSync2 } from "node:fs";
7448
+ import { homedir as homedir11 } from "node:os";
7449
+ import { join as join11 } from "node:path";
5581
7450
 
5582
7451
  // lib/agent-catalog.ts
5583
- import { existsSync as existsSync2 } from "node:fs";
5584
- import { homedir as homedir9 } from "node:os";
5585
- import { join as join9 } from "node:path";
7452
+ import { existsSync as existsSync3 } from "node:fs";
7453
+ import { homedir as homedir10 } from "node:os";
7454
+ import { join as join10 } from "node:path";
5586
7455
  var AGENT_LABELS = {
5587
7456
  claude: "Claude",
5588
7457
  codex: "Codex",
@@ -5591,8 +7460,8 @@ var AGENT_LABELS = {
5591
7460
  openclaw: "OpenClaw"
5592
7461
  };
5593
7462
  function collectAgentCatalog(specs, opts = {}) {
5594
- const home = opts.home ?? homedir9();
5595
- const exists = opts.exists ?? existsSync2;
7463
+ const home = opts.home ?? homedir10();
7464
+ const exists = opts.exists ?? existsSync3;
5596
7465
  return specs.map((spec) => ({
5597
7466
  id: spec.id,
5598
7467
  label: AGENT_LABELS[spec.id] ?? spec.id,
@@ -5603,7 +7472,7 @@ function collectAgentCatalog(specs, opts = {}) {
5603
7472
  function isSetUp(spec, home, exists) {
5604
7473
  for (const sp of spec.staticPaths) {
5605
7474
  if (sp.stagedAs === "state") continue;
5606
- if (exists(join9(home, ...sp.hostHomeRel))) return true;
7475
+ if (exists(join10(home, ...sp.hostHomeRel))) return true;
5607
7476
  }
5608
7477
  const backup = spec.credential?.hostBackup;
5609
7478
  return backup != null && exists(backup);
@@ -5618,7 +7487,7 @@ function realChildDirs(p) {
5618
7487
  return filterSkillNames(
5619
7488
  readdirSync(p).filter((name) => {
5620
7489
  try {
5621
- return statSync(join10(p, name)).isDirectory();
7490
+ return statSync2(join11(p, name)).isDirectory();
5622
7491
  } catch {
5623
7492
  return false;
5624
7493
  }
@@ -5632,13 +7501,13 @@ function tildePath(rel) {
5632
7501
  return `~/${rel.join("/")}`;
5633
7502
  }
5634
7503
  function collectHostCarried(specs, opts = {}) {
5635
- const home = opts.home ?? homedir10();
5636
- const exists = opts.exists ?? existsSync3;
7504
+ const home = opts.home ?? homedir11();
7505
+ const exists = opts.exists ?? existsSync4;
5637
7506
  const childDirs = opts.childDirs ?? realChildDirs;
5638
7507
  const out = [];
5639
- const agentsDir = join10(home, ".agents");
7508
+ const agentsDir = join11(home, ".agents");
5640
7509
  if (exists(agentsDir)) {
5641
- const skillsDir = join10(agentsDir, "skills");
7510
+ const skillsDir = join11(agentsDir, "skills");
5642
7511
  out.push({
5643
7512
  agent: "agents",
5644
7513
  label: "Shared agent skills",
@@ -5647,13 +7516,13 @@ function collectHostCarried(specs, opts = {}) {
5647
7516
  ...exists(skillsDir) ? { skills: childDirs(skillsDir) } : {}
5648
7517
  });
5649
7518
  }
5650
- const opencodeEnabled = exists(join10(home, ".config", "opencode")) || exists(join10(home, ".local", "share", "opencode"));
7519
+ const opencodeEnabled = exists(join11(home, ".config", "opencode")) || exists(join11(home, ".local", "share", "opencode"));
5651
7520
  for (const spec of specs) {
5652
7521
  if (spec.id === "opencode" && !opencodeEnabled) continue;
5653
7522
  for (const sp of spec.staticPaths) {
5654
- const abs = join10(home, ...sp.hostHomeRel);
7523
+ const abs = join11(home, ...sp.hostHomeRel);
5655
7524
  if (!exists(abs)) continue;
5656
- const skillsDir = join10(abs, "skills");
7525
+ const skillsDir = join11(abs, "skills");
5657
7526
  const isSkillHost = exists(skillsDir);
5658
7527
  out.push({
5659
7528
  agent: spec.id,
@@ -5668,7 +7537,7 @@ function collectHostCarried(specs, opts = {}) {
5668
7537
  [".claude.json", "Claude project config", "config"],
5669
7538
  [".gitconfig", "Git identity", "identity"]
5670
7539
  ]) {
5671
- if (exists(join10(home, rel))) {
7540
+ if (exists(join11(home, rel))) {
5672
7541
  out.push({
5673
7542
  agent: rel === ".gitconfig" ? "host" : "claude",
5674
7543
  label,
@@ -5682,7 +7551,7 @@ function collectHostCarried(specs, opts = {}) {
5682
7551
 
5683
7552
  // lib/git-auth.ts
5684
7553
  import { execFile as execFile3 } from "node:child_process";
5685
- import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
7554
+ import { existsSync as existsSync5, readFileSync as readFileSync2 } from "node:fs";
5686
7555
  import { promisify as promisify3 } from "node:util";
5687
7556
  var execFileAsync3 = promisify3(execFile3);
5688
7557
  var TOKEN_KEYS = ["GH_TOKEN", "GITHUB_TOKEN"];
@@ -5712,7 +7581,7 @@ function loadHubGitToken() {
5712
7581
  }
5713
7582
  }
5714
7583
  const path6 = secretsEnvPath();
5715
- if (!existsSync4(path6)) return void 0;
7584
+ if (!existsSync5(path6)) return void 0;
5716
7585
  let parsed;
5717
7586
  try {
5718
7587
  parsed = parseEnvFile(readFileSync2(path6, "utf8"));
@@ -5736,9 +7605,9 @@ async function configureHubGitCredentials(log) {
5736
7605
  await execFileAsync3("gh", ["auth", "setup-git"], { timeout: 3e4 });
5737
7606
  log("git credentials configured from the stored GitHub token (gh auth setup-git)");
5738
7607
  return "configured";
5739
- } catch (err) {
7608
+ } catch (err3) {
5740
7609
  log(
5741
- `git credential setup failed (${err instanceof Error ? err.message : String(err)}) \u2014 clone/push will fall back to whatever git can authenticate with`
7610
+ `git credential setup failed (${err3 instanceof Error ? err3.message : String(err3)}) \u2014 clone/push will fall back to whatever git can authenticate with`
5742
7611
  );
5743
7612
  return "failed";
5744
7613
  }
@@ -5778,7 +7647,7 @@ async function main() {
5778
7647
  const dir = import.meta.dirname;
5779
7648
  if (!dev) {
5780
7649
  const rsfPath = path5.join(dir, ".next", "required-server-files.json");
5781
- if (existsSync5(rsfPath)) {
7650
+ if (existsSync6(rsfPath)) {
5782
7651
  const rsf = JSON.parse(readFileSync3(rsfPath, "utf8"));
5783
7652
  process.env.__NEXT_PRIVATE_STANDALONE_CONFIG ??= JSON.stringify(rsf.config);
5784
7653
  process.chdir(dir);
@@ -5804,7 +7673,7 @@ async function main() {
5804
7673
  for (const f of (await registerInstalledAgentModules()).failed) {
5805
7674
  console.warn(`agent package "${f.packageName}" not loaded \u2014 ${f.reason}`);
5806
7675
  }
5807
- const hostReachTimeoutFromConfig = await loadEffectiveConfig(homedir11()).then((c) => c.effective.relay.hostReachTimeoutMs).catch(() => void 0);
7676
+ const hostReachTimeoutFromConfig = await loadEffectiveConfig(homedir12()).then((c) => c.effective.relay.hostReachTimeoutMs).catch(() => void 0);
5808
7677
  const daemon = await startRelayDaemon({
5809
7678
  port,
5810
7679
  host,
@@ -5920,7 +7789,7 @@ async function main() {
5920
7789
  }
5921
7790
  let worker;
5922
7791
  if (process.env.AGENTBOX_HUB_WORKER === "on") {
5923
- const { startHubWorker } = await import("./hub-worker-6JAWRLP2.js");
7792
+ const { startHubWorker } = await import("./hub-worker-LJYEEAJL.js");
5924
7793
  worker = startHubWorker({
5925
7794
  store: daemon.handle.store,
5926
7795
  log: (line) => process.stdout.write(`agentbox-hub-worker: ${line}
@@ -5949,9 +7818,9 @@ async function main() {
5949
7818
  process.on("SIGTERM", () => shutdown("SIGTERM"));
5950
7819
  process.on("SIGINT", () => shutdown("SIGINT"));
5951
7820
  }
5952
- main().catch((err) => {
7821
+ main().catch((err3) => {
5953
7822
  process.stderr.write(
5954
- `agentbox-hub: fatal ${err instanceof Error ? err.stack ?? err.message : String(err)}
7823
+ `agentbox-hub: fatal ${err3 instanceof Error ? err3.stack ?? err3.message : String(err3)}
5955
7824
  `
5956
7825
  );
5957
7826
  process.exit(1);