@madarco/agentbox 0.28.1 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/dist/_cloud-attach-HKRHYCY7.js +30 -0
  3. package/dist/{chunk-JNC7MCWJ.js → chunk-3INUZQTR.js} +10 -10
  4. package/dist/chunk-3INUZQTR.js.map +1 -0
  5. package/dist/{chunk-4PR3KJ5X.js → chunk-6PIGTR4D.js} +20 -20
  6. package/dist/{chunk-NHVGKFVY.js → chunk-7LNXTPEE.js} +340 -22
  7. package/dist/chunk-7LNXTPEE.js.map +1 -0
  8. package/dist/{chunk-WB6S4W7O.js → chunk-7Q6BG5AN.js} +2413 -1012
  9. package/dist/chunk-7Q6BG5AN.js.map +1 -0
  10. package/dist/{chunk-BUMKBUXS.js → chunk-7QU6XENE.js} +3 -3
  11. package/dist/chunk-BWE2I5QG.js +17 -0
  12. package/dist/chunk-BWE2I5QG.js.map +1 -0
  13. package/dist/{chunk-7ABO7OIF.js → chunk-CO2I3CQI.js} +4 -4
  14. package/dist/{chunk-OUF3YTQO.js → chunk-DBXCFLAR.js} +14 -17
  15. package/dist/chunk-DBXCFLAR.js.map +1 -0
  16. package/dist/{chunk-74VIUGY6.js → chunk-DYETLPUT.js} +6 -9
  17. package/dist/chunk-DYETLPUT.js.map +1 -0
  18. package/dist/{chunk-HYXCH4GA.js → chunk-EFVTQ7YB.js} +7 -7
  19. package/dist/{chunk-46NNZMZT.js → chunk-EPFXLXCW.js} +372 -72
  20. package/dist/chunk-EPFXLXCW.js.map +1 -0
  21. package/dist/chunk-GWKGSXDC.js +71 -0
  22. package/dist/chunk-GWKGSXDC.js.map +1 -0
  23. package/dist/{chunk-CKD3PRON.js → chunk-GWYD7YBK.js} +12 -9
  24. package/dist/{chunk-CKD3PRON.js.map → chunk-GWYD7YBK.js.map} +1 -1
  25. package/dist/{chunk-NHTRTST5.js → chunk-HNWZO2XU.js} +38 -15
  26. package/dist/chunk-HNWZO2XU.js.map +1 -0
  27. package/dist/{chunk-EVT2SNF2.js → chunk-HO2ACZES.js} +3 -3
  28. package/dist/{chunk-V5NWSLWD.js → chunk-HP4L45LW.js} +14 -14
  29. package/dist/{chunk-B4DAH2F2.js → chunk-LHOKRCNF.js} +3 -3
  30. package/dist/{chunk-G3H2L3O2.js → chunk-MNDKP4VS.js} +23 -3
  31. package/dist/chunk-MNDKP4VS.js.map +1 -0
  32. package/dist/{chunk-JDSYMTMS.js → chunk-NAT2H7J4.js} +110 -66
  33. package/dist/chunk-NAT2H7J4.js.map +1 -0
  34. package/dist/{chunk-KFLGXE3R.js → chunk-NGERWFSA.js} +133 -22
  35. package/dist/chunk-NGERWFSA.js.map +1 -0
  36. package/dist/{chunk-GFOWBXV7.js → chunk-OKLEPEWZ.js} +460 -253
  37. package/dist/chunk-OKLEPEWZ.js.map +1 -0
  38. package/dist/{chunk-YI4GHC2E.js → chunk-QU5BI2HC.js} +12 -15
  39. package/dist/chunk-QU5BI2HC.js.map +1 -0
  40. package/dist/{chunk-BWM56FKY.js → chunk-RQURMAPA.js} +11 -11
  41. package/dist/{chunk-FPMRFMVK.js → chunk-RZCLRWNY.js} +9 -9
  42. package/dist/{chunk-JQLOGVZK.js → chunk-THUST2QK.js} +85 -21
  43. package/dist/chunk-THUST2QK.js.map +1 -0
  44. package/dist/{chunk-OXKW4GWD.js → chunk-UPVP6YGJ.js} +4 -70
  45. package/dist/chunk-UPVP6YGJ.js.map +1 -0
  46. package/dist/{chunk-7RSE7ESY.js → chunk-VVNXQ4XS.js} +27 -18
  47. package/dist/chunk-VVNXQ4XS.js.map +1 -0
  48. package/dist/{chunk-FGQFVUMH.js → chunk-VY54AX4T.js} +3 -3
  49. package/dist/{chunk-OUWVN2F2.js → chunk-WGNI24H2.js} +16 -13
  50. package/dist/chunk-WGNI24H2.js.map +1 -0
  51. package/dist/{chunk-PSA6GADQ.js → chunk-WHFCJBMO.js} +14 -1
  52. package/dist/chunk-WHFCJBMO.js.map +1 -0
  53. package/dist/{chunk-KJ5TCYNI.js → chunk-WHJYOO5H.js} +7 -6
  54. package/dist/chunk-WHJYOO5H.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-UKKYXHIQ.js} +19 -18
  58. package/dist/cp-hub-upload-BM2OLTOS.js +81 -0
  59. package/dist/cp-hub-upload-BM2OLTOS.js.map +1 -0
  60. package/dist/{custody-client-PNCC2HBJ.js → custody-client-NPXJ46TB.js} +5 -4
  61. package/dist/{deploy-hetzner-SSGSXAKA.js → deploy-hetzner-Y3ILCDRF.js} +10 -10
  62. package/dist/{dist-RN6JOAG4.js → dist-5OGQ3CJQ.js} +81 -45
  63. package/dist/{dist-5OR4QTQW.js → dist-7B3VCLZI.js} +9 -9
  64. package/dist/{dist-EPFS5PRI.js → dist-A5ZEIVAW.js} +10 -10
  65. package/dist/{dist-6PYXFREL.js → dist-DOEGENNW.js} +61 -16
  66. package/dist/dist-DOEGENNW.js.map +1 -0
  67. package/dist/{dist-XQLKK7H3.js → dist-EOGD7KD6.js} +54 -28
  68. package/dist/dist-EOGD7KD6.js.map +1 -0
  69. package/dist/{dist-XATN4ZIR.js → dist-FBM2WS5S.js} +22 -4
  70. package/dist/{dist-POILUDVJ.js → dist-MUTFY7FA.js} +9 -9
  71. package/dist/{dist-ZNQZHTUN.js → dist-SMDXLPZO.js} +35 -6
  72. package/dist/{dist-M4O5MU5K.js → dist-VTLQKZ2E.js} +8 -8
  73. package/dist/{dist-SN2TCRZ5.js → dist-ZJIJHCZB.js} +9 -9
  74. package/dist/{dist-K5M4HKG7.js → dist-ZNYS7CVF.js} +21 -9
  75. package/dist/host-reach-drainer-ZJU2STQQ.js +9 -0
  76. package/dist/hub-Q4VOF4WN.js +37 -0
  77. package/dist/{hub-adopt-I44VGSBL.js → hub-adopt-OA336ZXZ.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-JKFCABK4.js} +16 -16
  80. package/dist/index.js +1321 -882
  81. package/dist/index.js.map +1 -1
  82. package/dist/prepare-GFWWKWGF.js +41 -0
  83. package/dist/prepared-custody-KU4PDVBT.js +36 -0
  84. package/dist/{prepared-state-PV3GUBHO-MF56HWMZ.js → prepared-state-LNQ7DYSU-AR5RMXAO.js} +4 -3
  85. package/dist/{publish-credentials-BPHUO5VL.js → publish-credentials-3SQXX45P.js} +11 -11
  86. package/dist/registry-AFKV3EO2.js +18 -0
  87. package/dist/relay-QH6OEY2V.js +20 -0
  88. package/dist/relay-QH6OEY2V.js.map +1 -0
  89. package/dist/{remote-docker-share-RX5ARK45.js → remote-docker-share-RMS6IB5X.js} +11 -11
  90. package/dist/remote-docker-share-RMS6IB5X.js.map +1 -0
  91. package/dist/tool-grant-push-T6DRBY3W.js +90 -0
  92. package/dist/tool-grant-push-T6DRBY3W.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 +6757 -5299
  96. package/runtime/_shared/gh-shim +103 -228
  97. package/runtime/digitalocean/agentbox-tool-shim +21 -0
  98. package/runtime/digitalocean/ctl.cjs +6757 -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 +6757 -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 +6757 -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 +6757 -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-VKOCY6SX.js → chunk-3AD3MYNV.js} +49 -14
  336. package/runtime/hub/apps/hub/{chunk-KTVETF3F.js → chunk-3ZDBZYOY.js} +11 -8
  337. package/runtime/hub/apps/hub/{chunk-LPYK2354.js → chunk-5ABFGGPT.js} +339 -21
  338. package/runtime/hub/apps/hub/{chunk-UMPTTQBE.js → chunk-GBYD2ODL.js} +458 -251
  339. package/runtime/hub/apps/hub/{chunk-5TM7XXLT.js → chunk-H5SUXDZA.js} +2833 -1277
  340. package/runtime/hub/apps/hub/{chunk-QU3FFGJY.js → chunk-UQ5XNPOF.js} +11 -14
  341. package/runtime/hub/apps/hub/{chunk-3LAHFDJF.js → chunk-VWQNSZGI.js} +22 -2
  342. package/runtime/hub/apps/hub/{chunk-EZUK53CC.js → chunk-WHGY7HOC.js} +85 -21
  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-ELZHBQEM.js → dist-37EKQ6RZ.js} +11 -11
  346. package/runtime/hub/apps/hub/{dist-D265LCAN.js → dist-CGH7PEMZ.js} +21 -3
  347. package/runtime/hub/apps/hub/{dist-SYWTB6RD.js → dist-CMVSARW5.js} +15 -18
  348. package/runtime/hub/apps/hub/{dist-5HTJSOHS.js → dist-EGXZRZH2.js} +19 -7
  349. package/runtime/hub/apps/hub/{dist-YK5FFPXZ.js → dist-EOGGFZZS.js} +62 -20
  350. package/runtime/hub/apps/hub/{dist-E2FTSTCY.js → dist-LJBHOO3K.js} +34 -5
  351. package/runtime/hub/apps/hub/{dist-N3E5YAYY.js → dist-R77W6WJ5.js} +53 -26
  352. package/runtime/hub/apps/hub/{dist-JVEDVVVG.js → dist-TH2JZYZY.js} +7 -7
  353. package/runtime/hub/apps/hub/{dist-2YP57GMB.js → dist-XPRGHQH2.js} +13 -13
  354. package/runtime/hub/apps/hub/{dist-NKCXH5DW.js → dist-Z2Y5F7AF.js} +6 -6
  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-DXVMUQWF.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-ABC2EQVI.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 +16623 -14688
  371. package/runtime/vercel/agentbox-tool-shim +21 -0
  372. package/runtime/vercel/ctl.cjs +6757 -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-HKRHYCY7.js.map} +0 -0
  417. /package/dist/{chunk-4PR3KJ5X.js.map → chunk-6PIGTR4D.js.map} +0 -0
  418. /package/dist/{chunk-BUMKBUXS.js.map → chunk-7QU6XENE.js.map} +0 -0
  419. /package/dist/{chunk-7ABO7OIF.js.map → chunk-CO2I3CQI.js.map} +0 -0
  420. /package/dist/{chunk-HYXCH4GA.js.map → chunk-EFVTQ7YB.js.map} +0 -0
  421. /package/dist/{chunk-EVT2SNF2.js.map → chunk-HO2ACZES.js.map} +0 -0
  422. /package/dist/{chunk-V5NWSLWD.js.map → chunk-HP4L45LW.js.map} +0 -0
  423. /package/dist/{chunk-B4DAH2F2.js.map → chunk-LHOKRCNF.js.map} +0 -0
  424. /package/dist/{chunk-BWM56FKY.js.map → chunk-RQURMAPA.js.map} +0 -0
  425. /package/dist/{chunk-FPMRFMVK.js.map → chunk-RZCLRWNY.js.map} +0 -0
  426. /package/dist/{chunk-FGQFVUMH.js.map → chunk-VY54AX4T.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-UKKYXHIQ.js.map} +0 -0
  429. /package/dist/{custody-client-PNCC2HBJ.js.map → custody-client-NPXJ46TB.js.map} +0 -0
  430. /package/dist/{deploy-hetzner-SSGSXAKA.js.map → deploy-hetzner-Y3ILCDRF.js.map} +0 -0
  431. /package/dist/{dist-5OR4QTQW.js.map → dist-5OGQ3CJQ.js.map} +0 -0
  432. /package/dist/{dist-EPFS5PRI.js.map → dist-7B3VCLZI.js.map} +0 -0
  433. /package/dist/{dist-K5M4HKG7.js.map → dist-A5ZEIVAW.js.map} +0 -0
  434. /package/dist/{dist-M4O5MU5K.js.map → dist-FBM2WS5S.js.map} +0 -0
  435. /package/dist/{dist-POILUDVJ.js.map → dist-MUTFY7FA.js.map} +0 -0
  436. /package/dist/{dist-RN6JOAG4.js.map → dist-SMDXLPZO.js.map} +0 -0
  437. /package/dist/{dist-SN2TCRZ5.js.map → dist-VTLQKZ2E.js.map} +0 -0
  438. /package/dist/{dist-XATN4ZIR.js.map → dist-ZJIJHCZB.js.map} +0 -0
  439. /package/dist/{dist-ZNQZHTUN.js.map → dist-ZNYS7CVF.js.map} +0 -0
  440. /package/dist/{hub-MJ7O4WXW.js.map → host-reach-drainer-ZJU2STQQ.js.map} +0 -0
  441. /package/dist/{hub-adopt-I44VGSBL.js.map → hub-Q4VOF4WN.js.map} +0 -0
  442. /package/dist/{hub-api-client-WJPBXZAZ.js.map → hub-adopt-OA336ZXZ.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-JKFCABK4.js.map} +0 -0
  445. /package/dist/{prepared-custody-QIXW7MJM.js.map → prepare-GFWWKWGF.js.map} +0 -0
  446. /package/dist/{prepared-state-PV3GUBHO-MF56HWMZ.js.map → prepared-custody-KU4PDVBT.js.map} +0 -0
  447. /package/dist/{relay-DRDELF6B.js.map → prepared-state-LNQ7DYSU-AR5RMXAO.js.map} +0 -0
  448. /package/dist/{publish-credentials-BPHUO5VL.js.map → publish-credentials-3SQXX45P.js.map} +0 -0
  449. /package/dist/{remote-docker-share-RX5ARK45.js.map → registry-AFKV3EO2.js.map} +0 -0
  450. /package/runtime/hub/apps/hub/.next/static/{z7_2bKU93xE7GwllL1Duv → XIx10ozuCZRzwSsiCF_5t}/_buildManifest.js +0 -0
  451. /package/runtime/hub/apps/hub/.next/static/{z7_2bKU93xE7GwllL1Duv → XIx10ozuCZRzwSsiCF_5t}/_clientMiddlewareManifest.js +0 -0
  452. /package/runtime/hub/apps/hub/.next/static/{z7_2bKU93xE7GwllL1Duv → XIx10ozuCZRzwSsiCF_5t}/_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,230 @@ 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 placeholderDescriptor(name) {
1969
+ return {
1970
+ name,
1971
+ kind: "cloud",
1972
+ label: name,
1973
+ loginHint: "",
1974
+ credentials: { envKeys: [], fields: [] },
1975
+ // NOT `true`: the hub's create gate deliberately skips the configured check
1976
+ // for plugins, so demanding a bake here would newly block creates that work.
1977
+ bake: { required: false, approxMinutes: "1" },
1978
+ capabilities: { ...FALLBACK_CAPABILITIES },
1979
+ blurb: `the ${name} provider`,
1980
+ sizeDesc: `Per-provider override of \`box.size\` for ${name}.`,
1981
+ imageDesc: `Per-provider override of \`box.image\` for ${name}.`
1982
+ };
1983
+ }
1984
+ function deriveDescriptor(name, mod) {
1985
+ const declared = mod.descriptor;
1986
+ if (declared) return declared;
1987
+ const base = placeholderDescriptor(name);
1988
+ const { provider, backend } = mod;
1989
+ return {
1990
+ ...base,
1991
+ kind: backend ? "cloud" : "local",
1992
+ credentials: {
1993
+ envKeys: [],
1994
+ // Only offer a credential form when the module can actually consume one.
1995
+ fields: mod.setCredentials ? [{ key: "apiKey", label: "API key" }] : []
1996
+ },
1997
+ capabilities: {
1998
+ ...base.capabilities,
1999
+ checkpoints: !!provider.checkpoint,
2000
+ ssh: !!provider.sshTarget,
2001
+ resync: !!provider.resyncWorkspace,
2002
+ prune: !!backend?.list,
2003
+ inbound: !!backend?.setInbound,
2004
+ ...backend?.timeoutModel ? { timeoutModel: backend.timeoutModel } : {}
2005
+ }
2006
+ };
2007
+ }
2008
+ async function ensureProviderDescriptor(name, mod, path = PLUGINS_FILE) {
2009
+ const existing = resolveProviderDescriptor(name, path);
2010
+ if (existing) return existing;
2011
+ const derived = deriveDescriptor(name, mod);
2012
+ await recordPluginDescriptor(name, derived, path).catch(() => {
2013
+ });
2014
+ return derived;
2015
+ }
1778
2016
  async function resolveCloudSshTarget(box, provider, opts = {}) {
1779
2017
  if (!provider.buildAttach) {
1780
2018
  throw new Error(`cloud provider '${provider.name}' does not support SSH attach`);
@@ -1825,10 +2063,12 @@ async function ensureCloudSshAlias(box, provider, opts = {}) {
1825
2063
  await syncAgentboxSshConfig();
1826
2064
  return conn;
1827
2065
  }
1828
- var PROVIDERS_WITH_DIRECT_BOX_SSH = ["hetzner", "digitalocean", "daytona"];
2066
+ function hasDirectBoxSsh(name) {
2067
+ return resolveProviderDescriptor(name)?.capabilities.directBoxSsh ?? false;
2068
+ }
1829
2069
  async function autoWriteSshConfig(box, provider, enabled, logWarn) {
1830
2070
  if (!enabled) return;
1831
- if (!provider.sshTarget && !PROVIDERS_WITH_DIRECT_BOX_SSH.includes(provider.name)) return;
2071
+ if (!provider.sshTarget && !hasDirectBoxSsh(provider.name)) return;
1832
2072
  try {
1833
2073
  const conn = await resolveCloudSshTarget(box, provider, { bringOnline: false });
1834
2074
  if (!conn.identityFile) return;
@@ -1848,22 +2088,22 @@ async function autoWriteSshConfig(box, provider, enabled, logWarn) {
1848
2088
  }
1849
2089
  async function mintSshKey(targetDir, comment) {
1850
2090
  const dir = resolve3(targetDir);
1851
- const priv = join5(dir, "id_ed25519");
2091
+ const priv = join6(dir, "id_ed25519");
1852
2092
  const pub = `${priv}.pub`;
1853
- await mkdir2(dir, { recursive: true, mode: 448 });
1854
- const existing = await readFile2(pub, "utf8").catch(() => null);
2093
+ await mkdir3(dir, { recursive: true, mode: 448 });
2094
+ const existing = await readFile3(pub, "utf8").catch(() => null);
1855
2095
  if (existing !== null) {
1856
2096
  return { dir, privatePath: priv, publicPath: pub, publicKey: existing.trim() };
1857
2097
  }
1858
2098
  await execa("ssh-keygen", ["-t", "ed25519", "-N", "", "-C", comment, "-f", priv, "-q"], {
1859
2099
  stdio: "pipe"
1860
2100
  });
1861
- const publicKey = (await readFile2(pub, "utf8")).trim();
2101
+ const publicKey = (await readFile3(pub, "utf8")).trim();
1862
2102
  return { dir, privatePath: priv, publicPath: pub, publicKey };
1863
2103
  }
1864
2104
  async function fileExists(path) {
1865
2105
  try {
1866
- return (await stat3(path)).isFile();
2106
+ return (await stat4(path)).isFile();
1867
2107
  } catch {
1868
2108
  return false;
1869
2109
  }
@@ -1894,7 +2134,7 @@ async function resolveSshConfigTarget(destination) {
1894
2134
  const port = Number.parseInt(fields.get("port")?.[0]?.trim() ?? "", 10);
1895
2135
  if (Number.isInteger(port) && port > 0 && port !== 22) out.port = port;
1896
2136
  for (const raw of fields.get("identityfile") ?? []) {
1897
- const path = raw.trim().replace(/^~(?=\/)/, homedir4());
2137
+ const path = raw.trim().replace(/^~(?=\/)/, homedir5());
1898
2138
  if (await fileExists(path)) {
1899
2139
  out.identityFile = path;
1900
2140
  break;
@@ -2007,7 +2247,7 @@ async function waitForSsh(target, deadlineMs, intervalMs = 5e3) {
2007
2247
  var HOST = "127.0.0.1";
2008
2248
  function controlSockPath(boxSshDir) {
2009
2249
  const hash = createHash("sha1").update(boxSshDir).digest("hex").slice(0, 12);
2010
- return resolve22(homedir5(), ".agentbox", "cm", `${hash}.sock`);
2250
+ return resolve22(homedir6(), ".agentbox", "cm", `${hash}.sock`);
2011
2251
  }
2012
2252
  var SshTunnelManager = class {
2013
2253
  /**
@@ -2026,10 +2266,10 @@ var SshTunnelManager = class {
2026
2266
  */
2027
2267
  async open(opts) {
2028
2268
  const boxSshDir = opts.boxSshDir ?? defaultBoxSshDir(opts.boxId, this.namespace);
2029
- await mkdir3(boxSshDir, { recursive: true, mode: 448 });
2269
+ await mkdir4(boxSshDir, { recursive: true, mode: 448 });
2030
2270
  const controlPath = controlSockPath(boxSshDir);
2031
- await mkdir3(join6(controlPath, ".."), { recursive: true, mode: 448 });
2032
- const knownHosts = join6(boxSshDir, "known_hosts");
2271
+ await mkdir4(join7(controlPath, ".."), { recursive: true, mode: 448 });
2272
+ const knownHosts = join7(boxSshDir, "known_hosts");
2033
2273
  const tunnel = {
2034
2274
  controlPath,
2035
2275
  vpsHost: opts.vpsHost,
@@ -2039,12 +2279,12 @@ var SshTunnelManager = class {
2039
2279
  boxSshDir,
2040
2280
  forwards: /* @__PURE__ */ new Map()
2041
2281
  };
2042
- if (existsSync2(controlPath) && await this.isAlive(controlPath)) {
2282
+ if (existsSync3(controlPath) && await this.isAlive(controlPath)) {
2043
2283
  this.boxes.set(opts.boxId, tunnel);
2044
2284
  return;
2045
2285
  }
2046
- if (existsSync2(controlPath)) {
2047
- await rm2(controlPath, { force: true });
2286
+ if (existsSync3(controlPath)) {
2287
+ await rm3(controlPath, { force: true });
2048
2288
  }
2049
2289
  const connectTimeout = opts.connectTimeoutSeconds ?? 10;
2050
2290
  const argv = ["-fNT", "-M", "-S", controlPath];
@@ -2081,7 +2321,7 @@ var SshTunnelManager = class {
2081
2321
  opts.vpsUser ? `${opts.vpsUser}@${opts.vpsHost}` : opts.vpsHost
2082
2322
  );
2083
2323
  const res = await execa("ssh", argv, { reject: false });
2084
- if (res.exitCode !== 0 || !existsSync2(controlPath)) {
2324
+ if (res.exitCode !== 0 || !existsSync3(controlPath)) {
2085
2325
  throw new Error(
2086
2326
  `ssh ControlMaster failed for ${opts.boxId} (exit ${String(res.exitCode)}): ${res.stderr || res.stdout || "(no output)"}`
2087
2327
  );
@@ -2140,14 +2380,14 @@ var SshTunnelManager = class {
2140
2380
  const existing = this.boxes.get(opts.boxId);
2141
2381
  if (existing) {
2142
2382
  const alive = await this.isAlive(existing.controlPath);
2143
- if (!alive && existsSync2(existing.controlPath)) {
2383
+ if (!alive && existsSync3(existing.controlPath)) {
2144
2384
  try {
2145
2385
  await execa("ssh", ["-O", "exit", "-S", existing.controlPath, "dummy"], {
2146
2386
  reject: false
2147
2387
  });
2148
2388
  } catch {
2149
2389
  }
2150
- await rm2(existing.controlPath, { force: true });
2390
+ await rm3(existing.controlPath, { force: true });
2151
2391
  }
2152
2392
  existing.forwards.clear();
2153
2393
  }
@@ -2177,9 +2417,9 @@ var SshTunnelManager = class {
2177
2417
  async close(boxId) {
2178
2418
  const tunnel = this.boxes.get(boxId);
2179
2419
  if (!tunnel) return;
2180
- if (existsSync2(tunnel.controlPath)) {
2420
+ if (existsSync3(tunnel.controlPath)) {
2181
2421
  await execa("ssh", ["-O", "exit", "-S", tunnel.controlPath, "dummy"], { reject: false });
2182
- await rm2(tunnel.controlPath, { force: true });
2422
+ await rm3(tunnel.controlPath, { force: true });
2183
2423
  }
2184
2424
  this.boxes.delete(boxId);
2185
2425
  }
@@ -2225,7 +2465,7 @@ var SshTunnelManager = class {
2225
2465
  };
2226
2466
  function defaultBoxSshDir(boxId, namespace) {
2227
2467
  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");
2468
+ return namespace ? resolve22(homedir6(), ".agentbox", namespace, "boxes", safe, "ssh") : resolve22(homedir6(), ".agentbox", "boxes", safe, "ssh");
2229
2469
  }
2230
2470
  function boxSshNamespaceForProvider(provider) {
2231
2471
  switch (provider) {
@@ -2389,17 +2629,17 @@ function errSummary(err) {
2389
2629
  return err instanceof Error ? firstLine(err.message) : String(err);
2390
2630
  }
2391
2631
  function secretsEnvPath() {
2392
- return resolve32(homedir6(), ".agentbox", "secrets.env");
2632
+ return resolve32(homedir7(), ".agentbox", "secrets.env");
2393
2633
  }
2394
2634
  function writeManagedSecrets(managedKeys, record) {
2395
2635
  for (const k of managedKeys) delete process.env[k];
2396
2636
  for (const [k, v] of Object.entries(record)) process.env[k] = v;
2397
2637
  const path = secretsEnvPath();
2398
- mkdirSync2(dirname4(path), { recursive: true });
2638
+ mkdirSync2(dirname5(path), { recursive: true });
2399
2639
  let existing = "";
2400
- if (existsSync3(path)) {
2640
+ if (existsSync4(path)) {
2401
2641
  try {
2402
- existing = readFileSync2(path, "utf8");
2642
+ existing = readFileSync3(path, "utf8");
2403
2643
  } catch {
2404
2644
  existing = "";
2405
2645
  }
@@ -2442,7 +2682,26 @@ async function publishManagedCredentials(providerId, fields) {
2442
2682
  } catch {
2443
2683
  }
2444
2684
  }
2445
- var HUB_RELAY_PORT = 8787;
2685
+ var FALLBACK_RELAY_PORT = 8787;
2686
+ var RELAY_PORT_ENV = "AGENTBOX_RELAY_PORT";
2687
+ var override = null;
2688
+ function isValidRelayPort(port) {
2689
+ return Number.isInteger(port) && port >= 1 && port <= 65535;
2690
+ }
2691
+ function setRelayPort(port) {
2692
+ if (!isValidRelayPort(port)) return;
2693
+ override = port;
2694
+ process.env[RELAY_PORT_ENV] = String(port);
2695
+ }
2696
+ function relayPort() {
2697
+ if (override !== null) return override;
2698
+ const fromEnv = Number.parseInt(process.env[RELAY_PORT_ENV] ?? "", 10);
2699
+ return isValidRelayPort(fromEnv) ? fromEnv : FALLBACK_RELAY_PORT;
2700
+ }
2701
+ function resetRelayPort() {
2702
+ override = null;
2703
+ delete process.env[RELAY_PORT_ENV];
2704
+ }
2446
2705
  function shouldReclaimForVersion(health, currentVersion) {
2447
2706
  if (health.cliEntry === false) return true;
2448
2707
  if (typeof health.version === "string" && health.version.length > 0 && typeof currentVersion === "string" && currentVersion.length > 0 && health.version !== currentVersion) {
@@ -2466,19 +2725,32 @@ async function killPid(pid) {
2466
2725
  }
2467
2726
  for (let i = 0; i < 20; i++) {
2468
2727
  if (!await processAlive(pid)) return;
2469
- await delay2(100);
2728
+ await delay3(100);
2470
2729
  }
2471
2730
  try {
2472
2731
  process.kill(pid, "SIGKILL");
2473
2732
  } catch {
2474
2733
  }
2475
2734
  }
2735
+ function portIsOccupied(timeoutMs, port = relayPort()) {
2736
+ return new Promise((resolveP) => {
2737
+ const sock = netConnect({ host: "127.0.0.1", port });
2738
+ const done = (occupied) => {
2739
+ sock.destroy();
2740
+ resolveP(occupied);
2741
+ };
2742
+ sock.setTimeout(timeoutMs);
2743
+ sock.once("connect", () => done(true));
2744
+ sock.once("timeout", () => done(false));
2745
+ sock.once("error", () => done(false));
2746
+ });
2747
+ }
2476
2748
  function pingHealthz(timeoutMs) {
2477
2749
  return new Promise((resolveP) => {
2478
2750
  const req = httpRequest(
2479
2751
  {
2480
2752
  host: "127.0.0.1",
2481
- port: HUB_RELAY_PORT,
2753
+ port: relayPort(),
2482
2754
  method: "GET",
2483
2755
  path: "/healthz",
2484
2756
  timeout: timeoutMs
@@ -2502,7 +2774,7 @@ function fetchHealthz(timeoutMs) {
2502
2774
  const req = httpRequest(
2503
2775
  {
2504
2776
  host: "127.0.0.1",
2505
- port: HUB_RELAY_PORT,
2777
+ port: relayPort(),
2506
2778
  method: "GET",
2507
2779
  path: "/healthz",
2508
2780
  timeout: timeoutMs
@@ -2553,30 +2825,30 @@ function fetchHealthz(timeoutMs) {
2553
2825
  });
2554
2826
  }
2555
2827
  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));
2828
+ const override2 = process.env.AGENTBOX_CLI_ENTRY;
2829
+ if (override2 && existsSync5(override2)) return override2;
2830
+ const here = dirname6(fileURLToPath(import.meta.url));
2559
2831
  const candidates = [
2560
2832
  resolve4(here, "index.js"),
2561
2833
  resolve4(here, "..", "..", "..", "apps", "cli", "dist", "index.js"),
2562
2834
  resolve4(here, "..", "..", "..", "..", "dist", "index.js")
2563
2835
  ];
2564
2836
  for (const c of candidates) {
2565
- if (existsSync4(c)) return c;
2837
+ if (existsSync5(c)) return c;
2566
2838
  }
2567
2839
  return null;
2568
2840
  }
2569
2841
  var RUNTIME_ROOT_ENV = "AGENTBOX_RUNTIME_ROOT";
2570
2842
  function stagedRuntimeRootCandidates(self) {
2571
2843
  const candidates = [];
2572
- const override = process.env[RUNTIME_ROOT_ENV];
2573
- if (override) candidates.push(override);
2844
+ const override2 = process.env[RUNTIME_ROOT_ENV];
2845
+ if (override2) candidates.push(override2);
2574
2846
  candidates.push(resolve5(self, "..", "runtime"), resolve5(self, "..", "..", "runtime"));
2575
2847
  return candidates;
2576
2848
  }
2577
2849
  function resolveStagedRuntimeRoot(self, marker) {
2578
2850
  for (const candidate of stagedRuntimeRootCandidates(self)) {
2579
- if (existsSync5(resolve5(candidate, marker))) return candidate;
2851
+ if (existsSync6(resolve5(candidate, marker))) return candidate;
2580
2852
  }
2581
2853
  return void 0;
2582
2854
  }
@@ -2614,22 +2886,22 @@ function setHubDockerContext(dir) {
2614
2886
  function hubDockerContext() {
2615
2887
  return dockerContext;
2616
2888
  }
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;
2889
+ var STATE_DIR2 = join8(homedir8(), ".agentbox");
2890
+ var HUB_PID_FILE = join8(STATE_DIR2, "hub.pid");
2891
+ var RELAY_PID_FILE = join8(STATE_DIR2, "relay.pid");
2892
+ var HUB_LOG_FILE = join8(STATE_DIR2, "hub.log");
2893
+ var HUB_TOKEN_FILE = join8(STATE_DIR2, "hub", "token");
2622
2894
  var HOST2 = "0.0.0.0";
2623
2895
  var LOOPBACK_HOST = "127.0.0.1";
2624
2896
  var NODE_MIN = { major: 22, minor: 5 };
2625
- var CP_DIR = join7(STATE_DIR2, "control-plane");
2897
+ var CP_DIR = join8(STATE_DIR2, "control-plane");
2626
2898
  async function resolveExposedSpawn() {
2627
2899
  try {
2628
2900
  const record = JSON.parse(
2629
- await readFile3(controlPlaneDeployPath(), "utf8")
2901
+ await readFile4(controlPlaneDeployPath(), "utf8")
2630
2902
  );
2631
2903
  if (record.provider !== "local") return null;
2632
- const envBody = await readFile3(join7(CP_DIR, "control-plane.env"), "utf8").catch(() => "");
2904
+ const envBody = await readFile4(join8(CP_DIR, "control-plane.env"), "utf8").catch(() => "");
2633
2905
  const env = buildExposedHubEnv(record, parseEnvFileBody(envBody));
2634
2906
  return { env, profile: EXPOSED_HUB_PROFILE };
2635
2907
  } catch {
@@ -2654,7 +2926,7 @@ function nodeFlags() {
2654
2926
  }
2655
2927
  async function readPid(file) {
2656
2928
  try {
2657
- const pid = Number.parseInt((await readFile3(file, "utf8")).trim(), 10);
2929
+ const pid = Number.parseInt((await readFile4(file, "utf8")).trim(), 10);
2658
2930
  return Number.isFinite(pid) && pid > 0 ? pid : null;
2659
2931
  } catch {
2660
2932
  return null;
@@ -2662,7 +2934,7 @@ async function readPid(file) {
2662
2934
  }
2663
2935
  async function readToken() {
2664
2936
  try {
2665
- const t = (await readFile3(HUB_TOKEN_FILE, "utf8")).trim();
2937
+ const t = (await readFile4(HUB_TOKEN_FILE, "utf8")).trim();
2666
2938
  return t.length > 0 ? t : null;
2667
2939
  } catch {
2668
2940
  return null;
@@ -2673,25 +2945,25 @@ function readHubToken() {
2673
2945
  }
2674
2946
  async function endpointFor(portlessUrl) {
2675
2947
  const token = await readToken();
2676
- const hostUrl = portlessUrl ?? `http://${LOOPBACK_HOST}:${String(PORT)}`;
2948
+ const hostUrl = portlessUrl ?? `http://${LOOPBACK_HOST}:${String(relayPort())}`;
2677
2949
  return {
2678
2950
  hostUrl,
2679
2951
  openUrl: token ? `${hostUrl}/?token=${token}` : hostUrl,
2680
- port: PORT,
2952
+ port: relayPort(),
2681
2953
  token
2682
2954
  };
2683
2955
  }
2684
2956
  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));
2957
+ const override2 = process.env.AGENTBOX_HUB_BIN;
2958
+ if (override2 && existsSync7(override2)) return override2;
2959
+ const here = dirname7(fileURLToPath2(import.meta.url));
2688
2960
  const candidates = [
2689
2961
  resolve6(here, "..", "runtime", "hub", "apps", "hub", "server.js"),
2690
2962
  resolve6(here, "..", "..", "..", "apps", "hub", "dist-standalone", "apps", "hub", "server.js"),
2691
2963
  resolve6(here, "..", "..", "apps", "hub", "dist-standalone", "apps", "hub", "server.js")
2692
2964
  ];
2693
2965
  for (const c of candidates) {
2694
- if (existsSync6(c)) return c;
2966
+ if (existsSync7(c)) return c;
2695
2967
  }
2696
2968
  throw new Error(
2697
2969
  `could not locate the built hub server; run \`pnpm --filter @agentbox/hub build:standalone\` (dev), or set AGENTBOX_HUB_BIN. Tried:
@@ -2702,7 +2974,7 @@ function hubRuntimeEnv(opts = {}) {
2702
2974
  const env = {};
2703
2975
  const dockerContext2 = opts.dockerContext ?? hubDockerContext();
2704
2976
  if (dockerContext2) env.AGENTBOX_DOCKER_CONTEXT = dockerContext2;
2705
- const runtimeRoot = opts.runtimeRoot ?? resolveStagedRuntimeRoot(dirname6(fileURLToPath2(import.meta.url)), "docker/Dockerfile.box");
2977
+ const runtimeRoot = opts.runtimeRoot ?? resolveStagedRuntimeRoot(dirname7(fileURLToPath2(import.meta.url)), "docker/Dockerfile.box");
2706
2978
  if (runtimeRoot) env[RUNTIME_ROOT_ENV] = runtimeRoot;
2707
2979
  return env;
2708
2980
  }
@@ -2713,14 +2985,16 @@ async function reclaimPort(reportedPid, log) {
2713
2985
  if (typeof pid !== "number" || pid <= 0 || seen.has(pid)) continue;
2714
2986
  seen.add(pid);
2715
2987
  if (!await processAlive(pid)) continue;
2716
- log(`stopping process on :${String(PORT)} (pid ${String(pid)})`);
2988
+ log(`stopping process on :${String(relayPort())} (pid ${String(pid)})`);
2717
2989
  await killPid(pid);
2718
2990
  }
2719
2991
  await unlink(HUB_PID_FILE).catch(() => {
2720
2992
  });
2993
+ await unlink(RELAY_PID_FILE).catch(() => {
2994
+ });
2721
2995
  if (await pingHealthz(300)) {
2722
2996
  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`
2997
+ `something is still listening on :${String(relayPort())} and could not be stopped (reported pid ${String(reportedPid ?? "unknown")}); kill it manually and retry`
2724
2998
  );
2725
2999
  }
2726
3000
  }
@@ -2728,19 +3002,26 @@ async function ensureHub(opts = {}) {
2728
3002
  const log = opts.onLog ?? (() => {
2729
3003
  });
2730
3004
  assertNodeSupported();
2731
- await mkdir4(STATE_DIR2, { recursive: true });
3005
+ await mkdir5(STATE_DIR2, { recursive: true });
2732
3006
  const exposed = await resolveExposedSpawn();
2733
3007
  const desiredProfile = exposed?.profile ?? "localhost";
3008
+ const exposedPort = Number.parseInt(exposed?.env["AGENTBOX_HUB_PORT"] ?? "", 10);
3009
+ if (isValidRelayPort(exposedPort) && exposedPort !== relayPort()) {
3010
+ log(
3011
+ `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`
3012
+ );
3013
+ setRelayPort(exposedPort);
3014
+ }
2734
3015
  const currentVersion = process.env.AGENTBOX_CLI_VERSION;
2735
3016
  const reusable = (h) => h.ui === true && !shouldReclaimForVersion(h, currentVersion) && (h.profile ?? "localhost") === desiredProfile;
2736
3017
  const health = await fetchHealthz(500);
2737
3018
  if (health !== null) {
2738
3019
  const profileMismatch = (health.profile ?? "localhost") !== desiredProfile;
2739
3020
  if (reusable(health)) {
2740
- return endpointFor(await hubPortlessSync(opts.portlessEnabled, PORT));
3021
+ return endpointFor(await hubPortlessSync(opts.portlessEnabled, relayPort()));
2741
3022
  }
2742
3023
  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"
3024
+ 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
3025
  );
2745
3026
  await reclaimPort(health.pid, log);
2746
3027
  } else {
@@ -2750,14 +3031,14 @@ async function ensureHub(opts = {}) {
2750
3031
  for (let i = 0; i < 10; i++) {
2751
3032
  late = await fetchHealthz(300);
2752
3033
  if (late !== null) break;
2753
- await delay3(200);
3034
+ await delay4(200);
2754
3035
  }
2755
3036
  if (late !== null && reusable(late)) {
2756
- return endpointFor(await hubPortlessSync(opts.portlessEnabled, PORT));
3037
+ return endpointFor(await hubPortlessSync(opts.portlessEnabled, relayPort()));
2757
3038
  }
2758
3039
  if (late !== null) {
2759
3040
  log(
2760
- `a hub in the ${late.profile ?? "localhost"} profile holds :${String(PORT)} \u2014 reclaiming to run ${desiredProfile}`
3041
+ `a hub in the ${late.profile ?? "localhost"} profile holds :${String(relayPort())} \u2014 reclaiming to run ${desiredProfile}`
2761
3042
  );
2762
3043
  }
2763
3044
  log(`hub pid ${String(pid)} alive but /healthz unresponsive \u2014 restarting it`);
@@ -2793,6 +3074,10 @@ async function spawnHub(hubServer, cliEntry, log, portlessEnabled, exposedEnv) {
2793
3074
  // so docker boxes reach its embedded relay via host.docker.internal; the
2794
3075
  // profile is set independently of the bind host in server.ts.
2795
3076
  AGENTBOX_HUB_HOST: HOST2,
3077
+ // Load-bearing for `relay.port`: server.ts defaults to 8787 on its own, so
3078
+ // without this the hub keeps binding 8787 while everything here probes the
3079
+ // configured port.
3080
+ AGENTBOX_HUB_PORT: String(relayPort()),
2796
3081
  // The hub bundle ships no staged build context of its own, so its
2797
3082
  // in-process freshness checks couldn't fingerprint (degrading to
2798
3083
  // 'unknown'). Hand it the CLI's resolved roots so hub-side fingerprints
@@ -2809,29 +3094,29 @@ async function spawnHub(hubServer, cliEntry, log, portlessEnabled, exposedEnv) {
2809
3094
  exit = { code, signal };
2810
3095
  });
2811
3096
  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)})`);
3097
+ await writeFile3(HUB_PID_FILE, String(child.pid), "utf8");
3098
+ log(`spawned hub process (pid ${String(child.pid)}, port ${String(relayPort())})`);
2814
3099
  }
2815
3100
  for (let i = 0; i < 50; i++) {
2816
3101
  if (await pingHealthz(300)) {
2817
- log(`hub reachable on http://${LOOPBACK_HOST}:${String(PORT)}`);
2818
- const purl = await hubPortlessSync(portlessEnabled, PORT);
3102
+ log(`hub reachable on http://${LOOPBACK_HOST}:${String(relayPort())}`);
3103
+ const purl = await hubPortlessSync(portlessEnabled, relayPort());
2819
3104
  if (purl) log(`hub also reachable on ${purl}`);
2820
3105
  return endpointFor(purl);
2821
3106
  }
2822
3107
  if (exit !== null) {
2823
3108
  await unlink(HUB_PID_FILE).catch(() => {
2824
3109
  });
2825
- await delay3(150);
3110
+ await delay4(150);
2826
3111
  throw new Error(
2827
3112
  await hubStartupError(`hub process exited (${describeExit(exit)}) during startup`)
2828
3113
  );
2829
3114
  }
2830
- await delay3(200);
3115
+ await delay4(200);
2831
3116
  }
2832
3117
  throw new Error(
2833
3118
  await hubStartupError(
2834
- `hub did not become reachable on http://${LOOPBACK_HOST}:${String(PORT)} within ~25s`
3119
+ `hub did not become reachable on http://${LOOPBACK_HOST}:${String(relayPort())} within ~25s`
2835
3120
  )
2836
3121
  );
2837
3122
  }
@@ -2848,7 +3133,7 @@ ${tail}` : `; see ${HUB_LOG_FILE}`;
2848
3133
  }
2849
3134
  async function tailFile(file, maxLines) {
2850
3135
  try {
2851
- const lines = (await readFile3(file, "utf8")).split("\n").filter((l) => l.trim().length > 0);
3136
+ const lines = (await readFile4(file, "utf8")).split("\n").filter((l) => l.trim().length > 0);
2852
3137
  return lines.slice(-maxLines).join("\n");
2853
3138
  } catch {
2854
3139
  return "";
@@ -2882,16 +3167,29 @@ async function getHubStatus() {
2882
3167
  ui: health?.ui === true,
2883
3168
  pid,
2884
3169
  pidAlive,
2885
- port: PORT,
3170
+ port: relayPort(),
2886
3171
  hostUrl: ep.hostUrl,
2887
3172
  openUrl: ep.openUrl,
2888
3173
  token: ep.token,
2889
3174
  pidFile: HUB_PID_FILE,
2890
3175
  logFile: HUB_LOG_FILE,
2891
3176
  ...health?.profile ? { profile: health.profile } : {},
2892
- ...health?.worker ? { worker: true } : {}
3177
+ ...health?.worker ? { worker: true } : {},
3178
+ ...await bundleIsNewerThanHub(pid) ? { staleBundle: true } : {}
2893
3179
  };
2894
3180
  }
3181
+ async function bundleIsNewerThanHub(pid) {
3182
+ if (pid === null) return false;
3183
+ try {
3184
+ const [startedAt, builtAt] = await Promise.all([
3185
+ stat5(HUB_PID_FILE).then((st) => st.mtimeMs),
3186
+ stat5(resolveHubServer()).then((st) => st.mtimeMs)
3187
+ ]);
3188
+ return builtAt > startedAt;
3189
+ } catch {
3190
+ return false;
3191
+ }
3192
+ }
2895
3193
  var activeRefresher;
2896
3194
  function setDockerCredentialRefresh(fn) {
2897
3195
  activeRefresher = fn;
@@ -2903,129 +3201,6 @@ async function runDockerCredentialRefresh(opts) {
2903
3201
  } catch {
2904
3202
  }
2905
3203
  }
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
3204
  function carryPlaceholderContext(ctx) {
3030
3205
  const out = {};
3031
3206
  if (ctx.name) out.AGENTBOX_BOX_NAME = ctx.name;
@@ -3597,7 +3772,7 @@ function parseFlatInventory(stdout) {
3597
3772
  }
3598
3773
  async function pathExists(path) {
3599
3774
  try {
3600
- await stat5(path);
3775
+ await stat6(path);
3601
3776
  return true;
3602
3777
  } catch {
3603
3778
  return false;
@@ -3968,7 +4143,7 @@ function planCarryEntry(entry) {
3968
4143
  }
3969
4144
  async function pathExists2(p) {
3970
4145
  try {
3971
- await stat6(p);
4146
+ await stat7(p);
3972
4147
  return true;
3973
4148
  } catch {
3974
4149
  return false;
@@ -4037,7 +4212,7 @@ async function findUnsyncableSymlinks(root, reachableRoots) {
4037
4212
  unsyncable.push(virtualFull);
4038
4213
  continue;
4039
4214
  }
4040
- const st = await stat7(real).catch(() => null);
4215
+ const st = await stat8(real).catch(() => null);
4041
4216
  if (st?.isDirectory()) await walk(real, virtualFull);
4042
4217
  } else if (ent.isDirectory()) {
4043
4218
  await walk(realFull, virtualFull);
@@ -4052,7 +4227,7 @@ async function findUnsyncableSymlinks(root, reachableRoots) {
4052
4227
  }
4053
4228
  async function pathExists3(p) {
4054
4229
  try {
4055
- await stat8(p);
4230
+ await stat9(p);
4056
4231
  return true;
4057
4232
  } catch {
4058
4233
  return false;
@@ -4100,7 +4275,7 @@ function isRealAgentCredential(agent, text) {
4100
4275
  }
4101
4276
  return Object.keys(parsed).length > 0;
4102
4277
  }
4103
- async function hostClaudeBackupExpired(path = CLAUDE_HOST_BACKUP, now = Date.now()) {
4278
+ async function hostClaudeAccessTokenExpired(path = CLAUDE_HOST_BACKUP, now = Date.now()) {
4104
4279
  try {
4105
4280
  const parsed = JSON.parse(await readFile7(path, "utf8"));
4106
4281
  const exp = parsed?.claudeAiOauth?.expiresAt;
@@ -4109,6 +4284,17 @@ async function hostClaudeBackupExpired(path = CLAUDE_HOST_BACKUP, now = Date.now
4109
4284
  return false;
4110
4285
  }
4111
4286
  }
4287
+ async function hostClaudeLoginDead(path = CLAUDE_HOST_BACKUP, now = Date.now()) {
4288
+ let text;
4289
+ try {
4290
+ text = await readFile7(path, "utf8");
4291
+ } catch {
4292
+ return false;
4293
+ }
4294
+ if (!isRealAgentCredential("claude", text)) return true;
4295
+ const exp = claudeRefreshExpiresAt(text);
4296
+ return exp !== null && exp < now;
4297
+ }
4112
4298
  async function hostBackupHasCredentials(path = CLAUDE_HOST_BACKUP) {
4113
4299
  try {
4114
4300
  const parsed = JSON.parse(await readFile7(path, "utf8"));
@@ -4167,6 +4353,15 @@ function claudeExpiresAt(text) {
4167
4353
  return null;
4168
4354
  }
4169
4355
  }
4356
+ function claudeRefreshExpiresAt(text) {
4357
+ try {
4358
+ const parsed = JSON.parse(text);
4359
+ const exp = parsed?.claudeAiOauth?.refreshTokenExpiresAt;
4360
+ return typeof exp === "number" && Number.isFinite(exp) ? exp : null;
4361
+ } catch {
4362
+ return null;
4363
+ }
4364
+ }
4170
4365
  function shouldAcceptCredentialUpdate(agent, incoming, existing) {
4171
4366
  if (existing === null) return { accept: true, reason: "no existing backup" };
4172
4367
  if (existing === incoming) return { accept: false, reason: "unchanged" };
@@ -4388,7 +4583,7 @@ var BOX_DYNAMIC_SYNC_MANIFEST = "/home/vscode/.agentbox/dynamic-sync.json";
4388
4583
  var BOX_MEMORY_DIR = `${BOX_CLAUDE_PROJECT_DIR}/memory`;
4389
4584
  async function pathExists4(p) {
4390
4585
  try {
4391
- await stat9(p);
4586
+ await stat10(p);
4392
4587
  return true;
4393
4588
  } catch {
4394
4589
  return false;
@@ -4411,7 +4606,7 @@ async function walkFiles(root, prefix = "") {
4411
4606
  out.push(rel);
4412
4607
  } else if (ent.isSymbolicLink()) {
4413
4608
  try {
4414
- const s = await stat9(full);
4609
+ const s = await stat10(full);
4415
4610
  if (s.isFile()) out.push(rel);
4416
4611
  } catch {
4417
4612
  }
@@ -4707,7 +4902,7 @@ var CREDENTIALS_BACKUP_FILE = resolveAgentSpec("claude").credential.hostBackup;
4707
4902
  var CLOUD_WORKSPACE = "/workspace";
4708
4903
  async function pathExists5(p) {
4709
4904
  try {
4710
- await stat10(p);
4905
+ await stat11(p);
4711
4906
  return true;
4712
4907
  } catch {
4713
4908
  return false;
@@ -4726,7 +4921,7 @@ async function findBrokenSymlinks(root) {
4726
4921
  const full = join19(dir, ent.name);
4727
4922
  if (ent.isSymbolicLink()) {
4728
4923
  try {
4729
- await stat10(full);
4924
+ await stat11(full);
4730
4925
  } catch {
4731
4926
  broken.push(relative2(root, full));
4732
4927
  }
@@ -5215,13 +5410,9 @@ var DOCKER_CONTEXT_FILE_MAP = {
5215
5410
  staged: "packages/sandbox-docker/scripts/git-shim",
5216
5411
  dev: "scripts/git-shim"
5217
5412
  },
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"
5413
+ "scripts/agentbox-tool-shim": {
5414
+ staged: "packages/sandbox-docker/scripts/agentbox-tool-shim",
5415
+ dev: "scripts/agentbox-tool-shim"
5225
5416
  },
5226
5417
  "scripts/chromium-resolver": {
5227
5418
  staged: "packages/sandbox-docker/scripts/chromium-resolver",
@@ -5305,6 +5496,8 @@ function boxNameBasisFromOriginUrl(originUrl) {
5305
5496
 
5306
5497
  export {
5307
5498
  resolveAgentLauncher,
5499
+ claudeTuiEnv,
5500
+ buildNoVncUrl,
5308
5501
  parseReplacements,
5309
5502
  UserFacingError,
5310
5503
  BoxNotFoundError,
@@ -5364,6 +5557,21 @@ export {
5364
5557
  EXPOSED_HUB_PROFILE,
5365
5558
  parseEnvFileBody,
5366
5559
  buildExposedHubEnv,
5560
+ PLUGINS_FILE,
5561
+ SUPPORTED_SDK_API_VERSIONS,
5562
+ isSupportedApiVersion,
5563
+ PLUGINS_FILE_VERSION,
5564
+ readPluginRegistrySync,
5565
+ readPluginRegistry,
5566
+ recordPluginDescriptor,
5567
+ addPluginRecord,
5568
+ removePluginRecord,
5569
+ pluginProviderNames,
5570
+ pluginForProvider,
5571
+ resolveProviderDescriptor,
5572
+ listProviderDescriptors,
5573
+ deriveDescriptor,
5574
+ ensureProviderDescriptor,
5367
5575
  resolveCloudSshTarget,
5368
5576
  ensureCloudSshAlias,
5369
5577
  autoWriteSshConfig,
@@ -5408,10 +5616,16 @@ export {
5408
5616
  maskSecret,
5409
5617
  setCredentialPublisher,
5410
5618
  publishManagedCredentials,
5411
- HUB_RELAY_PORT,
5619
+ FALLBACK_RELAY_PORT,
5620
+ RELAY_PORT_ENV,
5621
+ isValidRelayPort,
5622
+ setRelayPort,
5623
+ relayPort,
5624
+ resetRelayPort,
5412
5625
  shouldReclaimForVersion,
5413
5626
  processAlive,
5414
5627
  killPid,
5628
+ portIsOccupied,
5415
5629
  pingHealthz,
5416
5630
  fetchHealthz,
5417
5631
  resolveCliEntry,
@@ -5429,15 +5643,6 @@ export {
5429
5643
  getHubStatus,
5430
5644
  setDockerCredentialRefresh,
5431
5645
  runDockerCredentialRefresh,
5432
- PLUGINS_FILE,
5433
- SUPPORTED_SDK_API_VERSIONS,
5434
- isSupportedApiVersion,
5435
- readPluginRegistrySync,
5436
- readPluginRegistry,
5437
- addPluginRecord,
5438
- removePluginRecord,
5439
- pluginProviderNames,
5440
- pluginForProvider,
5441
5646
  carryPlaceholderContext,
5442
5647
  renderCarryEntries,
5443
5648
  makeRecordingTransport,
@@ -5494,11 +5699,13 @@ export {
5494
5699
  seedAgentsVolume,
5495
5700
  SEED_MARKER,
5496
5701
  isRealAgentCredential,
5497
- hostClaudeBackupExpired,
5702
+ hostClaudeAccessTokenExpired,
5703
+ hostClaudeLoginDead,
5498
5704
  hostBackupHasCredentials,
5499
5705
  extractCredentials,
5500
5706
  parseCredentialsUpdate,
5501
5707
  claudeExpiresAt,
5708
+ claudeRefreshExpiresAt,
5502
5709
  shouldAcceptCredentialUpdate,
5503
5710
  writeCredentialBackup,
5504
5711
  readCredentialBackup,