@madarco/agentbox 0.28.1 → 0.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. package/CHANGELOG.md +146 -0
  2. package/dist/_cloud-attach-EUO2OL7W.js +30 -0
  3. package/dist/chunk-2JHPGPLE.js +71 -0
  4. package/dist/chunk-2JHPGPLE.js.map +1 -0
  5. package/dist/{chunk-JQLOGVZK.js → chunk-4KYP775X.js} +85 -21
  6. package/dist/chunk-4KYP775X.js.map +1 -0
  7. package/dist/{chunk-V5NWSLWD.js → chunk-4NUETVTR.js} +14 -14
  8. package/dist/{chunk-OXKW4GWD.js → chunk-53OTEDBS.js} +4 -70
  9. package/dist/chunk-53OTEDBS.js.map +1 -0
  10. package/dist/{chunk-FGQFVUMH.js → chunk-6YSYQZRH.js} +3 -3
  11. package/dist/{chunk-KFLGXE3R.js → chunk-73D2HKA3.js} +138 -24
  12. package/dist/chunk-73D2HKA3.js.map +1 -0
  13. package/dist/{chunk-HYXCH4GA.js → chunk-7LC5IG5K.js} +7 -7
  14. package/dist/{chunk-NHVGKFVY.js → chunk-7LNXTPEE.js} +340 -22
  15. package/dist/chunk-7LNXTPEE.js.map +1 -0
  16. package/dist/{chunk-74VIUGY6.js → chunk-A2TATHHJ.js} +6 -9
  17. package/dist/chunk-A2TATHHJ.js.map +1 -0
  18. package/dist/{chunk-YI4GHC2E.js → chunk-AC3HU25W.js} +12 -15
  19. package/dist/chunk-AC3HU25W.js.map +1 -0
  20. package/dist/{chunk-7ABO7OIF.js → chunk-AUHYXXCA.js} +4 -4
  21. package/dist/{chunk-FPMRFMVK.js → chunk-B4YFG5TB.js} +9 -9
  22. package/dist/{chunk-OUF3YTQO.js → chunk-BIKWXLX7.js} +14 -17
  23. package/dist/chunk-BIKWXLX7.js.map +1 -0
  24. package/dist/{chunk-CKD3PRON.js → chunk-CZPVVFCF.js} +12 -9
  25. package/dist/{chunk-CKD3PRON.js.map → chunk-CZPVVFCF.js.map} +1 -1
  26. package/dist/chunk-F4PPZ4SI.js +17 -0
  27. package/dist/chunk-F4PPZ4SI.js.map +1 -0
  28. package/dist/{chunk-BWM56FKY.js → chunk-FEFLAITR.js} +11 -11
  29. package/dist/{chunk-EVT2SNF2.js → chunk-FELVUIIM.js} +3 -3
  30. package/dist/{chunk-46NNZMZT.js → chunk-I2DEYQLZ.js} +372 -72
  31. package/dist/chunk-I2DEYQLZ.js.map +1 -0
  32. package/dist/{chunk-OUWVN2F2.js → chunk-I7BSBUPC.js} +16 -13
  33. package/dist/chunk-I7BSBUPC.js.map +1 -0
  34. package/dist/{chunk-G3H2L3O2.js → chunk-MNDKP4VS.js} +23 -3
  35. package/dist/chunk-MNDKP4VS.js.map +1 -0
  36. package/dist/{chunk-BUMKBUXS.js → chunk-PAWAGULH.js} +3 -3
  37. package/dist/{chunk-4PR3KJ5X.js → chunk-PFEBKXFD.js} +20 -20
  38. package/dist/{chunk-JDSYMTMS.js → chunk-QDU7YDME.js} +130 -66
  39. package/dist/chunk-QDU7YDME.js.map +1 -0
  40. package/dist/{chunk-JNC7MCWJ.js → chunk-S32GHLVU.js} +10 -10
  41. package/dist/chunk-S32GHLVU.js.map +1 -0
  42. package/dist/{chunk-WB6S4W7O.js → chunk-THKVKVRF.js} +2413 -1012
  43. package/dist/chunk-THKVKVRF.js.map +1 -0
  44. package/dist/{chunk-7RSE7ESY.js → chunk-UEEW5TW7.js} +27 -18
  45. package/dist/chunk-UEEW5TW7.js.map +1 -0
  46. package/dist/{chunk-B4DAH2F2.js → chunk-UTOC2NHC.js} +3 -3
  47. package/dist/{chunk-NHTRTST5.js → chunk-WDBDFLH3.js} +38 -15
  48. package/dist/chunk-WDBDFLH3.js.map +1 -0
  49. package/dist/{chunk-PSA6GADQ.js → chunk-WHFCJBMO.js} +14 -1
  50. package/dist/chunk-WHFCJBMO.js.map +1 -0
  51. package/dist/{chunk-KJ5TCYNI.js → chunk-WJUKN4L4.js} +7 -6
  52. package/dist/chunk-WJUKN4L4.js.map +1 -0
  53. package/dist/{chunk-GFOWBXV7.js → chunk-XENTK32L.js} +463 -253
  54. package/dist/chunk-XENTK32L.js.map +1 -0
  55. package/dist/cloud-backends.js +5 -5
  56. package/dist/{cloud-poller-SUNA6ZQC-7M5LJHHE.js → cloud-poller-QJRZXB4W-LJ2BRB3L.js} +2 -2
  57. package/dist/{control-plane-5R7PYRQ6.js → control-plane-YQFX2ILX.js} +19 -18
  58. package/dist/cp-hub-upload-RMJ3XJ65.js +81 -0
  59. package/dist/cp-hub-upload-RMJ3XJ65.js.map +1 -0
  60. package/dist/{custody-client-PNCC2HBJ.js → custody-client-L4FEFW4C.js} +5 -4
  61. package/dist/{deploy-hetzner-SSGSXAKA.js → deploy-hetzner-EECQ4JCM.js} +10 -10
  62. package/dist/{dist-RN6JOAG4.js → dist-3BKIPZR3.js} +81 -45
  63. package/dist/{dist-K5M4HKG7.js → dist-C5B6NGBO.js} +21 -9
  64. package/dist/{dist-6PYXFREL.js → dist-E5EXDZG4.js} +61 -16
  65. package/dist/dist-E5EXDZG4.js.map +1 -0
  66. package/dist/{dist-XATN4ZIR.js → dist-FBM2WS5S.js} +22 -4
  67. package/dist/{dist-XQLKK7H3.js → dist-NFF2KEMB.js} +54 -28
  68. package/dist/dist-NFF2KEMB.js.map +1 -0
  69. package/dist/{dist-5OR4QTQW.js → dist-NTUHJOK3.js} +9 -9
  70. package/dist/{dist-ZNQZHTUN.js → dist-PTYASENV.js} +35 -6
  71. package/dist/{dist-POILUDVJ.js → dist-Q4UDCSZQ.js} +9 -9
  72. package/dist/{dist-M4O5MU5K.js → dist-TXFTYNNE.js} +8 -8
  73. package/dist/{dist-EPFS5PRI.js → dist-XUOHE22G.js} +10 -10
  74. package/dist/{dist-SN2TCRZ5.js → dist-Z2TPC3EN.js} +9 -9
  75. package/dist/host-reach-drainer-N4JSFUBY.js +9 -0
  76. package/dist/hub-3HPYOV5O.js +37 -0
  77. package/dist/{hub-adopt-I44VGSBL.js → hub-adopt-NCCCMMXL.js} +8 -8
  78. package/dist/{hub-api-client-WJPBXZAZ.js → hub-api-client-5U6WOTZ3.js} +2 -2
  79. package/dist/{hub-docker-target-REEEWUG2.js → hub-docker-target-ZKAWXVPH.js} +16 -16
  80. package/dist/index.js +1321 -882
  81. package/dist/index.js.map +1 -1
  82. package/dist/prepare-KIVDQRMN.js +41 -0
  83. package/dist/prepared-custody-EFSOOAIQ.js +36 -0
  84. package/dist/{prepared-state-PV3GUBHO-MF56HWMZ.js → prepared-state-LNQ7DYSU-2YFSDOCV.js} +4 -3
  85. package/dist/{publish-credentials-BPHUO5VL.js → publish-credentials-F2A5OVCO.js} +11 -11
  86. package/dist/registry-O3X2CDDU.js +18 -0
  87. package/dist/relay-3T57T4RI.js +20 -0
  88. package/dist/relay-3T57T4RI.js.map +1 -0
  89. package/dist/{remote-docker-share-RX5ARK45.js → remote-docker-share-QDCBM5UM.js} +11 -11
  90. package/dist/remote-docker-share-QDCBM5UM.js.map +1 -0
  91. package/dist/tool-grant-push-6ISDIJKH.js +90 -0
  92. package/dist/tool-grant-push-6ISDIJKH.js.map +1 -0
  93. package/package.json +1 -2
  94. package/runtime/_shared/agentbox-tool-shim +21 -0
  95. package/runtime/_shared/ctl.cjs +6760 -5299
  96. package/runtime/_shared/gh-shim +103 -228
  97. package/runtime/digitalocean/agentbox-tool-shim +21 -0
  98. package/runtime/digitalocean/ctl.cjs +6760 -5299
  99. package/runtime/digitalocean/gh-shim +103 -228
  100. package/runtime/digitalocean/scripts/install-box.sh +9 -15
  101. package/runtime/docker/Dockerfile.box +8 -18
  102. package/runtime/docker/packages/ctl/dist/bin.cjs +6760 -5299
  103. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-tool-shim +21 -0
  104. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +103 -228
  105. package/runtime/e2b/agentbox-tool-shim +21 -0
  106. package/runtime/e2b/ctl.cjs +6760 -5299
  107. package/runtime/e2b/gh-shim +103 -228
  108. package/runtime/e2b/scripts/build-template.sh +5 -9
  109. package/runtime/hetzner/agentbox-tool-shim +21 -0
  110. package/runtime/hetzner/ctl.cjs +6760 -5299
  111. package/runtime/hetzner/gh-shim +103 -228
  112. package/runtime/hetzner/scripts/install-box.sh +9 -15
  113. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  114. package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +2 -0
  115. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  116. package/runtime/hub/apps/hub/.next/routes-manifest.json +16 -0
  117. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js +5 -5
  118. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +1 -1
  119. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js +2 -2
  120. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -1
  121. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js +2 -2
  122. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -1
  123. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js +2 -2
  124. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -1
  125. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/agent/route.js +2 -2
  126. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/agent/route.js.nft.json +1 -1
  127. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js +2 -2
  128. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -1
  129. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js +2 -2
  130. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js.nft.json +1 -1
  131. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js +2 -2
  132. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -1
  133. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js +2 -2
  134. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -1
  135. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/logs/route.js +1 -1
  136. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/logs/route.js.nft.json +1 -1
  137. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +2 -2
  138. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -1
  139. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js +2 -2
  140. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -1
  141. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js +2 -2
  142. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -1
  143. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js +2 -2
  144. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -1
  145. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js +2 -2
  146. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -1
  147. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route/app-paths-manifest.json +3 -0
  148. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route/build-manifest.json +9 -0
  149. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route/server-reference-manifest.json +4 -0
  150. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js +8 -0
  151. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js.map +5 -0
  152. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js.nft.json +1 -0
  153. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route_client-reference-manifest.js +3 -0
  154. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js +2 -2
  155. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -1
  156. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/checkpoints/route.js +2 -2
  157. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/checkpoints/route.js.nft.json +1 -1
  158. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/[...path]/route.js +1 -1
  159. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/[...path]/route.js.nft.json +1 -1
  160. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/blob/[...path]/route.js +2 -2
  161. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/blob/[...path]/route.js.nft.json +1 -1
  162. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js +2 -2
  163. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js.nft.json +1 -1
  164. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js +2 -2
  165. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -1
  166. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js +2 -2
  167. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -1
  168. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js +2 -2
  169. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -1
  170. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js +2 -2
  171. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -1
  172. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js +2 -2
  173. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -1
  174. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js +2 -2
  175. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -1
  176. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/route.js +2 -2
  177. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/route.js.nft.json +1 -1
  178. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js +2 -2
  179. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -1
  180. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js +2 -2
  181. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -1
  182. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js +2 -2
  183. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -1
  184. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/seed/route.js +2 -2
  185. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/seed/route.js.nft.json +1 -1
  186. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js +2 -2
  187. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -1
  188. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js +2 -2
  189. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -1
  190. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js +2 -2
  191. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -1
  192. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js +2 -2
  193. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -1
  194. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js +2 -2
  195. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js.nft.json +1 -1
  196. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/system/route.js +2 -2
  197. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/system/route.js.nft.json +1 -1
  198. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js +1 -1
  199. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  200. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js +1 -1
  201. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
  202. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  203. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route/app-paths-manifest.json +3 -0
  204. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route/build-manifest.json +9 -0
  205. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route/server-reference-manifest.json +4 -0
  206. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js +8 -0
  207. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js.map +5 -0
  208. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js.nft.json +1 -0
  209. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route_client-reference-manifest.js +3 -0
  210. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page.js +1 -1
  211. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page.js.nft.json +1 -1
  212. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js +1 -1
  213. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  214. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js +1 -1
  215. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
  216. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js +1 -1
  217. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  218. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  219. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page.js +1 -1
  220. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page.js.nft.json +1 -1
  221. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +4 -4
  222. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
  223. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  224. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  225. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  226. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  227. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  228. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  229. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  230. package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +2 -0
  231. package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_boxes_[id]_vnc_route_actions_1cy1392.js +3 -0
  232. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_vnc_route_actions_10y_e83.js +3 -0
  233. package/runtime/hub/apps/hub/.next/server/chunks/{[externals]__1nj4awx._.js → [externals]__02a249v._.js} +2 -2
  234. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00f9v4p._.js +1 -1
  235. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01nppdu._.js +1 -1
  236. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02f8rwr._.js +1 -1
  237. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__068_052._.js +1 -1
  238. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06ma5m4._.js +3 -0
  239. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07kp2fu._.js +1 -1
  240. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1yi-2wa._.js → [root-of-the-server]__08u01ud._.js} +3 -3
  241. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__098bkh3._.js +3 -0
  242. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1hxo1tv._.js → [root-of-the-server]__09hbkgm._.js} +2 -2
  243. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09tmbom._.js +3 -0
  244. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_3m9sf._.js +1 -1
  245. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0aotdzg._.js +3 -0
  246. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bn6-pu._.js +1 -1
  247. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cpt9f9._.js +1 -1
  248. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +15 -15
  249. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dom248._.js +1 -1
  250. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f0bb7o._.js +1 -1
  251. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gb04bp._.js +1 -1
  252. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0glplq7._.js +1 -1
  253. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0xrdbh9._.js → [root-of-the-server]__0gxfyol._.js} +2 -2
  254. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0hsb2ak._.js +1 -1
  255. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0joqm8t._.js +1 -1
  256. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jp-895._.js +1 -1
  257. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1leda2s._.js → [root-of-the-server]__0jpqg_t._.js} +2 -2
  258. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__17bhgkz._.js → [root-of-the-server]__0lgnu00._.js} +2 -2
  259. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lsv9-6._.js +1 -1
  260. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pzgufc._.js +1 -1
  261. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qfv7z6._.js +1 -1
  262. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qlr61y._.js +1 -1
  263. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0s8srqi._.js +1 -1
  264. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0urn9j5._.js +1 -1
  265. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vb8mk2._.js +4 -0
  266. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__17w5eaa._.js → [root-of-the-server]__0x27ifo._.js} +2 -2
  267. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0y7rvy1._.js +1 -1
  268. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zsgjre._.js +1 -1
  269. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-bqa8a._.js +1 -1
  270. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11uspjg._.js +1 -1
  271. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0zvr6ul._.js → [root-of-the-server]__15tgdh6._.js} +2 -2
  272. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1ek7nxv._.js → [root-of-the-server]__16bz_kz._.js} +2 -2
  273. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1w7jw4q._.js → [root-of-the-server]__18tehjj._.js} +2 -2
  274. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1ds8g0e._.js → [root-of-the-server]__1_hzv4s._.js} +2 -2
  275. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0cgpsh8._.js → [root-of-the-server]__1b5f5h4._.js} +2 -2
  276. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__10-aihp._.js → [root-of-the-server]__1dv80yf._.js} +2 -2
  277. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1eanlxn._.js +1 -1
  278. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__16lcb2d._.js → [root-of-the-server]__1fc-nvn._.js} +2 -2
  279. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4iahl._.js +1 -1
  280. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0f-c-eh._.js → [root-of-the-server]__1j0vnh3._.js} +2 -2
  281. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lgrtx6._.js +1 -1
  282. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1unqgd7._.js → [root-of-the-server]__1lz7931._.js} +2 -2
  283. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1oclxlx._.js → [root-of-the-server]__1n3u6-5._.js} +2 -2
  284. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qky5cd._.js +1 -1
  285. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1r2quye._.js +3 -0
  286. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rb_nc5._.js +1 -1
  287. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0cv16py._.js → [root-of-the-server]__1spr8ss._.js} +2 -2
  288. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1t_juqb._.js +1 -1
  289. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0t8kwy3._.js → [root-of-the-server]__1tct9rj._.js} +3 -3
  290. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0gfa1jg._.js → [root-of-the-server]__1tjtt06._.js} +2 -2
  291. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__09cigc7._.js → [root-of-the-server]__1whjno0._.js} +2 -2
  292. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wn4-iv._.js +3 -0
  293. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1x6zxrf._.js +1 -1
  294. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0tyixgg._.js → [root-of-the-server]__1xfxc6i._.js} +2 -2
  295. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1m1_gm_._.js → [root-of-the-server]__1xqcvi4._.js} +2 -2
  296. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__207d30i._.js +1 -1
  297. package/runtime/hub/apps/hub/.next/server/chunks/_07icdxf._.js +1 -1
  298. package/runtime/hub/apps/hub/.next/server/chunks/_0907rw0._.js +1 -1
  299. package/runtime/hub/apps/hub/.next/server/chunks/_0adm87k._.js +1 -1
  300. package/runtime/hub/apps/hub/.next/server/chunks/_0g01mkg._.js +1 -1
  301. package/runtime/hub/apps/hub/.next/server/chunks/_0l_klgd._.js +1 -1
  302. package/runtime/hub/apps/hub/.next/server/chunks/_0lfm81x._.js +1 -1
  303. package/runtime/hub/apps/hub/.next/server/chunks/_0tbg83f._.js +1 -1
  304. package/runtime/hub/apps/hub/.next/server/chunks/_0tms_au._.js +1 -1
  305. package/runtime/hub/apps/hub/.next/server/chunks/_0zhli27._.js +1 -1
  306. package/runtime/hub/apps/hub/.next/server/chunks/_10yfoq5._.js +1 -1
  307. package/runtime/hub/apps/hub/.next/server/chunks/_12uhpbp._.js +1 -1
  308. package/runtime/hub/apps/hub/.next/server/chunks/_17a9v8y._.js +2 -2
  309. package/runtime/hub/apps/hub/.next/server/chunks/_1c7x9ee._.js +1 -1
  310. package/runtime/hub/apps/hub/.next/server/chunks/_1n-c443._.js +1 -1
  311. package/runtime/hub/apps/hub/.next/server/chunks/_1y80vfg._.js +1 -1
  312. package/runtime/hub/apps/hub/.next/server/chunks/_214_q-1._.js +1 -1
  313. package/runtime/hub/apps/hub/.next/server/chunks/apps_hub_app_(dashboard)_api_v1_lib_openapi_ts_1yokmzt._.js +1 -1
  314. package/runtime/hub/apps/hub/.next/server/chunks/{packages_relay_dist_0eg7ay1._.js → packages_relay_dist_0p8dnf4._.js} +4 -4
  315. package/runtime/hub/apps/hub/.next/server/chunks/ssr/{[root-of-the-server]__1plrs94._.js → [root-of-the-server]__0-c5j6l._.js} +2 -2
  316. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r2xlss._.js +1 -1
  317. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_19vy9ni._.js +2 -2
  318. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
  319. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_settings_page_tsx_0hv6n82._.js +1 -1
  320. package/runtime/hub/apps/hub/.next/server/chunks/ssr/{packages_relay_dist_1z9j3g0._.js → packages_relay_dist_0sap-2l._.js} +4 -4
  321. package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +3 -1
  322. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  323. package/runtime/hub/apps/hub/.next/server/middleware.js +1 -1
  324. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  325. package/runtime/hub/apps/hub/.next/static/chunks/{328ny-3zs_h7m.js → 0jefm3re1-2jv.js} +1 -1
  326. package/runtime/hub/apps/hub/.next/static/chunks/{30h8mz040b5-l.js → 3u4odx1_-dy6b.js} +1 -1
  327. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/[id]/vnc/route.ts +45 -0
  328. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/openapi.ts +45 -1
  329. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/validate.ts +14 -3
  330. package/runtime/hub/apps/hub/app/(dashboard)/boxes/[id]/vnc/route.ts +58 -0
  331. package/runtime/hub/apps/hub/app/(dashboard)/boxes/components/access.tsx +26 -9
  332. package/runtime/hub/apps/hub/app/(dashboard)/settings/components/provider-actions.tsx +34 -26
  333. package/runtime/hub/apps/hub/{auth-JMVHQKWY.js → auth-V7KPRWPS.js} +2 -2
  334. package/runtime/hub/apps/hub/{auth-config-5IFRWOK4.js → auth-config-B3Y3BT2I.js} +2 -2
  335. package/runtime/hub/apps/hub/{chunk-QU3FFGJY.js → chunk-2WB3A5IN.js} +11 -14
  336. package/runtime/hub/apps/hub/{chunk-LPYK2354.js → chunk-5ABFGGPT.js} +339 -21
  337. package/runtime/hub/apps/hub/{chunk-VKOCY6SX.js → chunk-BI4MPGQT.js} +49 -14
  338. package/runtime/hub/apps/hub/{chunk-UMPTTQBE.js → chunk-G6FJR7TN.js} +461 -251
  339. package/runtime/hub/apps/hub/{chunk-KTVETF3F.js → chunk-QGAP34GN.js} +11 -8
  340. package/runtime/hub/apps/hub/{chunk-5TM7XXLT.js → chunk-QWSP6WJ2.js} +2833 -1277
  341. package/runtime/hub/apps/hub/{chunk-EZUK53CC.js → chunk-RPPOFMPA.js} +85 -21
  342. package/runtime/hub/apps/hub/{chunk-3LAHFDJF.js → chunk-VWQNSZGI.js} +22 -2
  343. package/runtime/hub/apps/hub/{chunk-D33EV4YZ.js → chunk-ZP4RYI4U.js} +1 -1
  344. package/runtime/hub/apps/hub/{cloud-poller-SUNA6ZQC-VSKVMYHL.js → cloud-poller-QJRZXB4W-G7ECKNKQ.js} +1 -1
  345. package/runtime/hub/apps/hub/{dist-JVEDVVVG.js → dist-4F6XEJHK.js} +7 -7
  346. package/runtime/hub/apps/hub/{dist-2YP57GMB.js → dist-A3JOKKYG.js} +13 -13
  347. package/runtime/hub/apps/hub/{dist-D265LCAN.js → dist-CGH7PEMZ.js} +21 -3
  348. package/runtime/hub/apps/hub/{dist-SYWTB6RD.js → dist-F547YSBE.js} +15 -18
  349. package/runtime/hub/apps/hub/{dist-YK5FFPXZ.js → dist-FEHV4PC7.js} +62 -20
  350. package/runtime/hub/apps/hub/{dist-NKCXH5DW.js → dist-P7NT6VLK.js} +6 -6
  351. package/runtime/hub/apps/hub/{dist-E2FTSTCY.js → dist-W2YXTEQN.js} +34 -5
  352. package/runtime/hub/apps/hub/{dist-ELZHBQEM.js → dist-W5SGEJLA.js} +11 -11
  353. package/runtime/hub/apps/hub/{dist-N3E5YAYY.js → dist-YB3Y2XDK.js} +53 -26
  354. package/runtime/hub/apps/hub/{dist-5HTJSOHS.js → dist-ZTJMZLED.js} +19 -7
  355. package/runtime/hub/apps/hub/docker-compose.yml +1 -0
  356. package/runtime/hub/apps/hub/{hub-token-MDOBY7MZ.js → hub-token-DDJ5Z6RS.js} +2 -2
  357. package/runtime/hub/apps/hub/{hub-worker-UFFLF37F.js → hub-worker-I5QBLSRU.js} +16 -16
  358. package/runtime/hub/apps/hub/lib/boxes/backend-types.ts +11 -0
  359. package/runtime/hub/apps/hub/lib/boxes/types.ts +43 -0
  360. package/runtime/hub/apps/hub/lib/boxes/vnc-link.ts +51 -0
  361. package/runtime/hub/apps/hub/lib/hub-backend.ts +127 -54
  362. package/runtime/hub/apps/hub/lib/hub-worker.ts +4 -4
  363. package/runtime/hub/apps/hub/lib/provider-importers.ts +66 -1
  364. package/runtime/hub/apps/hub/{prepared-state-PV3GUBHO-PPRQDYFR.js → prepared-state-LNQ7DYSU-4I7FNNNS.js} +3 -2
  365. package/runtime/hub/apps/hub/server.js +130 -72
  366. package/runtime/hub/apps/hub/server.ts +18 -0
  367. package/runtime/hub/apps/hub/test/vnc-link.test.ts +61 -0
  368. package/runtime/hub/apps/hub/tsconfig.tsbuildinfo +1 -1
  369. package/runtime/hub-deploy/docker-compose.yml +1 -0
  370. package/runtime/relay/bin.cjs +16626 -14688
  371. package/runtime/vercel/agentbox-tool-shim +21 -0
  372. package/runtime/vercel/ctl.cjs +6760 -5299
  373. package/runtime/vercel/gh-shim +103 -228
  374. package/runtime/vercel/scripts/provision.sh +5 -9
  375. package/share/host-skills/agentbox-info/SKILL.md +24 -14
  376. package/dist/_cloud-attach-Y5HIQ373.js +0 -28
  377. package/dist/chunk-46NNZMZT.js.map +0 -1
  378. package/dist/chunk-74VIUGY6.js.map +0 -1
  379. package/dist/chunk-7RSE7ESY.js.map +0 -1
  380. package/dist/chunk-G3H2L3O2.js.map +0 -1
  381. package/dist/chunk-GFOWBXV7.js.map +0 -1
  382. package/dist/chunk-JDSYMTMS.js.map +0 -1
  383. package/dist/chunk-JNC7MCWJ.js.map +0 -1
  384. package/dist/chunk-JQLOGVZK.js.map +0 -1
  385. package/dist/chunk-KFLGXE3R.js.map +0 -1
  386. package/dist/chunk-KJ5TCYNI.js.map +0 -1
  387. package/dist/chunk-NHTRTST5.js.map +0 -1
  388. package/dist/chunk-NHVGKFVY.js.map +0 -1
  389. package/dist/chunk-OUF3YTQO.js.map +0 -1
  390. package/dist/chunk-OUWVN2F2.js.map +0 -1
  391. package/dist/chunk-OXKW4GWD.js.map +0 -1
  392. package/dist/chunk-PSA6GADQ.js.map +0 -1
  393. package/dist/chunk-WB6S4W7O.js.map +0 -1
  394. package/dist/chunk-YI4GHC2E.js.map +0 -1
  395. package/dist/dist-6PYXFREL.js.map +0 -1
  396. package/dist/dist-XQLKK7H3.js.map +0 -1
  397. package/dist/hub-MJ7O4WXW.js +0 -36
  398. package/dist/prepare-V4U5HVJU.js +0 -40
  399. package/dist/prepared-custody-QIXW7MJM.js +0 -35
  400. package/dist/relay-DRDELF6B.js +0 -20
  401. package/runtime/_shared/linear-shim +0 -181
  402. package/runtime/_shared/ntn-shim +0 -95
  403. package/runtime/digitalocean/linear-shim +0 -181
  404. package/runtime/digitalocean/ntn-shim +0 -95
  405. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -181
  406. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -95
  407. package/runtime/e2b/linear-shim +0 -181
  408. package/runtime/e2b/ntn-shim +0 -95
  409. package/runtime/hetzner/linear-shim +0 -181
  410. package/runtime/hetzner/ntn-shim +0 -95
  411. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__039tc0m._.js +0 -3
  412. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c_3x8u._.js +0 -3
  413. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ty7ew1._.js +0 -3
  414. package/runtime/vercel/linear-shim +0 -181
  415. package/runtime/vercel/ntn-shim +0 -95
  416. /package/dist/{_cloud-attach-Y5HIQ373.js.map → _cloud-attach-EUO2OL7W.js.map} +0 -0
  417. /package/dist/{chunk-V5NWSLWD.js.map → chunk-4NUETVTR.js.map} +0 -0
  418. /package/dist/{chunk-FGQFVUMH.js.map → chunk-6YSYQZRH.js.map} +0 -0
  419. /package/dist/{chunk-HYXCH4GA.js.map → chunk-7LC5IG5K.js.map} +0 -0
  420. /package/dist/{chunk-7ABO7OIF.js.map → chunk-AUHYXXCA.js.map} +0 -0
  421. /package/dist/{chunk-FPMRFMVK.js.map → chunk-B4YFG5TB.js.map} +0 -0
  422. /package/dist/{chunk-BWM56FKY.js.map → chunk-FEFLAITR.js.map} +0 -0
  423. /package/dist/{chunk-EVT2SNF2.js.map → chunk-FELVUIIM.js.map} +0 -0
  424. /package/dist/{chunk-BUMKBUXS.js.map → chunk-PAWAGULH.js.map} +0 -0
  425. /package/dist/{chunk-4PR3KJ5X.js.map → chunk-PFEBKXFD.js.map} +0 -0
  426. /package/dist/{chunk-B4DAH2F2.js.map → chunk-UTOC2NHC.js.map} +0 -0
  427. /package/dist/{cloud-poller-SUNA6ZQC-7M5LJHHE.js.map → cloud-poller-QJRZXB4W-LJ2BRB3L.js.map} +0 -0
  428. /package/dist/{control-plane-5R7PYRQ6.js.map → control-plane-YQFX2ILX.js.map} +0 -0
  429. /package/dist/{custody-client-PNCC2HBJ.js.map → custody-client-L4FEFW4C.js.map} +0 -0
  430. /package/dist/{deploy-hetzner-SSGSXAKA.js.map → deploy-hetzner-EECQ4JCM.js.map} +0 -0
  431. /package/dist/{dist-5OR4QTQW.js.map → dist-3BKIPZR3.js.map} +0 -0
  432. /package/dist/{dist-EPFS5PRI.js.map → dist-C5B6NGBO.js.map} +0 -0
  433. /package/dist/{dist-K5M4HKG7.js.map → dist-FBM2WS5S.js.map} +0 -0
  434. /package/dist/{dist-M4O5MU5K.js.map → dist-NTUHJOK3.js.map} +0 -0
  435. /package/dist/{dist-POILUDVJ.js.map → dist-PTYASENV.js.map} +0 -0
  436. /package/dist/{dist-RN6JOAG4.js.map → dist-Q4UDCSZQ.js.map} +0 -0
  437. /package/dist/{dist-SN2TCRZ5.js.map → dist-TXFTYNNE.js.map} +0 -0
  438. /package/dist/{dist-XATN4ZIR.js.map → dist-XUOHE22G.js.map} +0 -0
  439. /package/dist/{dist-ZNQZHTUN.js.map → dist-Z2TPC3EN.js.map} +0 -0
  440. /package/dist/{hub-MJ7O4WXW.js.map → host-reach-drainer-N4JSFUBY.js.map} +0 -0
  441. /package/dist/{hub-adopt-I44VGSBL.js.map → hub-3HPYOV5O.js.map} +0 -0
  442. /package/dist/{hub-api-client-WJPBXZAZ.js.map → hub-adopt-NCCCMMXL.js.map} +0 -0
  443. /package/dist/{prepare-V4U5HVJU.js.map → hub-api-client-5U6WOTZ3.js.map} +0 -0
  444. /package/dist/{hub-docker-target-REEEWUG2.js.map → hub-docker-target-ZKAWXVPH.js.map} +0 -0
  445. /package/dist/{prepared-custody-QIXW7MJM.js.map → prepare-KIVDQRMN.js.map} +0 -0
  446. /package/dist/{prepared-state-PV3GUBHO-MF56HWMZ.js.map → prepared-custody-EFSOOAIQ.js.map} +0 -0
  447. /package/dist/{relay-DRDELF6B.js.map → prepared-state-LNQ7DYSU-2YFSDOCV.js.map} +0 -0
  448. /package/dist/{publish-credentials-BPHUO5VL.js.map → publish-credentials-F2A5OVCO.js.map} +0 -0
  449. /package/dist/{remote-docker-share-RX5ARK45.js.map → registry-O3X2CDDU.js.map} +0 -0
  450. /package/runtime/hub/apps/hub/.next/static/{z7_2bKU93xE7GwllL1Duv → nDHi_1342DzyGDC14ocQo}/_buildManifest.js +0 -0
  451. /package/runtime/hub/apps/hub/.next/static/{z7_2bKU93xE7GwllL1Duv → nDHi_1342DzyGDC14ocQo}/_clientMiddlewareManifest.js +0 -0
  452. /package/runtime/hub/apps/hub/.next/static/{z7_2bKU93xE7GwllL1Duv → nDHi_1342DzyGDC14ocQo}/_ssgManifest.js +0 -0
