@madarco/agentbox 0.33.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (913) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/_cloud-attach-KEFEQ2YH.js +32 -0
  3. package/dist/{chunk-L55DASHB.js → chunk-2SKTXZGX.js} +8 -8
  4. package/dist/{chunk-YZZKWZO2.js → chunk-3PTSPFR6.js} +7 -1
  5. package/dist/chunk-3PTSPFR6.js.map +1 -0
  6. package/dist/{chunk-BKOKMZNK.js → chunk-3QTWB66F.js} +6 -6
  7. package/dist/{chunk-VSWIJHCH.js → chunk-5ZBNVZSU.js} +3 -3
  8. package/dist/{chunk-IX7S6NJR.js → chunk-72LKKHPI.js} +4 -4
  9. package/dist/{chunk-AXAMPAP3.js → chunk-7ELRQNNH.js} +3 -3
  10. package/dist/chunk-7ELRQNNH.js.map +1 -0
  11. package/dist/{chunk-WJ4MZESJ.js → chunk-7RDDR6BW.js} +27 -8
  12. package/dist/chunk-7RDDR6BW.js.map +1 -0
  13. package/dist/{chunk-7TPGIQOP.js → chunk-BORN6FJK.js} +10 -10
  14. package/dist/{chunk-OVLM2EZV.js → chunk-CUMSI7N3.js} +97 -83
  15. package/dist/chunk-CUMSI7N3.js.map +1 -0
  16. package/dist/{chunk-Z6LK4P54.js → chunk-EUE6F7HL.js} +40 -12
  17. package/dist/chunk-EUE6F7HL.js.map +1 -0
  18. package/dist/{chunk-7AMMBUEW.js → chunk-F2CNFPIA.js} +67 -33
  19. package/dist/chunk-F2CNFPIA.js.map +1 -0
  20. package/dist/{chunk-77IAHAQY.js → chunk-FBQC6TKM.js} +6 -6
  21. package/dist/{chunk-IJFP7N34.js → chunk-FPYYDMCR.js} +26 -9
  22. package/dist/chunk-FPYYDMCR.js.map +1 -0
  23. package/dist/{chunk-U7J7JT6R.js → chunk-G35FJ4KT.js} +108 -43
  24. package/dist/chunk-G35FJ4KT.js.map +1 -0
  25. package/dist/{chunk-JUTAYI2N.js → chunk-GCUJUUNE.js} +5 -5
  26. package/dist/{chunk-S77B5POZ.js → chunk-GKBAEX2P.js} +6 -6
  27. package/dist/{chunk-XKUF67M6.js → chunk-GT7VDGNV.js} +4 -4
  28. package/dist/{chunk-52OXHGKQ.js → chunk-HNPYVRX7.js} +35 -16
  29. package/dist/chunk-HNPYVRX7.js.map +1 -0
  30. package/dist/{chunk-AGHR7XOJ.js → chunk-HOJKUVH6.js} +3 -3
  31. package/dist/{chunk-PENAXZMR.js → chunk-INJIW6PP.js} +7 -7
  32. package/dist/{chunk-OYWP4SII.js → chunk-IZPNDZXI.js} +5 -5
  33. package/dist/{chunk-U3BCLGTH.js → chunk-JHS4ROJH.js} +11 -11
  34. package/dist/{chunk-CWN4DJYI.js → chunk-JVZZPJ2C.js} +3 -3
  35. package/dist/{chunk-KOGQNHV3.js → chunk-KA67IGEG.js} +4 -4
  36. package/dist/{chunk-OTAYAFYF.js → chunk-KRF2JODE.js} +3 -3
  37. package/dist/{chunk-SDWKZLGP.js → chunk-LFMJXQDL.js} +5 -5
  38. package/dist/{chunk-FM7PHYBD.js → chunk-NEU5B2VO.js} +162 -8
  39. package/dist/chunk-NEU5B2VO.js.map +1 -0
  40. package/dist/{chunk-2U4HKKM7.js → chunk-NSYCXUN5.js} +6 -6
  41. package/dist/{chunk-U4Z5OOOD.js → chunk-NZN3BME7.js} +32 -12
  42. package/dist/chunk-NZN3BME7.js.map +1 -0
  43. package/dist/{chunk-KWDFEQO6.js → chunk-PI4A3TGV.js} +24 -71
  44. package/dist/chunk-PI4A3TGV.js.map +1 -0
  45. package/dist/{chunk-HS6B3CE4.js → chunk-PJCIZLIX.js} +472 -138
  46. package/dist/chunk-PJCIZLIX.js.map +1 -0
  47. package/dist/{chunk-GERRSRQZ.js → chunk-PZK5KRFB.js} +12 -10
  48. package/dist/{chunk-GERRSRQZ.js.map → chunk-PZK5KRFB.js.map} +1 -1
  49. package/dist/{chunk-5JDGKHWH.js → chunk-QALBGVPR.js} +2 -2
  50. package/dist/{chunk-JCDC5S32.js → chunk-QDBDDJKT.js} +4 -4
  51. package/dist/{chunk-R7J7WFM5.js → chunk-QUBP3AZD.js} +220 -49
  52. package/dist/chunk-QUBP3AZD.js.map +1 -0
  53. package/dist/{chunk-YVIC7TNH.js → chunk-QZW3WXBW.js} +43 -23
  54. package/dist/{chunk-YVIC7TNH.js.map → chunk-QZW3WXBW.js.map} +1 -1
  55. package/dist/{chunk-ZPFTFIKP.js → chunk-S5WFZHC5.js} +5 -5
  56. package/dist/{chunk-UFOUBCPW.js → chunk-UDSNFS67.js} +34 -36
  57. package/dist/{chunk-UFOUBCPW.js.map → chunk-UDSNFS67.js.map} +1 -1
  58. package/dist/{chunk-PVZUQTLW.js → chunk-VUTEVIYG.js} +5 -5
  59. package/dist/{chunk-3HJQZQ76.js → chunk-WNFUSPZR.js} +25 -72
  60. package/dist/chunk-WNFUSPZR.js.map +1 -0
  61. package/dist/{chunk-OWCTDO67.js → chunk-WVBTRK6R.js} +13 -13
  62. package/dist/{chunk-4IQGL4KD.js → chunk-ZMKRUD6J.js} +6 -6
  63. package/dist/{chunk-J2AD7MLR.js → chunk-ZQWOZ5BL.js} +3 -3
  64. package/dist/{cli-6IPZVUXF.js → cli-B4VVKKYV.js} +10 -10
  65. package/dist/{cli-QIBPY2HQ.js → cli-ENMWXMKO.js} +10 -10
  66. package/dist/{cli-QSV6K33P.js → cli-F2UBHH7H.js} +11 -11
  67. package/dist/{cli-E2ZC5S4U.js → cli-JKSQBGRO.js} +11 -11
  68. package/dist/{cli-3WZP5JHA.js → cli-MIIWRJDK.js} +11 -11
  69. package/dist/cloud-backends.js +6 -6
  70. package/dist/{control-plane-I2QKMHPK.js → control-plane-R4ELXZHL.js} +22 -22
  71. package/dist/{cp-hub-upload-GW566DGZ.js → cp-hub-upload-IUQVJGOW.js} +10 -10
  72. package/dist/custody-client-PVDBOT7Y.js +18 -0
  73. package/dist/{deploy-hetzner-IIAXES7B.js → deploy-hetzner-KY6KWN4M.js} +11 -11
  74. package/dist/{dist-4K66F4UR.js → dist-2QGMP2UI.js} +10 -10
  75. package/dist/{dist-SZTW3RMB.js → dist-5MCQFGLX.js} +28 -8
  76. package/dist/{dist-XZXZSTTA.js → dist-7EKSUISW.js} +33 -18
  77. package/dist/dist-7EKSUISW.js.map +1 -0
  78. package/dist/{dist-5RMJLMYG.js → dist-EIVYC2MR.js} +3 -3
  79. package/dist/{dist-VKKHIHCZ.js → dist-JWXPKGPZ.js} +10 -10
  80. package/dist/{dist-HIQCE4H2.js → dist-ONAAPVBD.js} +21 -11
  81. package/dist/{dist-WR2HYACA.js → dist-OXLTCVA2.js} +10 -10
  82. package/dist/{dist-WTPYXNRH.js → dist-PBO4UHJK.js} +2 -2
  83. package/dist/{dist-YED5YJQN.js → dist-RCBMUPVR.js} +12 -4
  84. package/dist/{dist-IXPKVU3R.js → dist-TD74GXLP.js} +6 -6
  85. package/dist/{dist-44RSFOGQ.js → dist-VCZ3LZPJ.js} +22 -12
  86. package/dist/{dist-3EZQDIOD.js → dist-WGV7LRDC.js} +11 -9
  87. package/dist/{host-reach-drainer-A4ZO6UKT.js → host-reach-drainer-AZYC6UIB.js} +2 -2
  88. package/dist/{host-session-POJP4WO6.js → host-session-EGUDGE4R.js} +12 -12
  89. package/dist/hub-76RHPA7X.js +40 -0
  90. package/dist/{hub-adopt-YR7S5TNB.js → hub-adopt-5G7SKI2E.js} +9 -9
  91. package/dist/{hub-api-client-BUQDTSQ3.js → hub-api-client-WPZTG5AT.js} +5 -5
  92. package/dist/{hub-docker-target-XA5U2ZU5.js → hub-docker-target-CNJHYH4B.js} +16 -16
  93. package/dist/index.js +299 -224
  94. package/dist/index.js.map +1 -1
  95. package/dist/{manager-pty-XCGH6AUC-EZML75UO.js → manager-pty-XCGH6AUC-O3UNISN2.js} +5 -5
  96. package/dist/{plugin-update-BIPJZA24.js → plugin-update-UZYPWL4N.js} +6 -6
  97. package/dist/prepare-4GOTJXQL.js +48 -0
  98. package/dist/prepared-custody-4YJ4ZT7J.js +40 -0
  99. package/dist/{prepared-state-FO74QUCP-4WLAYPEO.js → prepared-state-FO74QUCP-GUIPQORN.js} +5 -5
  100. package/dist/pty-host.js +4 -4
  101. package/dist/{publish-credentials-N2JD2D3A.js → publish-credentials-RLRLNL33.js} +12 -12
  102. package/dist/registry-QMHCNR5X.js +18 -0
  103. package/dist/relay-VBWFCWKK.js +23 -0
  104. package/dist/{remote-docker-share-GIH6JNKY.js → remote-docker-share-TKG7SXHX.js} +13 -13
  105. package/dist/{tool-grant-push-7K765QKW.js → tool-grant-push-V7E3Y2W6.js} +3 -3
  106. package/package.json +2 -1
  107. package/runtime/_shared/ctl.cjs +138 -40
  108. package/runtime/digitalocean/ctl.cjs +138 -40
  109. package/runtime/docker/packages/ctl/dist/bin.cjs +138 -40
  110. package/runtime/e2b/ctl.cjs +138 -40
  111. package/runtime/hetzner/ctl.cjs +138 -40
  112. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  113. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  114. package/runtime/hub/apps/hub/.next/prerender-manifest.json +3 -3
  115. package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page/next-font-manifest.json +3 -3
  116. package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
  117. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -1
  118. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -1
  119. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -1
  120. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/agent/route.js.nft.json +1 -1
  121. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/backup/route.js.nft.json +1 -1
  122. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -1
  123. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js.nft.json +1 -1
  124. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/clone/route.js.nft.json +1 -1
  125. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -1
  126. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -1
  127. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/logs/route.js.nft.json +1 -1
  128. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -1
  129. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -1
  130. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -1
  131. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -1
  132. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -1
  133. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/upload/route.js.nft.json +1 -1
  134. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js.nft.json +1 -1
  135. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/web/route.js.nft.json +1 -1
  136. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -1
  137. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/checkpoints/route.js.nft.json +1 -1
  138. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -1
  139. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -1
  140. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -1
  141. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -1
  142. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -1
  143. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -1
  144. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/route.js.nft.json +1 -1
  145. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js.nft.json +1 -1
  146. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach-box/route.js.nft.json +1 -1
  147. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/heartbeat/route.js.nft.json +1 -1
  148. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js.nft.json +1 -1
  149. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js.nft.json +1 -1
  150. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/pin/route.js.nft.json +1 -1
  151. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js.nft.json +1 -1
  152. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js.nft.json +1 -1
  153. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js.nft.json +1 -1
  154. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js.nft.json +1 -1
  155. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js.nft.json +1 -1
  156. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -1
  157. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/bots/route.js.nft.json +1 -1
  158. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -1
  159. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/create-preflight/route.js.nft.json +1 -1
  160. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/restore/route.js.nft.json +1 -1
  161. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -1
  162. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/seed/route.js.nft.json +1 -1
  163. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -1
  164. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -1
  165. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -1
  166. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/size-check/route.js.nft.json +1 -1
  167. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -1
  168. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js.nft.json +1 -1
  169. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/system/route.js.nft.json +1 -1
  170. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js.nft.json +1 -1
  171. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/register/route.js.nft.json +1 -1
  172. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js.nft.json +1 -1
  173. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js.nft.json +1 -1
  174. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js.nft.json +1 -1
  175. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js.nft.json +1 -1
  176. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js.nft.json +1 -1
  177. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js.nft.json +1 -1
  178. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js.nft.json +1 -1
  179. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js.nft.json +1 -1
  180. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js.nft.json +1 -1
  181. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js.nft.json +1 -1
  182. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js.nft.json +1 -1
  183. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js.nft.json +1 -1
  184. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/events/route.js.nft.json +1 -1
  185. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js.nft.json +1 -1
  186. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js +2 -2
  187. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js.nft.json +1 -1
  188. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/next-font-manifest.json +3 -3
  189. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/server-reference-manifest.json +1 -1
  190. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  191. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  192. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/next-font-manifest.json +3 -3
  193. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/server-reference-manifest.json +12 -12
  194. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
  195. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  196. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js.nft.json +1 -1
  197. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/web/route.js.nft.json +1 -1
  198. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page/next-font-manifest.json +3 -3
  199. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page.js.nft.json +1 -1
  200. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page_client-reference-manifest.js +1 -1
  201. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/next-font-manifest.json +3 -3
  202. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/server-reference-manifest.json +12 -12
  203. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  204. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  205. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/next-font-manifest.json +3 -3
  206. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/server-reference-manifest.json +8 -8
  207. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
  208. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  209. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page/next-font-manifest.json +3 -3
  210. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  211. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  212. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page/next-font-manifest.json +3 -3
  213. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page.js.nft.json +1 -1
  214. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page_client-reference-manifest.js +1 -1
  215. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +1 -1
  216. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
  217. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  218. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  219. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  220. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  221. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  222. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  223. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  224. package/runtime/hub/apps/hub/.next/server/app/_not-found/page/next-font-manifest.json +3 -3
  225. package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  226. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-5e8ze._.js +3 -0
  227. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-di9rg._.js +3 -0
  228. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__008zqfx._.js → [root-of-the-server]__0-ovzfw._.js} +2 -2
  229. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-r5e8q._.js +3 -0
  230. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__007hogi._.js +3 -0
  231. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0-kl55b._.js → [root-of-the-server]__00bh9gb._.js} +2 -2
  232. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00dc6yl._.js +3 -0
  233. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00zpt4k._.js +3 -0
  234. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__017tfb_._.js +3 -0
  235. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01dlun3._.js +3 -0
  236. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01mhbng._.js +3 -0
  237. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03jx5m5._.js +3 -0
  238. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03l4evb._.js +3 -0
  239. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0126167._.js → [root-of-the-server]__03uelft._.js} +2 -2
  240. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03wt33b._.js +3 -0
  241. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03z-u4h._.js +3 -0
  242. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__02s5f9s._.js → [root-of-the-server]__048c4u3._.js} +2 -2
  243. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04glef0._.js +3 -0
  244. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04za-91._.js +3 -0
  245. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05cnibm._.js +3 -0
  246. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06e_no_._.js +3 -0
  247. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06g2ncr._.js +3 -0
  248. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06vmwu8._.js +3 -0
  249. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06wzlsi._.js +3 -0
  250. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07f11r9._.js +3 -0
  251. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07mtcs1._.js +3 -0
  252. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__084o93l._.js +3 -0
  253. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__085_re5._.js +3 -0
  254. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08kj50f._.js +3 -0
  255. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08txtdi._.js +3 -0
  256. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__092u79y._.js +3 -0
  257. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09j-kzo._.js +3 -0
  258. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09umuy8._.js +3 -0
  259. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09wu-6r._.js +3 -0
  260. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_60dmv._.js +3 -0
  261. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_f5r-w._.js +3 -0
  262. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ahciyb._.js +3 -0
  263. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ajp0a3._.js +3 -0
  264. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ao_4th._.js +3 -0
  265. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0aqoqhn._.js +3 -0
  266. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0b3_azq._.js +3 -0
  267. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cjjwg7._.js +3 -0
  268. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +1 -1
  269. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1wl4f._.js +3 -0
  270. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d2ce-o._.js +3 -0
  271. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dfklvw._.js +3 -0
  272. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dgkz7l._.js +3 -0
  273. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dlg6e7._.js +3 -0
  274. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dq5edp._.js +3 -0
  275. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0drzmcj._.js +3 -0
  276. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dvyt4d._.js +3 -0
  277. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dyqk31._.js +3 -0
  278. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0eliqqa._.js +3 -0
  279. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0eluwey._.js +3 -0
  280. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f5v0j5._.js +3 -0
  281. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f7g_na._.js +3 -0
  282. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fn2qow._.js +3 -0
  283. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0frnoss._.js +3 -0
  284. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0g0e1x-._.js +3 -0
  285. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gdwl-b._.js +3 -0
  286. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gfhbl7._.js +3 -0
  287. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gsie0d._.js +3 -0
  288. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0hg36y7._.js +3 -0
  289. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0hz77cq._.js +3 -0
  290. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0i501ph._.js +3 -0
  291. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0j5jaq9._.js +3 -0
  292. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0j7_6c5._.js +3 -0
  293. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jm5dx1._.js +3 -0
  294. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0k-t2mr._.js +3 -0
  295. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ktkk27._.js +3 -0
  296. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0kxp4k8._.js +3 -0
  297. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0l-mqzk._.js +3 -0
  298. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0l7rw-n._.js +3 -0
  299. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lb45m6._.js +3 -0
  300. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lvczy2._.js +3 -0
  301. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0m9zj9m._.js +3 -0
  302. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mg-juc._.js +3 -0
  303. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mriv1n._.js +3 -0
  304. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0n4gqir._.js +3 -0
  305. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0new-8d._.js +3 -0
  306. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nuc9du._.js +3 -0
  307. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nxnhun._.js +3 -0
  308. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0o42jfc._.js +3 -0
  309. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0o7zz8d._.js +3 -0
  310. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0omb75h._.js +3 -0
  311. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0p4ta6t._.js +3 -0
  312. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0p5_ap9._.js +3 -0
  313. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pan9yi._.js +3 -0
  314. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pr6h1j._.js +3 -0
  315. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pz23t_._.js +3 -0
  316. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qcvt0o._.js +3 -0
  317. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qn4mea._.js +3 -0
  318. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qp0txx._.js +3 -0
  319. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qsn9xm._.js +3 -0
  320. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qx8qwu._.js +3 -0
  321. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0r6p-ql._.js +3 -0
  322. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0r6tfw8._.js +3 -0
  323. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sgdrnp._.js +3 -0
  324. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ssn3y9._.js +1 -1
  325. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0te8u6u._.js +3 -0
  326. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ukg6s1._.js +3 -0
  327. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0up7ls4._.js +3 -0
  328. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0uvnrnf._.js +3 -0
  329. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0v2xw5s._.js +3 -0
  330. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0v5qu_p._.js +3 -0
  331. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__12p0ia1._.js → [root-of-the-server]__0vku_ep._.js} +2 -2
  332. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vuhl78._.js +3 -0
  333. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w52bth._.js +3 -0
  334. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wq5ukd._.js +3 -0
  335. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wx561s._.js +3 -0
  336. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wxo4bk._.js +3 -0
  337. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xfcui-._.js +3 -0
  338. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xm7z28._.js +3 -0
  339. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xqz1om._.js +3 -0
  340. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xur24w._.js +3 -0
  341. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xw3pee._.js +3 -0
  342. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xwht7v._.js +3 -0
  343. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0y20q9b._.js +3 -0
  344. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zfq7yk._.js +3 -0
  345. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zi_qda._.js +3 -0
  346. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zpm7wg._.js +3 -0
  347. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zxlzp1._.js +3 -0
  348. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-a4wnf._.js +3 -0
  349. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-fpw4q._.js +3 -0
  350. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-iro6m._.js +3 -0
  351. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-o35-u._.js +3 -0
  352. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1043gy8._.js +3 -0
  353. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10kehs5._.js +3 -0
  354. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10s1755._.js +3 -0
  355. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11d3dgq._.js +3 -0
  356. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__126lrtu._.js +3 -0
  357. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12n9728._.js +3 -0
  358. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13hluml._.js +3 -0
  359. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13hzwlv._.js +3 -0
  360. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__14c4h72._.js +3 -0
  361. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__14oho-o._.js +3 -0
  362. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__14zr9zt._.js +1 -1
  363. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__153axa9._.js +3 -0
  364. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1582-3i._.js +3 -0
  365. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__15v83nk._.js +3 -0
  366. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16e-k-w._.js +3 -0
  367. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16m0mie._.js +3 -0
  368. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16ta_9y._.js +3 -0
  369. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17a3r0z._.js +3 -0
  370. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17kg43w._.js +3 -0
  371. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18g18yc._.js +3 -0
  372. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18m4f3-._.js +3 -0
  373. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__190vthx._.js +3 -0
  374. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19vezsz._.js +3 -0
  375. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19vgyci._.js +3 -0
  376. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_ulp2r._.js +3 -0
  377. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1a6hiz5._.js +3 -0
  378. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1apqdye._.js +3 -0
  379. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1avjial._.js +3 -0
  380. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cicer7._.js +3 -0
  381. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1crkcf8._.js +3 -0
  382. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dra_qf._.js +3 -0
  383. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1eearvr._.js +3 -0
  384. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1eewe3-._.js +3 -0
  385. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1fd1yxa._.js +3 -0
  386. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1fyknn9._.js +3 -0
  387. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1g24h4v._.js +3 -0
  388. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1goi44d._.js +3 -0
  389. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hf8-7y._.js +3 -0
  390. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hn7h11._.js +3 -0
  391. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i9e2ly._.js +3 -0
  392. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1j6cxj7._.js +3 -0
  393. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1jwn6xy._.js +3 -0
  394. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1kw00ov._.js +3 -0
  395. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1l0xu4g._.js +3 -0
  396. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1laa5r-._.js +3 -0
  397. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lo6_vz._.js +3 -0
  398. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lzumk3._.js +3 -0
  399. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m1qnsg._.js +3 -0
  400. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m26y4h._.js +3 -0
  401. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m5qi0d._.js +3 -0
  402. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m7oktq._.js +3 -0
  403. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mq0v7p._.js +1 -1
  404. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1n29-mo._.js +3 -0
  405. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1n5aq-l._.js +3 -0
  406. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1nhwizo._.js +3 -0
  407. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1o2vpkc._.js +3 -0
  408. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1o9euia._.js +3 -0
  409. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1otvs-z._.js +3 -0
  410. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1p3nshl._.js +3 -0
  411. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pbl8am._.js +3 -0
  412. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q9a118._.js +3 -0
  413. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q9klny._.js +3 -0
  414. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qf5sar._.js +3 -0
  415. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qjpnlw._.js +3 -0
  416. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qpcmfu._.js +1 -1
  417. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1r8kqe3._.js +3 -0
  418. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ra-lry._.js +3 -0
  419. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rousb3._.js +3 -0
  420. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rvwwj8._.js +3 -0
  421. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rwfadw._.js +3 -0
  422. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sj1ox_._.js +3 -0
  423. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sq9444._.js +3 -0
  424. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sqteyf._.js +3 -0
  425. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1th4k80._.js +3 -0
  426. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1umt_5v._.js +3 -0
  427. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ux-zjb._.js +3 -0
  428. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v5fjky._.js +3 -0
  429. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1vspjdn._.js +3 -0
  430. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1w02nxp._.js +3 -0
  431. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1winv-x._.js +3 -0
  432. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wj9na5._.js +3 -0
  433. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1x-8rww._.js +3 -0
  434. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ybyads._.js +3 -0
  435. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1yzs5_p._.js +3 -0
  436. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1z3bc6x._.js +3 -0
  437. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zh-p_4._.js +3 -0
  438. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zj2l_d._.js +3 -0
  439. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zqt33m._.js +3 -0
  440. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zr57k3._.js +3 -0
  441. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zxsjfn._.js +3 -0
  442. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20ga3fy._.js +3 -0
  443. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20gp3bg._.js +3 -0
  444. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20k17-b._.js +3 -0
  445. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20o508x._.js +3 -0
  446. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20zx91s._.js +3 -0
  447. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__219zam7._.js +3 -0
  448. package/runtime/hub/apps/hub/.next/server/chunks/_03slv7y._.js +1 -1
  449. package/runtime/hub/apps/hub/.next/server/chunks/_03u-l9s._.js +1 -1
  450. package/runtime/hub/apps/hub/.next/server/chunks/_048yy7t._.js +1 -1
  451. package/runtime/hub/apps/hub/.next/server/chunks/_05_hmgg._.js +1 -1
  452. package/runtime/hub/apps/hub/.next/server/chunks/_08cr70o._.js +1 -1
  453. package/runtime/hub/apps/hub/.next/server/chunks/_0907rw0._.js +1 -1
  454. package/runtime/hub/apps/hub/.next/server/chunks/_09bu8dh._.js +1 -1
  455. package/runtime/hub/apps/hub/.next/server/chunks/_0_2z437._.js +1 -1
  456. package/runtime/hub/apps/hub/.next/server/chunks/_0_s1tx9._.js +1 -1
  457. package/runtime/hub/apps/hub/.next/server/chunks/_0_ue2iy._.js +1 -1
  458. package/runtime/hub/apps/hub/.next/server/chunks/_0b6vmhh._.js +1 -1
  459. package/runtime/hub/apps/hub/.next/server/chunks/_0bxg62j._.js +1 -1
  460. package/runtime/hub/apps/hub/.next/server/chunks/_0cc3kcz._.js +1 -1
  461. package/runtime/hub/apps/hub/.next/server/chunks/_0ccgezr._.js +1 -1
  462. package/runtime/hub/apps/hub/.next/server/chunks/_0e50cwx._.js +1 -1
  463. package/runtime/hub/apps/hub/.next/server/chunks/_0ek1dkx._.js +1 -1
  464. package/runtime/hub/apps/hub/.next/server/chunks/_0g94rtj._.js +1 -1
  465. package/runtime/hub/apps/hub/.next/server/chunks/_0hwl0oy._.js +1 -1
  466. package/runtime/hub/apps/hub/.next/server/chunks/_0ihch2c._.js +1 -1
  467. package/runtime/hub/apps/hub/.next/server/chunks/_0jal0nm._.js +1 -1
  468. package/runtime/hub/apps/hub/.next/server/chunks/_0jvwv07._.js +1 -1
  469. package/runtime/hub/apps/hub/.next/server/chunks/_0mpj2yt._.js +1 -1
  470. package/runtime/hub/apps/hub/.next/server/chunks/_0n22m88._.js +1 -1
  471. package/runtime/hub/apps/hub/.next/server/chunks/_0ndtf84._.js +1 -1
  472. package/runtime/hub/apps/hub/.next/server/chunks/_0o1r-if._.js +1 -1
  473. package/runtime/hub/apps/hub/.next/server/chunks/_0opn03l._.js +1 -1
  474. package/runtime/hub/apps/hub/.next/server/chunks/_0p-2n50._.js +1 -1
  475. package/runtime/hub/apps/hub/.next/server/chunks/_0qf4357._.js +1 -1
  476. package/runtime/hub/apps/hub/.next/server/chunks/_0tbb47v._.js +1 -1
  477. package/runtime/hub/apps/hub/.next/server/chunks/_0ubchhn._.js +1 -1
  478. package/runtime/hub/apps/hub/.next/server/chunks/_0ul-64a._.js +1 -1
  479. package/runtime/hub/apps/hub/.next/server/chunks/_0v--tpg._.js +1 -1
  480. package/runtime/hub/apps/hub/.next/server/chunks/_0v3xwi-._.js +1 -1
  481. package/runtime/hub/apps/hub/.next/server/chunks/_0vg6gvw._.js +42 -40
  482. package/runtime/hub/apps/hub/.next/server/chunks/_0y497n2._.js +1 -1
  483. package/runtime/hub/apps/hub/.next/server/chunks/_0zvfiwd._.js +1 -1
  484. package/runtime/hub/apps/hub/.next/server/chunks/_100tsj5._.js +1 -1
  485. package/runtime/hub/apps/hub/.next/server/chunks/_11-rqgb._.js +1 -1
  486. package/runtime/hub/apps/hub/.next/server/chunks/_113fejt._.js +1 -1
  487. package/runtime/hub/apps/hub/.next/server/chunks/_12juepz._.js +1 -1
  488. package/runtime/hub/apps/hub/.next/server/chunks/_12w22u2._.js +1 -1
  489. package/runtime/hub/apps/hub/.next/server/chunks/_134-gub._.js +1 -1
  490. package/runtime/hub/apps/hub/.next/server/chunks/_14kba0u._.js +1 -1
  491. package/runtime/hub/apps/hub/.next/server/chunks/_16ec74_._.js +1 -1
  492. package/runtime/hub/apps/hub/.next/server/chunks/_17ntgn8._.js +1 -1
  493. package/runtime/hub/apps/hub/.next/server/chunks/_1c27mjg._.js +1 -1
  494. package/runtime/hub/apps/hub/.next/server/chunks/_1c4zrlu._.js +1 -1
  495. package/runtime/hub/apps/hub/.next/server/chunks/_1cmknl6._.js +1 -1
  496. package/runtime/hub/apps/hub/.next/server/chunks/_1g8ctu7._.js +1 -1
  497. package/runtime/hub/apps/hub/.next/server/chunks/_1grz1bu._.js +1 -1
  498. package/runtime/hub/apps/hub/.next/server/chunks/_1itx6m_._.js +1 -1
  499. package/runtime/hub/apps/hub/.next/server/chunks/_1jaoh3w._.js +1 -1
  500. package/runtime/hub/apps/hub/.next/server/chunks/_1ktt212._.js +1 -1
  501. package/runtime/hub/apps/hub/.next/server/chunks/_1ldaou_._.js +1 -1
  502. package/runtime/hub/apps/hub/.next/server/chunks/_1n3e-p-._.js +1 -1
  503. package/runtime/hub/apps/hub/.next/server/chunks/_1onbxt8._.js +1 -1
  504. package/runtime/hub/apps/hub/.next/server/chunks/_1pudgbl._.js +1 -1
  505. package/runtime/hub/apps/hub/.next/server/chunks/_1qmsz02._.js +1 -1
  506. package/runtime/hub/apps/hub/.next/server/chunks/_1r3ah1o._.js +1 -1
  507. package/runtime/hub/apps/hub/.next/server/chunks/_1t24c_5._.js +1 -1
  508. package/runtime/hub/apps/hub/.next/server/chunks/_1vv20kp._.js +1 -1
  509. package/runtime/hub/apps/hub/.next/server/chunks/_1whgbe7._.js +1 -1
  510. package/runtime/hub/apps/hub/.next/server/chunks/_1wj2dpr._.js +1 -1
  511. package/runtime/hub/apps/hub/.next/server/chunks/_1wsllw4._.js +1 -1
  512. package/runtime/hub/apps/hub/.next/server/chunks/_1yk56nw._.js +1 -1
  513. package/runtime/hub/apps/hub/.next/server/chunks/_1yumxg7._.js +1 -1
  514. package/runtime/hub/apps/hub/.next/server/chunks/_1zlfubf._.js +1 -1
  515. package/runtime/hub/apps/hub/.next/server/chunks/_204rqiz._.js +1 -1
  516. package/runtime/hub/apps/hub/.next/server/chunks/_2056rpg._.js +1 -1
  517. package/runtime/hub/apps/hub/.next/server/chunks/_2056tby._.js +1 -1
  518. package/runtime/hub/apps/hub/.next/server/chunks/packages_agent-registry_dist_index_1ze3mqq.js +13 -13
  519. package/runtime/hub/apps/hub/.next/server/chunks/ssr/044u_hub__next-internal_server_app_(dashboard)_projects_[id]_page_actions_15f56np.js +1 -1
  520. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0515n2f._.js +1 -1
  521. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0h3qrm-._.js +3 -0
  522. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0o-fklw._.js +3 -0
  523. package/runtime/hub/apps/hub/.next/server/chunks/ssr/{[root-of-the-server]__0m1akem._.js → [root-of-the-server]__1jkmxi2._.js} +2 -2
  524. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0kpdmm-._.js +1 -1
  525. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0kzd494._.js +1 -1
  526. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ozyjt1._.js +1 -1
  527. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r2xlss._.js +1 -1
  528. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_14-qzbg._.js +33 -31
  529. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_1hrzkwr._.js +1 -1
  530. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0j5-o0f._.js +1 -1
  531. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_17myqp5._.js +1 -1
  532. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_approvals_page_actions_1mi0bpn.js +1 -1
  533. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_boxes_[id]_page_actions_0k7kgn2.js +1 -1
  534. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_page_actions_1t3u0xy.js +1 -1
  535. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
  536. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +1 -1
  537. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_page_tsx_0o2z21l._.js +1 -1
  538. package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_agent-registry_dist_index_0z476w4.js +1 -1
  539. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  540. package/runtime/hub/apps/hub/.next/server/next-font-manifest.js +1 -1
  541. package/runtime/hub/apps/hub/.next/server/next-font-manifest.json +27 -27
  542. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  543. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.js +1 -1
  544. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.json +19 -19
  545. package/runtime/hub/apps/hub/.next/static/chunks/{2hxatwkh8fha9.js → 02sqxeus8w0s0.js} +1 -1
  546. package/runtime/hub/apps/hub/.next/static/chunks/{0tmbn9jje8ulx.js → 03ceb0qh4s52a.js} +1 -1
  547. package/runtime/hub/apps/hub/.next/static/chunks/{03_fxfc3849ms.css → 0ofk3im5p6gn-.css} +2 -2
  548. package/runtime/hub/apps/hub/.next/static/chunks/{38dg0m6sbz8hx.js → 0qhuf1a_7byq-.js} +1 -1
  549. package/runtime/hub/apps/hub/.next/static/chunks/{05dzzanyo20wx.js → 0u50pq99k9z_4.js} +1 -1
  550. package/runtime/hub/apps/hub/.next/static/chunks/{27t0b0mja1zpt.js → 0x0l4io4rdmuq.js} +1 -1
  551. package/runtime/hub/apps/hub/.next/static/chunks/{1ct_kocalf1mw.js → 22rj-g4qe8jny.js} +1 -1
  552. package/runtime/hub/apps/hub/.next/static/chunks/{22fqc0ktzjo6x.js → 23kzsoacq647n.js} +1 -1
  553. package/runtime/hub/apps/hub/.next/static/media/02263ebadd758ea4-s.1iu7q7yw-zhgt.woff2 +0 -0
  554. package/runtime/hub/apps/hub/.next/static/media/1a69062cfe6f77f8-s.26axk51fv0nvx.woff2 +0 -0
  555. package/runtime/hub/apps/hub/.next/static/media/23b7a97ae3b5c134-s.p.17c61zbdzi3u-.woff2 +0 -0
  556. package/runtime/hub/apps/hub/.next/static/media/2e95a7d252b9825a-s.1at6z4kbofh3w.woff2 +0 -0
  557. package/runtime/hub/apps/hub/.next/static/media/2fe89d53234c61d4-s.1h7k3aqd68qji.woff2 +0 -0
  558. package/runtime/hub/apps/hub/.next/static/media/59b15b4bcd7b1eb5-s.0g4pmka8j2u20.woff2 +0 -0
  559. package/runtime/hub/apps/hub/.next/static/media/68757d6cddeff913-s.07-q_h5lq3omo.woff2 +0 -0
  560. package/runtime/hub/apps/hub/.next/static/media/77ce6907447ba740-s.1thpl3j71vtxe.woff2 +0 -0
  561. package/runtime/hub/apps/hub/.next/static/media/99e609270109b47d-s.p.30xqm3yldpj47.woff2 +0 -0
  562. package/runtime/hub/apps/hub/.next/static/media/9a4838fcda0d1bca-s.13qpbrx2rg1iz.woff2 +0 -0
  563. package/runtime/hub/apps/hub/.next/static/media/a7afbb44bec2bb18-s.42z9vm7u0i9n-.woff2 +0 -0
  564. package/runtime/hub/apps/hub/.next/static/media/bfc9b7e66b1caeca-s.3hdclex1x_th1.woff2 +0 -0
  565. package/runtime/hub/apps/hub/.next/static/media/e532fa1b9921e1cd-s.1v7x_qdpnbwoz.woff2 +0 -0
  566. package/runtime/hub/apps/hub/.next/static/media/effe91970fc4db64-s.p.27korwsf9c79u.woff2 +0 -0
  567. package/runtime/hub/apps/hub/.next/static/media/f7cb89c1bcef4d27-s.3ajilh452uwtx.woff2 +0 -0
  568. package/runtime/hub/apps/hub/{auth-3K7Z7LVZ.js → auth-475LXXJA.js} +2 -2
  569. package/runtime/hub/apps/hub/{auth-config-G23WLTGN.js → auth-config-SPDXLHDX.js} +2 -2
  570. package/runtime/hub/apps/hub/{chunk-GGYNXEOD.js → chunk-3WRZVFOY.js} +521 -189
  571. package/runtime/hub/apps/hub/{chunk-RNUUXV2X.js → chunk-67LASBXO.js} +107 -42
  572. package/runtime/hub/apps/hub/{chunk-VQUZQ5MH.js → chunk-6ND54VG2.js} +161 -7
  573. package/runtime/hub/apps/hub/{chunk-7B4VZTUH.js → chunk-7XCRB6GS.js} +96 -82
  574. package/runtime/hub/apps/hub/{chunk-BEK5SYX5.js → chunk-DAMV47HM.js} +6 -0
  575. package/runtime/hub/apps/hub/{chunk-RAIBV7TH.js → chunk-FPLCH64R.js} +1 -1
  576. package/runtime/hub/apps/hub/{chunk-64GCEGJK.js → chunk-KJHUOHQ5.js} +4 -4
  577. package/runtime/hub/apps/hub/{chunk-OWAJTG3G.js → chunk-XGNMYL3X.js} +11 -11
  578. package/runtime/hub/apps/hub/{chunk-FWMBOJTZ.js → chunk-YBYUNY5P.js} +7 -7
  579. package/runtime/hub/apps/hub/{chunk-L5XPW2AU.js → chunk-ZVLJG772.js} +24 -71
  580. package/runtime/hub/apps/hub/{dist-QXOLLT4Y.js → dist-2KUVFXS3.js} +19 -9
  581. package/runtime/hub/apps/hub/{dist-D4JO7PAL.js → dist-2PUSTW2W.js} +1 -1
  582. package/runtime/hub/apps/hub/{dist-I5V4YM32.js → dist-67P6KLUY.js} +2 -2
  583. package/runtime/hub/apps/hub/dist-7PN6FTJV.js +26176 -0
  584. package/runtime/hub/apps/hub/{dist-BX2OAELL.js → dist-O53WU2K6.js} +11 -3
  585. package/runtime/hub/apps/hub/{dist-4GYSUKN3.js → dist-ODKJZJI2.js} +7 -7
  586. package/runtime/hub/apps/hub/{dist-R7ZY7ZTV.js → dist-SUHXQDYN.js} +26 -6
  587. package/runtime/hub/apps/hub/{dist-IHHRC4JW.js → dist-UMA73Z3V.js} +7 -7
  588. package/runtime/hub/apps/hub/{dist-LZWGXCOQ.js → dist-VHXEBJX5.js} +9 -7
  589. package/runtime/hub/apps/hub/{dist-TWRKOELH.js → dist-XOMGXTMI.js} +26 -71
  590. package/runtime/hub/apps/hub/{dist-33UWJJFG.js → dist-ZSRBJAWL.js} +27 -10
  591. package/runtime/hub/apps/hub/{hub-token-EIS7FVL2.js → hub-token-VMKQH4IY.js} +2 -2
  592. package/runtime/hub/apps/hub/{hub-worker-2LVMIS5H.js → hub-worker-5WDNMFCP.js} +9 -9
  593. package/runtime/hub/apps/hub/{manager-pty-XCGH6AUC-VJSNM3A6.js → manager-pty-XCGH6AUC-ZYM2ENVR.js} +4 -4
  594. package/runtime/hub/apps/hub/package.json +2 -1
  595. package/runtime/hub/apps/hub/{prepared-state-FO74QUCP-LZNKUFC7.js → prepared-state-FO74QUCP-L5OKEU42.js} +4 -4
  596. package/runtime/hub/apps/hub/server.js +296 -123
  597. package/runtime/relay/bin.cjs +131 -33
  598. package/runtime/vercel/ctl.cjs +138 -40
  599. package/dist/_cloud-attach-F25HDXWB.js +0 -32
  600. package/dist/chunk-3HJQZQ76.js.map +0 -1
  601. package/dist/chunk-52OXHGKQ.js.map +0 -1
  602. package/dist/chunk-7AMMBUEW.js.map +0 -1
  603. package/dist/chunk-AXAMPAP3.js.map +0 -1
  604. package/dist/chunk-FM7PHYBD.js.map +0 -1
  605. package/dist/chunk-HS6B3CE4.js.map +0 -1
  606. package/dist/chunk-IJFP7N34.js.map +0 -1
  607. package/dist/chunk-KWDFEQO6.js.map +0 -1
  608. package/dist/chunk-OVLM2EZV.js.map +0 -1
  609. package/dist/chunk-R7J7WFM5.js.map +0 -1
  610. package/dist/chunk-U4Z5OOOD.js.map +0 -1
  611. package/dist/chunk-U7J7JT6R.js.map +0 -1
  612. package/dist/chunk-WJ4MZESJ.js.map +0 -1
  613. package/dist/chunk-YZZKWZO2.js.map +0 -1
  614. package/dist/chunk-Z6LK4P54.js.map +0 -1
  615. package/dist/custody-client-F3OAOAC7.js +0 -18
  616. package/dist/dist-XZXZSTTA.js.map +0 -1
  617. package/dist/hub-GHFEW3K2.js +0 -40
  618. package/dist/prepare-O4BUJIOQ.js +0 -48
  619. package/dist/prepared-custody-UTSSUTXF.js +0 -40
  620. package/dist/registry-IPDCZDNW.js +0 -18
  621. package/dist/relay-P5CXEGAZ.js +0 -23
  622. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-0scfb._.js +0 -3
  623. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00a4c3f._.js +0 -3
  624. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00tx9tm._.js +0 -3
  625. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02-rdq0._.js +0 -3
  626. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02kc2og._.js +0 -3
  627. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02sueng._.js +0 -3
  628. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02ywgcg._.js +0 -3
  629. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03_xi2c._.js +0 -3
  630. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03fxkqp._.js +0 -3
  631. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04-i6rm._.js +0 -3
  632. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04b75a4._.js +0 -3
  633. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04d3pe5._.js +0 -3
  634. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05_wgfq._.js +0 -3
  635. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__071c-t4._.js +0 -3
  636. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07fobp5._.js +0 -3
  637. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__081d104._.js +0 -3
  638. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08h5jgt._.js +0 -3
  639. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09grt_m._.js +0 -3
  640. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09jbqbh._.js +0 -3
  641. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09y4pdw._.js +0 -3
  642. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_t5f3m._.js +0 -3
  643. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_xcmfv._.js +0 -3
  644. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a6e0vs._.js +0 -3
  645. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a8ere2._.js +0 -3
  646. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0azx8z8._.js +0 -3
  647. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bok80z._.js +0 -3
  648. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bv_k0d._.js +0 -3
  649. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c1o4qr._.js +0 -3
  650. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c5mzbr._.js +0 -3
  651. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cc5lpl._.js +0 -3
  652. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ce13qa._.js +0 -3
  653. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cyy9az._.js +0 -3
  654. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d34880._.js +0 -3
  655. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dfvo5-._.js +0 -3
  656. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dtq9pr._.js +0 -3
  657. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dw7c0k._.js +0 -3
  658. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0e6_t-d._.js +0 -3
  659. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0edd68z._.js +0 -3
  660. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0engd-e._.js +0 -3
  661. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0eua3wn._.js +0 -3
  662. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ewh0df._.js +0 -3
  663. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f_4fiu._.js +0 -3
  664. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fkjz20._.js +0 -3
  665. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fknr6k._.js +0 -3
  666. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fxx69a._.js +0 -3
  667. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0g7gynv._.js +0 -3
  668. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gl-4ha._.js +0 -3
  669. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gr6v_i._.js +0 -3
  670. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0h181r5._.js +0 -3
  671. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0h668tm._.js +0 -3
  672. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0i65ptk._.js +0 -3
  673. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0iyr5bm._.js +0 -3
  674. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0j0vl7q._.js +0 -3
  675. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jvk7x8._.js +0 -3
  676. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jz3x26._.js +0 -3
  677. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0k_7aj_._.js +0 -3
  678. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lc-j_n._.js +0 -3
  679. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mid58_._.js +0 -3
  680. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mq5e3o._.js +0 -3
  681. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0n5hh_2._.js +0 -3
  682. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0neufba._.js +0 -3
  683. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nqggrc._.js +0 -3
  684. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nx6w0m._.js +0 -3
  685. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0o4rocd._.js +0 -3
  686. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0olhyt4._.js +0 -3
  687. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pe9g30._.js +0 -3
  688. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pik2ie._.js +0 -3
  689. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qkpqk7._.js +0 -3
  690. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qt_r6a._.js +0 -3
  691. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qudrhk._.js +0 -3
  692. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0r0v_c_._.js +0 -3
  693. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0r4qvs6._.js +0 -3
  694. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0rf4g7g._.js +0 -3
  695. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0s4vdow._.js +0 -3
  696. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0s5ck78._.js +0 -3
  697. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0scmgnp._.js +0 -3
  698. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sn7av8._.js +0 -3
  699. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0soiiqi._.js +0 -3
  700. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sz5p6g._.js +0 -3
  701. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0tl6p7k._.js +0 -3
  702. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0tv5sah._.js +0 -3
  703. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0usxinp._.js +0 -3
  704. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0v5krdd._.js +0 -3
  705. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vgxotx._.js +0 -3
  706. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vsn71u._.js +0 -3
  707. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0x5eodh._.js +0 -3
  708. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0x_rx1f._.js +0 -3
  709. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xo5ak-._.js +0 -3
  710. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xt0w30._.js +0 -3
  711. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0y-rry-._.js +0 -3
  712. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0y3snn7._.js +0 -3
  713. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ygnbei._.js +0 -3
  714. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yio_n7._.js +0 -3
  715. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yxeq50._.js +0 -3
  716. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0z2lkh_._.js +0 -3
  717. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zd42wf._.js +0 -3
  718. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zi14f-._.js +0 -3
  719. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zxv1ul._.js +0 -3
  720. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zyutsi._.js +0 -3
  721. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-90xgw._.js +0 -3
  722. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__106reiu._.js +0 -3
  723. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__112hqrh._.js +0 -3
  724. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__113ijth._.js +0 -3
  725. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11qbpq8._.js +0 -3
  726. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11xey3v._.js +0 -3
  727. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__121vdp5._.js +0 -3
  728. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12b40mo._.js +0 -3
  729. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12i61td._.js +0 -3
  730. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12tjfss._.js +0 -3
  731. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__139ha9-._.js +0 -3
  732. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13dk6en._.js +0 -3
  733. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13j6tof._.js +0 -3
  734. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13nfpq5._.js +0 -3
  735. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__14opl53._.js +0 -3
  736. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__14pxg1e._.js +0 -3
  737. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__15gc6-s._.js +0 -3
  738. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__15k2wx5._.js +0 -3
  739. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__15umca-._.js +0 -3
  740. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__162e1zj._.js +0 -3
  741. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__166_uek._.js +0 -3
  742. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16pmnr6._.js +0 -3
  743. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__174fgjv._.js +0 -3
  744. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17df14g._.js +0 -3
  745. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17jzikc._.js +0 -3
  746. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17y9pmx._.js +0 -3
  747. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18pwzaw._.js +0 -3
  748. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__192ppv6._.js +0 -3
  749. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__198-esg._.js +0 -3
  750. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19al998._.js +0 -3
  751. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19m88da._.js +0 -3
  752. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19nlcuf._.js +0 -3
  753. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_4v0mh._.js +0 -3
  754. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_dmv53._.js +0 -3
  755. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_xgm2e._.js +0 -3
  756. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_zs8b5._.js +0 -3
  757. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1abclgc._.js +0 -3
  758. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1aboxh4._.js +0 -3
  759. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bh1dxz._.js +0 -3
  760. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cb0_wq._.js +0 -3
  761. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cbn_et._.js +0 -3
  762. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cggpv7._.js +0 -3
  763. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cnhbta._.js +0 -3
  764. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cpqqag._.js +0 -3
  765. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cs6d52._.js +0 -3
  766. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d-v8kt._.js +0 -3
  767. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d-yop_._.js +0 -3
  768. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d60scp._.js +0 -3
  769. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dhzd1_._.js +0 -3
  770. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1diw0ei._.js +0 -3
  771. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dogvkr._.js +0 -3
  772. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ectuq4._.js +0 -3
  773. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ehcanu._.js +0 -3
  774. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1em476i._.js +0 -3
  775. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f9l4qz._.js +0 -3
  776. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4akof._.js +0 -3
  777. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i9bs12._.js +0 -3
  778. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1jbtokr._.js +0 -3
  779. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1jelopi._.js +0 -3
  780. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1jnfrsy._.js +0 -3
  781. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1k934r7._.js +0 -3
  782. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1kt9_sy._.js +0 -3
  783. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1kv_jgw._.js +0 -3
  784. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1l_uof1._.js +0 -3
  785. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lareew._.js +0 -3
  786. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lgn5_b._.js +0 -3
  787. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lnherq._.js +0 -3
  788. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lyqerb._.js +0 -3
  789. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1me3irq._.js +0 -3
  790. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mh1-lh._.js +0 -3
  791. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mk_lpu._.js +0 -3
  792. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1muxcy9._.js +0 -3
  793. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mx0_-f._.js +0 -3
  794. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1no5aw3._.js +0 -3
  795. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1noanyg._.js +0 -3
  796. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ntihlm._.js +0 -3
  797. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ob9yn9._.js +0 -3
  798. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1odu62n._.js +0 -3
  799. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1oy_ypa._.js +0 -3
  800. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1p6khix._.js +0 -3
  801. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pg2kzv._.js +0 -3
  802. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pk410t._.js +0 -3
  803. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pta31u._.js +0 -3
  804. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pz2967._.js +0 -3
  805. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q9ds80._.js +0 -3
  806. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qt1i63._.js +0 -3
  807. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rr4obb._.js +0 -3
  808. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rzg628._.js +0 -3
  809. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sdw2ls._.js +0 -3
  810. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1szemyb._.js +0 -3
  811. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1t88a94._.js +0 -3
  812. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1tfkm3m._.js +0 -3
  813. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1txvsbk._.js +0 -3
  814. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1uhiv-4._.js +0 -3
  815. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1utvnlp._.js +0 -3
  816. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1vc_bp9._.js +0 -3
  817. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1w25h0t._.js +0 -3
  818. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wc9zwl._.js +0 -3
  819. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ws4ucz._.js +0 -3
  820. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wx5ltv._.js +0 -3
  821. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xi8hyy._.js +0 -3
  822. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xl-uhz._.js +0 -3
  823. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xlddup._.js +0 -3
  824. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1y3gko6._.js +0 -3
  825. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1y9wbb2._.js +0 -3
  826. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ypmy86._.js +0 -3
  827. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ysubik._.js +0 -3
  828. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1yzmh_p._.js +0 -3
  829. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1z7mgd6._.js +0 -3
  830. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ztoaz1._.js +0 -3
  831. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__2019yzl._.js +0 -3
  832. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20opvks._.js +0 -3
  833. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20ygien._.js +0 -3
  834. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0bv8m80._.js +0 -3
  835. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1ay9-4x._.js +0 -3
  836. package/runtime/hub/apps/hub/.next/static/media/02263ebadd758ea4-s.29yke99gs9qpn.woff2 +0 -0
  837. package/runtime/hub/apps/hub/.next/static/media/1a69062cfe6f77f8-s.0o-3_g79811ob.woff2 +0 -0
  838. package/runtime/hub/apps/hub/.next/static/media/23b7a97ae3b5c134-s.p.226pwps5o-gq_.woff2 +0 -0
  839. package/runtime/hub/apps/hub/.next/static/media/2e95a7d252b9825a-s.15orukf5wyxb5.woff2 +0 -0
  840. package/runtime/hub/apps/hub/.next/static/media/2fe89d53234c61d4-s.1u30mmyq6lnsd.woff2 +0 -0
  841. package/runtime/hub/apps/hub/.next/static/media/59b15b4bcd7b1eb5-s.2vemzm0itqzfy.woff2 +0 -0
  842. package/runtime/hub/apps/hub/.next/static/media/68757d6cddeff913-s.1i-sca43-qwng.woff2 +0 -0
  843. package/runtime/hub/apps/hub/.next/static/media/99e609270109b47d-s.p.40sczeszzbjw1.woff2 +0 -0
  844. package/runtime/hub/apps/hub/.next/static/media/9a4838fcda0d1bca-s.0ngr-xkgqz1kf.woff2 +0 -0
  845. package/runtime/hub/apps/hub/.next/static/media/a7afbb44bec2bb18-s.1qc6dx89jd2qv.woff2 +0 -0
  846. package/runtime/hub/apps/hub/.next/static/media/e532fa1b9921e1cd-s.3cb5lpr2l6xud.woff2 +0 -0
  847. package/runtime/hub/apps/hub/.next/static/media/effe91970fc4db64-s.p.0oace-s_gkfks.woff2 +0 -0
  848. package/runtime/hub/apps/hub/dist-25JLZKGB.js +0 -1278
  849. /package/dist/{_cloud-attach-F25HDXWB.js.map → _cloud-attach-KEFEQ2YH.js.map} +0 -0
  850. /package/dist/{chunk-L55DASHB.js.map → chunk-2SKTXZGX.js.map} +0 -0
  851. /package/dist/{chunk-BKOKMZNK.js.map → chunk-3QTWB66F.js.map} +0 -0
  852. /package/dist/{chunk-VSWIJHCH.js.map → chunk-5ZBNVZSU.js.map} +0 -0
  853. /package/dist/{chunk-IX7S6NJR.js.map → chunk-72LKKHPI.js.map} +0 -0
  854. /package/dist/{chunk-7TPGIQOP.js.map → chunk-BORN6FJK.js.map} +0 -0
  855. /package/dist/{chunk-77IAHAQY.js.map → chunk-FBQC6TKM.js.map} +0 -0
  856. /package/dist/{chunk-JUTAYI2N.js.map → chunk-GCUJUUNE.js.map} +0 -0
  857. /package/dist/{chunk-S77B5POZ.js.map → chunk-GKBAEX2P.js.map} +0 -0
  858. /package/dist/{chunk-XKUF67M6.js.map → chunk-GT7VDGNV.js.map} +0 -0
  859. /package/dist/{chunk-AGHR7XOJ.js.map → chunk-HOJKUVH6.js.map} +0 -0
  860. /package/dist/{chunk-PENAXZMR.js.map → chunk-INJIW6PP.js.map} +0 -0
  861. /package/dist/{chunk-OYWP4SII.js.map → chunk-IZPNDZXI.js.map} +0 -0
  862. /package/dist/{chunk-U3BCLGTH.js.map → chunk-JHS4ROJH.js.map} +0 -0
  863. /package/dist/{chunk-CWN4DJYI.js.map → chunk-JVZZPJ2C.js.map} +0 -0
  864. /package/dist/{chunk-KOGQNHV3.js.map → chunk-KA67IGEG.js.map} +0 -0
  865. /package/dist/{chunk-OTAYAFYF.js.map → chunk-KRF2JODE.js.map} +0 -0
  866. /package/dist/{chunk-SDWKZLGP.js.map → chunk-LFMJXQDL.js.map} +0 -0
  867. /package/dist/{chunk-2U4HKKM7.js.map → chunk-NSYCXUN5.js.map} +0 -0
  868. /package/dist/{chunk-5JDGKHWH.js.map → chunk-QALBGVPR.js.map} +0 -0
  869. /package/dist/{chunk-JCDC5S32.js.map → chunk-QDBDDJKT.js.map} +0 -0
  870. /package/dist/{chunk-ZPFTFIKP.js.map → chunk-S5WFZHC5.js.map} +0 -0
  871. /package/dist/{chunk-PVZUQTLW.js.map → chunk-VUTEVIYG.js.map} +0 -0
  872. /package/dist/{chunk-OWCTDO67.js.map → chunk-WVBTRK6R.js.map} +0 -0
  873. /package/dist/{chunk-4IQGL4KD.js.map → chunk-ZMKRUD6J.js.map} +0 -0
  874. /package/dist/{chunk-J2AD7MLR.js.map → chunk-ZQWOZ5BL.js.map} +0 -0
  875. /package/dist/{cli-3WZP5JHA.js.map → cli-B4VVKKYV.js.map} +0 -0
  876. /package/dist/{cli-6IPZVUXF.js.map → cli-ENMWXMKO.js.map} +0 -0
  877. /package/dist/{cli-E2ZC5S4U.js.map → cli-F2UBHH7H.js.map} +0 -0
  878. /package/dist/{cli-QIBPY2HQ.js.map → cli-JKSQBGRO.js.map} +0 -0
  879. /package/dist/{cli-QSV6K33P.js.map → cli-MIIWRJDK.js.map} +0 -0
  880. /package/dist/{control-plane-I2QKMHPK.js.map → control-plane-R4ELXZHL.js.map} +0 -0
  881. /package/dist/{cp-hub-upload-GW566DGZ.js.map → cp-hub-upload-IUQVJGOW.js.map} +0 -0
  882. /package/dist/{custody-client-F3OAOAC7.js.map → custody-client-PVDBOT7Y.js.map} +0 -0
  883. /package/dist/{deploy-hetzner-IIAXES7B.js.map → deploy-hetzner-KY6KWN4M.js.map} +0 -0
  884. /package/dist/{dist-3EZQDIOD.js.map → dist-2QGMP2UI.js.map} +0 -0
  885. /package/dist/{dist-44RSFOGQ.js.map → dist-5MCQFGLX.js.map} +0 -0
  886. /package/dist/{dist-4K66F4UR.js.map → dist-EIVYC2MR.js.map} +0 -0
  887. /package/dist/{dist-VKKHIHCZ.js.map → dist-JWXPKGPZ.js.map} +0 -0
  888. /package/dist/{dist-5RMJLMYG.js.map → dist-ONAAPVBD.js.map} +0 -0
  889. /package/dist/{dist-HIQCE4H2.js.map → dist-OXLTCVA2.js.map} +0 -0
  890. /package/dist/{dist-IXPKVU3R.js.map → dist-PBO4UHJK.js.map} +0 -0
  891. /package/dist/{dist-SZTW3RMB.js.map → dist-RCBMUPVR.js.map} +0 -0
  892. /package/dist/{dist-WR2HYACA.js.map → dist-TD74GXLP.js.map} +0 -0
  893. /package/dist/{dist-WTPYXNRH.js.map → dist-VCZ3LZPJ.js.map} +0 -0
  894. /package/dist/{dist-YED5YJQN.js.map → dist-WGV7LRDC.js.map} +0 -0
  895. /package/dist/{host-reach-drainer-A4ZO6UKT.js.map → host-reach-drainer-AZYC6UIB.js.map} +0 -0
  896. /package/dist/{host-session-POJP4WO6.js.map → host-session-EGUDGE4R.js.map} +0 -0
  897. /package/dist/{hub-GHFEW3K2.js.map → hub-76RHPA7X.js.map} +0 -0
  898. /package/dist/{hub-adopt-YR7S5TNB.js.map → hub-adopt-5G7SKI2E.js.map} +0 -0
  899. /package/dist/{hub-api-client-BUQDTSQ3.js.map → hub-api-client-WPZTG5AT.js.map} +0 -0
  900. /package/dist/{hub-docker-target-XA5U2ZU5.js.map → hub-docker-target-CNJHYH4B.js.map} +0 -0
  901. /package/dist/{manager-pty-XCGH6AUC-EZML75UO.js.map → manager-pty-XCGH6AUC-O3UNISN2.js.map} +0 -0
  902. /package/dist/{plugin-update-BIPJZA24.js.map → plugin-update-UZYPWL4N.js.map} +0 -0
  903. /package/dist/{prepare-O4BUJIOQ.js.map → prepare-4GOTJXQL.js.map} +0 -0
  904. /package/dist/{prepared-custody-UTSSUTXF.js.map → prepared-custody-4YJ4ZT7J.js.map} +0 -0
  905. /package/dist/{prepared-state-FO74QUCP-4WLAYPEO.js.map → prepared-state-FO74QUCP-GUIPQORN.js.map} +0 -0
  906. /package/dist/{publish-credentials-N2JD2D3A.js.map → publish-credentials-RLRLNL33.js.map} +0 -0
  907. /package/dist/{registry-IPDCZDNW.js.map → registry-QMHCNR5X.js.map} +0 -0
  908. /package/dist/{relay-P5CXEGAZ.js.map → relay-VBWFCWKK.js.map} +0 -0
  909. /package/dist/{remote-docker-share-GIH6JNKY.js.map → remote-docker-share-TKG7SXHX.js.map} +0 -0
  910. /package/dist/{tool-grant-push-7K765QKW.js.map → tool-grant-push-V7E3Y2W6.js.map} +0 -0
  911. /package/runtime/hub/apps/hub/.next/static/{TMo35nbBXDtyGUs4P3Q_H → 2QUBvK0xJqbyGzVe1RBzl}/_buildManifest.js +0 -0
  912. /package/runtime/hub/apps/hub/.next/static/{TMo35nbBXDtyGUs4P3Q_H → 2QUBvK0xJqbyGzVe1RBzl}/_clientMiddlewareManifest.js +0 -0
  913. /package/runtime/hub/apps/hub/.next/static/{TMo35nbBXDtyGUs4P3Q_H → 2QUBvK0xJqbyGzVe1RBzl}/_ssgManifest.js +0 -0