@@ -1,4 +1,9 @@
1
1
  import { createRequire as __cr } from 'node:module'; import { fileURLToPath as __f } from 'node:url'; import { dirname as __d } from 'node:path'; const require = __cr(import.meta.url); const __filename = __f(import.meta.url); const __dirname = __d(__filename);
2
+ import {
3
+ PROVIDERS,
4
+ isProviderKind,
5
+ providerMeta
6
+ } from "./chunk-5ABFGGPT.js";
2
7
  import {
3
8
  execa
4
9
  } from "./chunk-EFW34I43.js";
@@ -16,16 +21,21 @@ import { dirname as dirname3, join as join4 } from "path";
16
21
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
17
22
  import { homedir as homedir22 } from "os";
18
23
  import { dirname as dirname22, join as join3 } from "path";
19
- import { mkdir as mkdir2, readFile as readFile2 } from "fs/promises";
20
- import { join as join5, resolve as resolve3 } from "path";
21
- import { stat as stat3 } from "fs/promises";
24
+ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
25
+ import { mkdir as mkdir2, open as open2, readFile as readFile2, rename as rename2, rm as rm2, stat as stat3, writeFile as writeFile2 } from "fs/promises";
22
26
  import { homedir as homedir4 } from "os";
27
+ import { dirname as dirname4, join as join5 } from "path";
28
+ import { setTimeout as delay2 } from "timers/promises";
29
+ import { mkdir as mkdir3, readFile as readFile3 } from "fs/promises";
30
+ import { join as join6, resolve as resolve3 } from "path";
31
+ import { stat as stat4 } from "fs/promises";
32
+ import { homedir as homedir5 } from "os";
23
33
  import { createHash } from "crypto";