@@ -13,11 +13,11 @@ import {
13
13
  runInteractiveClaudeLogin,
14
14
  startClaudeSession,
15
15
  warmUpClaudeCredentials
16
- } from "./chunk-U4Z5OOOD.js";
16
+ } from "./chunk-NZN3BME7.js";
17
17
  import {
18
18
  syncClaudeCredentials,
19
19
  volumeClaudeCredentials
20
- } from "./chunk-HS6B3CE4.js";
20
+ } from "./chunk-PJCIZLIX.js";
21
21
  import {
22
22
  BOX_WORKSPACE,
23
23
  INVALID_CODE,
@@ -38,24 +38,24 @@ import {
38
38
  stripAnsi,
39
39
  trimUrl,
40
40
  withLoginDefaults
41
- } from "./chunk-AXAMPAP3.js";
41
+ } from "./chunk-7ELRQNNH.js";
42
42
  import {
43
43
  DEFAULT_BOX_IMAGE,
44
44
  ensureImage,
45
45
  imageExists,
46
46
  variantImageRef
47
- } from "./chunk-L55DASHB.js";
47
+ } from "./chunk-2SKTXZGX.js";
48
48
  import {
49
49
  STATE_DIR,
50
50
  hostBackupHasCredentials,
51
51
  resolveAgentSpec
52
- } from "./chunk-U7J7JT6R.js";
52
+ } from "./chunk-G35FJ4KT.js";
53
53
  import {
54
54
  resolveAgentLauncher
55
- } from "./chunk-FM7PHYBD.js";
55
+ } from "./chunk-NEU5B2VO.js";
56
56
  import {
57
57
  loadEffectiveConfig
58
- } from "./chunk-YZZKWZO2.js";
58
+ } from "./chunk-3PTSPFR6.js";
59
59
 
60
60
  // ../../packages/agent-claude/dist/cli/index.js
61
61
  import { readFile } from "fs/promises";
@@ -850,14 +850,16 @@ var claudeCliSpec = {
850
850
  });
851
851
  return { deferred: [...pruneOutput(rebuild), () => ctx.host.showInstallHint()] };
852
852
  },
853
- async afterVolumeSync(box, { volume, message }) {
853
+ async afterVolumeSync(box, { volume }) {
854
854
  await syncClaudeCredentials(
855
855
  { volume },
856
856
  { image: box.image, isolate: volume !== SHARED_CLAUDE_VOLUME }
857
857
  );
858
+ },
859
+ async afterConfigSync(box, { volume, message }) {
858
860
  message("checking plugin native deps");
859
861
  const rebuild = await rebuildPluginNativeDeps(box.container, {
860
- volume: box.claudeConfigVolume ?? SHARED_CLAUDE_VOLUME,
862
+ volume,
861
863
  onProgress: (line) => message(line)
862
864
  });
863
865
  return { deferred: pruneOutput(rebuild) };
@@ -1037,4 +1039,4 @@ export {
1037
1039
  agentModule,
1038
1040
  runClaudeLogin
1039
1041
  };
1040
- //# sourceMappingURL=chunk-GERRSRQZ.js.map
1042
+ //# sourceMappingURL=chunk-PZK5KRFB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/agent-claude/src/cli/runtime.ts","../../../packages/agent-claude/src/cli/auth.ts","../../../packages/agent-claude/src/cli/login-binding.ts","../../../packages/agent-claude/src/cli/login.ts","../../../packages/agent-claude/src/cli/host-creds.ts","../../../packages/agent-claude/src/cli/cred-health.ts","../../../packages/agent-claude/src/cli/credential-renew.ts","../../../packages/agent-claude/src/cli/login-command.ts","../../../packages/agent-claude/src/cli/login-session.ts","../../../packages/agent-claude/src/cli/cli-spec.ts","../../../packages/agent-claude/src/cli/projects-dir.ts","../../../packages/agent-claude/src/cli/module.ts","../../../packages/agent-claude/src/cli/teleport.ts","../../../packages/agent-claude/src/cli/login-run.ts"],"sourcesContent":["/**\n * Claude's docker bindings and its own sign-in code.\n *\n * See `../codex/runtime.ts` for why this is separate from `./command.ts`.\n * Claude's login is the one that is genuinely a protocol rather than a call: it\n * has a headless print-URL / `--code` pair (`./login-command.ts`) and a\n * credential-HEALTH check rather than a present/absent probe, because a merely\n * lapsed access token renews itself and nagging about it is worse than useless.\n */\nimport type { EffectiveConfig, UserConfig } from '@agentbox/config';\nimport {\n ensureImage,\n hostBackupHasCredentials,\n imageExists,\n syncClaudeCredentials,\n volumeClaudeCredentials,\n type BoxRecord,\n} from '@agentbox/sandbox-docker';\nimport {\n buildClaudeAttachArgv,\n buildClaudeLoginRunArgv,\n ClaudeSessionError,\n claudeSessionInfo,\n ensureClaudeInstalled,\n ensureClaudeVolume,\n runInteractiveClaudeLogin,\n SHARED_CLAUDE_VOLUME,\n startClaudeSession,\n warmUpClaudeCredentials,\n} from '../docker-sync.js';\nimport { confirm, log, spinner } from '@agentbox/cli-kit';\nimport { resolveClaudeAuth } from './auth.js';\nimport { claudeLoginBinding } from './login-binding.js';\nimport { claudeCredStatus } from './host-creds.js';\nimport { resolveClaudeCredHealth } from './cred-health.js';\nimport { runGuidedLogin } from '@agentbox/cli-kit';\nimport { imageProgress } from '@agentbox/cli-kit';\nimport { loadPtyBackend } from '@agentbox/cli-kit';\nimport { applySkipPermissions, type SkipPermissionsRule } from '@agentbox/cli-kit';\nimport { clampSpinnerLine } from '@agentbox/cli-kit';\nimport { addClaudeLoginOptions, runClaudeLoginCommand } from './login-command.js';\nimport type { AgentRuntime, SignInResult } from '@agentbox/cli-kit';\n\n/**\n * Run `claude auth login` in a throwaway container against the shared\n * claude-config volume, then extract the result to the host backup so every\n * future box (shared or isolate) is seeded from it. Returns the login command's\n * exit code.\n *\n * This is the legacy passthrough: it hands the terminal to claude's own TUI. See\n * {@link signInToClaude} for why that is no longer the default.\n */\nasync function runClaudeLoginContainer(image: string, extraArgs: string[]): Promise<number> {\n const { exitCode } = runInteractiveClaudeLogin(\n buildClaudeLoginRunArgv({ volume: SHARED_CLAUDE_VOLUME, image, extraArgs }),\n );\n if (exitCode === 0) {\n // Absorb the fresh-token first-request 400 in a throwaway container before\n // any box uses these credentials (see warmUpClaudeCredentials). Runs before\n // syncClaudeCredentials so the host backup captures any token the warm-up\n // refreshes.\n const s = spinner();\n s.start('checking credentials');\n const warm = await warmUpClaudeCredentials(SHARED_CLAUDE_VOLUME, image, {\n onProgress: (line) => s.message(clampSpinnerLine(line)),\n });\n s.stop(warm.warmed ? 'credentials ready' : 'credentials check incomplete — continuing');\n await syncClaudeCredentials({ volume: SHARED_CLAUDE_VOLUME }, { image, isolate: false });\n }\n return exitCode;\n}\n\n/**\n * Sign in to Claude, the way every caller should: guided (drive the login\n * container under a pty, prompt for the code with our own clack prompt) so the\n * container's TUI never touches the user's terminal — it misbehaves on terminals\n * whose keyboard protocol it mishandles (kitty's CSI-u).\n *\n * Falls back to the passthrough when the optional node-pty prebuild is missing,\n * or when the caller forces it. Returns rather than exiting, so the first-run\n * offers can warn and continue.\n */\nexport async function signInToClaude(\n image: string,\n extraArgs: string[],\n opts: { passthrough?: boolean } = {},\n): Promise<SignInResult> {\n const usePassthrough = opts.passthrough === true || !(await loadPtyBackend());\n if (usePassthrough) {\n const exitCode = await runClaudeLoginContainer(image, extraArgs);\n return exitCode === 0\n ? { ok: true }\n : { ok: false, error: `\\`claude auth login\\` exited with code ${String(exitCode)}` };\n }\n const res = await runGuidedLogin('claude', (writeLog) =>\n claudeLoginBinding({ image, extraArgs, writeLog }),\n );\n return { ok: res.ok, error: res.error, cancelled: res.cancelled };\n}\n\n/**\n * Shared tail of both first-run offers: prepare the claude image layer, seed the\n * shared volume from the host's ~/.claude, then sign in.\n *\n * The volume seed happens BEFORE the login container runs, so `claude auth\n * login` writes its oauthAccount on top of the host config (trust,\n * installMethod, project alias) rather than into an empty volume.\n * `ensureClaudeVolume` is write-once for `_claude.json`, so the later createBox\n * sync cannot clobber the login's work.\n */\nasync function runLoginOffer(image: string, hostWorkspace: string): Promise<void> {\n const s = spinner();\n s.start('preparing sandbox image');\n // The login container RUNS claude, so it needs that agent's layer — the base\n // image is agentless. `ensureImage` returns the variant ref.\n const { ref: loginImage } = await ensureImage(image, {\n agents: ['claude'],\n onProgress: imageProgress(s),\n });\n s.message('preparing claude config');\n await ensureClaudeVolume(\n { volume: SHARED_CLAUDE_VOLUME },\n { syncFromHost: true, image: loginImage, hostWorkspace },\n );\n s.stop('image ready');\n\n const res = await signInToClaude(loginImage, ['--claudeai']);\n if (!res.ok) {\n log.warn('Claude login did not complete; continuing — run `agentbox claude login` to retry.');\n return;\n }\n log.success('Signed in with your Claude subscription — saved for future boxes.');\n}\n\nconst SKIPPED = 'Skipped sign-in — claude will prompt you to /login inside the box.';\n\n/** Claude's full permission-bypass flag, and the args that mean the user chose. */\nconst SKIP_PERMISSIONS_RULE: SkipPermissionsRule = {\n flag: '--dangerously-skip-permissions',\n conflictingArgs: ['--dangerously-skip-permissions', '--permission-mode'],\n};\n\nexport const claudeRuntime: AgentRuntime = {\n hostCredStatus: async ({ image, env, isCloud }) => {\n const status = await claudeCredStatus(env, isCloud, image);\n if (status === 'ok') return { status: 'ok' };\n if (status === 'missing') return { status: 'missing' };\n return {\n status: 'expired',\n message:\n 'Your saved Claude login can no longer be renewed. Sign in again with `agentbox claude login`, then retry.',\n };\n },\n sharedVolume: SHARED_CLAUDE_VOLUME,\n SessionError: ClaudeSessionError,\n\n startSession: (o) =>\n startClaudeSession({\n container: o.container,\n claudeArgs: o.args,\n sessionName: o.sessionName,\n boxName: o.boxName,\n workspacePath: o.workspacePath,\n }),\n sessionInfo: (container, sessionName) => claudeSessionInfo(container, sessionName),\n ensureInstalled: (container, o) => ensureClaudeInstalled(container, o),\n ensureVolume: (target, o) =>\n ensureClaudeVolume(target, {\n syncFromHost: o.syncFromHost,\n image: o.image,\n ...(o.hostWorkspace === undefined ? {} : { hostWorkspace: o.hostWorkspace }),\n }),\n buildAttachArgv: (container, sessionName) => buildClaudeAttachArgv(container, sessionName),\n\n // Unlike codex/opencode, claude ALWAYS syncs: a box with no recorded volume\n // still has the shared one, and its ~/.claude carries MCP servers and OAuth\n // state the in-box claude needs.\n resolveConfigVolume: (box: BoxRecord) => box.claudeConfigVolume ?? SHARED_CLAUDE_VOLUME,\n createBoxConfig: (isolate) => ({ claudeConfig: { isolate } }),\n\n sessionNameOf: (cfg: EffectiveConfig) => cfg.claude.sessionName,\n isolateOf: (cfg: EffectiveConfig) => cfg.box.isolateClaudeConfig,\n cliOverrides: ({ sessionName, skipPermissions, isolate }) => {\n const out: Partial<UserConfig> = {};\n const claude: NonNullable<UserConfig['claude']> = {};\n if (sessionName !== undefined) claude.sessionName = sessionName;\n if (skipPermissions !== undefined) claude.dangerouslySkipPermissions = skipPermissions;\n if (Object.keys(claude).length > 0) out.claude = claude;\n if (isolate === true) out.box = { isolateClaudeConfig: true };\n return out;\n },\n\n skipPermissions: {\n flag: SKIP_PERMISSIONS_RULE.flag,\n effect: 'auto-accept tool use',\n apply: (args, cfg) =>\n applySkipPermissions(\n args,\n SKIP_PERMISSIONS_RULE,\n cfg.claude.dangerouslySkipPermissions !== false,\n ),\n },\n\n /**\n * Host-env auth is the user's explicit choice — respect it and never check.\n * Otherwise a non-TTY run has no way to finish an in-box `/login`, so the\n * credential assertion is worth paying for.\n */\n requireCredsWhenNonTty: async () => (await resolveClaudeAuth(process.env)).source !== 'host-env',\n\n /**\n * Docker boots every box from the shared claude-config volume's live\n * `.credentials.json`; the host backup is only a mirror that diverges when an\n * in-box refresh fails (claude blanks the volume's refreshToken, and the\n * create-time extract then skips it, so the backup keeps a stale token). So\n * decide off the *volume*, not the backup:\n * - usable refresh token present -> trust the in-box refresh, no prompt (a\n * merely-expired access token renews itself; don't nag);\n * - file present but refresh token blanked -> the login is dead (the seed only\n * restores the same stale backup), so offer a fresh sign-in;\n * - no file yet -> the box seeds from the host backup, so only offer sign-in\n * when there is nothing to seed from either.\n */\n async offerDockerLogin({ image, yes, hostWorkspace }) {\n if (!process.stdin.isTTY || yes) return;\n const auth = await resolveClaudeAuth(process.env);\n if (auth.source === 'host-env') return;\n\n // The probe needs the image locally; skip it (fall back to the backup check)\n // when it isn't, so a first-ever run doesn't trigger an implicit pull here.\n const vol = (await imageExists(image))\n ? await volumeClaudeCredentials(SHARED_CLAUDE_VOLUME, image)\n : { present: false, hasRefreshToken: false };\n if (vol.hasRefreshToken) return;\n const blanked = vol.present && !vol.hasRefreshToken;\n if (!vol.present && (await hostBackupHasCredentials())) return;\n\n const message = blanked\n ? 'Your saved Claude login looks expired. Sign in again? (saved and reused by every box)'\n : auth.source === 'auth-file'\n ? \"You're on a legacy API token (shows as 'Claude API'). Sign in with your Claude subscription instead?\"\n : 'Sign in with your Claude subscription? (saved and reused by every box)';\n if (!(await confirm({ message, initialValue: true }))) {\n log.info(SKIPPED);\n return;\n }\n await runLoginOffer(image, hostWorkspace);\n },\n\n /**\n * Cloud has no shared volume to persist an in-box login, so without a host\n * credential the box boots unauthenticated. Capturing the login to\n * `~/.agentbox/claude-credentials.json` lets the cloud push seed it into this\n * box and every future one.\n *\n * The verdict comes from `resolveClaudeCredHealth`, which renews a merely-\n * lapsed access token rather than reporting it as an expiry — see that module\n * for why the old `expiresAt` gate nagged daily and why saying yes to it was\n * actively destructive.\n */\n async offerCloudLogin({ image, yes, hostWorkspace }) {\n if (!process.stdin.isTTY || yes) return;\n if ((await resolveClaudeAuth(process.env)).source === 'host-env') return;\n\n const probe = spinner();\n let started = false;\n const health = await resolveClaudeCredHealth({\n image,\n onProgress: (line) => {\n if (!started) {\n started = true;\n probe.start('checking your saved Claude login');\n }\n probe.message(clampSpinnerLine(line));\n },\n });\n if (started) probe.stop('checked your saved Claude login');\n if (health === 'ok') return;\n\n const message =\n health === 'dead'\n ? 'Your saved Claude login can no longer be renewed. Sign in again? (saved and reused by every box)'\n : 'Sign in with your Claude subscription? (saved and reused by every box)';\n if (!(await confirm({ message, initialValue: true }))) {\n log.info(SKIPPED);\n return;\n }\n await runLoginOffer(image, hostWorkspace);\n },\n\n signIn: (image, extraArgs, o) => signInToClaude(image, extraArgs, o),\n loginBinding: (o) => claudeLoginBinding(o),\n loginNeedsTty: 'interactive-only',\n loginCommand: { options: addClaudeLoginOptions, run: runClaudeLoginCommand },\n // Claude's create always derives an image with the agent baked in and has\n // never probed for the binary afterwards; see `ensureInstalledOnCreate`.\n ensureInstalledOnCreate: false,\n\n resume: {\n // Claude exposes the exact session id on every hook payload, so the in-box\n // hooks record it and resume is exact.\n async resumeArgs(exec) {\n const id = await exec('cat \"$HOME/.local/state/agentbox/claude-session\" 2>/dev/null');\n // Guard: only a uuid-ish token is safe to hand to `claude --resume`.\n return /^[0-9a-fA-F][0-9a-fA-F-]{7,}$/.test(id) ? ['--resume', id] : null;\n },\n },\n};\n","import { readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { STATE_DIR } from '@agentbox/sandbox-docker';\n\nexport const AUTH_FILE = join(STATE_DIR, 'auth.json');\n\nexport interface AuthFile {\n claudeCodeOauthToken?: string;\n}\n\nexport interface ResolvedClaudeAuth {\n /** Env vars to inject into the box. Only includes keys with non-empty string values. */\n env: Record<string, string>;\n /** Where the value(s) came from. `'none'` means there's nothing to forward. */\n source: 'host-env' | 'auth-file' | 'none';\n}\n\n/**\n * Merge host env + the legacy `~/.agentbox/auth.json` setup-token into the\n * effective env that the `claude` command forwards to the box. Env wins over\n * the file; either of the two known keys (API key or OAuth token) counts as\n * having auth.\n *\n * This is the **dormant fallback** path. The primary auth flow is the in-box\n * interactive OAuth login, persisted by `syncClaudeCredentials` — a box that\n * has real credentials in its claude-config volume ignores any forwarded\n * `CLAUDE_CODE_OAUTH_TOKEN` anyway. `auth.json` is only ever read here, never\n * written, kept so existing users and CI keep working.\n */\nexport async function resolveClaudeAuth(\n processEnv: NodeJS.ProcessEnv,\n opts: { authFilePath?: string } = {},\n): Promise<ResolvedClaudeAuth> {\n const env: Record<string, string> = {};\n const envApiKey = processEnv['ANTHROPIC_API_KEY'];\n const envOauth = processEnv['CLAUDE_CODE_OAUTH_TOKEN'];\n if (typeof envApiKey === 'string' && envApiKey.length > 0) env['ANTHROPIC_API_KEY'] = envApiKey;\n if (typeof envOauth === 'string' && envOauth.length > 0)\n env['CLAUDE_CODE_OAUTH_TOKEN'] = envOauth;\n if (Object.keys(env).length > 0) return { env, source: 'host-env' };\n\n const file = await readAuthFile(opts.authFilePath);\n if (file.claudeCodeOauthToken && file.claudeCodeOauthToken.length > 0) {\n return {\n env: { CLAUDE_CODE_OAUTH_TOKEN: file.claudeCodeOauthToken },\n source: 'auth-file',\n };\n }\n return { env: {}, source: 'none' };\n}\n\nexport async function readAuthFile(path: string = AUTH_FILE): Promise<AuthFile> {\n try {\n const raw = await readFile(path, 'utf8');\n const parsed = JSON.parse(raw) as unknown;\n if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {\n const t = (parsed as { claudeCodeOauthToken?: unknown }).claudeCodeOauthToken;\n return typeof t === 'string' && t.length > 0 ? { claudeCodeOauthToken: t } : {};\n }\n return {};\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === 'ENOENT') return {};\n // A garbage / corrupted file shouldn't kill `agentbox claude`. Treat as empty.\n return {};\n }\n}\n","/**\n * Binds claude's login spec to the docker surface it runs against: the\n * `docker run` argv, the post-exit credential check, and the post-success\n * warm-up. Beside the runtime that is its only caller — see\n * `lib/agent-login-bindings.ts` for why it is not in the shared lib.\n */\nimport { syncClaudeCredentials, volumeClaudeCredentials } from '@agentbox/sandbox-docker';\nimport {\n buildClaudeLoginRunArgv,\n SHARED_CLAUDE_VOLUME,\n warmUpClaudeCredentials,\n} from '../docker-sync.js';\nimport { withLoginDefaults, type AgentLoginBinding } from '@agentbox/cli-kit';\nimport { CLAUDE_LOGIN_SPEC } from './login.js';\n\nexport function claudeLoginBinding(o: {\n image: string;\n volume?: string;\n extraArgs?: string[];\n writeLog?: (line: string) => void;\n}): AgentLoginBinding {\n const volume = o.volume ?? SHARED_CLAUDE_VOLUME;\n const { image } = o;\n const extraArgs = withLoginDefaults(CLAUDE_LOGIN_SPEC, o.extraArgs ?? []);\n return {\n spec: CLAUDE_LOGIN_SPEC,\n dockerArgv: buildClaudeLoginRunArgv({ volume, image, extraArgs }),\n verify: async () => (await volumeClaudeCredentials(volume, image)).hasRefreshToken,\n // Absorb the fresh-token first-request 400 in a throwaway container before\n // any box uses these credentials, then mirror them to the host backup.\n finalize: async () => {\n const warm = await warmUpClaudeCredentials(volume, image, {\n onProgress: (l) => o.writeLog?.(l),\n });\n await syncClaudeCredentials({ volume }, { image, isolate: false });\n return { warmed: warm.warmed };\n },\n };\n}\n","/**\n * Claude Code's guided-login detector — see `../../lib/agent-login-specs.ts` for what\n * a detector is and why the flow is driven from the host.\n */\n\nimport {\n stripAnsi,\n trimUrl,\n URL_BODY,\n INVALID_CODE,\n type AgentLoginSpec,\n} from '@agentbox/cli-kit';\n\n// Match an OAuth approval URL on any current Claude/Anthropic auth host\n// (claude.com/cai/oauth/…, claude.ai, console.anthropic.com) and REQUIRE the\n// literal `oauth` in the path/query so an unrelated claude.com link can't match.\nconst CLAUDE_OAUTH_URL = new RegExp(\n `https?://(?:claude\\\\.com|claude\\\\.ai|console\\\\.anthropic\\\\.com)/${URL_BODY}*oauth${URL_BODY}*`,\n 'i',\n);\n\n/**\n * Pull the OAuth approval URL out of accumulated (possibly ANSI-styled) login\n * output. Claude's paste-code flow prints a `https://claude.com/cai/oauth/…`\n * (or claude.ai / console.anthropic.com) link.\n */\nexport function extractOAuthUrl(text: string): string | null {\n const m = stripAnsi(text).match(CLAUDE_OAUTH_URL);\n return m ? trimUrl(m[0]) : null;\n}\n\nexport const CLAUDE_LOGIN_SPEC: AgentLoginSpec = {\n agent: 'claude',\n // No method flags → the subscription paste-code flow (prints a URL, reads a code).\n defaultArgs: ['--claudeai'],\n detect(buf) {\n const url = extractOAuthUrl(buf);\n return url ? { kind: 'paste-code', url } : null;\n },\n invalidInputPattern: INVALID_CODE,\n};\n","/**\n * Claude's host-side credential check, for the pre-flight that runs before a\n * detached `-i` job. Beside the runtime that owns it — the shared queue helper\n * used to hold this and codex's and opencode's, dispatching between them with a\n * three-arm chain that a fourth agent fell through silently.\n */\nimport { hostBackupHasCredentials } from '@agentbox/sandbox-docker';\nimport { resolveClaudeAuth } from './auth.js';\nimport { resolveClaudeCredHealth, type ClaudeCredHealthOptions } from './cred-health.js';\n\n/**\n * True when Claude is already authenticated on the host: a forwarded env var\n * (`ANTHROPIC_API_KEY` / `CLAUDE_CODE_OAUTH_TOKEN`), the legacy\n * `~/.agentbox/auth.json` setup-token, or a real OAuth refresh token in the\n * host backup (`~/.agentbox/claude-credentials.json`). The backup is what the\n * foreground sync writes whenever a box's claude logs in, so its presence is\n * the load-bearing signal that the shared volume has been seeded.\n */\nexport async function claudeAuthAvailable(env: NodeJS.ProcessEnv): Promise<boolean> {\n const resolved = await resolveClaudeAuth(env);\n if (resolved.source !== 'none') return true;\n return hostBackupHasCredentials();\n}\n\n/**\n * Richer Claude credential verdict for the non-interactive paths. `'missing'`\n * when nothing can seed a box; `'expired'` when the saved login can no longer be\n * renewed AND we're on a cloud provider — cloud has no shared volume to fall\n * back to, whereas a docker box boots from the volume's live copy and refreshes\n * it in-box. A host-env token (`ANTHROPIC_API_KEY` / `CLAUDE_CODE_OAUTH_TOKEN`)\n * or legacy `auth.json` short-circuits to `'ok'`: it has no expiry concept here.\n * Mirrors the interactive `maybeRunCloudClaudeLogin` split, and shares its\n * verdict helper — so a merely-lapsed access token is renewed here too rather\n * than failing the job. This used to gate on `expiresAt` (the ~8h access token)\n * and so refused to submit perfectly good jobs every day.\n */\nexport async function claudeCredStatus(\n env: NodeJS.ProcessEnv,\n isCloud: boolean,\n image?: string,\n /** Forwarded to {@link resolveClaudeCredHealth}; see its `probes`. */\n probes?: ClaudeCredHealthOptions['probes'],\n): Promise<'ok' | 'missing' | 'expired'> {\n const resolved = await resolveClaudeAuth(env);\n if (resolved.source !== 'none') return 'ok';\n if (!isCloud) {\n const has = probes?.hostBackupHasCredentials ?? hostBackupHasCredentials;\n return (await has()) ? 'ok' : 'missing';\n }\n const health = await resolveClaudeCredHealth({\n image: image ?? '',\n // No image to probe with means no renewal; answer off the backup alone.\n ...(image === undefined ? { offlineOnly: true } : {}),\n ...(probes ? { probes } : {}),\n });\n if (health === 'missing') return 'missing';\n return health === 'dead' ? 'expired' : 'ok';\n}\n","/**\n * One verdict on the saved Claude login, shared by every gate that might ask\n * the user to sign in again.\n *\n * Why it exists: those gates used to read `claudeAiOauth.expiresAt`, which dates\n * the ~8h ACCESS token. On a cloud-only workflow nothing rewrites the host\n * backup between logins, so that field is in the past within a day of every\n * sign-in and stays there — a guaranteed daily \"your saved Claude login looks\n * expired\" on a login with weeks of life left. Worse, accepting the offer runs a\n * login container that refreshes and ROTATES the shared refresh token before the\n * user touches the browser; the write-back only ran on success, so a cancelled\n * sign-in left the host backup, the control box's backup and its custody copy\n * all holding a spent token. The false alarm made itself true.\n *\n * So: decide on refresh-token health, and when the access token has merely\n * lapsed, actually renew it (`renewClaudeCredential`) instead of guessing. That\n * both silences the nag and hands the next cloud box a fresh token, which is the\n * other half of why the credential kept dying between sessions.\n */\nimport { hostBackupHasCredentials, imageExists, variantImageRef } from '@agentbox/sandbox-docker';\nimport { hostClaudeAccessTokenExpired, hostClaudeLoginDead } from './host-cred-guards.js';\nimport { renewClaudeCredential, type RenewClaudeResult } from './credential-renew.js';\n\n/**\n * `ok` — usable (possibly after a silent renewal). `missing` — nothing saved to\n * seed a box with. `dead` — saved, but it can no longer be renewed, so only a\n * fresh sign-in helps.\n */\nexport type ClaudeCredHealth = 'ok' | 'missing' | 'dead';\n\nexport interface ClaudeCredHealthOptions {\n /** Box image the renewal probe runs in. */\n image: string;\n /** Progress lines from the renewal (it can take a few seconds). */\n onProgress?: (line: string) => void;\n /**\n * Skip the renewal probe and answer from the backup alone. The stale-access-\n * token case then answers `ok` — the refresh token is alive and the box can\n * renew it in-box, so there is nothing to warn about.\n */\n offlineOnly?: boolean;\n /**\n * The IO this verdict is built from, injectable.\n *\n * Every one of these reads a file or starts a container, so a caller that\n * wants to assert on the DECISION — which combination of \"saved?\", \"dead?\",\n * \"lapsed?\" and \"renewable?\" yields which verdict — otherwise has to reach\n * into another package's internals to do it. They used to be mockable by\n * accident, because they were imported across a package boundary; they are\n * this package's own now, so the seam is explicit instead.\n */\n probes?: Partial<CredHealthProbes>;\n}\n\n/** The four IO probes {@link resolveClaudeCredHealth} decides from. */\nexport interface CredHealthProbes {\n hostBackupHasCredentials(): Promise<boolean>;\n loginDead(): Promise<boolean>;\n accessTokenExpired(): Promise<boolean>;\n imageExists(image: string): Promise<boolean>;\n renew(opts: { image: string; onLog?: (msg: string) => void }): Promise<RenewClaudeResult>;\n}\n\nconst REAL_PROBES: CredHealthProbes = {\n hostBackupHasCredentials,\n loginDead: hostClaudeLoginDead,\n accessTokenExpired: hostClaudeAccessTokenExpired,\n imageExists,\n renew: renewClaudeCredential,\n};\n\nexport async function resolveClaudeCredHealth(\n opts: ClaudeCredHealthOptions,\n): Promise<ClaudeCredHealth> {\n const p: CredHealthProbes = { ...REAL_PROBES, ...opts.probes };\n if (!(await p.hostBackupHasCredentials())) return 'missing';\n if (await p.loginDead()) return 'dead';\n if (!(await p.accessTokenExpired())) return 'ok';\n\n // Stale access token, live refresh token. Renewing needs the image locally;\n // don't trigger an implicit pull just to answer a question, and never nag on\n // a host that simply can't run the probe — the refresh token is alive and the\n // box will renew it itself.\n //\n // THE PROBE RUNS `claude -p`, so it needs claude's DERIVED layer: the base\n // image has been agentless since one-agent-per-box, and callers hand us a\n // base ref (`box.image` / `DEFAULT_BOX_IMAGE`). Renewing in the base makes\n // every attempt fail, which reads as `dead` — nagging the user to sign in\n // again over a perfectly live credential. `variantImageRef` is pure, so the\n // `imageExists` gate keeps its meaning: no variant built locally, no probe.\n if (opts.offlineOnly === true) return 'ok';\n const probeImage = variantImageRef(opts.image, ['claude']);\n if (!(await p.imageExists(probeImage))) return 'ok';\n\n const renewed = await p.renew({\n image: probeImage,\n ...(opts.onProgress ? { onLog: opts.onProgress } : {}),\n });\n return renewed === 'failed' ? 'dead' : 'ok';\n}\n","/**\n * Actively renew claude's saved host login.\n *\n * Moved out of `sandbox-docker/src/credential-refresh.ts`. Living there meant it\n * had to reach claude's own warm-up through `requireAgentSyncModule('claude')` —\n * an inversion that existed only because the code was on the wrong side of the\n * boundary. Here it calls `warmUpClaudeCredentials` directly, and the registry\n * lookup is gone.\n *\n * The generic `dockerCredentialRefresh` stays in `sandbox-docker`: that one is\n * the provider-neutral refresher hook, not claude's behaviour.\n */\n\nimport { DEFAULT_BOX_IMAGE, syncClaudeCredentials } from '@agentbox/sandbox-docker';\nimport { resolveAgentSpec } from '@agentbox/sandbox-core';\nimport { warmUpClaudeCredentials } from '../docker-sync.js';\n\n/** Outcome of {@link renewClaudeCredential}. */\nexport type RenewClaudeResult = 'renewed' | 'unchanged' | 'failed';\n\n/**\n * Renew the saved claude login through the shared docker volume, and report\n * whether it still works.\n *\n * A credential's health is not readable off disk: `expiresAt` only dates the\n * ~8h access token, and a refresh token that was rotated away by another copy\n * looks perfectly valid until you try it. The only honest test is to use it —\n * so drive the same pair the successful-login path runs in its `finalize`:\n *\n * 1. `syncClaudeCredentials` — converge volume and backup on the newer blob,\n * so we renew from the freshest copy rather than whichever the volume holds.\n * 2. `warmUpClaudeCredentials` — a headless `claude -p` forces a real OAuth\n * refresh, minting a fresh access token into the volume.\n * 3. `syncClaudeCredentials` again — extract that fresh blob to the host backup\n * so the cloud seed (and every later box) gets a live credential.\n *\n * This is what keeps the fleet logged in without nagging: a lapsed access token\n * is renewed silently, and only a genuine failure — `'failed'` — is worth\n * asking the user to sign in again for.\n *\n * `attempts` is deliberately small (2 by default): the login path's 6 exist to\n * outwait the fresh-token first-request 400, but on the create path every extra\n * attempt costs the user 5s + a container start before we can say \"dead\".\n *\n * Best-effort: any docker failure resolves to `'failed'`, never throws.\n */\nexport async function renewClaudeCredential(opts: {\n image?: string;\n attempts?: number;\n onLog?: (msg: string) => void;\n}): Promise<RenewClaudeResult> {\n const log = opts.onLog ?? (() => {});\n const image = opts.image ?? DEFAULT_BOX_IMAGE;\n const volume = resolveAgentSpec('claude').dockerVolume;\n try {\n await syncClaudeCredentials({ volume }, { image, isolate: false });\n const warm = await warmUpClaudeCredentials(volume, image, {\n attempts: opts.attempts ?? 2,\n onProgress: (line: string) => {\n log(line);\n },\n });\n if (!warm.warmed) {\n log('claude: saved login did not renew — it may have been rotated away by another box');\n return 'failed';\n }\n const synced = await syncClaudeCredentials({ volume }, { image, isolate: false });\n return synced.direction === 'extracted' ? 'renewed' : 'unchanged';\n } catch {\n return 'failed';\n }\n}\n","/**\n * `agentbox claude login` — the one agent login that is a protocol rather than a\n * call.\n *\n * Three modes, picked by `selectLoginMode`:\n * - guided (a terminal): drive the login container under a pty, print the auth\n * URL, prompt for the code with our own clack prompt.\n * - headless (no TTY, or `--headless`): spawn a detached worker that HOLDS the\n * live `claude auth login`, print the URL, and return. A second invocation\n * with `--code <CODE>` finishes it. This is what makes login work from CI and\n * from an orchestrating agent.\n * - interactive: hand claude's own TUI the terminal (legacy passthrough).\n *\n * The other agents need none of this, which is why the factory's default login\n * body stays small and this replaces it wholesale via `runtime.loginCommand`.\n */\nimport { spawn } from 'node:child_process';\nimport { randomUUID } from 'node:crypto';\nimport { existsSync } from 'node:fs';\nimport { setTimeout as sleep } from 'node:timers/promises';\nimport { loadEffectiveConfig } from '@agentbox/config';\nimport { ensureImage } from '@agentbox/sandbox-docker';\nimport type { Command } from 'commander';\nimport type { AgentLoginHost } from '@agentbox/cli-kit';\nimport { intro, log, outro, spinner } from '@agentbox/cli-kit';\nimport {\n cleanupStaleSessions,\n findLiveSession,\n findPendingSession,\n readLoginState,\n selectLoginMode,\n writeLoginCode,\n writeLoginRequest,\n writeLoginState,\n type LoginState,\n} from './login-session.js';\nimport { imageProgress } from '@agentbox/cli-kit';\nimport { loadPtyBackend } from '@agentbox/cli-kit';\nimport { signInToClaude } from './runtime.js';\n\nfunction printAwaitingCode(st: LoginState): void {\n const url = st.url ?? '';\n log.info('To finish signing in, open this URL in a browser and approve access:');\n process.stdout.write(`\\n ${url}\\n\\n`);\n log.info('Then run: agentbox claude login --code <CODE>');\n // Stable, greppable marker so an orchestrating agent can grab the URL\n // deterministically regardless of how the prose above is worded.\n process.stdout.write(`AGENTBOX_LOGIN_URL=${url}\\n`);\n}\n\n/**\n * Headless login (non-TTY / `--headless`): spawn the detached worker that holds\n * the live `claude auth login`, wait for it to publish the auth URL, print it +\n * the `--code` follow-up, and return while the worker keeps waiting. A second\n * `agentbox claude login --code <CODE>` ({@link deliverLoginCode}) finishes it.\n */\nasync function startHeadlessLogin(args: string[]): Promise<void> {\n // node-pty drives the login; without the prebuild there is no headless path.\n if (!(await loadPtyBackend())) {\n log.error(\n 'Headless login needs the node-pty prebuild, which is not installed. Run `agentbox claude login` from an interactive terminal instead.',\n );\n process.exit(1);\n }\n cleanupStaleSessions();\n // Only one live session at a time. Match ANY non-terminal live session (incl.\n // a worker still in `starting`, before its URL is published) so a second\n // `--headless` can't slip through and spawn a duplicate worker.\n const existing = findLiveSession();\n if (existing) {\n if (existing.state.phase === 'awaiting-code' && existing.state.url) {\n log.info('A login is already pending; finish it (or wait for it to expire):');\n printAwaitingCode(existing.state);\n } else {\n log.info(\n 'A login is already in progress; wait for it to print its URL, then finish with `agentbox claude login --code <CODE>`.',\n );\n }\n return;\n }\n\n const cfg = await loadEffectiveConfig(process.cwd());\n const baseImage = cfg.effective.box.image;\n const s = spinner();\n s.start('preparing sandbox image');\n // The detached login worker RUNS claude, so record the claude-layer ref in\n // the request — the base image is agentless.\n const { ref: image } = await ensureImage(baseImage, {\n agents: ['claude'],\n onProgress: imageProgress(s),\n });\n s.stop('image ready');\n\n const id = randomUUID().slice(0, 8);\n writeLoginRequest(id, {\n image,\n extraArgs: args,\n cwd: process.cwd(),\n createdAt: new Date().toISOString(),\n });\n\n // This foreground process IS the CLI entry, so argv[1] is the right script to\n // re-exec for the worker; AGENTBOX_CLI_ENTRY wins if a wrapper set it.\n const entry = process.env.AGENTBOX_CLI_ENTRY ?? process.argv[1];\n if (!entry || !existsSync(entry)) {\n log.error('could not resolve the agentbox CLI entry to spawn the login worker');\n process.exit(1);\n }\n const child = spawn(process.execPath, [entry, '_claude-login-worker', id], {\n detached: true,\n stdio: 'ignore',\n env: process.env,\n });\n child.unref();\n // Publish a `starting` state with the worker pid immediately, so a concurrent\n // `--headless` sees a live session and won't spawn a second worker during the\n // window before the worker itself writes any state.\n if (typeof child.pid === 'number') {\n writeLoginState(id, { phase: 'starting', pid: child.pid, createdAt: new Date().toISOString() });\n }\n\n // Wait past the worker's own no-URL deadline (60s) so we observe its verdict\n // (awaiting-code or a published error) instead of giving up while it's still\n // working and missing the URL it later prints.\n const deadline = Date.now() + 65_000;\n for (;;) {\n const st = readLoginState(id);\n if (st?.phase === 'awaiting-code' && st.url) {\n printAwaitingCode(st);\n return;\n }\n if (st?.phase === 'error') {\n log.error(`login could not start: ${st.error ?? 'unknown error'}`);\n process.exit(1);\n }\n if (Date.now() > deadline) {\n log.error(\n `timed out waiting for the login URL — see ~/.agentbox/logs/claude-login-${id}.log`,\n );\n process.exit(1);\n }\n await sleep(400);\n }\n}\n\n/** Deliver an OAuth code to the pending headless login session and report the outcome. */\nasync function deliverLoginCode(code: string): Promise<void> {\n cleanupStaleSessions();\n const pending = findPendingSession();\n if (!pending) {\n log.error(\n 'No pending login is waiting for a code. Start one first with `agentbox claude login` (or --headless).',\n );\n process.exit(1);\n }\n const { id } = pending;\n const submittedAt = Date.now();\n writeLoginCode(id, code);\n\n const s = spinner();\n s.start('completing sign-in');\n const deadline = Date.now() + 120_000;\n for (;;) {\n const st = readLoginState(id);\n if (st?.phase === 'done') {\n s.stop(st.warmed ? 'credentials ready' : 'signed in (credential check incomplete)');\n outro('signed in — credentials saved for future boxes');\n return;\n }\n if (st?.phase === 'error') {\n s.stop('sign-in failed');\n log.error(st.error ?? 'login failed');\n process.exit(1);\n }\n // Worker reverted to awaiting-code after our submit → the code was rejected;\n // the session stays valid so a corrected `--code` can retry it.\n if (st?.phase === 'awaiting-code' && st.lastError && Date.parse(st.updatedAt) >= submittedAt) {\n s.stop('code rejected');\n log.error(\n `${st.lastError}. Run \\`agentbox claude login --code <CODE>\\` again with a fresh code.`,\n );\n process.exit(1);\n }\n if (Date.now() > deadline) {\n s.stop('sign-in timed out');\n log.error('timed out completing sign-in — see the login worker log under ~/.agentbox/logs/');\n process.exit(1);\n }\n await sleep(500);\n }\n}\n\n/** Declared BEFORE the factory's `--interactive`, which is the order help prints. */\nexport function addClaudeLoginOptions(cmd: Command): void {\n cmd\n .option(\n '--headless',\n 'drive login without a terminal: print the auth URL, then finish with `--code` (auto-selected when stdin is not a TTY)',\n )\n .option('--code <code>', 'deliver the OAuth code to a pending headless login session');\n}\n\nexport async function runClaudeLoginCommand(\n args: string[],\n rawOpts: Record<string, unknown>,\n host: AgentLoginHost,\n): Promise<void> {\n const opts = rawOpts as { headless?: boolean; code?: string; interactive?: boolean };\n const mode = selectLoginMode({\n isTTY: !!process.stdin.isTTY,\n headless: !!opts.headless,\n code: typeof opts.code === 'string',\n interactive: !!opts.interactive,\n ptyAvailable: !!(await loadPtyBackend()),\n });\n try {\n if (mode === 'code') {\n await deliverLoginCode(opts.code as string);\n return;\n }\n if (mode === 'headless') {\n await startHeadlessLogin(args);\n return;\n }\n intro('Signing in to Claude...');\n const cfg = await loadEffectiveConfig(process.cwd());\n const baseImage = cfg.effective.box.image;\n\n const s = spinner();\n s.start('preparing sandbox image');\n // The throwaway login container RUNS claude; the base image is agentless.\n const { ref: image } = await ensureImage(baseImage, {\n agents: ['claude'],\n onProgress: imageProgress(s),\n });\n s.stop('image ready');\n\n // Throwaway `docker run` against the shared volume — the written credentials\n // persist there and `syncClaudeCredentials` mirrors them to the host backup,\n // so every later box (shared or isolate) is seeded.\n const res = await signInToClaude(image, args, { passthrough: mode === 'interactive' });\n if (res.cancelled) {\n outro('sign-in cancelled');\n process.exit(1);\n }\n if (!res.ok) {\n log.error(res.error ?? 'login failed');\n // A login method whose output we can't recognize (an exotic `-- --sso`\n // shape) never reaches a prompt; the passthrough still drives it.\n if (res.error?.includes('never printed an auth URL')) {\n log.info(\"Try `agentbox claude login --interactive` to use claude's own login TUI.\");\n }\n process.exit(1);\n }\n outro('signed in — credentials saved for future boxes');\n // A fresh login is exactly when the control box's copy goes stale — push the\n // refreshed backup to custody (best-effort, silent, no-op without a control\n // box or when the hash is unchanged).\n await host.syncCredentialsIfChanged();\n } catch (err) {\n host.fail(err);\n }\n}\n","/**\n * State + IPC for the headless (`--headless` / non-TTY) `agentbox claude login`\n * flow. The login is a PKCE OAuth flow, so the process that prints the auth URL\n * must be the same one that exchanges the pasted code — it can't be split across\n * two independent CLI invocations. So a detached worker holds the live login\n * process while two short foreground calls coordinate with it through files\n * under `~/.agentbox/claude-login/<id>/`:\n *\n * request.json start → worker { image, extraArgs, cwd, createdAt }\n * state.json worker → polls { phase, url?, pid, ... } (atomically replaced)\n * code --code → worker the pasted OAuth code (atomically created)\n *\n * All writers write a temp file then `rename` over the target (atomic on the\n * same filesystem); readers tolerate a transient ENOENT mid-rename.\n */\nimport {\n mkdirSync,\n readdirSync,\n readFileSync,\n renameSync,\n rmSync,\n unlinkSync,\n writeFileSync,\n} from 'node:fs';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\n\nexport type LoginPhase = 'starting' | 'awaiting-code' | 'exchanging' | 'done' | 'error';\n\nexport interface LoginState {\n phase: LoginPhase;\n /** OAuth URL the user must approve; present from `awaiting-code` onward. */\n url?: string;\n /** Worker pid — readers use it to tell a live session from a crashed one. */\n pid: number;\n createdAt: string;\n updatedAt: string;\n /** Warm-up result (the sacrificial first-request absorb), set on `done`. */\n warmed?: boolean;\n /** A recoverable problem (e.g. a rejected code) — session stays usable. */\n lastError?: string;\n /** A terminal failure reason, set with phase `error`. */\n error?: string;\n /** Login process exit code, when it exited. */\n exitCode?: number;\n}\n\nexport interface LoginRequest {\n image: string;\n extraArgs: string[];\n cwd: string;\n createdAt: string;\n}\n\nexport type LoginMode = 'code' | 'headless' | 'guided' | 'interactive';\n\n/**\n * Pick the login flavor from the invocation shape. `--code` always means\n * \"deliver a code to a pending session\". Anything non-interactive (orchestrator\n * pipe, CI) or an explicit `--headless` gets the two-call worker flow.\n *\n * A real TTY gets `guided`: we drive the login container under a pty and prompt\n * for the code ourselves. The `interactive` passthrough — which hands the\n * terminal to claude's own TUI, and breaks on terminals whose keyboard protocol\n * that TUI mishandles (kitty's CSI-u) — is now opt-in via `--interactive`, and\n * the automatic fallback when the optional node-pty prebuild is missing.\n */\nexport function selectLoginMode(o: {\n isTTY: boolean;\n headless: boolean;\n code: boolean;\n interactive: boolean;\n ptyAvailable: boolean;\n}): LoginMode {\n if (o.code) return 'code';\n if (o.headless || !o.isTTY) return 'headless';\n if (o.interactive || !o.ptyAvailable) return 'interactive';\n return 'guided';\n}\n\n/** `~/.agentbox` honoring `AGENTBOX_HOME` (mirrors lib/log-file.ts). */\nfunction stateDir(): string {\n return process.env.AGENTBOX_HOME ?? join(homedir(), '.agentbox');\n}\nexport function loginRootDir(): string {\n return join(stateDir(), 'claude-login');\n}\nexport function loginSessionDir(id: string): string {\n return join(loginRootDir(), id);\n}\n\nfunction atomicWrite(path: string, data: string): void {\n const tmp = `${path}.tmp.${String(process.pid)}.${String(Date.now())}`;\n writeFileSync(tmp, data, { mode: 0o600 });\n renameSync(tmp, path);\n}\n\nfunction readJsonWithRetry<T>(path: string): T | null {\n for (let attempt = 0; attempt < 2; attempt++) {\n try {\n return JSON.parse(readFileSync(path, 'utf8')) as T;\n } catch {\n // A read that races a rename can see ENOENT or a partial file; retry once.\n }\n }\n return null;\n}\n\nexport function writeLoginRequest(id: string, req: LoginRequest): void {\n mkdirSync(loginSessionDir(id), { recursive: true });\n atomicWrite(join(loginSessionDir(id), 'request.json'), JSON.stringify(req));\n}\nexport function readLoginRequest(id: string): LoginRequest | null {\n return readJsonWithRetry<LoginRequest>(join(loginSessionDir(id), 'request.json'));\n}\n\nexport function writeLoginState(id: string, state: Omit<LoginState, 'updatedAt'>): void {\n mkdirSync(loginSessionDir(id), { recursive: true });\n const full: LoginState = { ...state, updatedAt: new Date().toISOString() };\n atomicWrite(join(loginSessionDir(id), 'state.json'), JSON.stringify(full));\n}\nexport function readLoginState(id: string): LoginState | null {\n return readJsonWithRetry<LoginState>(join(loginSessionDir(id), 'state.json'));\n}\n\nexport function writeLoginCode(id: string, code: string): void {\n mkdirSync(loginSessionDir(id), { recursive: true });\n atomicWrite(join(loginSessionDir(id), 'code'), code.trim());\n}\n/** Read and consume the pasted code (deleting it so a retry can deliver a new one). */\nexport function takeLoginCode(id: string): string | null {\n const path = join(loginSessionDir(id), 'code');\n try {\n const code = readFileSync(path, 'utf8').trim();\n try {\n unlinkSync(path);\n } catch {\n /* already gone */\n }\n return code.length > 0 ? code : null;\n } catch {\n return null;\n }\n}\n\nexport function pidAlive(pid: number): boolean {\n if (!Number.isInteger(pid) || pid <= 0) return false;\n try {\n process.kill(pid, 0);\n return true;\n } catch (err) {\n // EPERM means the process exists but we can't signal it — still alive.\n return (err as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\nexport function listSessions(): string[] {\n try {\n return readdirSync(loginRootDir(), { withFileTypes: true })\n .filter((e) => e.isDirectory())\n .map((e) => e.name);\n } catch {\n return [];\n }\n}\n\n/**\n * The single live session still waiting for a code (worker process alive). The\n * normal flow only ever has one; if a future caller starts several, the first\n * live one wins and the caller can disambiguate with `--session`.\n */\nexport function findPendingSession(): { id: string; state: LoginState } | null {\n for (const id of listSessions()) {\n const state = readLoginState(id);\n if (state && state.phase === 'awaiting-code' && pidAlive(state.pid)) {\n return { id, state };\n }\n }\n return null;\n}\n\n/**\n * Any live (worker-alive) session in a non-terminal phase — including `starting`\n * (URL not published yet) and `exchanging`. The start guard uses THIS, not\n * {@link findPendingSession}: blocking only on `awaiting-code` would let a second\n * `--headless` slip through during the brief `starting` window and spawn a\n * duplicate worker, breaking the single-session PKCE assumption.\n */\nexport function findLiveSession(): { id: string; state: LoginState } | null {\n for (const id of listSessions()) {\n const state = readLoginState(id);\n if (state && state.phase !== 'done' && state.phase !== 'error' && pidAlive(state.pid)) {\n return { id, state };\n }\n }\n return null;\n}\n\n/**\n * Reap finished/dead/old session dirs. Removed when: the worker pid is dead and\n * the phase isn't terminal (crash), the phase is terminal and older than 5 min,\n * or the state is missing/older than 15 min (stuck/abandoned).\n */\nexport function cleanupStaleSessions(now: number = Date.now()): void {\n const TERMINAL_MAX_AGE = 5 * 60_000;\n const STUCK_MAX_AGE = 15 * 60_000;\n for (const id of listSessions()) {\n const dir = loginSessionDir(id);\n const state = readLoginState(id);\n let stale = false;\n if (!state) {\n stale = true;\n } else {\n const age = now - Date.parse(state.updatedAt);\n const terminal = state.phase === 'done' || state.phase === 'error';\n if (terminal) {\n stale = age > TERMINAL_MAX_AGE;\n } else if (!pidAlive(state.pid)) {\n stale = true;\n } else {\n stale = age > STUCK_MAX_AGE;\n }\n }\n if (stale) {\n try {\n rmSync(dir, { recursive: true, force: true });\n } catch {\n /* best-effort */\n }\n }\n }\n}\n\n// The URL extractor now lives with the other per-agent prompt detectors; keep\n// re-exporting it here, where the headless flow's callers already look for it.\nexport { extractOAuthUrl } from './login.js';\n","/**\n * `agentbox claude` — the DESCRIPTOR.\n *\n * Claude is the agent the factory's hook set exists for: the `--plan` pre-flight\n * beside session teleport, the first-run setup wizard, the plugin-native-deps\n * rebuild on create and on start, and the clipboard paste handlers on attach.\n *\n * This file used to live in `apps/cli/src/agents/claude/` — not because claude\n * is special, but because its hooks called UP into the app (`runPrepare`, the\n * wizard, `providerForBox`, the paste helpers). An agent package sits below\n * `apps/cli`, so importing them directly would have closed a cycle.\n *\n * They arrive through `ctx.host` / the `clipboard` argument now, so the\n * descriptor sits with the other three and the app keeps only the pipeline.\n */\nimport type { AgentCliSpec } from '@agentbox/cli-kit';\nimport { log, TeleportError } from '@agentbox/cli-kit';\nimport { resolveAgentLauncher } from '@agentbox/core';\nimport { resolveAgentSpec } from '@agentbox/sandbox-core';\nimport { syncClaudeCredentials } from '@agentbox/sandbox-docker';\nimport type { Command } from 'commander';\nimport { rebuildPluginNativeDeps, SHARED_CLAUDE_VOLUME } from '../docker-sync.js';\nimport { claudeRuntime } from './runtime.js';\nimport { BOX_CLAUDE_PLANS_DIR } from './projects-dir.js';\n\nconst spec = resolveAgentSpec('claude');\n\n/**\n * What the plugin-native-deps rebuild has to say, as callbacks the caller runs\n * after the spinner stops: how much the prune reclaimed, and any plugin whose\n * install failed.\n */\nfunction pruneOutput(rebuild: {\n pruned: string[];\n prunedBytes: number;\n failed: { dir: string; stderr: string }[];\n}): (() => void)[] {\n const out: (() => void)[] = [];\n if (rebuild.prunedBytes > 0) {\n const mb = Math.round(rebuild.prunedBytes / 1024 / 1024);\n const n = rebuild.pruned.length;\n out.push(() =>\n log.info(\n `pruned ${String(n)} stale plugin cache${n === 1 ? '' : 's'} (${String(mb)} MB freed)`,\n ),\n );\n }\n for (const f of rebuild.failed) {\n out.push(() =>\n log.warn(\n `plugin install failed for ${f.dir}; claude may still load it. stderr:\\n${f.stderr.trim()}`,\n ),\n );\n }\n return out;\n}\n\n/** The `--plan` seed, so `beforeCreate` can build its \"resume the plan\" turn. */\nconst PLAN_SEED = 'plan';\n\nexport const claudeCliSpec: Omit<AgentCliSpec, 'attachWrapped'> = {\n id: 'claude',\n spec,\n productName: 'Claude Code',\n shortName: 'Claude',\n runtime: claudeRuntime,\n acceptsSeedPrompt: true,\n // Ahead of the setup wizard, which can spend minutes re-baking a stale base:\n // ask the user to sign in before, not after.\n signInOfferTiming: 'before-gates',\n text: {\n description: 'Create a sandboxed box and launch Claude Code in a detachable tmux session',\n isolateVolumeLabel: '~/.claude',\n syncConfigLabel: '~/.claude',\n argsExample: '--model sonnet',\n resumeIdWord: 'id',\n verboseExtra: ' (docker build / Daytona snapshot create)',\n initialPromptExtra:\n \" NOTE: this is NOT claude's own `-p` headless print mode — for that, pass `-- -p ...`.\",\n continueHelp:\n 'teleport the most recent host Claude Code session for this cwd into the box and resume from it',\n resumeHelp:\n 'teleport the specified host Claude Code session id into the box and resume from it',\n startContinueHelp:\n 'teleport the most recent host Claude Code session for this cwd into the box and resume',\n startResumeHelp: 'teleport the specified host Claude Code session id into the box and resume',\n attachDescription:\n 'Attach to a Claude Code tmux session in a box, starting one if none is running (auto-unpause/start; never re-syncs ~/.claude — use `claude start` for that)',\n startDescription:\n 'Start a Claude Code tmux session in an already-existing box (auto-unpause/start). If a session is already running, just attach.',\n loginDescription:\n 'Sign in to Claude for use in sandboxes (forwards args to `claude auth login`, e.g. --sso, --console). Runs in a throwaway container against the shared claude-config volume — usable before the first `agentbox claude`. In a terminal it prints the auth URL and prompts for the code. Non-interactive (no TTY) or `--headless`: prints the auth URL, then finish with `--code <CODE>`.',\n loginArgsHelp:\n 'extra args forwarded to `claude auth login`; place after `--`, e.g. `agentbox claude login -- --sso`',\n loginInteractiveHelp:\n \"attach your terminal to claude's own login TUI (legacy passthrough; try this if the guided prompt can't drive your login method)\",\n resumeWithPromptError:\n '-i / --initial-prompt cannot be combined with -c / --resume (seeding a new turn into a resumed session is not supported).',\n hubIncompatibleReason:\n '--via-hub is ignored for --resume / --plan runs (they teleport host state at create time); building this box locally.',\n resumeIntoRunningError: (boxName) =>\n `cannot resume into ${boxName}: a Claude session is already running. Detach and kill the session first (Control+a then :kill-session), or use \\`agentbox claude attach\\` to reattach to the live one.`,\n },\n hooks: {\n /**\n * `--plan`: copy a host plan file into the box, start in plan mode and seed\n * a \"resume the plan\" turn. The `-c` / `--resume` half is shared — `base` is\n * what the body already resolved — so this only adds claude's own payload.\n */\n async preflight(ctx, base) {\n const opts = ctx.opts as { initialPrompt?: string; plan?: string };\n if (!opts.plan) return base;\n // --plan seeds an interactive \"resume the plan\" turn, which is\n // incompatible with -i's background-queue mode (the same reason resume +\n // -i is rejected).\n if (opts.initialPrompt && opts.initialPrompt.length > 0) {\n ctx.fail(\n '--plan cannot be combined with -i / --initial-prompt (--plan already seeds an interactive \"resume the plan\" turn).',\n );\n }\n try {\n // forwardArgs is empty: the plan drives the prompt + permission-mode\n // through `argsTransform` below, not through resume flags.\n const resolved = await ctx.host.resolvePlanFile({\n path: opts.plan,\n hostCwd: ctx.workspace,\n log: ctx.writeLog,\n boxParentDir: BOX_CLAUDE_PLANS_DIR,\n });\n return {\n ...base,\n seeds: [\n ...base.seeds,\n {\n label: 'uploading plan into box',\n tag: PLAN_SEED,\n resolved,\n forwardArgs: [],\n ownsFirstTurn: true,\n },\n ],\n hubIncompatible: true,\n };\n } catch (err) {\n if (err instanceof TeleportError) ctx.fail(err.message);\n throw err;\n }\n },\n\n /**\n * First-run wizard: with no agentbox.yaml, offer to inject an initial user\n * message so claude reads /agentbox-setup and writes one. It can also\n * re-bake a stale base and discard a dead default checkpoint.\n */\n async beforeCreate(ctx) {\n const opts = ctx.opts as { workspace: string; yes?: boolean; snapshot?: string };\n const planSessionId = ctx.preflight.seeds.find((x) => x.tag === PLAN_SEED)?.resolved\n .sessionId;\n // Grading the base, re-baking a stale one and routing all live behind the\n // seam (`AgentHostServices.setupWizard`) — none of it was claude behavior.\n const wiz = await ctx.host.setupWizard({\n checkpointFromDefault: !(opts.snapshot && opts.snapshot.length > 0),\n });\n return {\n // The wizard may discard a stale/dead default checkpoint: boot from the\n // current base instead of a dead artifact. An explicit `--snapshot` is\n // never discarded.\n ...(wiz.discardCheckpoint ? { checkpointRef: undefined } : {}),\n ...(wiz.envFilesToImport ? { envFilesToImport: wiz.envFilesToImport } : {}),\n seedsFirstTurn:\n Boolean(planSessionId) ||\n (wiz.action === 'launch-with-prompt' && Boolean(wiz.initialPrompt)),\n argsTransform: (args) => {\n // --plan: enter plan mode and seed a \"resume the plan\" turn. Adding\n // --permission-mode BEFORE the skip-permissions injection makes the latter\n // treat it as a conflict and skip --dangerously-skip-permissions —\n // plan mode wins.\n if (planSessionId) {\n let out = args;\n const hasPermissionMode = out.some(\n (x) => x === '--permission-mode' || x.startsWith('--permission-mode='),\n );\n if (!hasPermissionMode) out = [...out, '--permission-mode', 'plan'];\n return resolveAgentLauncher('claude-code').buildArgs(\n `Resume the plan at ~/.claude/plans/${planSessionId}`,\n out,\n );\n }\n if (wiz.action === 'launch-with-prompt' && wiz.initialPrompt) {\n return resolveAgentLauncher('claude-code').buildArgs(wiz.initialPrompt, args);\n }\n return args;\n },\n };\n },\n\n /**\n * Plugin native deps: the sync excludes `node_modules` (host darwin binaries\n * don't run on linux/amd64). The first claude session in a fresh box pays the\n * npm-install cost for each plugin that ships a package.json; later attaches\n * see node_modules already present and exit immediately.\n */\n async afterCreate(box, ctx) {\n ctx.message('checking plugin native deps');\n const rebuild = await rebuildPluginNativeDeps(box.container, {\n volume: box.claudeConfigVolume ?? SHARED_CLAUDE_VOLUME,\n onProgress: (line) => ctx.message(line),\n });\n return { deferred: [...pruneOutput(rebuild), () => ctx.host.showInstallHint()] };\n },\n\n async afterVolumeSync(box, { volume, message }) {\n // The /agentbox-setup skill is seeded by the shared body from\n // `spec.seeds` — what stays here is real behavior, not file placement.\n // Mirror the in-box OAuth credentials with the host backup. Runs regardless\n // of --no-sync-config (this is not the host ~/.claude rsync) — it keeps the\n // backup fresh as the in-box claude rotates its token, and seeds an isolate\n // box's volume from an up-front sign-in.\n await syncClaudeCredentials(\n { volume },\n { image: box.image, isolate: volume !== SHARED_CLAUDE_VOLUME },\n );\n // Idempotent — gated by a per-plugin marker, so a no-op on later starts\n // unless a new plugin was synced just now.\n message('checking plugin native deps');\n const rebuild = await rebuildPluginNativeDeps(box.container, {\n volume: box.claudeConfigVolume ?? SHARED_CLAUDE_VOLUME,\n onProgress: (line) => message(line),\n });\n return { deferred: pruneOutput(rebuild) };\n },\n\n /**\n * Only wire Ctrl+V paste when this host can actually capture a clipboard\n * image (macOS, or a Linux desktop with xclip/wl-paste). Elsewhere Ctrl+V\n * forwards verbatim instead of being intercepted for a guaranteed-empty paste.\n */\n async attachExtras(box, clipboard) {\n if (!(await clipboard.available())) return {};\n return {\n onPasteImage: () => clipboard.pasteImage(box),\n onPasteImageFile: (p: string) => clipboard.pasteImageFile(box, p),\n };\n },\n\n extendCommand(cmd: Command) {\n cmd.option(\n '--plan <path>',\n 'copy a Claude Code plan file (e.g. ~/.claude/plans/<slug>.md) into the box, launch claude with --permission-mode plan, and seed a \"resume the plan\" prompt',\n );\n },\n },\n};\n","/**\n * Claude Code encodes the working-directory absolute path into the\n * `~/.claude/projects/<encoded>/` directory name by replacing every\n * non-alphanumeric character with `-`. E.g. `/Users/marco/Projects/foo` →\n * `-Users-marco-Projects-foo`; `/Users/marco/.agents/skills` →\n * `-Users-marco--agents-skills` (the dot AND the slash both become `-`).\n *\n * Lived in `@agentbox/cli-kit`, the shared CLI kit — but this is Claude Code's\n * own on-disk scheme and claude's session teleport is its only consumer.\n * `sandbox-core` keeps its own copy of the same rule (`encodeClaudeProjectsKey`)\n * because it sits below the agent packages and cannot import one.\n */\nexport function encodeClaudeProjectsDir(absPath: string): string {\n return absPath.replace(/[^a-zA-Z0-9]/g, '-');\n}\n\n/** Encoded form of `/workspace` — the in-box project key for any AgentBox sandbox. */\nexport const BOX_WORKSPACE_ENCODED = encodeClaudeProjectsDir('/workspace');\n\n/**\n * In-box `~/.claude/plans/` directory (vscode user home).\n *\n * `agentbox claude --plan` uploads a host plan file here. It lived in\n * `apps/cli/src/session-teleport/plan.ts`, which is otherwise generic teleport\n * plumbing — the DESTINATION is claude's, so it sits with claude.\n */\nexport const BOX_CLAUDE_PLANS_DIR = '/home/vscode/.claude/plans';\n","import { defineAgentModule, type AgentModule } from '@agentbox/cli-kit';\nimport { CLAUDE_LOGIN_SPEC } from './login.js';\nimport { claudeRuntime } from './runtime.js';\nimport { resolveClaudeTeleport } from './teleport.js';\n\nexport const agentModule: AgentModule = defineAgentModule('claude', {\n login: CLAUDE_LOGIN_SPEC,\n runtime: claudeRuntime,\n teleport: resolveClaudeTeleport,\n});\n","/**\n * Claude Code session teleport. Finds a host session JSONL under\n * `~/.claude/projects/<encoded host cwd>/<id>.jsonl`, rewrites each line's\n * top-level `cwd` field to `/workspace`, and writes the result to a host tmp\n * file ready for upload into the box's `/home/vscode/.claude/projects/-workspace/`.\n *\n * Claude session files are line-delimited JSON. We parse each line, swap\n * `cwd` if present, and re-serialize. Lines that don't parse cleanly are\n * forwarded verbatim — the file may contain forward-compatible variants we\n * don't recognize and shouldn't drop.\n */\n\nimport { mkdir, mkdtemp, readdir, readFile, stat, writeFile } from 'node:fs/promises';\nimport { existsSync } from 'node:fs';\nimport { homedir, tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { BOX_WORKSPACE } from '@agentbox/cli-kit';\nimport {\n TeleportError,\n type ResolvedTeleport,\n type ResumeMode,\n type TeleportLogger,\n} from '@agentbox/cli-kit';\nimport { BOX_WORKSPACE_ENCODED, encodeClaudeProjectsDir } from './projects-dir.js';\n\n/** In-box `~/.claude/projects/-workspace/` directory. */\nexport const BOX_CLAUDE_PROJECTS_DIR = `/home/vscode/.claude/projects/${BOX_WORKSPACE_ENCODED}`;\n\ninterface ClaudeResolveOptions {\n hostCwd: string;\n mode: ResumeMode;\n /** Override for tests. */\n hostHome?: string;\n log?: TeleportLogger;\n}\n\nexport async function resolveClaudeTeleport(opts: ClaudeResolveOptions): Promise<ResolvedTeleport> {\n const hostHome = opts.hostHome ?? homedir();\n const projectDir = join(hostHome, '.claude', 'projects', encodeClaudeProjectsDir(opts.hostCwd));\n\n if (!existsSync(projectDir)) {\n throw new TeleportError(\n `no Claude session history found on the host for ${opts.hostCwd} (expected at ${projectDir}). Run \\`claude\\` here at least once before using -c / --resume.`,\n );\n }\n\n const sessionPath = await pickSessionFile(projectDir, opts.mode);\n const sessionId =\n sessionPath\n .replace(/\\.jsonl$/u, '')\n .split('/')\n .pop() ?? '';\n\n // Stage the rewritten copy in a host tmp dir. The caller will upload from\n // here via `provider.uploadPath`.\n const stage = await mkdtemp(join(tmpdir(), 'agentbox-teleport-claude-'));\n const stagedFile = join(stage, `${sessionId}.jsonl`);\n await rewriteSessionFile(sessionPath, stagedFile, opts.hostCwd);\n opts.log?.(`teleport: claude session ${sessionId} staged for upload`);\n\n return {\n agent: 'claude',\n sessionId,\n hostFile: stagedFile,\n boxPath: `${BOX_CLAUDE_PROJECTS_DIR}/${sessionId}.jsonl`,\n boxParentDir: BOX_CLAUDE_PROJECTS_DIR,\n forwardArgs: ['--resume', sessionId],\n };\n}\n\nasync function pickSessionFile(projectDir: string, mode: ResumeMode): Promise<string> {\n if (mode.kind === 'resume') {\n const target = join(projectDir, `${mode.id}.jsonl`);\n if (!existsSync(target)) {\n throw new TeleportError(\n `Claude session \"${mode.id}\" not found in ${projectDir}. List available sessions with: ls \"${projectDir}\"`,\n );\n }\n return target;\n }\n const entries = await readdir(projectDir);\n const jsonl = entries.filter((e) => e.endsWith('.jsonl'));\n if (jsonl.length === 0) {\n throw new TeleportError(\n `no Claude sessions found in ${projectDir} — nothing to continue. Run \\`claude\\` here once first.`,\n );\n }\n const stats = await Promise.all(\n jsonl.map(async (name) => {\n const full = join(projectDir, name);\n const s = await stat(full);\n return { full, mtimeMs: s.mtimeMs };\n }),\n );\n stats.sort((a, b) => b.mtimeMs - a.mtimeMs);\n return stats[0]!.full;\n}\n\nasync function rewriteSessionFile(src: string, dst: string, hostCwd: string): Promise<void> {\n const raw = await readFile(src, 'utf8');\n // Preserve original line endings — split on \\n keeps a trailing empty entry\n // when the file ends with \\n; we restore that on join.\n const lines = raw.split('\\n');\n const out: string[] = [];\n for (const line of lines) {\n if (line.length === 0) {\n out.push(line);\n continue;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(line);\n } catch {\n out.push(line);\n continue;\n }\n if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {\n const obj = parsed as Record<string, unknown>;\n if (obj.cwd === hostCwd) {\n obj.cwd = BOX_WORKSPACE;\n out.push(JSON.stringify(obj));\n continue;\n }\n }\n out.push(line);\n }\n await mkdir(join(dst, '..'), { recursive: true });\n await writeFile(dst, out.join('\\n'), 'utf8');\n}\n","/**\n * Claude's binding of the agent-agnostic login core ({@link runAgentLogin}):\n * drive `claude auth login` in a throwaway docker container under a node-pty,\n * mirror its output verbatim, publish the OAuth URL it prints, feed back the\n * pasted approval code, and on success run the warm-up + host-backup sync.\n *\n * Three callers share this loop with different transports:\n * - `commands/claude.ts` guided mode (the TTY default) prompts with clack.\n * - `_claude-login-worker.ts` (`--headless`) uses file-backed state\n * (`state.json` / `code`).\n * - the create-job worker (`_run-queued-job.ts`) uses the queue manifest's\n * `login` sub-state so the hub API/UI can surface it.\n */\nimport { syncClaudeCredentials, volumeClaudeCredentials } from '@agentbox/sandbox-docker';\nimport {\n buildClaudeLoginRunArgv,\n SHARED_CLAUDE_VOLUME,\n warmUpClaudeCredentials,\n} from '../docker-sync.js';\nimport { runAgentLogin, type AgentLoginPhase } from '@agentbox/cli-kit';\nimport { CLAUDE_LOGIN_SPEC } from './login.js';\nimport type { LoginPhase } from './login-session.js';\n\nexport interface LoginPhaseUpdate {\n url?: string;\n error?: string;\n lastError?: string;\n warmed?: boolean;\n exitCode?: number;\n}\n\nexport interface RunClaudeLoginOptions {\n image: string;\n /** Shared claude credential volume the login writes into. */\n volume?: string;\n /** Login-method args forwarded to `claude auth login` (default `['--claudeai']`). */\n extraArgs?: string[];\n /** Verbatim mirror of the container's pty stream (do NOT reformat). */\n writeRaw: (chunk: string) => void;\n /** Optional annotated log line (progress notes, not the raw stream). */\n writeLog?: (line: string) => void;\n /** Publish a phase transition (url on `awaiting-code`, error/warmed on terminal). */\n onPhase: (phase: LoginPhase, update?: LoginPhaseUpdate) => void;\n /** Poll+consume a pasted approval code (return null when none is pending). */\n getCode: () => string | null | undefined;\n /** Abort the login (e.g. on SIGTERM); resolves with an error result. */\n signal?: AbortSignal;\n urlTimeoutMs?: number;\n codeTimeoutMs?: number;\n}\n\nexport interface RunClaudeLoginResult {\n ok: boolean;\n error?: string;\n warmed?: boolean;\n exitCode?: number;\n}\n\n/**\n * The claude spec is `paste-code` only, so the core's `awaiting-approval` phase\n * is unreachable here and `LoginPhase` (which has no such member) stays exact.\n */\nfunction asLoginPhase(phase: AgentLoginPhase): LoginPhase {\n return phase === 'awaiting-approval' ? 'awaiting-code' : phase;\n}\n\n/**\n * Run one `claude auth login` to completion. Resolves when the login process\n * exits or a timeout/abort fires; `onPhase` is called for every transition\n * (`starting`→`awaiting-code`→`exchanging`→`done`/`error`) so the caller can\n * mirror state to its own transport.\n */\nexport async function runClaudeLogin(opts: RunClaudeLoginOptions): Promise<RunClaudeLoginResult> {\n const volume = opts.volume ?? SHARED_CLAUDE_VOLUME;\n const extraArgs =\n opts.extraArgs && opts.extraArgs.length > 0 ? opts.extraArgs : CLAUDE_LOGIN_SPEC.defaultArgs;\n const { image } = opts;\n\n const { ok, error, warmed, exitCode } = await runAgentLogin({\n spec: CLAUDE_LOGIN_SPEC,\n dockerArgv: buildClaudeLoginRunArgv({ volume, image, extraArgs }),\n writeRaw: opts.writeRaw,\n writeLog: opts.writeLog,\n onPhase: (phase, update) => {\n const { url, error: err, lastError, warmed: w, exitCode: code } = update ?? {};\n opts.onPhase(asLoginPhase(phase), { url, error: err, lastError, warmed: w, exitCode: code });\n },\n getInput: opts.getCode,\n verify: async () => (await volumeClaudeCredentials(volume, image)).hasRefreshToken,\n // Absorb the fresh-token first-request 400 before any box uses these\n // credentials, then mirror them to the host backup.\n finalize: async () => {\n const warm = await warmUpClaudeCredentials(volume, image, {\n onProgress: (l) => opts.writeLog?.(l),\n });\n await syncClaudeCredentials({ volume }, { image, isolate: false });\n return { warmed: warm.warmed };\n },\n signal: opts.signal,\n urlTimeoutMs: opts.urlTimeoutMs,\n inputTimeoutMs: opts.codeTimeoutMs,\n });\n\n return { ok, error, warmed, exitCode };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,SAAS,gBAAgB;AACzB,SAAS,YAAY;AMerB,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,cAAc,aAAa;ACJpC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;OACK;AACP,SAAS,eAAe;AACxB,SAAS,QAAAA,aAAY;AIbrB,SAAS,OAAO,SAAS,SAAS,YAAAC,WAAU,MAAM,iBAAiB;AACnE,SAAS,cAAAC,mBAAkB;AAC3B,SAAS,WAAAC,U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AM;AAC7C;AD3HO,IAAM,cAA2B,kBAAkB,UAAU;EAClE,OAAO;EACP,SAAS;EACT,UAAU;AACZ,CAAC;AEqDD,SAAS,aAAa,OAAoC;AACxD,SAAO,UAAU,sBAAsB,kBAAkB;AAC3D;AAQA,eAAsB,eAAe,MAA4D;AAC/F,QAAM,SAAS,KAAK,UAAU;AAC9B,QAAM,YACJ,KAAK,aAAa,KAAK,UAAU,SAAS,IAAI,KAAK,YAAY,kBAAkB;AACnF,QAAM,EAAE,MAAM,IAAI;AAElB,QAAM,EAAE,IAAI,OAAO,QAAQ,SAAS,IAAI,MAAM,cAAc;IAC1D,MAAM;IACN,YAAY,wBAAwB,EAAE,QAAQ,OAAO,UAAU,CAAC;IAChE,UAAU,KAAK;IACf,UAAU,KAAK;IACf,SAAS,CAAC,OAAO,WAAW;AAC1B,YAAM,EAAE,KAAK,OAAO,KAAK,WAAW,QAAQ,GAAG,UAAU,KAAK,IAAI,UAAU,CAAC;AAC7E,WAAK,QAAQ,aAAa,KAAK,GAAG,EAAE,KAAK,OAAO,KAAK,WAAW,QAAQ,GAAG,UAAU,KAAK,CAAC;IAC7F;IACA,UAAU,KAAK;IACf,QAAQ,aAAa,MAAMM,wBAAwB,QAAQ,KAAK,GAAG;;;IAGnE,UAAU,YAAY;AACpB,YAAM,OAAO,MAAM,wBAAwB,QAAQ,OAAO;QACxD,YAAY,CAAC,MAAM,KAAK,WAAW,CAAC;MACtC,CAAC;AACD,YAAMR,sBAAsB,EAAE,OAAO,GAAG,EAAE,OAAO,SAAS,MAAM,CAAC;AACjE,aAAO,EAAE,QAAQ,KAAK,OAAO;IAC/B;IACA,QAAQ,KAAK;IACb,cAAc,KAAK;IACnB,gBAAgB,KAAK;EACvB,CAAC;AAED,SAAO,EAAE,IAAI,OAAO,QAAQ,SAAS;AACvC;","names":["join","readFile","existsSync","homedir","join","log","syncClaudeCredentials","hostBackupHasCredentials","join","spinner","loadPtyBackend","ensureImage","imageProgress","imageExists","volumeClaudeCredentials","resolveAgentSpec","homedir","existsSync","TeleportError","readFile"]}
1
+ {"version":3,"sources":["../../../packages/agent-claude/src/cli/runtime.ts","../../../packages/agent-claude/src/cli/auth.ts","../../../packages/agent-claude/src/cli/login-binding.ts","../../../packages/agent-claude/src/cli/login.ts","../../../packages/agent-claude/src/cli/host-creds.ts","../../../packages/agent-claude/src/cli/cred-health.ts","../../../packages/agent-claude/src/cli/credential-renew.ts","../../../packages/agent-claude/src/cli/login-command.ts","../../../packages/agent-claude/src/cli/login-session.ts","../../../packages/agent-claude/src/cli/cli-spec.ts","../../../packages/agent-claude/src/cli/projects-dir.ts","../../../packages/agent-claude/src/cli/module.ts","../../../packages/agent-claude/src/cli/teleport.ts","../../../packages/agent-claude/src/cli/login-run.ts"],"sourcesContent":["/**\n * Claude's docker bindings and its own sign-in code.\n *\n * See `../codex/runtime.ts` for why this is separate from `./command.ts`.\n * Claude's login is the one that is genuinely a protocol rather than a call: it\n * has a headless print-URL / `--code` pair (`./login-command.ts`) and a\n * credential-HEALTH check rather than a present/absent probe, because a merely\n * lapsed access token renews itself and nagging about it is worse than useless.\n */\nimport type { EffectiveConfig, UserConfig } from '@agentbox/config';\nimport {\n ensureImage,\n hostBackupHasCredentials,\n imageExists,\n syncClaudeCredentials,\n volumeClaudeCredentials,\n type BoxRecord,\n} from '@agentbox/sandbox-docker';\nimport {\n buildClaudeAttachArgv,\n buildClaudeLoginRunArgv,\n ClaudeSessionError,\n claudeSessionInfo,\n ensureClaudeInstalled,\n ensureClaudeVolume,\n runInteractiveClaudeLogin,\n SHARED_CLAUDE_VOLUME,\n startClaudeSession,\n warmUpClaudeCredentials,\n} from '../docker-sync.js';\nimport { confirm, log, spinner } from '@agentbox/cli-kit';\nimport { resolveClaudeAuth } from './auth.js';\nimport { claudeLoginBinding } from './login-binding.js';\nimport { claudeCredStatus } from './host-creds.js';\nimport { resolveClaudeCredHealth } from './cred-health.js';\nimport { runGuidedLogin } from '@agentbox/cli-kit';\nimport { imageProgress } from '@agentbox/cli-kit';\nimport { loadPtyBackend } from '@agentbox/cli-kit';\nimport { applySkipPermissions, type SkipPermissionsRule } from '@agentbox/cli-kit';\nimport { clampSpinnerLine } from '@agentbox/cli-kit';\nimport { addClaudeLoginOptions, runClaudeLoginCommand } from './login-command.js';\nimport type { AgentRuntime, SignInResult } from '@agentbox/cli-kit';\n\n/**\n * Run `claude auth login` in a throwaway container against the shared\n * claude-config volume, then extract the result to the host backup so every\n * future box (shared or isolate) is seeded from it. Returns the login command's\n * exit code.\n *\n * This is the legacy passthrough: it hands the terminal to claude's own TUI. See\n * {@link signInToClaude} for why that is no longer the default.\n */\nasync function runClaudeLoginContainer(image: string, extraArgs: string[]): Promise<number> {\n const { exitCode } = runInteractiveClaudeLogin(\n buildClaudeLoginRunArgv({ volume: SHARED_CLAUDE_VOLUME, image, extraArgs }),\n );\n if (exitCode === 0) {\n // Absorb the fresh-token first-request 400 in a throwaway container before\n // any box uses these credentials (see warmUpClaudeCredentials). Runs before\n // syncClaudeCredentials so the host backup captures any token the warm-up\n // refreshes.\n const s = spinner();\n s.start('checking credentials');\n const warm = await warmUpClaudeCredentials(SHARED_CLAUDE_VOLUME, image, {\n onProgress: (line) => s.message(clampSpinnerLine(line)),\n });\n s.stop(warm.warmed ? 'credentials ready' : 'credentials check incomplete — continuing');\n await syncClaudeCredentials({ volume: SHARED_CLAUDE_VOLUME }, { image, isolate: false });\n }\n return exitCode;\n}\n\n/**\n * Sign in to Claude, the way every caller should: guided (drive the login\n * container under a pty, prompt for the code with our own clack prompt) so the\n * container's TUI never touches the user's terminal — it misbehaves on terminals\n * whose keyboard protocol it mishandles (kitty's CSI-u).\n *\n * Falls back to the passthrough when the optional node-pty prebuild is missing,\n * or when the caller forces it. Returns rather than exiting, so the first-run\n * offers can warn and continue.\n */\nexport async function signInToClaude(\n image: string,\n extraArgs: string[],\n opts: { passthrough?: boolean } = {},\n): Promise<SignInResult> {\n const usePassthrough = opts.passthrough === true || !(await loadPtyBackend());\n if (usePassthrough) {\n const exitCode = await runClaudeLoginContainer(image, extraArgs);\n return exitCode === 0\n ? { ok: true }\n : { ok: false, error: `\\`claude auth login\\` exited with code ${String(exitCode)}` };\n }\n const res = await runGuidedLogin('claude', (writeLog) =>\n claudeLoginBinding({ image, extraArgs, writeLog }),\n );\n return { ok: res.ok, error: res.error, cancelled: res.cancelled };\n}\n\n/**\n * Shared tail of both first-run offers: prepare the claude image layer, seed the\n * shared volume from the host's ~/.claude, then sign in.\n *\n * The volume seed happens BEFORE the login container runs, so `claude auth\n * login` writes its oauthAccount on top of the host config (trust,\n * installMethod, project alias) rather than into an empty volume.\n * `ensureClaudeVolume` is write-once for `_claude.json`, so the later createBox\n * sync cannot clobber the login's work.\n */\nasync function runLoginOffer(image: string, hostWorkspace: string): Promise<void> {\n const s = spinner();\n s.start('preparing sandbox image');\n // The login container RUNS claude, so it needs that agent's layer — the base\n // image is agentless. `ensureImage` returns the variant ref.\n const { ref: loginImage } = await ensureImage(image, {\n agents: ['claude'],\n onProgress: imageProgress(s),\n });\n s.message('preparing claude config');\n await ensureClaudeVolume(\n { volume: SHARED_CLAUDE_VOLUME },\n { syncFromHost: true, image: loginImage, hostWorkspace },\n );\n s.stop('image ready');\n\n const res = await signInToClaude(loginImage, ['--claudeai']);\n if (!res.ok) {\n log.warn('Claude login did not complete; continuing — run `agentbox claude login` to retry.');\n return;\n }\n log.success('Signed in with your Claude subscription — saved for future boxes.');\n}\n\nconst SKIPPED = 'Skipped sign-in — claude will prompt you to /login inside the box.';\n\n/** Claude's full permission-bypass flag, and the args that mean the user chose. */\nconst SKIP_PERMISSIONS_RULE: SkipPermissionsRule = {\n flag: '--dangerously-skip-permissions',\n conflictingArgs: ['--dangerously-skip-permissions', '--permission-mode'],\n};\n\nexport const claudeRuntime: AgentRuntime = {\n hostCredStatus: async ({ image, env, isCloud }) => {\n const status = await claudeCredStatus(env, isCloud, image);\n if (status === 'ok') return { status: 'ok' };\n if (status === 'missing') return { status: 'missing' };\n return {\n status: 'expired',\n message:\n 'Your saved Claude login can no longer be renewed. Sign in again with `agentbox claude login`, then retry.',\n };\n },\n sharedVolume: SHARED_CLAUDE_VOLUME,\n SessionError: ClaudeSessionError,\n\n startSession: (o) =>\n startClaudeSession({\n container: o.container,\n claudeArgs: o.args,\n sessionName: o.sessionName,\n boxName: o.boxName,\n workspacePath: o.workspacePath,\n }),\n sessionInfo: (container, sessionName) => claudeSessionInfo(container, sessionName),\n ensureInstalled: (container, o) => ensureClaudeInstalled(container, o),\n ensureVolume: (target, o) =>\n ensureClaudeVolume(target, {\n syncFromHost: o.syncFromHost,\n image: o.image,\n ...(o.hostWorkspace === undefined ? {} : { hostWorkspace: o.hostWorkspace }),\n }),\n buildAttachArgv: (container, sessionName) => buildClaudeAttachArgv(container, sessionName),\n\n // Unlike codex/opencode, claude ALWAYS syncs: a box with no recorded volume\n // still has the shared one, and its ~/.claude carries MCP servers and OAuth\n // state the in-box claude needs.\n resolveConfigVolume: (box: BoxRecord) => box.claudeConfigVolume ?? SHARED_CLAUDE_VOLUME,\n createBoxConfig: (isolate) => ({ claudeConfig: { isolate } }),\n\n sessionNameOf: (cfg: EffectiveConfig) => cfg.claude.sessionName,\n isolateOf: (cfg: EffectiveConfig) => cfg.box.isolateClaudeConfig,\n cliOverrides: ({ sessionName, skipPermissions, isolate }) => {\n const out: Partial<UserConfig> = {};\n const claude: NonNullable<UserConfig['claude']> = {};\n if (sessionName !== undefined) claude.sessionName = sessionName;\n if (skipPermissions !== undefined) claude.dangerouslySkipPermissions = skipPermissions;\n if (Object.keys(claude).length > 0) out.claude = claude;\n if (isolate === true) out.box = { isolateClaudeConfig: true };\n return out;\n },\n\n skipPermissions: {\n flag: SKIP_PERMISSIONS_RULE.flag,\n effect: 'auto-accept tool use',\n apply: (args, cfg) =>\n applySkipPermissions(\n args,\n SKIP_PERMISSIONS_RULE,\n cfg.claude.dangerouslySkipPermissions !== false,\n ),\n },\n\n /**\n * Host-env auth is the user's explicit choice — respect it and never check.\n * Otherwise a non-TTY run has no way to finish an in-box `/login`, so the\n * credential assertion is worth paying for.\n */\n requireCredsWhenNonTty: async () => (await resolveClaudeAuth(process.env)).source !== 'host-env',\n\n /**\n * Docker boots every box from the shared claude-config volume's live\n * `.credentials.json`; the host backup is only a mirror that diverges when an\n * in-box refresh fails (claude blanks the volume's refreshToken, and the\n * create-time extract then skips it, so the backup keeps a stale token). So\n * decide off the *volume*, not the backup:\n * - usable refresh token present -> trust the in-box refresh, no prompt (a\n * merely-expired access token renews itself; don't nag);\n * - file present but refresh token blanked -> the login is dead (the seed only\n * restores the same stale backup), so offer a fresh sign-in;\n * - no file yet -> the box seeds from the host backup, so only offer sign-in\n * when there is nothing to seed from either.\n */\n async offerDockerLogin({ image, yes, hostWorkspace }) {\n if (!process.stdin.isTTY || yes) return;\n const auth = await resolveClaudeAuth(process.env);\n if (auth.source === 'host-env') return;\n\n // The probe needs the image locally; skip it (fall back to the backup check)\n // when it isn't, so a first-ever run doesn't trigger an implicit pull here.\n const vol = (await imageExists(image))\n ? await volumeClaudeCredentials(SHARED_CLAUDE_VOLUME, image)\n : { present: false, hasRefreshToken: false };\n if (vol.hasRefreshToken) return;\n const blanked = vol.present && !vol.hasRefreshToken;\n if (!vol.present && (await hostBackupHasCredentials())) return;\n\n const message = blanked\n ? 'Your saved Claude login looks expired. Sign in again? (saved and reused by every box)'\n : auth.source === 'auth-file'\n ? \"You're on a legacy API token (shows as 'Claude API'). Sign in with your Claude subscription instead?\"\n : 'Sign in with your Claude subscription? (saved and reused by every box)';\n if (!(await confirm({ message, initialValue: true }))) {\n log.info(SKIPPED);\n return;\n }\n await runLoginOffer(image, hostWorkspace);\n },\n\n /**\n * Cloud has no shared volume to persist an in-box login, so without a host\n * credential the box boots unauthenticated. Capturing the login to\n * `~/.agentbox/claude-credentials.json` lets the cloud push seed it into this\n * box and every future one.\n *\n * The verdict comes from `resolveClaudeCredHealth`, which renews a merely-\n * lapsed access token rather than reporting it as an expiry — see that module\n * for why the old `expiresAt` gate nagged daily and why saying yes to it was\n * actively destructive.\n */\n async offerCloudLogin({ image, yes, hostWorkspace }) {\n if (!process.stdin.isTTY || yes) return;\n if ((await resolveClaudeAuth(process.env)).source === 'host-env') return;\n\n const probe = spinner();\n let started = false;\n const health = await resolveClaudeCredHealth({\n image,\n onProgress: (line) => {\n if (!started) {\n started = true;\n probe.start('checking your saved Claude login');\n }\n probe.message(clampSpinnerLine(line));\n },\n });\n if (started) probe.stop('checked your saved Claude login');\n if (health === 'ok') return;\n\n const message =\n health === 'dead'\n ? 'Your saved Claude login can no longer be renewed. Sign in again? (saved and reused by every box)'\n : 'Sign in with your Claude subscription? (saved and reused by every box)';\n if (!(await confirm({ message, initialValue: true }))) {\n log.info(SKIPPED);\n return;\n }\n await runLoginOffer(image, hostWorkspace);\n },\n\n signIn: (image, extraArgs, o) => signInToClaude(image, extraArgs, o),\n loginBinding: (o) => claudeLoginBinding(o),\n loginNeedsTty: 'interactive-only',\n loginCommand: { options: addClaudeLoginOptions, run: runClaudeLoginCommand },\n // Claude's create always derives an image with the agent baked in and has\n // never probed for the binary afterwards; see `ensureInstalledOnCreate`.\n ensureInstalledOnCreate: false,\n\n resume: {\n // Claude exposes the exact session id on every hook payload, so the in-box\n // hooks record it and resume is exact.\n async resumeArgs(exec) {\n const id = await exec('cat \"$HOME/.local/state/agentbox/claude-session\" 2>/dev/null');\n // Guard: only a uuid-ish token is safe to hand to `claude --resume`.\n return /^[0-9a-fA-F][0-9a-fA-F-]{7,}$/.test(id) ? ['--resume', id] : null;\n },\n },\n};\n","import { readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { STATE_DIR } from '@agentbox/sandbox-docker';\n\nexport const AUTH_FILE = join(STATE_DIR, 'auth.json');\n\nexport interface AuthFile {\n claudeCodeOauthToken?: string;\n}\n\nexport interface ResolvedClaudeAuth {\n /** Env vars to inject into the box. Only includes keys with non-empty string values. */\n env: Record<string, string>;\n /** Where the value(s) came from. `'none'` means there's nothing to forward. */\n source: 'host-env' | 'auth-file' | 'none';\n}\n\n/**\n * Merge host env + the legacy `~/.agentbox/auth.json` setup-token into the\n * effective env that the `claude` command forwards to the box. Env wins over\n * the file; either of the two known keys (API key or OAuth token) counts as\n * having auth.\n *\n * This is the **dormant fallback** path. The primary auth flow is the in-box\n * interactive OAuth login, persisted by `syncClaudeCredentials` — a box that\n * has real credentials in its claude-config volume ignores any forwarded\n * `CLAUDE_CODE_OAUTH_TOKEN` anyway. `auth.json` is only ever read here, never\n * written, kept so existing users and CI keep working.\n */\nexport async function resolveClaudeAuth(\n processEnv: NodeJS.ProcessEnv,\n opts: { authFilePath?: string } = {},\n): Promise<ResolvedClaudeAuth> {\n const env: Record<string, string> = {};\n const envApiKey = processEnv['ANTHROPIC_API_KEY'];\n const envOauth = processEnv['CLAUDE_CODE_OAUTH_TOKEN'];\n if (typeof envApiKey === 'string' && envApiKey.length > 0) env['ANTHROPIC_API_KEY'] = envApiKey;\n if (typeof envOauth === 'string' && envOauth.length > 0)\n env['CLAUDE_CODE_OAUTH_TOKEN'] = envOauth;\n if (Object.keys(env).length > 0) return { env, source: 'host-env' };\n\n const file = await readAuthFile(opts.authFilePath);\n if (file.claudeCodeOauthToken && file.claudeCodeOauthToken.length > 0) {\n return {\n env: { CLAUDE_CODE_OAUTH_TOKEN: file.claudeCodeOauthToken },\n source: 'auth-file',\n };\n }\n return { env: {}, source: 'none' };\n}\n\nexport async function readAuthFile(path: string = AUTH_FILE): Promise<AuthFile> {\n try {\n const raw = await readFile(path, 'utf8');\n const parsed = JSON.parse(raw) as unknown;\n if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {\n const t = (parsed as { claudeCodeOauthToken?: unknown }).claudeCodeOauthToken;\n return typeof t === 'string' && t.length > 0 ? { claudeCodeOauthToken: t } : {};\n }\n return {};\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === 'ENOENT') return {};\n // A garbage / corrupted file shouldn't kill `agentbox claude`. Treat as empty.\n return {};\n }\n}\n","/**\n * Binds claude's login spec to the docker surface it runs against: the\n * `docker run` argv, the post-exit credential check, and the post-success\n * warm-up. Beside the runtime that is its only caller — see\n * `lib/agent-login-bindings.ts` for why it is not in the shared lib.\n */\nimport { syncClaudeCredentials, volumeClaudeCredentials } from '@agentbox/sandbox-docker';\nimport {\n buildClaudeLoginRunArgv,\n SHARED_CLAUDE_VOLUME,\n warmUpClaudeCredentials,\n} from '../docker-sync.js';\nimport { withLoginDefaults, type AgentLoginBinding } from '@agentbox/cli-kit';\nimport { CLAUDE_LOGIN_SPEC } from './login.js';\n\nexport function claudeLoginBinding(o: {\n image: string;\n volume?: string;\n extraArgs?: string[];\n writeLog?: (line: string) => void;\n}): AgentLoginBinding {\n const volume = o.volume ?? SHARED_CLAUDE_VOLUME;\n const { image } = o;\n const extraArgs = withLoginDefaults(CLAUDE_LOGIN_SPEC, o.extraArgs ?? []);\n return {\n spec: CLAUDE_LOGIN_SPEC,\n dockerArgv: buildClaudeLoginRunArgv({ volume, image, extraArgs }),\n verify: async () => (await volumeClaudeCredentials(volume, image)).hasRefreshToken,\n // Absorb the fresh-token first-request 400 in a throwaway container before\n // any box uses these credentials, then mirror them to the host backup.\n finalize: async () => {\n const warm = await warmUpClaudeCredentials(volume, image, {\n onProgress: (l) => o.writeLog?.(l),\n });\n await syncClaudeCredentials({ volume }, { image, isolate: false });\n return { warmed: warm.warmed };\n },\n };\n}\n","/**\n * Claude Code's guided-login detector — see `../../lib/agent-login-specs.ts` for what\n * a detector is and why the flow is driven from the host.\n */\n\nimport {\n stripAnsi,\n trimUrl,\n URL_BODY,\n INVALID_CODE,\n type AgentLoginSpec,\n} from '@agentbox/cli-kit';\n\n// Match an OAuth approval URL on any current Claude/Anthropic auth host\n// (claude.com/cai/oauth/…, claude.ai, console.anthropic.com) and REQUIRE the\n// literal `oauth` in the path/query so an unrelated claude.com link can't match.\nconst CLAUDE_OAUTH_URL = new RegExp(\n `https?://(?:claude\\\\.com|claude\\\\.ai|console\\\\.anthropic\\\\.com)/${URL_BODY}*oauth${URL_BODY}*`,\n 'i',\n);\n\n/**\n * Pull the OAuth approval URL out of accumulated (possibly ANSI-styled) login\n * output. Claude's paste-code flow prints a `https://claude.com/cai/oauth/…`\n * (or claude.ai / console.anthropic.com) link.\n */\nexport function extractOAuthUrl(text: string): string | null {\n const m = stripAnsi(text).match(CLAUDE_OAUTH_URL);\n return m ? trimUrl(m[0]) : null;\n}\n\nexport const CLAUDE_LOGIN_SPEC: AgentLoginSpec = {\n agent: 'claude',\n // No method flags → the subscription paste-code flow (prints a URL, reads a code).\n defaultArgs: ['--claudeai'],\n detect(buf) {\n const url = extractOAuthUrl(buf);\n return url ? { kind: 'paste-code', url } : null;\n },\n invalidInputPattern: INVALID_CODE,\n};\n","/**\n * Claude's host-side credential check, for the pre-flight that runs before a\n * detached `-i` job. Beside the runtime that owns it — the shared queue helper\n * used to hold this and codex's and opencode's, dispatching between them with a\n * three-arm chain that a fourth agent fell through silently.\n */\nimport { hostBackupHasCredentials } from '@agentbox/sandbox-docker';\nimport { resolveClaudeAuth } from './auth.js';\nimport { resolveClaudeCredHealth, type ClaudeCredHealthOptions } from './cred-health.js';\n\n/**\n * True when Claude is already authenticated on the host: a forwarded env var\n * (`ANTHROPIC_API_KEY` / `CLAUDE_CODE_OAUTH_TOKEN`), the legacy\n * `~/.agentbox/auth.json` setup-token, or a real OAuth refresh token in the\n * host backup (`~/.agentbox/claude-credentials.json`). The backup is what the\n * foreground sync writes whenever a box's claude logs in, so its presence is\n * the load-bearing signal that the shared volume has been seeded.\n */\nexport async function claudeAuthAvailable(env: NodeJS.ProcessEnv): Promise<boolean> {\n const resolved = await resolveClaudeAuth(env);\n if (resolved.source !== 'none') return true;\n return hostBackupHasCredentials();\n}\n\n/**\n * Richer Claude credential verdict for the non-interactive paths. `'missing'`\n * when nothing can seed a box; `'expired'` when the saved login can no longer be\n * renewed AND we're on a cloud provider — cloud has no shared volume to fall\n * back to, whereas a docker box boots from the volume's live copy and refreshes\n * it in-box. A host-env token (`ANTHROPIC_API_KEY` / `CLAUDE_CODE_OAUTH_TOKEN`)\n * or legacy `auth.json` short-circuits to `'ok'`: it has no expiry concept here.\n * Mirrors the interactive `maybeRunCloudClaudeLogin` split, and shares its\n * verdict helper — so a merely-lapsed access token is renewed here too rather\n * than failing the job. This used to gate on `expiresAt` (the ~8h access token)\n * and so refused to submit perfectly good jobs every day.\n */\nexport async function claudeCredStatus(\n env: NodeJS.ProcessEnv,\n isCloud: boolean,\n image?: string,\n /** Forwarded to {@link resolveClaudeCredHealth}; see its `probes`. */\n probes?: ClaudeCredHealthOptions['probes'],\n): Promise<'ok' | 'missing' | 'expired'> {\n const resolved = await resolveClaudeAuth(env);\n if (resolved.source !== 'none') return 'ok';\n if (!isCloud) {\n const has = probes?.hostBackupHasCredentials ?? hostBackupHasCredentials;\n return (await has()) ? 'ok' : 'missing';\n }\n const health = await resolveClaudeCredHealth({\n image: image ?? '',\n // No image to probe with means no renewal; answer off the backup alone.\n ...(image === undefined ? { offlineOnly: true } : {}),\n ...(probes ? { probes } : {}),\n });\n if (health === 'missing') return 'missing';\n return health === 'dead' ? 'expired' : 'ok';\n}\n","/**\n * One verdict on the saved Claude login, shared by every gate that might ask\n * the user to sign in again.\n *\n * Why it exists: those gates used to read `claudeAiOauth.expiresAt`, which dates\n * the ~8h ACCESS token. On a cloud-only workflow nothing rewrites the host\n * backup between logins, so that field is in the past within a day of every\n * sign-in and stays there — a guaranteed daily \"your saved Claude login looks\n * expired\" on a login with weeks of life left. Worse, accepting the offer runs a\n * login container that refreshes and ROTATES the shared refresh token before the\n * user touches the browser; the write-back only ran on success, so a cancelled\n * sign-in left the host backup, the control box's backup and its custody copy\n * all holding a spent token. The false alarm made itself true.\n *\n * So: decide on refresh-token health, and when the access token has merely\n * lapsed, actually renew it (`renewClaudeCredential`) instead of guessing. That\n * both silences the nag and hands the next cloud box a fresh token, which is the\n * other half of why the credential kept dying between sessions.\n */\nimport { hostBackupHasCredentials, imageExists, variantImageRef } from '@agentbox/sandbox-docker';\nimport { hostClaudeAccessTokenExpired, hostClaudeLoginDead } from './host-cred-guards.js';\nimport { renewClaudeCredential, type RenewClaudeResult } from './credential-renew.js';\n\n/**\n * `ok` — usable (possibly after a silent renewal). `missing` — nothing saved to\n * seed a box with. `dead` — saved, but it can no longer be renewed, so only a\n * fresh sign-in helps.\n */\nexport type ClaudeCredHealth = 'ok' | 'missing' | 'dead';\n\nexport interface ClaudeCredHealthOptions {\n /** Box image the renewal probe runs in. */\n image: string;\n /** Progress lines from the renewal (it can take a few seconds). */\n onProgress?: (line: string) => void;\n /**\n * Skip the renewal probe and answer from the backup alone. The stale-access-\n * token case then answers `ok` — the refresh token is alive and the box can\n * renew it in-box, so there is nothing to warn about.\n */\n offlineOnly?: boolean;\n /**\n * The IO this verdict is built from, injectable.\n *\n * Every one of these reads a file or starts a container, so a caller that\n * wants to assert on the DECISION — which combination of \"saved?\", \"dead?\",\n * \"lapsed?\" and \"renewable?\" yields which verdict — otherwise has to reach\n * into another package's internals to do it. They used to be mockable by\n * accident, because they were imported across a package boundary; they are\n * this package's own now, so the seam is explicit instead.\n */\n probes?: Partial<CredHealthProbes>;\n}\n\n/** The four IO probes {@link resolveClaudeCredHealth} decides from. */\nexport interface CredHealthProbes {\n hostBackupHasCredentials(): Promise<boolean>;\n loginDead(): Promise<boolean>;\n accessTokenExpired(): Promise<boolean>;\n imageExists(image: string): Promise<boolean>;\n renew(opts: { image: string; onLog?: (msg: string) => void }): Promise<RenewClaudeResult>;\n}\n\nconst REAL_PROBES: CredHealthProbes = {\n hostBackupHasCredentials,\n loginDead: hostClaudeLoginDead,\n accessTokenExpired: hostClaudeAccessTokenExpired,\n imageExists,\n renew: renewClaudeCredential,\n};\n\nexport async function resolveClaudeCredHealth(\n opts: ClaudeCredHealthOptions,\n): Promise<ClaudeCredHealth> {\n const p: CredHealthProbes = { ...REAL_PROBES, ...opts.probes };\n if (!(await p.hostBackupHasCredentials())) return 'missing';\n if (await p.loginDead()) return 'dead';\n if (!(await p.accessTokenExpired())) return 'ok';\n\n // Stale access token, live refresh token. Renewing needs the image locally;\n // don't trigger an implicit pull just to answer a question, and never nag on\n // a host that simply can't run the probe — the refresh token is alive and the\n // box will renew it itself.\n //\n // THE PROBE RUNS `claude -p`, so it needs claude's DERIVED layer: the base\n // image has been agentless since one-agent-per-box, and callers hand us a\n // base ref (`box.image` / `DEFAULT_BOX_IMAGE`). Renewing in the base makes\n // every attempt fail, which reads as `dead` — nagging the user to sign in\n // again over a perfectly live credential. `variantImageRef` is pure, so the\n // `imageExists` gate keeps its meaning: no variant built locally, no probe.\n if (opts.offlineOnly === true) return 'ok';\n const probeImage = variantImageRef(opts.image, ['claude']);\n if (!(await p.imageExists(probeImage))) return 'ok';\n\n const renewed = await p.renew({\n image: probeImage,\n ...(opts.onProgress ? { onLog: opts.onProgress } : {}),\n });\n return renewed === 'failed' ? 'dead' : 'ok';\n}\n","/**\n * Actively renew claude's saved host login.\n *\n * Moved out of `sandbox-docker/src/credential-refresh.ts`. Living there meant it\n * had to reach claude's own warm-up through `requireAgentSyncModule('claude')` —\n * an inversion that existed only because the code was on the wrong side of the\n * boundary. Here it calls `warmUpClaudeCredentials` directly, and the registry\n * lookup is gone.\n *\n * The generic `dockerCredentialRefresh` stays in `sandbox-docker`: that one is\n * the provider-neutral refresher hook, not claude's behaviour.\n */\n\nimport { DEFAULT_BOX_IMAGE, syncClaudeCredentials } from '@agentbox/sandbox-docker';\nimport { resolveAgentSpec } from '@agentbox/sandbox-core';\nimport { warmUpClaudeCredentials } from '../docker-sync.js';\n\n/** Outcome of {@link renewClaudeCredential}. */\nexport type RenewClaudeResult = 'renewed' | 'unchanged' | 'failed';\n\n/**\n * Renew the saved claude login through the shared docker volume, and report\n * whether it still works.\n *\n * A credential's health is not readable off disk: `expiresAt` only dates the\n * ~8h access token, and a refresh token that was rotated away by another copy\n * looks perfectly valid until you try it. The only honest test is to use it —\n * so drive the same pair the successful-login path runs in its `finalize`:\n *\n * 1. `syncClaudeCredentials` — converge volume and backup on the newer blob,\n * so we renew from the freshest copy rather than whichever the volume holds.\n * 2. `warmUpClaudeCredentials` — a headless `claude -p` forces a real OAuth\n * refresh, minting a fresh access token into the volume.\n * 3. `syncClaudeCredentials` again — extract that fresh blob to the host backup\n * so the cloud seed (and every later box) gets a live credential.\n *\n * This is what keeps the fleet logged in without nagging: a lapsed access token\n * is renewed silently, and only a genuine failure — `'failed'` — is worth\n * asking the user to sign in again for.\n *\n * `attempts` is deliberately small (2 by default): the login path's 6 exist to\n * outwait the fresh-token first-request 400, but on the create path every extra\n * attempt costs the user 5s + a container start before we can say \"dead\".\n *\n * Best-effort: any docker failure resolves to `'failed'`, never throws.\n */\nexport async function renewClaudeCredential(opts: {\n image?: string;\n attempts?: number;\n onLog?: (msg: string) => void;\n}): Promise<RenewClaudeResult> {\n const log = opts.onLog ?? (() => {});\n const image = opts.image ?? DEFAULT_BOX_IMAGE;\n const volume = resolveAgentSpec('claude').dockerVolume;\n try {\n await syncClaudeCredentials({ volume }, { image, isolate: false });\n const warm = await warmUpClaudeCredentials(volume, image, {\n attempts: opts.attempts ?? 2,\n onProgress: (line: string) => {\n log(line);\n },\n });\n if (!warm.warmed) {\n log('claude: saved login did not renew — it may have been rotated away by another box');\n return 'failed';\n }\n const synced = await syncClaudeCredentials({ volume }, { image, isolate: false });\n return synced.direction === 'extracted' ? 'renewed' : 'unchanged';\n } catch {\n return 'failed';\n }\n}\n","/**\n * `agentbox claude login` — the one agent login that is a protocol rather than a\n * call.\n *\n * Three modes, picked by `selectLoginMode`:\n * - guided (a terminal): drive the login container under a pty, print the auth\n * URL, prompt for the code with our own clack prompt.\n * - headless (no TTY, or `--headless`): spawn a detached worker that HOLDS the\n * live `claude auth login`, print the URL, and return. A second invocation\n * with `--code <CODE>` finishes it. This is what makes login work from CI and\n * from an orchestrating agent.\n * - interactive: hand claude's own TUI the terminal (legacy passthrough).\n *\n * The other agents need none of this, which is why the factory's default login\n * body stays small and this replaces it wholesale via `runtime.loginCommand`.\n */\nimport { spawn } from 'node:child_process';\nimport { randomUUID } from 'node:crypto';\nimport { existsSync } from 'node:fs';\nimport { setTimeout as sleep } from 'node:timers/promises';\nimport { loadEffectiveConfig } from '@agentbox/config';\nimport { ensureImage } from '@agentbox/sandbox-docker';\nimport type { Command } from 'commander';\nimport type { AgentLoginHost } from '@agentbox/cli-kit';\nimport { intro, log, outro, spinner } from '@agentbox/cli-kit';\nimport {\n cleanupStaleSessions,\n findLiveSession,\n findPendingSession,\n readLoginState,\n selectLoginMode,\n writeLoginCode,\n writeLoginRequest,\n writeLoginState,\n type LoginState,\n} from './login-session.js';\nimport { imageProgress } from '@agentbox/cli-kit';\nimport { loadPtyBackend } from '@agentbox/cli-kit';\nimport { signInToClaude } from './runtime.js';\n\nfunction printAwaitingCode(st: LoginState): void {\n const url = st.url ?? '';\n log.info('To finish signing in, open this URL in a browser and approve access:');\n process.stdout.write(`\\n ${url}\\n\\n`);\n log.info('Then run: agentbox claude login --code <CODE>');\n // Stable, greppable marker so an orchestrating agent can grab the URL\n // deterministically regardless of how the prose above is worded.\n process.stdout.write(`AGENTBOX_LOGIN_URL=${url}\\n`);\n}\n\n/**\n * Headless login (non-TTY / `--headless`): spawn the detached worker that holds\n * the live `claude auth login`, wait for it to publish the auth URL, print it +\n * the `--code` follow-up, and return while the worker keeps waiting. A second\n * `agentbox claude login --code <CODE>` ({@link deliverLoginCode}) finishes it.\n */\nasync function startHeadlessLogin(args: string[]): Promise<void> {\n // node-pty drives the login; without the prebuild there is no headless path.\n if (!(await loadPtyBackend())) {\n log.error(\n 'Headless login needs the node-pty prebuild, which is not installed. Run `agentbox claude login` from an interactive terminal instead.',\n );\n process.exit(1);\n }\n cleanupStaleSessions();\n // Only one live session at a time. Match ANY non-terminal live session (incl.\n // a worker still in `starting`, before its URL is published) so a second\n // `--headless` can't slip through and spawn a duplicate worker.\n const existing = findLiveSession();\n if (existing) {\n if (existing.state.phase === 'awaiting-code' && existing.state.url) {\n log.info('A login is already pending; finish it (or wait for it to expire):');\n printAwaitingCode(existing.state);\n } else {\n log.info(\n 'A login is already in progress; wait for it to print its URL, then finish with `agentbox claude login --code <CODE>`.',\n );\n }\n return;\n }\n\n const cfg = await loadEffectiveConfig(process.cwd());\n const baseImage = cfg.effective.box.image;\n const s = spinner();\n s.start('preparing sandbox image');\n // The detached login worker RUNS claude, so record the claude-layer ref in\n // the request — the base image is agentless.\n const { ref: image } = await ensureImage(baseImage, {\n agents: ['claude'],\n onProgress: imageProgress(s),\n });\n s.stop('image ready');\n\n const id = randomUUID().slice(0, 8);\n writeLoginRequest(id, {\n image,\n extraArgs: args,\n cwd: process.cwd(),\n createdAt: new Date().toISOString(),\n });\n\n // This foreground process IS the CLI entry, so argv[1] is the right script to\n // re-exec for the worker; AGENTBOX_CLI_ENTRY wins if a wrapper set it.\n const entry = process.env.AGENTBOX_CLI_ENTRY ?? process.argv[1];\n if (!entry || !existsSync(entry)) {\n log.error('could not resolve the agentbox CLI entry to spawn the login worker');\n process.exit(1);\n }\n const child = spawn(process.execPath, [entry, '_claude-login-worker', id], {\n detached: true,\n stdio: 'ignore',\n env: process.env,\n });\n child.unref();\n // Publish a `starting` state with the worker pid immediately, so a concurrent\n // `--headless` sees a live session and won't spawn a second worker during the\n // window before the worker itself writes any state.\n if (typeof child.pid === 'number') {\n writeLoginState(id, { phase: 'starting', pid: child.pid, createdAt: new Date().toISOString() });\n }\n\n // Wait past the worker's own no-URL deadline (60s) so we observe its verdict\n // (awaiting-code or a published error) instead of giving up while it's still\n // working and missing the URL it later prints.\n const deadline = Date.now() + 65_000;\n for (;;) {\n const st = readLoginState(id);\n if (st?.phase === 'awaiting-code' && st.url) {\n printAwaitingCode(st);\n return;\n }\n if (st?.phase === 'error') {\n log.error(`login could not start: ${st.error ?? 'unknown error'}`);\n process.exit(1);\n }\n if (Date.now() > deadline) {\n log.error(\n `timed out waiting for the login URL — see ~/.agentbox/logs/claude-login-${id}.log`,\n );\n process.exit(1);\n }\n await sleep(400);\n }\n}\n\n/** Deliver an OAuth code to the pending headless login session and report the outcome. */\nasync function deliverLoginCode(code: string): Promise<void> {\n cleanupStaleSessions();\n const pending = findPendingSession();\n if (!pending) {\n log.error(\n 'No pending login is waiting for a code. Start one first with `agentbox claude login` (or --headless).',\n );\n process.exit(1);\n }\n const { id } = pending;\n const submittedAt = Date.now();\n writeLoginCode(id, code);\n\n const s = spinner();\n s.start('completing sign-in');\n const deadline = Date.now() + 120_000;\n for (;;) {\n const st = readLoginState(id);\n if (st?.phase === 'done') {\n s.stop(st.warmed ? 'credentials ready' : 'signed in (credential check incomplete)');\n outro('signed in — credentials saved for future boxes');\n return;\n }\n if (st?.phase === 'error') {\n s.stop('sign-in failed');\n log.error(st.error ?? 'login failed');\n process.exit(1);\n }\n // Worker reverted to awaiting-code after our submit → the code was rejected;\n // the session stays valid so a corrected `--code` can retry it.\n if (st?.phase === 'awaiting-code' && st.lastError && Date.parse(st.updatedAt) >= submittedAt) {\n s.stop('code rejected');\n log.error(\n `${st.lastError}. Run \\`agentbox claude login --code <CODE>\\` again with a fresh code.`,\n );\n process.exit(1);\n }\n if (Date.now() > deadline) {\n s.stop('sign-in timed out');\n log.error('timed out completing sign-in — see the login worker log under ~/.agentbox/logs/');\n process.exit(1);\n }\n await sleep(500);\n }\n}\n\n/** Declared BEFORE the factory's `--interactive`, which is the order help prints. */\nexport function addClaudeLoginOptions(cmd: Command): void {\n cmd\n .option(\n '--headless',\n 'drive login without a terminal: print the auth URL, then finish with `--code` (auto-selected when stdin is not a TTY)',\n )\n .option('--code <code>', 'deliver the OAuth code to a pending headless login session');\n}\n\nexport async function runClaudeLoginCommand(\n args: string[],\n rawOpts: Record<string, unknown>,\n host: AgentLoginHost,\n): Promise<void> {\n const opts = rawOpts as { headless?: boolean; code?: string; interactive?: boolean };\n const mode = selectLoginMode({\n isTTY: !!process.stdin.isTTY,\n headless: !!opts.headless,\n code: typeof opts.code === 'string',\n interactive: !!opts.interactive,\n ptyAvailable: !!(await loadPtyBackend()),\n });\n try {\n if (mode === 'code') {\n await deliverLoginCode(opts.code as string);\n return;\n }\n if (mode === 'headless') {\n await startHeadlessLogin(args);\n return;\n }\n intro('Signing in to Claude...');\n const cfg = await loadEffectiveConfig(process.cwd());\n const baseImage = cfg.effective.box.image;\n\n const s = spinner();\n s.start('preparing sandbox image');\n // The throwaway login container RUNS claude; the base image is agentless.\n const { ref: image } = await ensureImage(baseImage, {\n agents: ['claude'],\n onProgress: imageProgress(s),\n });\n s.stop('image ready');\n\n // Throwaway `docker run` against the shared volume — the written credentials\n // persist there and `syncClaudeCredentials` mirrors them to the host backup,\n // so every later box (shared or isolate) is seeded.\n const res = await signInToClaude(image, args, { passthrough: mode === 'interactive' });\n if (res.cancelled) {\n outro('sign-in cancelled');\n process.exit(1);\n }\n if (!res.ok) {\n log.error(res.error ?? 'login failed');\n // A login method whose output we can't recognize (an exotic `-- --sso`\n // shape) never reaches a prompt; the passthrough still drives it.\n if (res.error?.includes('never printed an auth URL')) {\n log.info(\"Try `agentbox claude login --interactive` to use claude's own login TUI.\");\n }\n process.exit(1);\n }\n outro('signed in — credentials saved for future boxes');\n // A fresh login is exactly when the control box's copy goes stale — push the\n // refreshed backup to custody (best-effort, silent, no-op without a control\n // box or when the hash is unchanged).\n await host.syncCredentialsIfChanged();\n } catch (err) {\n host.fail(err);\n }\n}\n","/**\n * State + IPC for the headless (`--headless` / non-TTY) `agentbox claude login`\n * flow. The login is a PKCE OAuth flow, so the process that prints the auth URL\n * must be the same one that exchanges the pasted code — it can't be split across\n * two independent CLI invocations. So a detached worker holds the live login\n * process while two short foreground calls coordinate with it through files\n * under `~/.agentbox/claude-login/<id>/`:\n *\n * request.json start → worker { image, extraArgs, cwd, createdAt }\n * state.json worker → polls { phase, url?, pid, ... } (atomically replaced)\n * code --code → worker the pasted OAuth code (atomically created)\n *\n * All writers write a temp file then `rename` over the target (atomic on the\n * same filesystem); readers tolerate a transient ENOENT mid-rename.\n */\nimport {\n mkdirSync,\n readdirSync,\n readFileSync,\n renameSync,\n rmSync,\n unlinkSync,\n writeFileSync,\n} from 'node:fs';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\n\nexport type LoginPhase = 'starting' | 'awaiting-code' | 'exchanging' | 'done' | 'error';\n\nexport interface LoginState {\n phase: LoginPhase;\n /** OAuth URL the user must approve; present from `awaiting-code` onward. */\n url?: string;\n /** Worker pid — readers use it to tell a live session from a crashed one. */\n pid: number;\n createdAt: string;\n updatedAt: string;\n /** Warm-up result (the sacrificial first-request absorb), set on `done`. */\n warmed?: boolean;\n /** A recoverable problem (e.g. a rejected code) — session stays usable. */\n lastError?: string;\n /** A terminal failure reason, set with phase `error`. */\n error?: string;\n /** Login process exit code, when it exited. */\n exitCode?: number;\n}\n\nexport interface LoginRequest {\n image: string;\n extraArgs: string[];\n cwd: string;\n createdAt: string;\n}\n\nexport type LoginMode = 'code' | 'headless' | 'guided' | 'interactive';\n\n/**\n * Pick the login flavor from the invocation shape. `--code` always means\n * \"deliver a code to a pending session\". Anything non-interactive (orchestrator\n * pipe, CI) or an explicit `--headless` gets the two-call worker flow.\n *\n * A real TTY gets `guided`: we drive the login container under a pty and prompt\n * for the code ourselves. The `interactive` passthrough — which hands the\n * terminal to claude's own TUI, and breaks on terminals whose keyboard protocol\n * that TUI mishandles (kitty's CSI-u) — is now opt-in via `--interactive`, and\n * the automatic fallback when the optional node-pty prebuild is missing.\n */\nexport function selectLoginMode(o: {\n isTTY: boolean;\n headless: boolean;\n code: boolean;\n interactive: boolean;\n ptyAvailable: boolean;\n}): LoginMode {\n if (o.code) return 'code';\n if (o.headless || !o.isTTY) return 'headless';\n if (o.interactive || !o.ptyAvailable) return 'interactive';\n return 'guided';\n}\n\n/** `~/.agentbox` honoring `AGENTBOX_HOME` (mirrors lib/log-file.ts). */\nfunction stateDir(): string {\n return process.env.AGENTBOX_HOME ?? join(homedir(), '.agentbox');\n}\nexport function loginRootDir(): string {\n return join(stateDir(), 'claude-login');\n}\nexport function loginSessionDir(id: string): string {\n return join(loginRootDir(), id);\n}\n\nfunction atomicWrite(path: string, data: string): void {\n const tmp = `${path}.tmp.${String(process.pid)}.${String(Date.now())}`;\n writeFileSync(tmp, data, { mode: 0o600 });\n renameSync(tmp, path);\n}\n\nfunction readJsonWithRetry<T>(path: string): T | null {\n for (let attempt = 0; attempt < 2; attempt++) {\n try {\n return JSON.parse(readFileSync(path, 'utf8')) as T;\n } catch {\n // A read that races a rename can see ENOENT or a partial file; retry once.\n }\n }\n return null;\n}\n\nexport function writeLoginRequest(id: string, req: LoginRequest): void {\n mkdirSync(loginSessionDir(id), { recursive: true });\n atomicWrite(join(loginSessionDir(id), 'request.json'), JSON.stringify(req));\n}\nexport function readLoginRequest(id: string): LoginRequest | null {\n return readJsonWithRetry<LoginRequest>(join(loginSessionDir(id), 'request.json'));\n}\n\nexport function writeLoginState(id: string, state: Omit<LoginState, 'updatedAt'>): void {\n mkdirSync(loginSessionDir(id), { recursive: true });\n const full: LoginState = { ...state, updatedAt: new Date().toISOString() };\n atomicWrite(join(loginSessionDir(id), 'state.json'), JSON.stringify(full));\n}\nexport function readLoginState(id: string): LoginState | null {\n return readJsonWithRetry<LoginState>(join(loginSessionDir(id), 'state.json'));\n}\n\nexport function writeLoginCode(id: string, code: string): void {\n mkdirSync(loginSessionDir(id), { recursive: true });\n atomicWrite(join(loginSessionDir(id), 'code'), code.trim());\n}\n/** Read and consume the pasted code (deleting it so a retry can deliver a new one). */\nexport function takeLoginCode(id: string): string | null {\n const path = join(loginSessionDir(id), 'code');\n try {\n const code = readFileSync(path, 'utf8').trim();\n try {\n unlinkSync(path);\n } catch {\n /* already gone */\n }\n return code.length > 0 ? code : null;\n } catch {\n return null;\n }\n}\n\nexport function pidAlive(pid: number): boolean {\n if (!Number.isInteger(pid) || pid <= 0) return false;\n try {\n process.kill(pid, 0);\n return true;\n } catch (err) {\n // EPERM means the process exists but we can't signal it — still alive.\n return (err as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\nexport function listSessions(): string[] {\n try {\n return readdirSync(loginRootDir(), { withFileTypes: true })\n .filter((e) => e.isDirectory())\n .map((e) => e.name);\n } catch {\n return [];\n }\n}\n\n/**\n * The single live session still waiting for a code (worker process alive). The\n * normal flow only ever has one; if a future caller starts several, the first\n * live one wins and the caller can disambiguate with `--session`.\n */\nexport function findPendingSession(): { id: string; state: LoginState } | null {\n for (const id of listSessions()) {\n const state = readLoginState(id);\n if (state && state.phase === 'awaiting-code' && pidAlive(state.pid)) {\n return { id, state };\n }\n }\n return null;\n}\n\n/**\n * Any live (worker-alive) session in a non-terminal phase — including `starting`\n * (URL not published yet) and `exchanging`. The start guard uses THIS, not\n * {@link findPendingSession}: blocking only on `awaiting-code` would let a second\n * `--headless` slip through during the brief `starting` window and spawn a\n * duplicate worker, breaking the single-session PKCE assumption.\n */\nexport function findLiveSession(): { id: string; state: LoginState } | null {\n for (const id of listSessions()) {\n const state = readLoginState(id);\n if (state && state.phase !== 'done' && state.phase !== 'error' && pidAlive(state.pid)) {\n return { id, state };\n }\n }\n return null;\n}\n\n/**\n * Reap finished/dead/old session dirs. Removed when: the worker pid is dead and\n * the phase isn't terminal (crash), the phase is terminal and older than 5 min,\n * or the state is missing/older than 15 min (stuck/abandoned).\n */\nexport function cleanupStaleSessions(now: number = Date.now()): void {\n const TERMINAL_MAX_AGE = 5 * 60_000;\n const STUCK_MAX_AGE = 15 * 60_000;\n for (const id of listSessions()) {\n const dir = loginSessionDir(id);\n const state = readLoginState(id);\n let stale = false;\n if (!state) {\n stale = true;\n } else {\n const age = now - Date.parse(state.updatedAt);\n const terminal = state.phase === 'done' || state.phase === 'error';\n if (terminal) {\n stale = age > TERMINAL_MAX_AGE;\n } else if (!pidAlive(state.pid)) {\n stale = true;\n } else {\n stale = age > STUCK_MAX_AGE;\n }\n }\n if (stale) {\n try {\n rmSync(dir, { recursive: true, force: true });\n } catch {\n /* best-effort */\n }\n }\n }\n}\n\n// The URL extractor now lives with the other per-agent prompt detectors; keep\n// re-exporting it here, where the headless flow's callers already look for it.\nexport { extractOAuthUrl } from './login.js';\n","/**\n * `agentbox claude` — the DESCRIPTOR.\n *\n * Claude is the agent the factory's hook set exists for: the `--plan` pre-flight\n * beside session teleport, the first-run setup wizard, the plugin-native-deps\n * rebuild on create and on start, and the clipboard paste handlers on attach.\n *\n * This file used to live in `apps/cli/src/agents/claude/` — not because claude\n * is special, but because its hooks called UP into the app (`runPrepare`, the\n * wizard, `providerForBox`, the paste helpers). An agent package sits below\n * `apps/cli`, so importing them directly would have closed a cycle.\n *\n * They arrive through `ctx.host` / the `clipboard` argument now, so the\n * descriptor sits with the other three and the app keeps only the pipeline.\n */\nimport type { AgentCliSpec } from '@agentbox/cli-kit';\nimport { log, TeleportError } from '@agentbox/cli-kit';\nimport { resolveAgentLauncher } from '@agentbox/core';\nimport { resolveAgentSpec } from '@agentbox/sandbox-core';\nimport { syncClaudeCredentials } from '@agentbox/sandbox-docker';\nimport type { Command } from 'commander';\nimport { rebuildPluginNativeDeps, SHARED_CLAUDE_VOLUME } from '../docker-sync.js';\nimport { claudeRuntime } from './runtime.js';\nimport { BOX_CLAUDE_PLANS_DIR } from './projects-dir.js';\n\nconst spec = resolveAgentSpec('claude');\n\n/**\n * What the plugin-native-deps rebuild has to say, as callbacks the caller runs\n * after the spinner stops: how much the prune reclaimed, and any plugin whose\n * install failed.\n */\nfunction pruneOutput(rebuild: {\n pruned: string[];\n prunedBytes: number;\n failed: { dir: string; stderr: string }[];\n}): (() => void)[] {\n const out: (() => void)[] = [];\n if (rebuild.prunedBytes > 0) {\n const mb = Math.round(rebuild.prunedBytes / 1024 / 1024);\n const n = rebuild.pruned.length;\n out.push(() =>\n log.info(\n `pruned ${String(n)} stale plugin cache${n === 1 ? '' : 's'} (${String(mb)} MB freed)`,\n ),\n );\n }\n for (const f of rebuild.failed) {\n out.push(() =>\n log.warn(\n `plugin install failed for ${f.dir}; claude may still load it. stderr:\\n${f.stderr.trim()}`,\n ),\n );\n }\n return out;\n}\n\n/** The `--plan` seed, so `beforeCreate` can build its \"resume the plan\" turn. */\nconst PLAN_SEED = 'plan';\n\nexport const claudeCliSpec: Omit<AgentCliSpec, 'attachWrapped'> = {\n id: 'claude',\n spec,\n productName: 'Claude Code',\n shortName: 'Claude',\n runtime: claudeRuntime,\n acceptsSeedPrompt: true,\n // Ahead of the setup wizard, which can spend minutes re-baking a stale base:\n // ask the user to sign in before, not after.\n signInOfferTiming: 'before-gates',\n text: {\n description: 'Create a sandboxed box and launch Claude Code in a detachable tmux session',\n isolateVolumeLabel: '~/.claude',\n syncConfigLabel: '~/.claude',\n argsExample: '--model sonnet',\n resumeIdWord: 'id',\n verboseExtra: ' (docker build / Daytona snapshot create)',\n initialPromptExtra:\n \" NOTE: this is NOT claude's own `-p` headless print mode — for that, pass `-- -p ...`.\",\n continueHelp:\n 'teleport the most recent host Claude Code session for this cwd into the box and resume from it',\n resumeHelp:\n 'teleport the specified host Claude Code session id into the box and resume from it',\n startContinueHelp:\n 'teleport the most recent host Claude Code session for this cwd into the box and resume',\n startResumeHelp: 'teleport the specified host Claude Code session id into the box and resume',\n attachDescription:\n 'Attach to a Claude Code tmux session in a box, starting one if none is running (auto-unpause/start; never re-syncs ~/.claude — use `claude start` for that)',\n startDescription:\n 'Start a Claude Code tmux session in an already-existing box (auto-unpause/start). If a session is already running, just attach.',\n loginDescription:\n 'Sign in to Claude for use in sandboxes (forwards args to `claude auth login`, e.g. --sso, --console). Runs in a throwaway container against the shared claude-config volume — usable before the first `agentbox claude`. In a terminal it prints the auth URL and prompts for the code. Non-interactive (no TTY) or `--headless`: prints the auth URL, then finish with `--code <CODE>`.',\n loginArgsHelp:\n 'extra args forwarded to `claude auth login`; place after `--`, e.g. `agentbox claude login -- --sso`',\n loginInteractiveHelp:\n \"attach your terminal to claude's own login TUI (legacy passthrough; try this if the guided prompt can't drive your login method)\",\n resumeWithPromptError:\n '-i / --initial-prompt cannot be combined with -c / --resume (seeding a new turn into a resumed session is not supported).',\n hubIncompatibleReason:\n '--via-hub is ignored for --resume / --plan runs (they teleport host state at create time); building this box locally.',\n resumeIntoRunningError: (boxName) =>\n `cannot resume into ${boxName}: a Claude session is already running. Detach and kill the session first (Control+a then :kill-session), or use \\`agentbox claude attach\\` to reattach to the live one.`,\n },\n hooks: {\n /**\n * `--plan`: copy a host plan file into the box, start in plan mode and seed\n * a \"resume the plan\" turn. The `-c` / `--resume` half is shared — `base` is\n * what the body already resolved — so this only adds claude's own payload.\n */\n async preflight(ctx, base) {\n const opts = ctx.opts as { initialPrompt?: string; plan?: string };\n if (!opts.plan) return base;\n // --plan seeds an interactive \"resume the plan\" turn, which is\n // incompatible with -i's background-queue mode (the same reason resume +\n // -i is rejected).\n if (opts.initialPrompt && opts.initialPrompt.length > 0) {\n ctx.fail(\n '--plan cannot be combined with -i / --initial-prompt (--plan already seeds an interactive \"resume the plan\" turn).',\n );\n }\n try {\n // forwardArgs is empty: the plan drives the prompt + permission-mode\n // through `argsTransform` below, not through resume flags.\n const resolved = await ctx.host.resolvePlanFile({\n path: opts.plan,\n hostCwd: ctx.workspace,\n log: ctx.writeLog,\n boxParentDir: BOX_CLAUDE_PLANS_DIR,\n });\n return {\n ...base,\n seeds: [\n ...base.seeds,\n {\n label: 'uploading plan into box',\n tag: PLAN_SEED,\n resolved,\n forwardArgs: [],\n ownsFirstTurn: true,\n },\n ],\n hubIncompatible: true,\n };\n } catch (err) {\n if (err instanceof TeleportError) ctx.fail(err.message);\n throw err;\n }\n },\n\n /**\n * First-run wizard: with no agentbox.yaml, offer to inject an initial user\n * message so claude reads /agentbox-setup and writes one. It can also\n * re-bake a stale base and discard a dead default checkpoint.\n */\n async beforeCreate(ctx) {\n const opts = ctx.opts as { workspace: string; yes?: boolean; snapshot?: string };\n const planSessionId = ctx.preflight.seeds.find((x) => x.tag === PLAN_SEED)?.resolved\n .sessionId;\n // Grading the base, re-baking a stale one and routing all live behind the\n // seam (`AgentHostServices.setupWizard`) — none of it was claude behavior.\n const wiz = await ctx.host.setupWizard({\n checkpointFromDefault: !(opts.snapshot && opts.snapshot.length > 0),\n });\n return {\n // The wizard may discard a stale/dead default checkpoint: boot from the\n // current base instead of a dead artifact. An explicit `--snapshot` is\n // never discarded.\n ...(wiz.discardCheckpoint ? { checkpointRef: undefined } : {}),\n ...(wiz.envFilesToImport ? { envFilesToImport: wiz.envFilesToImport } : {}),\n seedsFirstTurn:\n Boolean(planSessionId) ||\n (wiz.action === 'launch-with-prompt' && Boolean(wiz.initialPrompt)),\n argsTransform: (args) => {\n // --plan: enter plan mode and seed a \"resume the plan\" turn. Adding\n // --permission-mode BEFORE the skip-permissions injection makes the latter\n // treat it as a conflict and skip --dangerously-skip-permissions —\n // plan mode wins.\n if (planSessionId) {\n let out = args;\n const hasPermissionMode = out.some(\n (x) => x === '--permission-mode' || x.startsWith('--permission-mode='),\n );\n if (!hasPermissionMode) out = [...out, '--permission-mode', 'plan'];\n return resolveAgentLauncher('claude-code').buildArgs(\n `Resume the plan at ~/.claude/plans/${planSessionId}`,\n out,\n );\n }\n if (wiz.action === 'launch-with-prompt' && wiz.initialPrompt) {\n return resolveAgentLauncher('claude-code').buildArgs(wiz.initialPrompt, args);\n }\n return args;\n },\n };\n },\n\n /**\n * Plugin native deps: the sync excludes `node_modules` (host darwin binaries\n * don't run on linux/amd64). The first claude session in a fresh box pays the\n * npm-install cost for each plugin that ships a package.json; later attaches\n * see node_modules already present and exit immediately.\n */\n async afterCreate(box, ctx) {\n ctx.message('checking plugin native deps');\n const rebuild = await rebuildPluginNativeDeps(box.container, {\n volume: box.claudeConfigVolume ?? SHARED_CLAUDE_VOLUME,\n onProgress: (line) => ctx.message(line),\n });\n return { deferred: [...pruneOutput(rebuild), () => ctx.host.showInstallHint()] };\n },\n\n async afterVolumeSync(box, { volume }) {\n // The /agentbox-setup skill is seeded by the shared body from\n // `spec.seeds` — what stays here is real behavior, not file placement.\n // Mirror the in-box OAuth credentials with the host backup. Runs regardless\n // of --no-sync-config (this is not the host ~/.claude rsync) — it keeps the\n // backup fresh as the in-box claude rotates its token, and seeds an isolate\n // box's volume from an up-front sign-in.\n await syncClaudeCredentials(\n { volume },\n { image: box.image, isolate: volume !== SHARED_CLAUDE_VOLUME },\n );\n },\n\n async afterConfigSync(box, { volume, message }) {\n // Idempotent — gated by a per-plugin marker, so a no-op on later starts\n // unless a new plugin was synced just now. Runs in the container after a\n // staged config was mirrored in; `volume` (only when mounted) enables the\n // host-side prescan.\n message('checking plugin native deps');\n const rebuild = await rebuildPluginNativeDeps(box.container, {\n volume,\n onProgress: (line) => message(line),\n });\n return { deferred: pruneOutput(rebuild) };\n },\n\n /**\n * Only wire Ctrl+V paste when this host can actually capture a clipboard\n * image (macOS, or a Linux desktop with xclip/wl-paste). Elsewhere Ctrl+V\n * forwards verbatim instead of being intercepted for a guaranteed-empty paste.\n */\n async attachExtras(box, clipboard) {\n if (!(await clipboard.available())) return {};\n return {\n onPasteImage: () => clipboard.pasteImage(box),\n onPasteImageFile: (p: string) => clipboard.pasteImageFile(box, p),\n };\n },\n\n extendCommand(cmd: Command) {\n cmd.option(\n '--plan <path>',\n 'copy a Claude Code plan file (e.g. ~/.claude/plans/<slug>.md) into the box, launch claude with --permission-mode plan, and seed a \"resume the plan\" prompt',\n );\n },\n },\n};\n","/**\n * Claude Code encodes the working-directory absolute path into the\n * `~/.claude/projects/<encoded>/` directory name by replacing every\n * non-alphanumeric character with `-`. E.g. `/Users/marco/Projects/foo` →\n * `-Users-marco-Projects-foo`; `/Users/marco/.agents/skills` →\n * `-Users-marco--agents-skills` (the dot AND the slash both become `-`).\n *\n * Lived in `@agentbox/cli-kit`, the shared CLI kit — but this is Claude Code's\n * own on-disk scheme and claude's session teleport is its only consumer.\n * `sandbox-core` keeps its own copy of the same rule (`encodeClaudeProjectsKey`)\n * because it sits below the agent packages and cannot import one.\n */\nexport function encodeClaudeProjectsDir(absPath: string): string {\n return absPath.replace(/[^a-zA-Z0-9]/g, '-');\n}\n\n/** Encoded form of `/workspace` — the in-box project key for any AgentBox sandbox. */\nexport const BOX_WORKSPACE_ENCODED = encodeClaudeProjectsDir('/workspace');\n\n/**\n * In-box `~/.claude/plans/` directory (vscode user home).\n *\n * `agentbox claude --plan` uploads a host plan file here. It lived in\n * `apps/cli/src/session-teleport/plan.ts`, which is otherwise generic teleport\n * plumbing — the DESTINATION is claude's, so it sits with claude.\n */\nexport const BOX_CLAUDE_PLANS_DIR = '/home/vscode/.claude/plans';\n","import { defineAgentModule, type AgentModule } from '@agentbox/cli-kit';\nimport { CLAUDE_LOGIN_SPEC } from './login.js';\nimport { claudeRuntime } from './runtime.js';\nimport { resolveClaudeTeleport } from './teleport.js';\n\nexport const agentModule: AgentModule = defineAgentModule('claude', {\n login: CLAUDE_LOGIN_SPEC,\n runtime: claudeRuntime,\n teleport: resolveClaudeTeleport,\n});\n","/**\n * Claude Code session teleport. Finds a host session JSONL under\n * `~/.claude/projects/<encoded host cwd>/<id>.jsonl`, rewrites each line's\n * top-level `cwd` field to `/workspace`, and writes the result to a host tmp\n * file ready for upload into the box's `/home/vscode/.claude/projects/-workspace/`.\n *\n * Claude session files are line-delimited JSON. We parse each line, swap\n * `cwd` if present, and re-serialize. Lines that don't parse cleanly are\n * forwarded verbatim — the file may contain forward-compatible variants we\n * don't recognize and shouldn't drop.\n */\n\nimport { mkdir, mkdtemp, readdir, readFile, stat, writeFile } from 'node:fs/promises';\nimport { existsSync } from 'node:fs';\nimport { homedir, tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { BOX_WORKSPACE } from '@agentbox/cli-kit';\nimport {\n TeleportError,\n type ResolvedTeleport,\n type ResumeMode,\n type TeleportLogger,\n} from '@agentbox/cli-kit';\nimport { BOX_WORKSPACE_ENCODED, encodeClaudeProjectsDir } from './projects-dir.js';\n\n/** In-box `~/.claude/projects/-workspace/` directory. */\nexport const BOX_CLAUDE_PROJECTS_DIR = `/home/vscode/.claude/projects/${BOX_WORKSPACE_ENCODED}`;\n\ninterface ClaudeResolveOptions {\n hostCwd: string;\n mode: ResumeMode;\n /** Override for tests. */\n hostHome?: string;\n log?: TeleportLogger;\n}\n\nexport async function resolveClaudeTeleport(opts: ClaudeResolveOptions): Promise<ResolvedTeleport> {\n const hostHome = opts.hostHome ?? homedir();\n const projectDir = join(hostHome, '.claude', 'projects', encodeClaudeProjectsDir(opts.hostCwd));\n\n if (!existsSync(projectDir)) {\n throw new TeleportError(\n `no Claude session history found on the host for ${opts.hostCwd} (expected at ${projectDir}). Run \\`claude\\` here at least once before using -c / --resume.`,\n );\n }\n\n const sessionPath = await pickSessionFile(projectDir, opts.mode);\n const sessionId =\n sessionPath\n .replace(/\\.jsonl$/u, '')\n .split('/')\n .pop() ?? '';\n\n // Stage the rewritten copy in a host tmp dir. The caller will upload from\n // here via `provider.uploadPath`.\n const stage = await mkdtemp(join(tmpdir(), 'agentbox-teleport-claude-'));\n const stagedFile = join(stage, `${sessionId}.jsonl`);\n await rewriteSessionFile(sessionPath, stagedFile, opts.hostCwd);\n opts.log?.(`teleport: claude session ${sessionId} staged for upload`);\n\n return {\n agent: 'claude',\n sessionId,\n hostFile: stagedFile,\n boxPath: `${BOX_CLAUDE_PROJECTS_DIR}/${sessionId}.jsonl`,\n boxParentDir: BOX_CLAUDE_PROJECTS_DIR,\n forwardArgs: ['--resume', sessionId],\n };\n}\n\nasync function pickSessionFile(projectDir: string, mode: ResumeMode): Promise<string> {\n if (mode.kind === 'resume') {\n const target = join(projectDir, `${mode.id}.jsonl`);\n if (!existsSync(target)) {\n throw new TeleportError(\n `Claude session \"${mode.id}\" not found in ${projectDir}. List available sessions with: ls \"${projectDir}\"`,\n );\n }\n return target;\n }\n const entries = await readdir(projectDir);\n const jsonl = entries.filter((e) => e.endsWith('.jsonl'));\n if (jsonl.length === 0) {\n throw new TeleportError(\n `no Claude sessions found in ${projectDir} — nothing to continue. Run \\`claude\\` here once first.`,\n );\n }\n const stats = await Promise.all(\n jsonl.map(async (name) => {\n const full = join(projectDir, name);\n const s = await stat(full);\n return { full, mtimeMs: s.mtimeMs };\n }),\n );\n stats.sort((a, b) => b.mtimeMs - a.mtimeMs);\n return stats[0]!.full;\n}\n\nasync function rewriteSessionFile(src: string, dst: string, hostCwd: string): Promise<void> {\n const raw = await readFile(src, 'utf8');\n // Preserve original line endings — split on \\n keeps a trailing empty entry\n // when the file ends with \\n; we restore that on join.\n const lines = raw.split('\\n');\n const out: string[] = [];\n for (const line of lines) {\n if (line.length === 0) {\n out.push(line);\n continue;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(line);\n } catch {\n out.push(line);\n continue;\n }\n if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {\n const obj = parsed as Record<string, unknown>;\n if (obj.cwd === hostCwd) {\n obj.cwd = BOX_WORKSPACE;\n out.push(JSON.stringify(obj));\n continue;\n }\n }\n out.push(line);\n }\n await mkdir(join(dst, '..'), { recursive: true });\n await writeFile(dst, out.join('\\n'), 'utf8');\n}\n","/**\n * Claude's binding of the agent-agnostic login core ({@link runAgentLogin}):\n * drive `claude auth login` in a throwaway docker container under a node-pty,\n * mirror its output verbatim, publish the OAuth URL it prints, feed back the\n * pasted approval code, and on success run the warm-up + host-backup sync.\n *\n * Three callers share this loop with different transports:\n * - `commands/claude.ts` guided mode (the TTY default) prompts with clack.\n * - `_claude-login-worker.ts` (`--headless`) uses file-backed state\n * (`state.json` / `code`).\n * - the create-job worker (`_run-queued-job.ts`) uses the queue manifest's\n * `login` sub-state so the hub API/UI can surface it.\n */\nimport { syncClaudeCredentials, volumeClaudeCredentials } from '@agentbox/sandbox-docker';\nimport {\n buildClaudeLoginRunArgv,\n SHARED_CLAUDE_VOLUME,\n warmUpClaudeCredentials,\n} from '../docker-sync.js';\nimport { runAgentLogin, type AgentLoginPhase } from '@agentbox/cli-kit';\nimport { CLAUDE_LOGIN_SPEC } from './login.js';\nimport type { LoginPhase } from './login-session.js';\n\nexport interface LoginPhaseUpdate {\n url?: string;\n error?: string;\n lastError?: string;\n warmed?: boolean;\n exitCode?: number;\n}\n\nexport interface RunClaudeLoginOptions {\n image: string;\n /** Shared claude credential volume the login writes into. */\n volume?: string;\n /** Login-method args forwarded to `claude auth login` (default `['--claudeai']`). */\n extraArgs?: string[];\n /** Verbatim mirror of the container's pty stream (do NOT reformat). */\n writeRaw: (chunk: string) => void;\n /** Optional annotated log line (progress notes, not the raw stream). */\n writeLog?: (line: string) => void;\n /** Publish a phase transition (url on `awaiting-code`, error/warmed on terminal). */\n onPhase: (phase: LoginPhase, update?: LoginPhaseUpdate) => void;\n /** Poll+consume a pasted approval code (return null when none is pending). */\n getCode: () => string | null | undefined;\n /** Abort the login (e.g. on SIGTERM); resolves with an error result. */\n signal?: AbortSignal;\n urlTimeoutMs?: number;\n codeTimeoutMs?: number;\n}\n\nexport interface RunClaudeLoginResult {\n ok: boolean;\n error?: string;\n warmed?: boolean;\n exitCode?: number;\n}\n\n/**\n * The claude spec is `paste-code` only, so the core's `awaiting-approval` phase\n * is unreachable here and `LoginPhase` (which has no such member) stays exact.\n */\nfunction asLoginPhase(phase: AgentLoginPhase): LoginPhase {\n return phase === 'awaiting-approval' ? 'awaiting-code' : phase;\n}\n\n/**\n * Run one `claude auth login` to completion. Resolves when the login process\n * exits or a timeout/abort fires; `onPhase` is called for every transition\n * (`starting`→`awaiting-code`→`exchanging`→`done`/`error`) so the caller can\n * mirror state to its own transport.\n */\nexport async function runClaudeLogin(opts: RunClaudeLoginOptions): Promise<RunClaudeLoginResult> {\n const volume = opts.volume ?? SHARED_CLAUDE_VOLUME;\n const extraArgs =\n opts.extraArgs && opts.extraArgs.length > 0 ? opts.extraArgs : CLAUDE_LOGIN_SPEC.defaultArgs;\n const { image } = opts;\n\n const { ok, error, warmed, exitCode } = await runAgentLogin({\n spec: CLAUDE_LOGIN_SPEC,\n dockerArgv: buildClaudeLoginRunArgv({ volume, image, extraArgs }),\n writeRaw: opts.writeRaw,\n writeLog: opts.writeLog,\n onPhase: (phase, update) => {\n const { url, error: err, lastError, warmed: w, exitCode: code } = update ?? {};\n opts.onPhase(asLoginPhase(phase), { url, error: err, lastError, warmed: w, exitCode: code });\n },\n getInput: opts.getCode,\n verify: async () => (await volumeClaudeCredentials(volume, image)).hasRefreshToken,\n // Absorb the fresh-token first-request 400 before any box uses these\n // credentials, then mirror them to the host backup.\n finalize: async () => {\n const warm = await warmUpClaudeCredentials(volume, image, {\n onProgress: (l) => opts.writeLog?.(l),\n });\n await syncClaudeCredentials({ volume }, { image, isolate: false });\n return { warmed: warm.warmed };\n },\n signal: opts.signal,\n urlTimeoutMs: opts.urlTimeoutMs,\n inputTimeoutMs: opts.codeTimeoutMs,\n });\n\n return { ok, error, warmed, exitCode };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,SAAS,gBAAgB;AACzB,SAAS,YAAY;AMerB,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,cAAc,aAAa;ACJpC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;OACK;AACP,SAAS,eAAe;AACxB,SAAS,QAAAA,aAAY;AIbrB,SAAS,OAAO,SAAS,SAAS,YAAAC,WAAU,MAAM,iBAAiB;AACnE,SAAS,cAAAC,mBAAkB;AAC3B,SAAS,WAAAC,UAAS,cAAc;AAChC,SAAS,QAAAC,aAAY;AXXd,IAAM,YAAY,KAAK,WAAW,WAAW;AAyBpD,eAAsB,kBACpB,YACA,OAAkC,CAAC,GACN;AAC7B,QAAM,MAA8B,CAAC;AACrC,QAAM,YAAY,WAAW,mBAAmB;AAChD,QAAM,WAAW,WAAW,yBAAyB;AACrD,MAAI,OAAO,cAAc,YAAY,UAAU,SAAS,EAAG,KAAI,mBAAmB,IAAI;AACtF,MAAI,OAAO,aAAa,YAAY,SAAS,SAAS;AACpD,QAAI,yBAAyB,IAAI;AACnC,MAAI,OAAO,KAAK,GAAG,EAAE,SAAS,EAAG,QAAO,EAAE,KAAK,QAAQ,WAAW;AAElE,QAAM,OAAO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B,EAAE,QAAQ,OAAO,UAAU,CAAC;IAChE,UAAU,KAAK;IACf,UAAU,KAAK;IACf,SAAS,CAAC,OAAO,WAAW;AAC1B,YAAM,EAAE,KAAK,OAAO,KAAK,WAAW,QAAQ,GAAG,UAAU,KAAK,IAAI,UAAU,CAAC;AAC7E,WAAK,QAAQ,aAAa,KAAK,GAAG,EAAE,KAAK,OAAO,KAAK,WAAW,QAAQ,GAAG,UAAU,KAAK,CAAC;IAC7F;IACA,UAAU,KAAK;IACf,QAAQ,aAAa,MAAMM,wBAAwB,QAAQ,KAAK,GAAG;;;IAGnE,UAAU,YAAY;AACpB,YAAM,OAAO,MAAM,wBAAwB,QAAQ,OAAO;QACxD,YAAY,CAAC,MAAM,KAAK,WAAW,CAAC;MACtC,CAAC;AACD,YAAMR,sBAAsB,EAAE,OAAO,GAAG,EAAE,OAAO,SAAS,MAAM,CAAC;AACjE,aAAO,EAAE,QAAQ,KAAK,OAAO;IAC/B;IACA,QAAQ,KAAK;IACb,cAAc,KAAK;IACnB,gBAAgB,KAAK;EACvB,CAAC;AAED,SAAO,EAAE,IAAI,OAAO,QAAQ,SAAS;AACvC;","names":["join","readFile","existsSync","homedir","join","log","syncClaudeCredentials","hostBackupHasCredentials","join","spinner","loadPtyBackend","ensureImage","imageProgress","imageExists","volumeClaudeCredentials","resolveAgentSpec","homedir","existsSync","TeleportError","readFile"]}
@@ -5,7 +5,7 @@ async function ensureHostReachDrainer(box) {
5
5
  try {
6
6
  if ((box.provider ?? "docker") === "docker") return;
7
7
  if (!box.cloud?.controlPlaneUrl) return;
8
- const { ensureRelay } = await import("./dist-SZTW3RMB.js");
8
+ const { ensureRelay } = await import("./dist-5MCQFGLX.js");
9
9
  await ensureRelay();
10
10
  } catch {
11
11
  }
@@ -14,4 +14,4 @@ async function ensureHostReachDrainer(box) {
14
14
  export {
15
15
  ensureHostReachDrainer
16
16
  };
17
- //# sourceMappingURL=chunk-5JDGKHWH.js.map
17
+ //# sourceMappingURL=chunk-QALBGVPR.js.map
@@ -12,13 +12,13 @@ import {
12
12
  resolveContextFilesFrom,
13
13
  writeManagedSecrets,
14
14
  writePreparedStateRaw
15
- } from "./chunk-U7J7JT6R.js";
15
+ } from "./chunk-G35FJ4KT.js";
16
16
  import {
17
17
  providerWarning
18
- } from "./chunk-FM7PHYBD.js";
18
+ } from "./chunk-NEU5B2VO.js";
19
19
  import {
20
20
  DAYTONA_VM_REGION
21
- } from "./chunk-YZZKWZO2.js";
21
+ } from "./chunk-3PTSPFR6.js";
22
22
 
23
23
  // ../../packages/sandbox-daytona/dist/chunk-4563VTWS.js
24
24
  import { existsSync } from "fs";
@@ -1137,4 +1137,4 @@ export {
1137
1137
  readDaytonaCredStatus,
1138
1138
  maskKey
1139
1139
  };
1140
- //# sourceMappingURL=chunk-JCDC5S32.js.map
1140
+ //# sourceMappingURL=chunk-QDBDDJKT.js.map