24
- import { existsSync as existsSync2 } from "fs";
25
- import { mkdir as mkdir3, rm as rm2 } from "fs/promises";
34
+ import { existsSync as existsSync3 } from "fs";
35
+ import { mkdir as mkdir4, rm as rm3 } from "fs/promises";
26
36
  import { createServer } from "net";
27
- import { homedir as homedir5 } from "os";
28
- import { join as join6, resolve as resolve22 } from "path";
37
+ import { homedir as homedir6 } from "os";
38
+ import { join as join7, resolve as resolve22 } from "path";
29
39
 
30
40
  // ../../packages/core/dist/index.js
31
41
  import { randomBytes } from "crypto";
@@ -63,6 +73,14 @@ function resolveAgentLauncher(kind) {
63
73
  if (kind === "opencode") return opencodeLauncher;
64
74
  throw new Error(`unknown agent kind: ${String(kind)}`);
65
75
  }
76
+ function claudeTuiEnv(mode) {
77
+ if (mode === "default") return { CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN: "1" };
78
+ if (mode === "fullscreen") return { CLAUDE_CODE_NO_FLICKER: "1" };
79
+ return {};
80
+ }
81
+ function buildNoVncUrl(base, password) {
82
+ return `${base.replace(/\/+$/, "")}/vnc.html?autoconnect=1&password=${encodeURIComponent(password)}`;
83
+ }
66
84
  var PLACEHOLDER_KEYS = [
67
85
  "AGENTBOX_BOX_NAME",
68
86
  "AGENTBOX_BOX_ID",
@@ -352,33 +370,29 @@ function sanitizeGitArgs(args) {
352
370
  }
353
371
 
354
372
  // ../../packages/sandbox-core/dist/index.js
355
- import { chmodSync, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, renameSync, writeFileSync as writeFileSync2 } from "fs";
356
- import { homedir as homedir6 } from "os";
357
- import { dirname as dirname4, resolve as resolve32 } from "path";
358
- import { existsSync as existsSync4 } from "fs";
373
+ import { chmodSync, existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync3, renameSync, writeFileSync as writeFileSync2 } from "fs";
374
+ import { homedir as homedir7 } from "os";
375
+ import { dirname as dirname5, resolve as resolve32 } from "path";
376
+ import { existsSync as existsSync5 } from "fs";
359
377
  import { request as httpRequest } from "http";
360
- import { dirname as dirname5, resolve as resolve4 } from "path";
361
- import { setTimeout as delay2 } from "timers/promises";
378
+ import { connect as netConnect } from "net";
379
+ import { dirname as dirname6, resolve as resolve4 } from "path";
380
+ import { setTimeout as delay3 } from "timers/promises";
362
381
  import { fileURLToPath } from "url";
363
382
  import { spawn } from "child_process";
364
- import { existsSync as existsSync6, openSync } from "fs";
365
- import { mkdir as mkdir4, readFile as readFile3, unlink, writeFile as writeFile2 } from "fs/promises";
366
- import { homedir as homedir7 } from "os";
367
- import { dirname as dirname6, join as join7, resolve as resolve6 } from "path";
368
- import { setTimeout as delay3 } from "timers/promises";
369
- import { fileURLToPath as fileURLToPath2 } from "url";
370
- import { existsSync as existsSync5 } from "fs";
371
- import { resolve as resolve5 } from "path";
372
- import { existsSync as existsSync7, readFileSync as readFileSync3 } from "fs";
373
- import { mkdir as mkdir5, open as open2, readFile as readFile4, rename as rename2, rm as rm3, stat as stat4, writeFile as writeFile3 } from "fs/promises";
383
+ import { existsSync as existsSync7, openSync } from "fs";
384
+ import { mkdir as mkdir5, readFile as readFile4, stat as stat5, unlink, writeFile as writeFile3 } from "fs/promises";
374
385
  import { homedir as homedir8 } from "os";
375
- import { dirname as dirname7, join as join8 } from "path";
386
+ import { dirname as dirname7, join as join8, resolve as resolve6 } from "path";
376
387
  import { setTimeout as delay4 } from "timers/promises";
388
+ import { fileURLToPath as fileURLToPath2 } from "url";
389
+ import { existsSync as existsSync6 } from "fs";
390
+ import { resolve as resolve5 } from "path";
377
391
  import { mkdtemp, readFile as readFile5, writeFile as writeFile4 } from "fs/promises";
378
392
  import { tmpdir } from "os";
379
393
  import { basename as basename2, join as join9 } from "path";
380
394
  import { join as join10 } from "path";
381
- import { chmod, mkdir as mkdir6, readdir as readdir2, readFile as readFile6, stat as stat5, writeFile as writeFile5 } from "fs/promises";
395
+ import { chmod, mkdir as mkdir6, readdir as readdir2, readFile as readFile6, stat as stat6, writeFile as writeFile5 } from "fs/promises";
382
396
  import { homedir as homedir9 } from "os";
383
397
  import { dirname as dirname8, join as join11 } from "path";
384
398
  import { mkdir as mkdir7, mkdtemp as mkdtemp2, rm as rm4, writeFile as writeFile6 } from "fs/promises";
@@ -388,12 +402,12 @@ import { homedir as homedir10 } from "os";
388
402
  import { mkdtemp as mkdtemp3, rm as rm5 } from "fs/promises";
389
403
  import { tmpdir as tmpdir3 } from "os";
390
404
  import { join as join13 } from "path";
391
- import { readdir as readdir3, stat as stat6 } from "fs/promises";
405
+ import { readdir as readdir3, stat as stat7 } from "fs/promises";
392
406
  import { homedir as homedir11 } from "os";
393
407
  import { join as join14 } from "path";
394
- import { readdir as readdir4, realpath as realpath2, stat as stat7 } from "fs/promises";
408
+ import { readdir as readdir4, realpath as realpath2, stat as stat8 } from "fs/promises";
395
409
  import { isAbsolute as isAbsolute3, join as join15, relative } from "path";
396
- import { stat as stat8 } from "fs/promises";
410
+ import { stat as stat9 } from "fs/promises";
397
411
  import { chmod as chmod2, mkdir as mkdir8, mkdtemp as mkdtemp4, readFile as readFile7, rename as rename3, rm as rm6, writeFile as writeFile7 } from "fs/promises";
398
412
  import { tmpdir as tmpdir4 } from "os";
399
413
  import { dirname as dirname10, join as join16 } from "path";
@@ -401,10 +415,10 @@ import { createHash as createHash2 } from "crypto";
401
415
  import { readFile as readFile8 } from "fs/promises";
402
416
  import { join as join17 } from "path";
403
417
  import { createHash as createHash3 } from "crypto";
404
- import { copyFile, mkdir as mkdir9, mkdtemp as mkdtemp5, readdir as readdir5, readFile as readFile9, rm as rm7, stat as stat9 } from "fs/promises";
418
+ import { copyFile, mkdir as mkdir9, mkdtemp as mkdtemp5, readdir as readdir5, readFile as readFile9, rm as rm7, stat as stat10 } from "fs/promises";
405
419
  import { homedir as homedir12, tmpdir as tmpdir5 } from "os";
406
420
  import { basename as basename22, dirname as dirname11, join as join18 } from "path";
407
- import { copyFile as copyFile2, mkdtemp as mkdtemp6, readdir as readdir6, readFile as readFile10, rm as rm8, stat as stat10, writeFile as writeFile8 } from "fs/promises";
421
+ import { copyFile as copyFile2, mkdtemp as mkdtemp6, readdir as readdir6, readFile as readFile10, rm as rm8, stat as stat11, writeFile as writeFile8 } from "fs/promises";
408
422
  import { homedir as homedir14, tmpdir as tmpdir6 } from "os";
409
423
  import { basename as basename3, join as join19, relative as relative2 } from "path";
410
424
  import { homedir as homedir13 } from "os";
@@ -1775,6 +1789,233 @@ function buildExposedHubEnv(record, env) {
1775
1789
  }
1776
1790
  return out;
1777
1791
  }
1792
+ var PLUGINS_FILE = join5(homedir4(), ".agentbox", "plugins.json");
1793
+ var SUPPORTED_SDK_API_VERSIONS = [1, 2];
1794
+ function isSupportedApiVersion(v) {
1795
+ return SUPPORTED_SDK_API_VERSIONS.includes(v);
1796
+ }
1797
+ var PLUGINS_FILE_VERSION = 2;
1798
+ var EMPTY2 = { version: PLUGINS_FILE_VERSION, plugins: [] };
1799
+ function isKnownVersion(v) {
1800
+ return v === 1 || v === 2;
1801
+ }
1802
+ var LOCK_STALE_MS2 = 15e3;
1803
+ var LOCK_ACQUIRE_TIMEOUT_MS2 = 2e4;
1804
+ var LOCK_RETRY_MS2 = 25;
1805
+ async function withFileLock(path, fn) {
1806
+ const lockPath = `${path}.lock`;
1807
+ await mkdir2(dirname4(path), { recursive: true });
1808
+ const deadline = Date.now() + LOCK_ACQUIRE_TIMEOUT_MS2;
1809
+ let held = false;
1810
+ while (!held) {
1811
+ try {
1812
+ const fh = await open2(lockPath, "wx");
1813
+ await fh.writeFile(`${String(process.pid)}
1814
+ `);
1815
+ await fh.close();
1816
+ held = true;
1817
+ } catch (err) {
1818
+ if (err.code !== "EEXIST") throw err;
1819
+ try {
1820
+ const st = await stat3(lockPath);
1821
+ if (Date.now() - st.mtimeMs > LOCK_STALE_MS2) {
1822
+ await rm2(lockPath, { force: true });
1823
+ continue;
1824
+ }
1825
+ } catch {
1826
+ continue;
1827
+ }
1828
+ if (Date.now() >= deadline) break;
1829
+ await delay2(LOCK_RETRY_MS2);
1830
+ }
1831
+ }
1832
+ try {
1833
+ return await fn();
1834
+ } finally {
1835
+ if (held) await rm2(lockPath, { force: true }).catch(() => {
1836
+ });
1837
+ }
1838
+ }
1839
+ function normalize2(raw) {
1840
+ const parsed = raw;
1841
+ if (!parsed || !isKnownVersion(parsed.version) || !Array.isArray(parsed.plugins)) {
1842
+ return { ...EMPTY2 };
1843
+ }
1844
+ return parsed;
1845
+ }
1846
+ function readPluginRegistrySync(path = PLUGINS_FILE) {
1847
+ try {
1848
+ if (!existsSync2(path)) return { ...EMPTY2 };
1849
+ return normalize2(JSON.parse(readFileSync2(path, "utf8")));
1850
+ } catch {
1851
+ return { ...EMPTY2 };
1852
+ }
1853
+ }
1854
+ async function readPluginRegistry(path = PLUGINS_FILE) {
1855
+ try {
1856
+ return normalize2(JSON.parse(await readFile2(path, "utf8")));
1857
+ } catch (err) {
1858
+ if (err.code === "ENOENT") return { ...EMPTY2 };
1859
+ return { ...EMPTY2 };
1860
+ }
1861
+ }
1862
+ async function readForWrite(path) {
1863
+ let raw;
1864
+ try {
1865
+ raw = await readFile2(path, "utf8");
1866
+ } catch (err) {
1867
+ if (err.code === "ENOENT") return { ...EMPTY2 };
1868
+ throw err;
1869
+ }
1870
+ let parsed;
1871
+ try {
1872
+ parsed = JSON.parse(raw);
1873
+ } catch (err) {
1874
+ throw new Error(
1875
+ `refusing to modify a corrupt plugin registry at ${path} (${err.message}) \u2014 fix or delete the file and retry.`
1876
+ );
1877
+ }
1878
+ const p = parsed;
1879
+ if (!p || !isKnownVersion(p.version) || !Array.isArray(p.plugins)) {
1880
+ throw new Error(
1881
+ `refusing to modify an unrecognized plugin registry at ${path} \u2014 fix or delete the file and retry.`
1882
+ );
1883
+ }
1884
+ return p;
1885
+ }
1886
+ async function writeRegistry(file, path = PLUGINS_FILE) {
1887
+ await mkdir2(dirname4(path), { recursive: true });
1888
+ const tmp = `${path}.tmp.${String(process.pid)}.${String(Date.now())}`;
1889
+ const out = { ...file, version: PLUGINS_FILE_VERSION };
1890
+ await writeFile2(tmp, JSON.stringify(out, null, 2) + "\n", "utf8");
1891
+ await rename2(tmp, path);
1892
+ }
1893
+ async function recordPluginDescriptor(providerName, descriptor, path = PLUGINS_FILE) {
1894
+ await withFileLock(path, async () => {
1895
+ const file = await readForWrite(path);
1896
+ const rec = file.plugins.find((p) => p.providers.includes(providerName));
1897
+ if (!rec) return;
1898
+ rec.descriptors = { ...rec.descriptors, [providerName]: descriptor };
1899
+ await writeRegistry(file, path);
1900
+ });
1901
+ }
1902
+ async function addPluginRecord(record, path = PLUGINS_FILE) {
1903
+ await withFileLock(path, async () => {
1904
+ const file = await readForWrite(path);
1905
+ const next = file.plugins.filter((p) => p.packageName !== record.packageName);
1906
+ next.push(record);
1907
+ await writeRegistry({ version: PLUGINS_FILE_VERSION, plugins: next }, path);
1908
+ });
1909
+ }
1910
+ async function removePluginRecord(nameOrPackage, path = PLUGINS_FILE) {
1911
+ let removed = 0;
1912
+ await withFileLock(path, async () => {
1913
+ const file = await readForWrite(path);
1914
+ const next = file.plugins.filter((p) => {
1915
+ const match = p.packageName === nameOrPackage || p.providers.includes(nameOrPackage);
1916
+ if (match) removed += 1;
1917
+ return !match;
1918
+ });
1919
+ await writeRegistry({ version: PLUGINS_FILE_VERSION, plugins: next }, path);
1920
+ });
1921
+ return removed;
1922
+ }
1923
+ function pluginProviderNames(path = PLUGINS_FILE) {
1924
+ return readPluginRegistrySync(path).plugins.flatMap((p) => p.providers);
1925
+ }
1926
+ function pluginForProvider(providerName, path = PLUGINS_FILE) {
1927
+ return readPluginRegistrySync(path).plugins.find((p) => p.providers.includes(providerName)) ?? null;
1928
+ }
1929
+ function resolveProviderDescriptor(name, path = PLUGINS_FILE) {
1930
+ if (isProviderKind(name)) return providerMeta(name);
1931
+ return pluginForProvider(name, path)?.descriptors?.[name];
1932
+ }
1933
+ function listProviderDescriptors(path = PLUGINS_FILE) {
1934
+ const builtIns = [...PROVIDERS];
1935
+ const plugins = [];
1936
+ for (const rec of readPluginRegistrySync(path).plugins) {
1937
+ for (const providerName of rec.providers) {
1938
+ const d = rec.descriptors?.[providerName];
1939
+ plugins.push(d ?? placeholderDescriptor(providerName));
1940
+ }
1941
+ }
1942
+ return [...builtIns, ...plugins];
1943
+ }
1944
+ var FALLBACK_CAPABILITIES = {
1945
+ // Cloud plugins are near-universally built on `createCloudProvider`, which
1946
+ // gives them a working `checkpoint`. `deriveDescriptor` refines this from the
1947
+ // real module when one is available.
1948
+ checkpoints: false,
1949
+ checkpointReboots: false,
1950
+ ssh: false,
1951
+ // Plugins were excluded from PERSISTENT_SSH_PROVIDERS / the direct-ssh list,
1952
+ // so false IS the status quo — a plugin opts in by declaring a descriptor.
1953
+ persistentSsh: false,
1954
+ directBoxSsh: false,
1955
+ inbound: false,
1956
+ directGit: false,
1957
+ resync: true,
1958
+ prune: false,
1959
+ // TRUE on purpose: `createCloudProvider` wires VNC unconditionally and
1960
+ // degrades best-effort, and `launchDockerd` defaults true. Defaulting these
1961
+ // false would remove a VNC button / DinD that works today.
1962
+ vnc: true,
1963
+ dind: true,
1964
+ // The pre-descriptor UI showed an unqualified Pause for every running box.
1965
+ pauseSemantics: "freeze",
1966
+ hubRoutable: true
1967
+ };
1968
+ function placeholderLabel(name) {
1969
+ return name.charAt(0).toUpperCase() + name.slice(1);
1970
+ }
1971
+ function placeholderDescriptor(name) {
1972
+ return {
1973
+ name,
1974
+ kind: "cloud",
1975
+ label: placeholderLabel(name),
1976
+ loginHint: "",
1977
+ credentials: { envKeys: [], fields: [] },
1978
+ // NOT `true`: the hub's create gate deliberately skips the configured check
1979
+ // for plugins, so demanding a bake here would newly block creates that work.
1980
+ bake: { required: false, approxMinutes: "1" },
1981
+ capabilities: { ...FALLBACK_CAPABILITIES },
1982
+ blurb: `the ${name} provider`,
1983
+ sizeDesc: `Per-provider override of \`box.size\` for ${name}.`,
1984
+ imageDesc: `Per-provider override of \`box.image\` for ${name}.`
1985
+ };
1986
+ }
1987
+ function deriveDescriptor(name, mod) {
1988
+ const declared = mod.descriptor;
1989
+ if (declared) return declared;
1990
+ const base = placeholderDescriptor(name);
1991
+ const { provider, backend } = mod;
1992
+ return {
1993
+ ...base,
1994
+ kind: backend ? "cloud" : "local",
1995
+ credentials: {
1996
+ envKeys: [],
1997
+ // Only offer a credential form when the module can actually consume one.
1998
+ fields: mod.setCredentials ? [{ key: "apiKey", label: "API key" }] : []
1999
+ },
2000
+ capabilities: {
2001
+ ...base.capabilities,
2002
+ checkpoints: !!provider.checkpoint,
2003
+ ssh: !!provider.sshTarget,
2004
+ resync: !!provider.resyncWorkspace,
2005
+ prune: !!backend?.list,
2006
+ inbound: !!backend?.setInbound,
2007
+ ...backend?.timeoutModel ? { timeoutModel: backend.timeoutModel } : {}
2008
+ }
2009
+ };
2010
+ }
2011
+ async function ensureProviderDescriptor(name, mod, path = PLUGINS_FILE) {
2012
+ const existing = resolveProviderDescriptor(name, path);
2013
+ if (existing) return existing;
2014
+ const derived = deriveDescriptor(name, mod);
2015
+ await recordPluginDescriptor(name, derived, path).catch(() => {
2016
+ });
2017
+ return derived;
2018
+ }
1778
2019
  async function resolveCloudSshTarget(box, provider, opts = {}) {
1779
2020
  if (!provider.buildAttach) {
1780
2021
  throw new Error(`cloud provider '${provider.name}' does not support SSH attach`);
@@ -1825,10 +2066,12 @@ async function ensureCloudSshAlias(box, provider, opts = {}) {
1825
2066
  await syncAgentboxSshConfig();
1826
2067
  return conn;
1827
2068
  }
1828
- var PROVIDERS_WITH_DIRECT_BOX_SSH = ["hetzner", "digitalocean", "daytona"];
2069
+ function hasDirectBoxSsh(name) {
2070
+ return resolveProviderDescriptor(name)?.capabilities.directBoxSsh ?? false;
2071
+ }
1829
2072
  async function autoWriteSshConfig(box, provider, enabled, logWarn) {
1830
2073
  if (!enabled) return;
1831
- if (!provider.sshTarget && !PROVIDERS_WITH_DIRECT_BOX_SSH.includes(provider.name)) return;
2074
+ if (!provider.sshTarget && !hasDirectBoxSsh(provider.name)) return;
1832
2075
  try {
1833
2076
  const conn = await resolveCloudSshTarget(box, provider, { bringOnline: false });
1834
2077
  if (!conn.identityFile) return;
@@ -1848,22 +2091,22 @@ async function autoWriteSshConfig(box, provider, enabled, logWarn) {
1848
2091
  }
1849
2092
  async function mintSshKey(targetDir, comment) {
1850
2093
  const dir = resolve3(targetDir);
1851
- const priv = join5(dir, "id_ed25519");
2094
+ const priv = join6(dir, "id_ed25519");
1852
2095
  const pub = `${priv}.pub`;
1853
- await mkdir2(dir, { recursive: true, mode: 448 });
1854
- const existing = await readFile2(pub, "utf8").catch(() => null);
2096
+ await mkdir3(dir, { recursive: true, mode: 448 });
2097
+ const existing = await readFile3(pub, "utf8").catch(() => null);
1855
2098
  if (existing !== null) {
1856
2099
  return { dir, privatePath: priv, publicPath: pub, publicKey: existing.trim() };
1857
2100
  }
1858
2101
  await execa("ssh-keygen", ["-t", "ed25519", "-N", "", "-C", comment, "-f", priv, "-q"], {
1859
2102
  stdio: "pipe"
1860
2103
  });
1861
- const publicKey = (await readFile2(pub, "utf8")).trim();
2104
+ const publicKey = (await readFile3(pub, "utf8")).trim();
1862
2105
  return { dir, privatePath: priv, publicPath: pub, publicKey };
1863
2106
  }
1864
2107
  async function fileExists(path) {
1865
2108
  try {
1866
- return (await stat3(path)).isFile();
2109
+ return (await stat4(path)).isFile();
1867
2110
  } catch {
1868
2111
  return false;
1869
2112
  }
@@ -1894,7 +2137,7 @@ async function resolveSshConfigTarget(destination) {
1894
2137
  const port = Number.parseInt(fields.get("port")?.[0]?.trim() ?? "", 10);
1895
2138
  if (Number.isInteger(port) && port > 0 && port !== 22) out.port = port;
1896
2139
  for (const raw of fields.get("identityfile") ?? []) {
1897
- const path = raw.trim().replace(/^~(?=\/)/, homedir4());
2140
+ const path = raw.trim().replace(/^~(?=\/)/, homedir5());
1898
2141
  if (await fileExists(path)) {
1899
2142
  out.identityFile = path;
1900
2143
  break;
@@ -2007,7 +2250,7 @@ async function waitForSsh(target, deadlineMs, intervalMs = 5e3) {
2007
2250
  var HOST = "127.0.0.1";
2008
2251
  function controlSockPath(boxSshDir) {
2009
2252
  const hash = createHash("sha1").update(boxSshDir).digest("hex").slice(0, 12);
2010
- return resolve22(homedir5(), ".agentbox", "cm", `${hash}.sock`);
2253
+ return resolve22(homedir6(), ".agentbox", "cm", `${hash}.sock`);
2011
2254
  }
2012
2255
  var SshTunnelManager = class {
2013
2256
  /**
@@ -2026,10 +2269,10 @@ var SshTunnelManager = class {
2026
2269
  */
2027
2270
  async open(opts) {
2028
2271
  const boxSshDir = opts.boxSshDir ?? defaultBoxSshDir(opts.boxId, this.namespace);
2029
- await mkdir3(boxSshDir, { recursive: true, mode: 448 });
2272
+ await mkdir4(boxSshDir, { recursive: true, mode: 448 });
2030
2273
  const controlPath = controlSockPath(boxSshDir);
2031
- await mkdir3(join6(controlPath, ".."), { recursive: true, mode: 448 });
2032
- const knownHosts = join6(boxSshDir, "known_hosts");
2274
+ await mkdir4(join7(controlPath, ".."), { recursive: true, mode: 448 });
2275
+ const knownHosts = join7(boxSshDir, "known_hosts");
2033
2276
  const tunnel = {
2034
2277
  controlPath,
2035
2278
  vpsHost: opts.vpsHost,
@@ -2039,12 +2282,12 @@ var SshTunnelManager = class {
2039
2282
  boxSshDir,
2040
2283
  forwards: /* @__PURE__ */ new Map()
2041
2284
  };
2042
- if (existsSync2(controlPath) && await this.isAlive(controlPath)) {
2285
+ if (existsSync3(controlPath) && await this.isAlive(controlPath)) {
2043
2286
  this.boxes.set(opts.boxId, tunnel);
2044
2287
  return;
2045
2288
  }
2046
- if (existsSync2(controlPath)) {
2047
- await rm2(controlPath, { force: true });
2289
+ if (existsSync3(controlPath)) {
2290
+ await rm3(controlPath, { force: true });
2048
2291
  }
2049
2292
  const connectTimeout = opts.connectTimeoutSeconds ?? 10;
2050
2293
  const argv = ["-fNT", "-M", "-S", controlPath];
@@ -2081,7 +2324,7 @@ var SshTunnelManager = class {
2081
2324
  opts.vpsUser ? `${opts.vpsUser}@${opts.vpsHost}` : opts.vpsHost
2082
2325
  );
2083
2326
  const res = await execa("ssh", argv, { reject: false });
2084
- if (res.exitCode !== 0 || !existsSync2(controlPath)) {
2327
+ if (res.exitCode !== 0 || !existsSync3(controlPath)) {
2085
2328
  throw new Error(
2086
2329
  `ssh ControlMaster failed for ${opts.boxId} (exit ${String(res.exitCode)}): ${res.stderr || res.stdout || "(no output)"}`
2087
2330
  );
@@ -2140,14 +2383,14 @@ var SshTunnelManager = class {
2140
2383
  const existing = this.boxes.get(opts.boxId);
2141
2384
  if (existing) {
2142
2385
  const alive = await this.isAlive(existing.controlPath);
2143
- if (!alive && existsSync2(existing.controlPath)) {
2386
+ if (!alive && existsSync3(existing.controlPath)) {
2144
2387
  try {
2145
2388
  await execa("ssh", ["-O", "exit", "-S", existing.controlPath, "dummy"], {
2146
2389
  reject: false
2147
2390
  });
2148
2391
  } catch {
2149
2392
  }
2150
- await rm2(existing.controlPath, { force: true });
2393
+ await rm3(existing.controlPath, { force: true });
2151
2394
  }
2152
2395
  existing.forwards.clear();
2153
2396
  }
@@ -2177,9 +2420,9 @@ var SshTunnelManager = class {
2177
2420
  async close(boxId) {
2178
2421
  const tunnel = this.boxes.get(boxId);
2179
2422
  if (!tunnel) return;
2180
- if (existsSync2(tunnel.controlPath)) {
2423
+ if (existsSync3(tunnel.controlPath)) {
2181
2424
  await execa("ssh", ["-O", "exit", "-S", tunnel.controlPath, "dummy"], { reject: false });
2182
- await rm2(tunnel.controlPath, { force: true });
2425
+ await rm3(tunnel.controlPath, { force: true });
2183
2426
  }
2184
2427
  this.boxes.delete(boxId);
2185
2428
  }
@@ -2225,7 +2468,7 @@ var SshTunnelManager = class {
2225
2468
  };
2226
2469
  function defaultBoxSshDir(boxId, namespace) {
2227
2470
  const safe = boxId.replace(/[^A-Za-z0-9._-]/g, "_");
2228
- return namespace ? resolve22(homedir5(), ".agentbox", namespace, "boxes", safe, "ssh") : resolve22(homedir5(), ".agentbox", "boxes", safe, "ssh");
2471
+ return namespace ? resolve22(homedir6(), ".agentbox", namespace, "boxes", safe, "ssh") : resolve22(homedir6(), ".agentbox", "boxes", safe, "ssh");
2229
2472
  }
2230
2473
  function boxSshNamespaceForProvider(provider) {
2231
2474
  switch (provider) {
@@ -2389,17 +2632,17 @@ function errSummary(err) {
2389
2632
  return err instanceof Error ? firstLine(err.message) : String(err);
2390
2633
  }
2391
2634
  function secretsEnvPath() {
2392
- return resolve32(homedir6(), ".agentbox", "secrets.env");
2635
+ return resolve32(homedir7(), ".agentbox", "secrets.env");
2393
2636
  }
2394
2637
  function writeManagedSecrets(managedKeys, record) {
2395
2638
  for (const k of managedKeys) delete process.env[k];
2396
2639
  for (const [k, v] of Object.entries(record)) process.env[k] = v;
2397
2640
  const path = secretsEnvPath();
2398
- mkdirSync2(dirname4(path), { recursive: true });
2641
+ mkdirSync2(dirname5(path), { recursive: true });
2399
2642
  let existing = "";
2400
- if (existsSync3(path)) {
2643
+ if (existsSync4(path)) {
2401
2644
  try {
2402
- existing = readFileSync2(path, "utf8");
2645
+ existing = readFileSync3(path, "utf8");
2403
2646
  } catch {
2404
2647
  existing = "";
2405
2648
  }
@@ -2442,7 +2685,26 @@ async function publishManagedCredentials(providerId, fields) {
2442
2685
  } catch {
2443
2686
  }
2444
2687
  }
2445
- var HUB_RELAY_PORT = 8787;
2688
+ var FALLBACK_RELAY_PORT = 8787;
2689
+ var RELAY_PORT_ENV = "AGENTBOX_RELAY_PORT";
2690
+ var override = null;
2691
+ function isValidRelayPort(port) {
2692
+ return Number.isInteger(port) && port >= 1 && port <= 65535;
2693
+ }
2694
+ function setRelayPort(port) {
2695
+ if (!isValidRelayPort(port)) return;
2696
+ override = port;
2697
+ process.env[RELAY_PORT_ENV] = String(port);
2698
+ }
2699
+ function relayPort() {
2700
+ if (override !== null) return override;
2701
+ const fromEnv = Number.parseInt(process.env[RELAY_PORT_ENV] ?? "", 10);
2702
+ return isValidRelayPort(fromEnv) ? fromEnv : FALLBACK_RELAY_PORT;
2703
+ }
2704
+ function resetRelayPort() {
2705
+ override = null;
2706
+ delete process.env[RELAY_PORT_ENV];
2707
+ }
2446
2708
  function shouldReclaimForVersion(health, currentVersion) {
2447
2709
  if (health.cliEntry === false) return true;
2448
2710
  if (typeof health.version === "string" && health.version.length > 0 && typeof currentVersion === "string" && currentVersion.length > 0 && health.version !== currentVersion) {
@@ -2466,19 +2728,32 @@ async function killPid(pid) {
2466
2728
  }
2467
2729
  for (let i = 0; i < 20; i++) {
2468
2730
  if (!await processAlive(pid)) return;
2469
- await delay2(100);
2731
+ await delay3(100);
2470
2732
  }
2471
2733
  try {
2472
2734
  process.kill(pid, "SIGKILL");
2473
2735
  } catch {
2474
2736
  }
2475
2737
  }
2738
+ function portIsOccupied(timeoutMs, port = relayPort()) {
2739
+ return new Promise((resolveP) => {
2740
+ const sock = netConnect({ host: "127.0.0.1", port });
2741
+ const done = (occupied) => {
2742
+ sock.destroy();
2743
+ resolveP(occupied);
2744
+ };
2745
+ sock.setTimeout(timeoutMs);
2746
+ sock.once("connect", () => done(true));
2747
+ sock.once("timeout", () => done(false));
2748
+ sock.once("error", () => done(false));
2749
+ });
2750
+ }
2476
2751
  function pingHealthz(timeoutMs) {
2477
2752
  return new Promise((resolveP) => {
2478
2753
  const req = httpRequest(
2479
2754
  {
2480
2755
  host: "127.0.0.1",
2481
- port: HUB_RELAY_PORT,
2756
+ port: relayPort(),
2482
2757
  method: "GET",
2483
2758
  path: "/healthz",
2484
2759
  timeout: timeoutMs
@@ -2502,7 +2777,7 @@ function fetchHealthz(timeoutMs) {
2502
2777
  const req = httpRequest(
2503
2778
  {
2504
2779
  host: "127.0.0.1",
2505
- port: HUB_RELAY_PORT,
2780
+ port: relayPort(),
2506
2781
  method: "GET",
2507
2782
  path: "/healthz",
2508
2783
  timeout: timeoutMs
@@ -2553,30 +2828,30 @@ function fetchHealthz(timeoutMs) {
2553
2828
  });
2554
2829
  }
2555
2830
  function resolveCliEntry() {
2556
- const override = process.env.AGENTBOX_CLI_ENTRY;
2557
- if (override && existsSync4(override)) return override;
2558
- const here = dirname5(fileURLToPath(import.meta.url));
2831
+ const override2 = process.env.AGENTBOX_CLI_ENTRY;
2832
+ if (override2 && existsSync5(override2)) return override2;
2833
+ const here = dirname6(fileURLToPath(import.meta.url));
2559
2834
  const candidates = [
2560
2835
  resolve4(here, "index.js"),
2561
2836
  resolve4(here, "..", "..", "..", "apps", "cli", "dist", "index.js"),
2562
2837
  resolve4(here, "..", "..", "..", "..", "dist", "index.js")
2563
2838
  ];
2564
2839
  for (const c of candidates) {
2565
- if (existsSync4(c)) return c;
2840
+ if (existsSync5(c)) return c;
2566
2841
  }
2567
2842
  return null;
2568
2843
  }
2569
2844
  var RUNTIME_ROOT_ENV = "AGENTBOX_RUNTIME_ROOT";
2570
2845
  function stagedRuntimeRootCandidates(self) {
2571
2846
  const candidates = [];
2572
- const override = process.env[RUNTIME_ROOT_ENV];
2573
- if (override) candidates.push(override);
2847
+ const override2 = process.env[RUNTIME_ROOT_ENV];
2848
+ if (override2) candidates.push(override2);
2574
2849
  candidates.push(resolve5(self, "..", "runtime"), resolve5(self, "..", "..", "runtime"));
2575
2850
  return candidates;
2576
2851
  }
2577
2852
  function resolveStagedRuntimeRoot(self, marker) {
2578
2853
  for (const candidate of stagedRuntimeRootCandidates(self)) {
2579
- if (existsSync5(resolve5(candidate, marker))) return candidate;
2854
+ if (existsSync6(resolve5(candidate, marker))) return candidate;
2580
2855
  }
2581
2856
  return void 0;
2582
2857
  }
@@ -2614,22 +2889,22 @@ function setHubDockerContext(dir) {
2614
2889
  function hubDockerContext() {
2615
2890
  return dockerContext;
2616
2891
  }
2617
- var STATE_DIR2 = join7(homedir7(), ".agentbox");
2618
- var HUB_PID_FILE = join7(STATE_DIR2, "hub.pid");
2619
- var HUB_LOG_FILE = join7(STATE_DIR2, "hub.log");
2620
- var HUB_TOKEN_FILE = join7(STATE_DIR2, "hub", "token");
2621
- var PORT = HUB_RELAY_PORT;
2892
+ var STATE_DIR2 = join8(homedir8(), ".agentbox");
2893
+ var HUB_PID_FILE = join8(STATE_DIR2, "hub.pid");
2894
+ var RELAY_PID_FILE = join8(STATE_DIR2, "relay.pid");
2895
+ var HUB_LOG_FILE = join8(STATE_DIR2, "hub.log");
2896
+ var HUB_TOKEN_FILE = join8(STATE_DIR2, "hub", "token");
2622
2897
  var HOST2 = "0.0.0.0";
2623
2898
  var LOOPBACK_HOST = "127.0.0.1";
2624
2899
  var NODE_MIN = { major: 22, minor: 5 };
2625
- var CP_DIR = join7(STATE_DIR2, "control-plane");
2900
+ var CP_DIR = join8(STATE_DIR2, "control-plane");
2626
2901
  async function resolveExposedSpawn() {
2627
2902
  try {
2628
2903
  const record = JSON.parse(
2629
- await readFile3(controlPlaneDeployPath(), "utf8")
2904
+ await readFile4(controlPlaneDeployPath(), "utf8")
2630
2905
  );
2631
2906
  if (record.provider !== "local") return null;
2632
- const envBody = await readFile3(join7(CP_DIR, "control-plane.env"), "utf8").catch(() => "");
2907
+ const envBody = await readFile4(join8(CP_DIR, "control-plane.env"), "utf8").catch(() => "");
2633
2908
  const env = buildExposedHubEnv(record, parseEnvFileBody(envBody));
2634
2909
  return { env, profile: EXPOSED_HUB_PROFILE };
2635
2910
  } catch {
@@ -2654,7 +2929,7 @@ function nodeFlags() {
2654
2929
  }
2655
2930
  async function readPid(file) {
2656
2931
  try {
2657
- const pid = Number.parseInt((await readFile3(file, "utf8")).trim(), 10);
2932
+ const pid = Number.parseInt((await readFile4(file, "utf8")).trim(), 10);
2658
2933
  return Number.isFinite(pid) && pid > 0 ? pid : null;
2659
2934
  } catch {
2660
2935
  return null;
@@ -2662,7 +2937,7 @@ async function readPid(file) {
2662
2937
  }
2663
2938
  async function readToken() {
2664
2939
  try {
2665
- const t = (await readFile3(HUB_TOKEN_FILE, "utf8")).trim();
2940
+ const t = (await readFile4(HUB_TOKEN_FILE, "utf8")).trim();
2666
2941
  return t.length > 0 ? t : null;
2667
2942
  } catch {
2668
2943
  return null;
@@ -2673,25 +2948,25 @@ function readHubToken() {
2673
2948
  }
2674
2949
  async function endpointFor(portlessUrl) {
2675
2950
  const token = await readToken();
2676
- const hostUrl = portlessUrl ?? `http://${LOOPBACK_HOST}:${String(PORT)}`;
2951
+ const hostUrl = portlessUrl ?? `http://${LOOPBACK_HOST}:${String(relayPort())}`;
2677
2952
  return {
2678
2953
  hostUrl,
2679
2954
  openUrl: token ? `${hostUrl}/?token=${token}` : hostUrl,
2680
- port: PORT,
2955
+ port: relayPort(),
2681
2956
  token
2682
2957
  };
2683
2958
  }
2684
2959
  function resolveHubServer() {
2685
- const override = process.env.AGENTBOX_HUB_BIN;
2686
- if (override && existsSync6(override)) return override;
2687
- const here = dirname6(fileURLToPath2(import.meta.url));
2960
+ const override2 = process.env.AGENTBOX_HUB_BIN;
2961
+ if (override2 && existsSync7(override2)) return override2;
2962
+ const here = dirname7(fileURLToPath2(import.meta.url));
2688
2963
  const candidates = [
2689
2964
  resolve6(here, "..", "runtime", "hub", "apps", "hub", "server.js"),
2690
2965
  resolve6(here, "..", "..", "..", "apps", "hub", "dist-standalone", "apps", "hub", "server.js"),
2691
2966
  resolve6(here, "..", "..", "apps", "hub", "dist-standalone", "apps", "hub", "server.js")
2692
2967
  ];
2693
2968
  for (const c of candidates) {
2694
- if (existsSync6(c)) return c;
2969
+ if (existsSync7(c)) return c;
2695
2970
  }
2696
2971
  throw new Error(
2697
2972
  `could not locate the built hub server; run \`pnpm --filter @agentbox/hub build:standalone\` (dev), or set AGENTBOX_HUB_BIN. Tried:
@@ -2702,7 +2977,7 @@ function hubRuntimeEnv(opts = {}) {
2702
2977
  const env = {};
2703
2978
  const dockerContext2 = opts.dockerContext ?? hubDockerContext();
2704
2979
  if (dockerContext2) env.AGENTBOX_DOCKER_CONTEXT = dockerContext2;
2705
- const runtimeRoot = opts.runtimeRoot ?? resolveStagedRuntimeRoot(dirname6(fileURLToPath2(import.meta.url)), "docker/Dockerfile.box");
2980
+ const runtimeRoot = opts.runtimeRoot ?? resolveStagedRuntimeRoot(dirname7(fileURLToPath2(import.meta.url)), "docker/Dockerfile.box");
2706
2981
  if (runtimeRoot) env[RUNTIME_ROOT_ENV] = runtimeRoot;
2707
2982
  return env;
2708
2983
  }
@@ -2713,14 +2988,16 @@ async function reclaimPort(reportedPid, log) {
2713
2988
  if (typeof pid !== "number" || pid <= 0 || seen.has(pid)) continue;
2714
2989
  seen.add(pid);
2715
2990
  if (!await processAlive(pid)) continue;
2716
- log(`stopping process on :${String(PORT)} (pid ${String(pid)})`);
2991
+ log(`stopping process on :${String(relayPort())} (pid ${String(pid)})`);
2717
2992
  await killPid(pid);
2718
2993
  }
2719
2994
  await unlink(HUB_PID_FILE).catch(() => {
2720
2995
  });
2996
+ await unlink(RELAY_PID_FILE).catch(() => {
2997
+ });
2721
2998
  if (await pingHealthz(300)) {
2722
2999
  throw new Error(
2723
- `something is still listening on :${String(PORT)} and could not be stopped (reported pid ${String(reportedPid ?? "unknown")}); kill it manually and retry`
3000
+ `something is still listening on :${String(relayPort())} and could not be stopped (reported pid ${String(reportedPid ?? "unknown")}); kill it manually and retry`
2724
3001
  );
2725
3002
  }
2726
3003
  }
@@ -2728,19 +3005,26 @@ async function ensureHub(opts = {}) {
2728
3005
  const log = opts.onLog ?? (() => {
2729
3006
  });
2730
3007
  assertNodeSupported();
2731
- await mkdir4(STATE_DIR2, { recursive: true });
3008
+ await mkdir5(STATE_DIR2, { recursive: true });
2732
3009
  const exposed = await resolveExposedSpawn();
2733
3010
  const desiredProfile = exposed?.profile ?? "localhost";
3011
+ const exposedPort = Number.parseInt(exposed?.env["AGENTBOX_HUB_PORT"] ?? "", 10);
3012
+ if (isValidRelayPort(exposedPort) && exposedPort !== relayPort()) {
3013
+ log(
3014
+ `this machine's hub is exposed on :${String(exposedPort)}, so relay.port (${String(relayPort())}) does not apply here \u2014 re-run \`agentbox hub expose --port\` to move it`
3015
+ );
3016
+ setRelayPort(exposedPort);
3017
+ }
2734
3018
  const currentVersion = process.env.AGENTBOX_CLI_VERSION;
2735
3019
  const reusable = (h) => h.ui === true && !shouldReclaimForVersion(h, currentVersion) && (h.profile ?? "localhost") === desiredProfile;
2736
3020
  const health = await fetchHealthz(500);
2737
3021
  if (health !== null) {
2738
3022
  const profileMismatch = (health.profile ?? "localhost") !== desiredProfile;
2739
3023
  if (reusable(health)) {
2740
- return endpointFor(await hubPortlessSync(opts.portlessEnabled, PORT));
3024
+ return endpointFor(await hubPortlessSync(opts.portlessEnabled, relayPort()));
2741
3025
  }
2742
3026
  log(
2743
- profileMismatch ? `a hub in the ${health.profile ?? "localhost"} profile holds :${String(PORT)} \u2014 reclaiming to run ${desiredProfile}` : health.ui === true ? "a hub from a different agentbox version holds :8787 \u2014 reclaiming" : "a lean relay holds :8787 \u2014 reclaiming to start the hub"
3027
+ profileMismatch ? `a hub in the ${health.profile ?? "localhost"} profile holds :${String(relayPort())} \u2014 reclaiming to run ${desiredProfile}` : health.ui === true ? "a hub from a different agentbox version holds :8787 \u2014 reclaiming" : "a lean relay holds :8787 \u2014 reclaiming to start the hub"
2744
3028
  );
2745
3029
  await reclaimPort(health.pid, log);
2746
3030
  } else {
@@ -2750,14 +3034,14 @@ async function ensureHub(opts = {}) {
2750
3034
  for (let i = 0; i < 10; i++) {
2751
3035
  late = await fetchHealthz(300);
2752
3036
  if (late !== null) break;
2753
- await delay3(200);
3037
+ await delay4(200);
2754
3038
  }
2755
3039
  if (late !== null && reusable(late)) {
2756
- return endpointFor(await hubPortlessSync(opts.portlessEnabled, PORT));
3040
+ return endpointFor(await hubPortlessSync(opts.portlessEnabled, relayPort()));
2757
3041
  }
2758
3042
  if (late !== null) {
2759
3043
  log(
2760
- `a hub in the ${late.profile ?? "localhost"} profile holds :${String(PORT)} \u2014 reclaiming to run ${desiredProfile}`
3044
+ `a hub in the ${late.profile ?? "localhost"} profile holds :${String(relayPort())} \u2014 reclaiming to run ${desiredProfile}`
2761
3045
  );
2762
3046
  }
2763
3047
  log(`hub pid ${String(pid)} alive but /healthz unresponsive \u2014 restarting it`);
@@ -2793,6 +3077,10 @@ async function spawnHub(hubServer, cliEntry, log, portlessEnabled, exposedEnv) {
2793
3077
  // so docker boxes reach its embedded relay via host.docker.internal; the
2794
3078
  // profile is set independently of the bind host in server.ts.
2795
3079
  AGENTBOX_HUB_HOST: HOST2,
3080
+ // Load-bearing for `relay.port`: server.ts defaults to 8787 on its own, so
3081
+ // without this the hub keeps binding 8787 while everything here probes the
3082
+ // configured port.
3083
+ AGENTBOX_HUB_PORT: String(relayPort()),
2796
3084
  // The hub bundle ships no staged build context of its own, so its
2797
3085
  // in-process freshness checks couldn't fingerprint (degrading to
2798
3086
  // 'unknown'). Hand it the CLI's resolved roots so hub-side fingerprints
@@ -2809,29 +3097,29 @@ async function spawnHub(hubServer, cliEntry, log, portlessEnabled, exposedEnv) {
2809
3097
  exit = { code, signal };
2810
3098
  });
2811
3099
  if (typeof child.pid === "number") {
2812
- await writeFile2(HUB_PID_FILE, String(child.pid), "utf8");
2813
- log(`spawned hub process (pid ${String(child.pid)}, port ${String(PORT)})`);
3100
+ await writeFile3(HUB_PID_FILE, String(child.pid), "utf8");
3101
+ log(`spawned hub process (pid ${String(child.pid)}, port ${String(relayPort())})`);
2814
3102
  }
2815
3103
  for (let i = 0; i < 50; i++) {
2816
3104
  if (await pingHealthz(300)) {
2817
- log(`hub reachable on http://${LOOPBACK_HOST}:${String(PORT)}`);
2818
- const purl = await hubPortlessSync(portlessEnabled, PORT);
3105
+ log(`hub reachable on http://${LOOPBACK_HOST}:${String(relayPort())}`);
3106
+ const purl = await hubPortlessSync(portlessEnabled, relayPort());
2819
3107
  if (purl) log(`hub also reachable on ${purl}`);
2820
3108
  return endpointFor(purl);
2821
3109
  }
2822
3110
  if (exit !== null) {
2823
3111
  await unlink(HUB_PID_FILE).catch(() => {
2824
3112
  });
2825
- await delay3(150);
3113
+ await delay4(150);
2826
3114
  throw new Error(
2827
3115
  await hubStartupError(`hub process exited (${describeExit(exit)}) during startup`)
2828
3116
  );
2829
3117
  }
2830
- await delay3(200);
3118
+ await delay4(200);
2831
3119
  }
2832
3120
  throw new Error(
2833
3121
  await hubStartupError(
2834
- `hub did not become reachable on http://${LOOPBACK_HOST}:${String(PORT)} within ~25s`
3122
+ `hub did not become reachable on http://${LOOPBACK_HOST}:${String(relayPort())} within ~25s`
2835
3123
  )
2836
3124
  );
2837
3125
  }
@@ -2848,7 +3136,7 @@ ${tail}` : `; see ${HUB_LOG_FILE}`;
2848
3136
  }
2849
3137
  async function tailFile(file, maxLines) {
2850
3138
  try {
2851
- const lines = (await readFile3(file, "utf8")).split("\n").filter((l) => l.trim().length > 0);
3139
+ const lines = (await readFile4(file, "utf8")).split("\n").filter((l) => l.trim().length > 0);
2852
3140
  return lines.slice(-maxLines).join("\n");
2853
3141
  } catch {
2854
3142
  return "";
@@ -2882,16 +3170,29 @@ async function getHubStatus() {
2882
3170
  ui: health?.ui === true,
2883
3171
  pid,
2884
3172
  pidAlive,
2885
- port: PORT,
3173
+ port: relayPort(),
2886
3174
  hostUrl: ep.hostUrl,
2887
3175
  openUrl: ep.openUrl,
2888
3176
  token: ep.token,
2889
3177
  pidFile: HUB_PID_FILE,
2890
3178
  logFile: HUB_LOG_FILE,
2891
3179
  ...health?.profile ? { profile: health.profile } : {},
2892
- ...health?.worker ? { worker: true } : {}
3180
+ ...health?.worker ? { worker: true } : {},
3181
+ ...await bundleIsNewerThanHub(pid) ? { staleBundle: true } : {}
2893
3182
  };
2894
3183
  }
3184
+ async function bundleIsNewerThanHub(pid) {
3185
+ if (pid === null) return false;
3186
+ try {
3187
+ const [startedAt, builtAt] = await Promise.all([
3188
+ stat5(HUB_PID_FILE).then((st) => st.mtimeMs),
3189
+ stat5(resolveHubServer()).then((st) => st.mtimeMs)
3190
+ ]);
3191
+ return builtAt > startedAt;
3192
+ } catch {
3193
+ return false;
3194
+ }
3195
+ }
2895
3196
  var activeRefresher;
2896
3197
  function setDockerCredentialRefresh(fn) {
2897
3198
  activeRefresher = fn;
@@ -2903,129 +3204,6 @@ async function runDockerCredentialRefresh(opts) {
2903
3204
  } catch {
2904
3205
  }
2905
3206
  }
2906
- var PLUGINS_FILE = join8(homedir8(), ".agentbox", "plugins.json");
2907
- var SUPPORTED_SDK_API_VERSIONS = [1, 2];
2908
- function isSupportedApiVersion(v) {
2909
- return SUPPORTED_SDK_API_VERSIONS.includes(v);
2910
- }
2911
- var EMPTY2 = { version: 1, plugins: [] };
2912
- var LOCK_STALE_MS2 = 15e3;
2913
- var LOCK_ACQUIRE_TIMEOUT_MS2 = 2e4;
2914
- var LOCK_RETRY_MS2 = 25;
2915
- async function withFileLock(path, fn) {
2916
- const lockPath = `${path}.lock`;
2917
- await mkdir5(dirname7(path), { recursive: true });
2918
- const deadline = Date.now() + LOCK_ACQUIRE_TIMEOUT_MS2;
2919
- let held = false;
2920
- while (!held) {
2921
- try {
2922
- const fh = await open2(lockPath, "wx");
2923
- await fh.writeFile(`${String(process.pid)}
2924
- `);
2925
- await fh.close();
2926
- held = true;
2927
- } catch (err) {
2928
- if (err.code !== "EEXIST") throw err;
2929
- try {
2930
- const st = await stat4(lockPath);
2931
- if (Date.now() - st.mtimeMs > LOCK_STALE_MS2) {
2932
- await rm3(lockPath, { force: true });
2933
- continue;
2934
- }
2935
- } catch {
2936
- continue;
2937
- }
2938
- if (Date.now() >= deadline) break;
2939
- await delay4(LOCK_RETRY_MS2);
2940
- }
2941
- }
2942
- try {
2943
- return await fn();
2944
- } finally {
2945
- if (held) await rm3(lockPath, { force: true }).catch(() => {
2946
- });
2947
- }
2948
- }
2949
- function normalize2(raw) {
2950
- const parsed = raw;
2951
- if (!parsed || parsed.version !== 1 || !Array.isArray(parsed.plugins)) {
2952
- return { ...EMPTY2 };
2953
- }
2954
- return parsed;
2955
- }
2956
- function readPluginRegistrySync(path = PLUGINS_FILE) {
2957
- try {
2958
- if (!existsSync7(path)) return { ...EMPTY2 };
2959
- return normalize2(JSON.parse(readFileSync3(path, "utf8")));
2960
- } catch {
2961
- return { ...EMPTY2 };
2962
- }
2963
- }
2964
- async function readPluginRegistry(path = PLUGINS_FILE) {
2965
- try {
2966
- return normalize2(JSON.parse(await readFile4(path, "utf8")));
2967
- } catch (err) {
2968
- if (err.code === "ENOENT") return { ...EMPTY2 };
2969
- return { ...EMPTY2 };
2970
- }
2971
- }
2972
- async function readForWrite(path) {
2973
- let raw;
2974
- try {
2975
- raw = await readFile4(path, "utf8");
2976
- } catch (err) {
2977
- if (err.code === "ENOENT") return { ...EMPTY2 };
2978
- throw err;
2979
- }
2980
- let parsed;
2981
- try {
2982
- parsed = JSON.parse(raw);
2983
- } catch (err) {
2984
- throw new Error(
2985
- `refusing to modify a corrupt plugin registry at ${path} (${err.message}) \u2014 fix or delete the file and retry.`
2986
- );
2987
- }
2988
- const p = parsed;
2989
- if (!p || p.version !== 1 || !Array.isArray(p.plugins)) {
2990
- throw new Error(
2991
- `refusing to modify an unrecognized plugin registry at ${path} \u2014 fix or delete the file and retry.`
2992
- );
2993
- }
2994
- return p;
2995
- }
2996
- async function writeRegistry(file, path = PLUGINS_FILE) {
2997
- await mkdir5(dirname7(path), { recursive: true });
2998
- const tmp = `${path}.tmp.${String(process.pid)}.${String(Date.now())}`;
2999
- await writeFile3(tmp, JSON.stringify(file, null, 2) + "\n", "utf8");
3000
- await rename2(tmp, path);
3001
- }
3002
- async function addPluginRecord(record, path = PLUGINS_FILE) {
3003
- await withFileLock(path, async () => {
3004
- const file = await readForWrite(path);
3005
- const next = file.plugins.filter((p) => p.packageName !== record.packageName);
3006
- next.push(record);
3007
- await writeRegistry({ version: 1, plugins: next }, path);
3008
- });
3009
- }
3010
- async function removePluginRecord(nameOrPackage, path = PLUGINS_FILE) {
3011
- let removed = 0;
3012
- await withFileLock(path, async () => {
3013
- const file = await readForWrite(path);
3014
- const next = file.plugins.filter((p) => {
3015
- const match = p.packageName === nameOrPackage || p.providers.includes(nameOrPackage);
3016
- if (match) removed += 1;
3017
- return !match;
3018
- });
3019
- await writeRegistry({ version: 1, plugins: next }, path);
3020
- });
3021
- return removed;
3022
- }
3023
- function pluginProviderNames(path = PLUGINS_FILE) {
3024
- return readPluginRegistrySync(path).plugins.flatMap((p) => p.providers);
3025
- }
3026
- function pluginForProvider(providerName, path = PLUGINS_FILE) {
3027
- return readPluginRegistrySync(path).plugins.find((p) => p.providers.includes(providerName)) ?? null;
3028
- }
3029
3207
  function carryPlaceholderContext(ctx) {
3030
3208
  const out = {};
3031
3209
  if (ctx.name) out.AGENTBOX_BOX_NAME = ctx.name;
@@ -3597,7 +3775,7 @@ function parseFlatInventory(stdout) {
3597
3775
  }
3598
3776
  async function pathExists(path) {
3599
3777
  try {
3600
- await stat5(path);
3778
+ await stat6(path);
3601
3779
  return true;
3602
3780
  } catch {
3603
3781
  return false;
@@ -3968,7 +4146,7 @@ function planCarryEntry(entry) {
3968
4146
  }
3969
4147
  async function pathExists2(p) {
3970
4148
  try {
3971
- await stat6(p);
4149
+ await stat7(p);
3972
4150
  return true;
3973
4151
  } catch {
3974
4152
  return false;
@@ -4037,7 +4215,7 @@ async function findUnsyncableSymlinks(root, reachableRoots) {
4037
4215
  unsyncable.push(virtualFull);
4038
4216
  continue;
4039
4217
  }
4040
- const st = await stat7(real).catch(() => null);
4218
+ const st = await stat8(real).catch(() => null);
4041
4219
  if (st?.isDirectory()) await walk(real, virtualFull);
4042
4220
  } else if (ent.isDirectory()) {
4043
4221
  await walk(realFull, virtualFull);
@@ -4052,7 +4230,7 @@ async function findUnsyncableSymlinks(root, reachableRoots) {
4052
4230
  }
4053
4231
  async function pathExists3(p) {
4054
4232
  try {
4055
- await stat8(p);
4233
+ await stat9(p);
4056
4234
  return true;
4057
4235
  } catch {
4058
4236
  return false;
@@ -4100,7 +4278,7 @@ function isRealAgentCredential(agent, text) {
4100
4278
  }
4101
4279
  return Object.keys(parsed).length > 0;
4102
4280
  }
4103
- async function hostClaudeBackupExpired(path = CLAUDE_HOST_BACKUP, now = Date.now()) {
4281
+ async function hostClaudeAccessTokenExpired(path = CLAUDE_HOST_BACKUP, now = Date.now()) {
4104
4282
  try {
4105
4283
  const parsed = JSON.parse(await readFile7(path, "utf8"));
4106
4284
  const exp = parsed?.claudeAiOauth?.expiresAt;
@@ -4109,6 +4287,17 @@ async function hostClaudeBackupExpired(path = CLAUDE_HOST_BACKUP, now = Date.now
4109
4287
  return false;
4110
4288
  }
4111
4289
  }
4290
+ async function hostClaudeLoginDead(path = CLAUDE_HOST_BACKUP, now = Date.now()) {
4291
+ let text;
4292
+ try {
4293
+ text = await readFile7(path, "utf8");
4294
+ } catch {
4295
+ return false;
4296
+ }
4297
+ if (!isRealAgentCredential("claude", text)) return true;
4298
+ const exp = claudeRefreshExpiresAt(text);
4299
+ return exp !== null && exp < now;
4300
+ }
4112
4301
  async function hostBackupHasCredentials(path = CLAUDE_HOST_BACKUP) {
4113
4302
  try {
4114
4303
  const parsed = JSON.parse(await readFile7(path, "utf8"));
@@ -4167,6 +4356,15 @@ function claudeExpiresAt(text) {
4167
4356
  return null;
4168
4357
  }
4169
4358
  }
4359
+ function claudeRefreshExpiresAt(text) {
4360
+ try {
4361
+ const parsed = JSON.parse(text);
4362
+ const exp = parsed?.claudeAiOauth?.refreshTokenExpiresAt;
4363
+ return typeof exp === "number" && Number.isFinite(exp) ? exp : null;
4364
+ } catch {
4365
+ return null;
4366
+ }
4367
+ }
4170
4368
  function shouldAcceptCredentialUpdate(agent, incoming, existing) {
4171
4369
  if (existing === null) return { accept: true, reason: "no existing backup" };
4172
4370
  if (existing === incoming) return { accept: false, reason: "unchanged" };
@@ -4388,7 +4586,7 @@ var BOX_DYNAMIC_SYNC_MANIFEST = "/home/vscode/.agentbox/dynamic-sync.json";
4388
4586
  var BOX_MEMORY_DIR = `${BOX_CLAUDE_PROJECT_DIR}/memory`;
4389
4587
  async function pathExists4(p) {
4390
4588
  try {
4391
- await stat9(p);
4589
+ await stat10(p);
4392
4590
  return true;
4393
4591
  } catch {
4394
4592
  return false;
@@ -4411,7 +4609,7 @@ async function walkFiles(root, prefix = "") {
4411
4609
  out.push(rel);
4412
4610
  } else if (ent.isSymbolicLink()) {
4413
4611
  try {
4414
- const s = await stat9(full);
4612
+ const s = await stat10(full);
4415
4613
  if (s.isFile()) out.push(rel);
4416
4614
  } catch {
4417
4615
  }
@@ -4707,7 +4905,7 @@ var CREDENTIALS_BACKUP_FILE = resolveAgentSpec("claude").credential.hostBackup;
4707
4905
  var CLOUD_WORKSPACE = "/workspace";
4708
4906
  async function pathExists5(p) {
4709
4907
  try {
4710
- await stat10(p);
4908
+ await stat11(p);
4711
4909
  return true;
4712
4910
  } catch {
4713
4911
  return false;
@@ -4726,7 +4924,7 @@ async function findBrokenSymlinks(root) {
4726
4924
  const full = join19(dir, ent.name);
4727
4925
  if (ent.isSymbolicLink()) {
4728
4926
  try {
4729
- await stat10(full);
4927
+ await stat11(full);
4730
4928
  } catch {
4731
4929
  broken.push(relative2(root, full));
4732
4930
  }
@@ -5215,13 +5413,9 @@ var DOCKER_CONTEXT_FILE_MAP = {
5215
5413
  staged: "packages/sandbox-docker/scripts/git-shim",
5216
5414
  dev: "scripts/git-shim"
5217
5415
  },
5218
- "scripts/ntn-shim": {
5219
- staged: "packages/sandbox-docker/scripts/ntn-shim",
5220
- dev: "scripts/ntn-shim"
5221
- },
5222
- "scripts/linear-shim": {
5223
- staged: "packages/sandbox-docker/scripts/linear-shim",
5224
- dev: "scripts/linear-shim"
5416
+ "scripts/agentbox-tool-shim": {
5417
+ staged: "packages/sandbox-docker/scripts/agentbox-tool-shim",
5418
+ dev: "scripts/agentbox-tool-shim"
5225
5419
  },
5226
5420
  "scripts/chromium-resolver": {
5227
5421
  staged: "packages/sandbox-docker/scripts/chromium-resolver",
@@ -5305,6 +5499,8 @@ function boxNameBasisFromOriginUrl(originUrl) {
5305
5499
 
5306
5500
  export {
5307
5501
  resolveAgentLauncher,
5502
+ claudeTuiEnv,
5503
+ buildNoVncUrl,
5308
5504
  parseReplacements,
5309
5505
  UserFacingError,
5310
5506
  BoxNotFoundError,
@@ -5364,6 +5560,21 @@ export {
5364
5560
  EXPOSED_HUB_PROFILE,
5365
5561
  parseEnvFileBody,
5366
5562
  buildExposedHubEnv,
5563
+ PLUGINS_FILE,
5564
+ SUPPORTED_SDK_API_VERSIONS,
5565
+ isSupportedApiVersion,
5566
+ PLUGINS_FILE_VERSION,
5567
+ readPluginRegistrySync,
5568
+ readPluginRegistry,
5569
+ recordPluginDescriptor,
5570
+ addPluginRecord,
5571
+ removePluginRecord,
5572
+ pluginProviderNames,
5573
+ pluginForProvider,
5574
+ resolveProviderDescriptor,
5575
+ listProviderDescriptors,
5576
+ deriveDescriptor,
5577
+ ensureProviderDescriptor,
5367
5578
  resolveCloudSshTarget,
5368
5579
  ensureCloudSshAlias,
5369
5580
  autoWriteSshConfig,
@@ -5408,10 +5619,16 @@ export {
5408
5619
  maskSecret,
5409
5620
  setCredentialPublisher,
5410
5621
  publishManagedCredentials,
5411
- HUB_RELAY_PORT,
5622
+ FALLBACK_RELAY_PORT,
5623
+ RELAY_PORT_ENV,
5624
+ isValidRelayPort,
5625
+ setRelayPort,
5626
+ relayPort,
5627
+ resetRelayPort,
5412
5628
  shouldReclaimForVersion,
5413
5629
  processAlive,
5414
5630
  killPid,
5631
+ portIsOccupied,
5415
5632
  pingHealthz,
5416
5633
  fetchHealthz,
5417
5634
  resolveCliEntry,
@@ -5429,15 +5646,6 @@ export {
5429
5646
  getHubStatus,
5430
5647
  setDockerCredentialRefresh,
5431
5648
  runDockerCredentialRefresh,
5432
- PLUGINS_FILE,
5433
- SUPPORTED_SDK_API_VERSIONS,
5434
- isSupportedApiVersion,
5435
- readPluginRegistrySync,
5436
- readPluginRegistry,
5437
- addPluginRecord,
5438
- removePluginRecord,
5439
- pluginProviderNames,
5440
- pluginForProvider,
5441
5649
  carryPlaceholderContext,
5442
5650
  renderCarryEntries,
5443
5651
  makeRecordingTransport,
@@ -5494,11 +5702,13 @@ export {
5494
5702
  seedAgentsVolume,
5495
5703
  SEED_MARKER,
5496
5704
  isRealAgentCredential,
5497
- hostClaudeBackupExpired,
5705
+ hostClaudeAccessTokenExpired,
5706
+ hostClaudeLoginDead,
5498
5707
  hostBackupHasCredentials,
5499
5708
  extractCredentials,
5500
5709
  parseCredentialsUpdate,
5501
5710
  claudeExpiresAt,
5711
+ claudeRefreshExpiresAt,
5502
5712
  shouldAcceptCredentialUpdate,
5503
5713
  writeCredentialBackup,
5504
5714
  readCredentialBackup,