@madarco/agentbox 0.22.1 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/dist/{_cloud-attach-YH2SU75S.js → _cloud-attach-RFPLNACE.js} +5 -5
  3. package/dist/{chunk-GGWVTWJM.js → chunk-6OQENOJZ.js} +16 -13
  4. package/dist/chunk-6OQENOJZ.js.map +1 -0
  5. package/dist/{chunk-ALEYDWAO.js → chunk-CKC3CP7Y.js} +494 -148
  6. package/dist/chunk-CKC3CP7Y.js.map +1 -0
  7. package/dist/{chunk-O67ZESNL.js → chunk-ERMU7RMK.js} +43 -58
  8. package/dist/{chunk-O67ZESNL.js.map → chunk-ERMU7RMK.js.map} +1 -1
  9. package/dist/chunk-G3H2L3O2.js +0 -0
  10. package/dist/{chunk-KBVD2UUQ.js → chunk-JXDSSSXS.js} +3 -3
  11. package/dist/{chunk-CDEJ2GQK.js → chunk-L5SOSNQI.js} +4 -4
  12. package/dist/{chunk-W2FLHB54.js → chunk-Q626V2YX.js} +2 -2
  13. package/dist/{chunk-YZXXBHWG.js → chunk-QGL734YX.js} +170 -53
  14. package/dist/chunk-QGL734YX.js.map +1 -0
  15. package/dist/{chunk-VBSRJG53.js → chunk-QT3SHMLY.js} +9 -1
  16. package/dist/chunk-QT3SHMLY.js.map +1 -0
  17. package/dist/{chunk-O2NDZQHN.js → chunk-QVWGQJV6.js} +2 -2
  18. package/dist/chunk-WJFZJZIM.js +0 -0
  19. package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
  20. package/dist/{dist-QBXEP4VY.js → dist-2BTJQUJS.js} +2 -2
  21. package/dist/{dist-UR2DB2HT.js → dist-GEHCZJCS.js} +6 -6
  22. package/dist/{dist-LJHS4PTC.js → dist-GJCIKH2C.js} +6 -6
  23. package/dist/{dist-EJXUKIR7.js → dist-JFUUDAI3.js} +18 -4
  24. package/dist/{dist-QNV4H6NN.js → dist-W5476E2U.js} +6 -6
  25. package/dist/{dist-YECTRVGD.js → dist-Z3GSHEFO.js} +8 -7
  26. package/dist/index.js +1339 -782
  27. package/dist/index.js.map +1 -1
  28. package/dist/{prepared-state-5FIGV4BE-BMUK63FD.js → prepared-state-LW2PKTEQ-5YMKG7UN.js} +2 -2
  29. package/package.json +28 -27
  30. package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
  31. package/runtime/_shared/agentbox-dockerd-start +0 -0
  32. package/runtime/_shared/agentbox-open +0 -0
  33. package/runtime/_shared/agentbox-portless-trust +0 -0
  34. package/runtime/_shared/agentbox-vnc-start +0 -0
  35. package/runtime/_shared/ctl.cjs +13 -1
  36. package/runtime/_shared/gh-shim +0 -0
  37. package/runtime/_shared/git-shim +0 -0
  38. package/runtime/_shared/linear-shim +0 -0
  39. package/runtime/_shared/ntn-shim +0 -0
  40. package/runtime/docker/Dockerfile.box +12 -0
  41. package/runtime/docker/packages/ctl/dist/bin.cjs +13 -1
  42. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
  43. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
  44. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
  45. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
  46. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +44 -0
  47. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
  48. package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
  49. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
  50. package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
  51. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
  52. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
  53. package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
  54. package/runtime/e2b/agentbox-dockerd-start +0 -0
  55. package/runtime/e2b/agentbox-open +0 -0
  56. package/runtime/e2b/agentbox-vnc-start +0 -0
  57. package/runtime/e2b/ctl.cjs +13 -1
  58. package/runtime/e2b/gh-shim +0 -0
  59. package/runtime/e2b/git-shim +0 -0
  60. package/runtime/e2b/linear-shim +0 -0
  61. package/runtime/e2b/ntn-shim +0 -0
  62. package/runtime/e2b/scripts/build-template.sh +0 -0
  63. package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
  64. package/runtime/hetzner/agentbox-dockerd-start +0 -0
  65. package/runtime/hetzner/agentbox-open +0 -0
  66. package/runtime/hetzner/agentbox-portless-trust +0 -0
  67. package/runtime/hetzner/agentbox-vnc-start +0 -0
  68. package/runtime/hetzner/ctl.cjs +13 -1
  69. package/runtime/hetzner/gh-shim +0 -0
  70. package/runtime/hetzner/git-shim +0 -0
  71. package/runtime/hetzner/linear-shim +0 -0
  72. package/runtime/hetzner/ntn-shim +0 -0
  73. package/runtime/hetzner/scripts/install-box.sh +0 -0
  74. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  75. package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +3 -0
  76. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  77. package/runtime/hub/apps/hub/.next/routes-manifest.json +22 -0
  78. package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
  79. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/app-paths-manifest.json +3 -0
  80. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/build-manifest.json +9 -0
  81. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/server-reference-manifest.json +4 -0
  82. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +9 -0
  83. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.map +5 -0
  84. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -0
  85. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route_client-reference-manifest.js +3 -0
  86. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route/app-paths-manifest.json +3 -0
  87. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route/build-manifest.json +9 -0
  88. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route/server-reference-manifest.json +4 -0
  89. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js +9 -0
  90. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.map +5 -0
  91. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -0
  92. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route_client-reference-manifest.js +3 -0
  93. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/app-paths-manifest.json +3 -0
  94. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/build-manifest.json +9 -0
  95. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/server-reference-manifest.json +4 -0
  96. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js +8 -0
  97. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.map +5 -0
  98. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -0
  99. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route_client-reference-manifest.js +3 -0
  100. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  101. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/server-reference-manifest.json +12 -0
  102. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  103. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/server-reference-manifest.json +12 -0
  104. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  105. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/server-reference-manifest.json +12 -0
  106. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  107. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  108. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  109. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  110. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  111. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  112. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  113. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  114. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  115. package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  116. package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +3 -0
  117. package/runtime/hub/apps/hub/.next/server/chunks/0m4a_kysely_dist_095p8vu._.js +1 -1
  118. package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_open-targets_route_actions_1z-vd4m.js +3 -0
  119. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_open_route_actions_1agwl8h.js +3 -0
  120. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_rename_route_actions_0mf3a9p.js +3 -0
  121. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +1 -1
  122. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +1 -1
  123. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ql4fjo._.js +1 -1
  124. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0szd4sh._.js +3 -0
  125. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vs8fma._.js +1 -1
  126. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w9ud8u._.js +1 -1
  127. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yhb0gc._.js +1 -1
  128. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-0flwc._.js +3 -0
  129. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1a50b07._.js +3 -0
  130. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bqbkd5._.js +2 -2
  131. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dn_3i1._.js +1 -1
  132. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hqla7-._.js +1 -1
  133. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1js2jdv._.js +1 -1
  134. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1nepkp-._.js +1 -1
  135. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q5bqse._.js +1 -1
  136. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +2 -2
  137. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thipug._.js +3 -0
  138. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9om6g._.js +1 -1
  139. package/runtime/hub/apps/hub/.next/server/chunks/_06f2faq._.js +1 -1
  140. package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +14 -14
  141. package/runtime/hub/apps/hub/.next/server/chunks/_0f3molr._.js +3 -0
  142. package/runtime/hub/apps/hub/.next/server/chunks/_0lgs9kd._.js +3 -0
  143. package/runtime/hub/apps/hub/.next/server/chunks/ssr/044u_hub__next-internal_server_app_(dashboard)_projects_[id]_page_actions_15f56np.js +1 -1
  144. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_09gdzmo._.js +1 -1
  145. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ozyjt1._.js +1 -1
  146. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.js +1 -1
  147. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0tgpglr._.js +1 -1
  148. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_1laion6._.js +1 -1
  149. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +1 -1
  150. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_boxes_[id]_page_actions_0k7kgn2.js +1 -1
  151. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_page_actions_1t3u0xy.js +1 -1
  152. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
  153. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +1 -1
  154. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_components_1z1p98f._.js +1 -1
  155. package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +3 -0
  156. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  157. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  158. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.js +1 -1
  159. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.json +24 -0
  160. package/runtime/hub/apps/hub/.next/static/chunks/1py5tlz57h7ra.js +1 -0
  161. package/runtime/hub/apps/hub/.next/static/chunks/{3y2c7woqhtx9s.js → 23fswvjrabu89.js} +1 -1
  162. package/runtime/hub/apps/hub/.next/static/chunks/2xc1sm79a6tsb.js +1 -0
  163. package/runtime/hub/apps/hub/.next/static/chunks/3nedwutnzpdis.css +3 -0
  164. package/runtime/hub/apps/hub/.next/static/chunks/3p86ecqhr_7yy.js +1 -0
  165. package/runtime/hub/apps/hub/.next/static/chunks/3qof5hg87qf5n.js +1 -0
  166. package/runtime/hub/apps/hub/{auth-YBXDRLHG.js → auth-675P3LQS.js} +2 -2
  167. package/runtime/hub/apps/hub/{auth-config-LJGI76HI.js → auth-config-AOBEKRZQ.js} +2 -2
  168. package/runtime/hub/apps/hub/{chunk-OBKLTPIR.js → chunk-56YQBVN2.js} +1 -1
  169. package/runtime/hub/apps/hub/{chunk-JDA7BPPN.js → chunk-6HD4PARX.js} +9 -9
  170. package/runtime/hub/apps/hub/{chunk-AKLBSCSZ.js → chunk-EXQCBM5Q.js} +8 -0
  171. package/runtime/hub/apps/hub/{chunk-V5KGFHCF.js → chunk-JQFB2CNA.js} +132 -16
  172. package/runtime/hub/apps/hub/{chunk-LJG4CEGS.js → chunk-K6RA5GJI.js} +412 -117
  173. package/runtime/hub/apps/hub/{dist-ELOY2IUE.js → dist-3HR4RIPE.js} +17 -3
  174. package/runtime/hub/apps/hub/{dist-GGM4BUKM.js → dist-7GNKBKFV.js} +29 -42
  175. package/runtime/hub/apps/hub/{dist-BF54UNHK.js → dist-JWVTVHBT.js} +4 -4
  176. package/runtime/hub/apps/hub/{dist-CM4YAQLI.js → dist-OUNL2TCW.js} +4 -4
  177. package/runtime/hub/apps/hub/{dist-IENF7YOD.js → dist-STQK5XM6.js} +1 -1
  178. package/runtime/hub/apps/hub/{dist-FDBOJ74K.js → dist-TOHA4OA5.js} +4 -4
  179. package/runtime/hub/apps/hub/{hub-token-EW32VDIU.js → hub-token-2BZFBBW3.js} +2 -2
  180. package/runtime/hub/apps/hub/{prepared-state-5FIGV4BE-FIXKBF5A.js → prepared-state-LW2PKTEQ-7BCXARGA.js} +1 -1
  181. package/runtime/hub/apps/hub/server.js +153 -31
  182. package/runtime/relay/bin.cjs +13 -1
  183. package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
  184. package/runtime/vercel/agentbox-dockerd-start +0 -0
  185. package/runtime/vercel/agentbox-open +0 -0
  186. package/runtime/vercel/agentbox-vnc-start +0 -0
  187. package/runtime/vercel/ctl.cjs +13 -1
  188. package/runtime/vercel/gh-shim +0 -0
  189. package/runtime/vercel/git-shim +0 -0
  190. package/runtime/vercel/linear-shim +0 -0
  191. package/runtime/vercel/ntn-shim +0 -0
  192. package/runtime/vercel/scripts/provision.sh +0 -0
  193. package/LICENSE +0 -21
  194. package/dist/chunk-ALEYDWAO.js.map +0 -1
  195. package/dist/chunk-GGWVTWJM.js.map +0 -1
  196. package/dist/chunk-VBSRJG53.js.map +0 -1
  197. package/dist/chunk-YZXXBHWG.js.map +0 -1
  198. package/runtime/hub/apps/hub/.next/static/chunks/0dx4alyqu7cq1.css +0 -3
  199. package/runtime/hub/apps/hub/.next/static/chunks/0lq354ziiwxxl.js +0 -1
  200. package/runtime/hub/apps/hub/.next/static/chunks/11vmjdy3390ik.js +0 -1
  201. package/runtime/hub/apps/hub/.next/static/chunks/1svigjdfotduh.js +0 -1
  202. package/runtime/hub/apps/hub/.next/static/chunks/2d5e6t-5j4etp.js +0 -1
  203. /package/dist/{_cloud-attach-YH2SU75S.js.map → _cloud-attach-RFPLNACE.js.map} +0 -0
  204. /package/dist/{chunk-KBVD2UUQ.js.map → chunk-JXDSSSXS.js.map} +0 -0
  205. /package/dist/{chunk-CDEJ2GQK.js.map → chunk-L5SOSNQI.js.map} +0 -0
  206. /package/dist/{chunk-W2FLHB54.js.map → chunk-Q626V2YX.js.map} +0 -0
  207. /package/dist/{chunk-O2NDZQHN.js.map → chunk-QVWGQJV6.js.map} +0 -0
  208. /package/dist/{dist-EJXUKIR7.js.map → dist-2BTJQUJS.js.map} +0 -0
  209. /package/dist/{dist-UR2DB2HT.js.map → dist-GEHCZJCS.js.map} +0 -0
  210. /package/dist/{dist-LJHS4PTC.js.map → dist-GJCIKH2C.js.map} +0 -0
  211. /package/dist/{dist-QBXEP4VY.js.map → dist-JFUUDAI3.js.map} +0 -0
  212. /package/dist/{dist-QNV4H6NN.js.map → dist-W5476E2U.js.map} +0 -0
  213. /package/dist/{dist-YECTRVGD.js.map → dist-Z3GSHEFO.js.map} +0 -0
  214. /package/dist/{prepared-state-5FIGV4BE-BMUK63FD.js.map → prepared-state-LW2PKTEQ-5YMKG7UN.js.map} +0 -0
  215. /package/runtime/hub/apps/hub/.next/static/{TpPTWVdZDxqrPlONtJcR5 → 6WtaFwavHBpin3eT7-HjR}/_buildManifest.js +0 -0
  216. /package/runtime/hub/apps/hub/.next/static/{TpPTWVdZDxqrPlONtJcR5 → 6WtaFwavHBpin3eT7-HjR}/_clientMiddlewareManifest.js +0 -0
  217. /package/runtime/hub/apps/hub/.next/static/{TpPTWVdZDxqrPlONtJcR5 → 6WtaFwavHBpin3eT7-HjR}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88451,e=>{"use strict";var t=e.i(1262),r=e.i(45971),s=e.i(54129),n=e.i(44344),a=e.i(69377),o=e.i(9383);let l=(0,o.createServerReference)("60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",o.callServer,void 0,o.findSourceMapURL,"answerApprovalAction");e.s(["ApprovalActions",0,function({id:e}){let o=(0,r.useRouter)(),[i,c]=(0,s.useTransition)(),d=t=>{c(async()=>{let r=await l(e,t);r.ok||window.alert(`Failed: ${r.error}`),o.refresh()})};return(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsxs)(a.Button,{variant:"outline",size:"sm",disabled:i,className:"hover:border-[var(--red-line)] hover:bg-[var(--red-soft)] hover:text-[var(--red)]",onClick:()=>d("n"),children:[(0,t.jsx)(n.Icons.x,{}),"Deny"]}),(0,t.jsxs)(a.Button,{size:"sm",disabled:i,onClick:()=>d("y"),children:[(0,t.jsx)(n.Icons.check,{}),"Approve"]})]})}],88451)},95141,e=>{"use strict";var t=e.i(1262),r=e.i(54129),s=e.i(65232),n=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:a,children:o}){return(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{className:"anim-fade fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-[rgba(20,24,30,.42)] p-6 backdrop-blur-[2px]",onClick:e,children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,s.cn)("anim-pop relative m-auto w-full max-w-[500px] rounded-2xl border border-border bg-card shadow-[0_40px_80px_-30px_rgba(20,24,30,.5)]",a),onClick:e=>e.stopPropagation(),children:[o,(0,t.jsx)("button",{className:"absolute right-4 top-4 grid h-7 w-7 cursor-pointer place-items-center rounded-md border-0 bg-transparent text-[#a4a9b0] transition-colors hover:bg-secondary hover:text-foreground",onClick:e,"aria-label":"Close",children:(0,t.jsx)(n.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("px-5 py-4",e),...r})},"DialogDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("mt-1 font-mono text-xs text-muted-foreground",e),...r})},"DialogFooter",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",e),...r})},"DialogHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",e),...r})},"DialogIcon",0,function({children:e}){return(0,t.jsx)("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-lg border border-[var(--green-line)] bg-accent text-primary [&_svg]:size-[17px]",children:e})},"DialogTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("text-base font-semibold leading-tight tracking-tight",e),...r})}])},86892,30544,e=>{"use strict";var t=e.i(1262),r=e.i(64595);let s={running:{label:"running",badgeClass:"badge-run"},paused:{label:"paused",badgeClass:"badge-pause"},stopped:{label:"stopped",badgeClass:"badge-stop"},creating:{label:"creating",badgeClass:"badge-create"},error:{label:"error",badgeClass:"badge-err"}};e.s(["StatusBadge",0,function({status:e}){let n=s[e]??s.stopped;return(0,t.jsxs)(r.Badge,{className:n.badgeClass,children:[(0,t.jsx)("span",{className:"badge-dot"}),n.label]})}],86892);var n=e.i(45971),a=e.i(54129),o=e.i(65232),l=e.i(69377),i=e.i(44344),c=e.i(9383);let d=(0,c.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",c.callServer,void 0,c.findSourceMapURL,"destroyBoxAction"),u=(0,c.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",c.callServer,void 0,c.findSourceMapURL,"pauseBoxAction"),x=(0,c.createServerReference)("6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb",c.callServer,void 0,c.findSourceMapURL,"renameBoxAction"),m=(0,c.createServerReference)("4071308a0e1675de302803bb969800c52d79f11e13",c.callServer,void 0,c.findSourceMapURL,"resumeBoxAction"),p=(0,c.createServerReference)("40e545c7dd69b4a1d410deb9c94101099961d3af7a",c.callServer,void 0,c.findSourceMapURL,"stopBoxAction");e.s(["BoxActions",0,function({box:e,size:r}){let s=(0,n.useRouter)(),[c,b]=(0,a.useTransition)(),h="running"===e.status,f="paused"===e.status,g="stopped"===e.status,j="lg"===r,v=j?"sm":"icon-sm",N=(t,r,n)=>{t.stopPropagation(),(!n||window.confirm(n))&&b(async()=>{let t=await r(e.id);t.ok||window.alert(`Action failed: ${t.error}`),s.refresh()})};return(0,t.jsxs)("div",{className:(0,o.cn)("flex gap-1.5",j?"":"justify-end"),children:[f?(0,t.jsxs)(l.Button,{variant:j?"default":"outline",size:v,title:"Resume",disabled:c,className:j?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:e=>N(e,m),children:[(0,t.jsx)(i.Icons.play,{}),j?"Resume":null]}):(0,t.jsxs)(l.Button,{variant:"outline",size:v,disabled:c||!h,title:"Pause",className:j?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:e=>N(e,u),children:[(0,t.jsx)(i.Icons.pause,{}),j?"Pause":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:v,disabled:c||g,title:"Stop",onClick:e=>N(e,p),children:[(0,t.jsx)(i.Icons.stop,{}),j?"Stop":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:v,disabled:c,title:"Rename",onClick:t=>{t.stopPropagation();let r=window.prompt("Rename box (label only — leave blank to reset)",e.displayName??e.task);null!==r&&b(async()=>{let t=await x(e.id,r.trim());t.ok||window.alert(`Rename failed: ${t.error}`),s.refresh()})},children:[(0,t.jsx)(i.Icons.pencil,{}),j?"Rename":null]}),(0,t.jsxs)(l.Button,{variant:"destructive",size:v,title:"Destroy",disabled:c,onClick:t=>N(t,d,`Destroy box ${e.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,t.jsx)(i.Icons.trash,{}),j?"Destroy":null]})]})}],30544)},49604,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Select",0,function({wrapperClassName:e,className:s,children:n,...a}){return(0,t.jsxs)("span",{className:(0,r.cn)("relative inline-flex",e),children:[(0,t.jsx)("select",{className:(0,r.cn)("h-9 w-full cursor-pointer appearance-none rounded-lg border border-input bg-card py-1 pl-3 pr-9 text-[13px] shadow-sm focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",s),...a,children:n}),(0,t.jsx)("svg",{className:"pointer-events-none absolute right-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:(0,t.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}])},8536,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Card",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...s})},"CardContent",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("p-5 pt-0",e),...s})},"CardDescription",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[12.5px] text-muted-foreground",e),...s})},"CardHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-1 p-5",e),...s})},"CardTitle",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...s})}])},3060,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Input",0,function({className:e,...s}){return(0,t.jsx)("input",{className:(0,r.cn)("flex h-10 w-full rounded-lg border border-input bg-card px-3 py-1 text-sm shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...s})}])},86184,e=>{"use strict";var t=e.i(1262),r=e.i(54129),s=e.i(69377),n=e.i(3060);function a({jobId:e,login:o}){let[l,i]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[u,x]=(0,r.useState)(null),m="exchanging"===o.phase,p=async()=>{let t=l.trim();if(t&&!c){d(!0),x(null);try{let r=await fetch(`/api/v1/jobs/${encodeURIComponent(e)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})});if(!r.ok){let e=await r.json().catch(()=>null);x(e?.error?.message??`request failed (${r.status})`);return}i("")}catch(e){x(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,t.jsx)("p",{className:"text-xs text-amber-100/80",children:"Your saved Claude login is expired. Open the sign-in page, approve access, then paste the code Claude shows you."}),o.url?(0,t.jsx)("a",{href:o.url,target:"_blank",rel:"noreferrer",className:"w-fit rounded-md bg-amber-500/20 px-2.5 py-1 text-xs font-medium text-amber-100 underline decoration-amber-400/50 underline-offset-2 hover:bg-amber-500/30",children:"Open Claude sign-in ↗"}):(0,t.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,t.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,t.jsx)(n.Input,{value:l,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&p()},placeholder:"Paste approval code",disabled:m,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(s.Button,{type:"button",onClick:()=>void p(),disabled:!l.trim()||c||m,children:m?"Verifying…":c?"Submitting…":"Submit"})]}),o.lastError?(0,t.jsx)("p",{className:"text-xs text-amber-300",children:o.lastError}):null,"error"===o.phase&&o.error?(0,t.jsx)("p",{className:"text-xs text-red-400",children:o.error}):null,u?(0,t.jsx)("p",{className:"text-xs text-red-400",children:u}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:s,onDone:n,onStatus:o,onLogin:l}){let[i,c]=(0,r.useState)([]),[d,u]=(0,r.useState)(null),x=(0,r.useRef)(null),m=(0,r.useRef)(n);m.current=n;let p=(0,r.useRef)(o);p.current=o;let b=(0,r.useRef)(l);return b.current=l,(0,r.useEffect)(()=>{p.current?.("streaming");let t=new EventSource(s??`/api/jobs/${encodeURIComponent(e)}/logs`);return t.addEventListener("log",e=>{let t=JSON.parse(e.data);c(e=>[...e,t])}),t.addEventListener("login",e=>{let t=JSON.parse(e.data);u(t),b.current?.(t)}),t.addEventListener("end",e=>{let r=JSON.parse(e.data);p.current?.(r.status),m.current?.(r.status),t.close()}),()=>t.close()},[e,s]),(0,r.useEffect)(()=>{let e=x.current;e&&(e.scrollTop=e.scrollHeight)},[i]),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[d&&"done"!==d.phase?(0,t.jsx)(a,{jobId:e,login:d}):null,(0,t.jsx)("pre",{ref:x,className:"max-h-[440px] min-h-[220px] overflow-auto whitespace-pre rounded-lg bg-[#16181c] p-3 font-mono text-[11.5px] leading-relaxed text-[#d6d9de]",children:0===i.length?"starting…":i.join("\n")})]})}])},33789,1485,e=>{"use strict";var t=e.i(1262),r=e.i(54129);e.s(["Ago",0,function({ms:e}){let[s,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>n(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:s?function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return t+"s ago";let r=Math.floor(t/60);if(r<60)return r+"m ago";let s=Math.floor(r/60);return s<24?s+"h ago":Math.floor(s/24)+"d ago"}(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:r}){return(0,t.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[e,(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),r??null]})}],1485)},9383,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={callServer:function(){return a.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var n in s)Object.defineProperty(r,n,{enumerable:!0,get:s[n]});let a=e.r(57855),o=e.r(61414),l=e.r(97615)},31758,e=>{"use strict";var t=e.i(1262),r=e.i(44344);e.s(["EmptyBox",0,function({children:e}){return(0,t.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-card px-5 py-9 text-center text-[13.5px] text-muted-foreground",children:[(0,t.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,t.jsx)(r.Icons.box,{className:"size-5"})}),e]})}])},23878,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Table",0,function({className:e,...s}){return(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...s})},"TableBody",0,function({className:e,...s}){return(0,t.jsx)("tbody",{className:(0,r.cn)("[&_tr:last-child]:border-0",e),...s})},"TableCell",0,function({className:e,...s}){return(0,t.jsx)("td",{className:(0,r.cn)("px-4 py-3 align-middle",e),...s})},"TableHead",0,function({className:e,...s}){return(0,t.jsx)("th",{className:(0,r.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",e),...s})},"TableHeader",0,function({className:e,...s}){return(0,t.jsx)("thead",{className:(0,r.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",e),...s})},"TableRow",0,function({className:e,...s}){return(0,t.jsx)("tr",{className:(0,r.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",e),...s})}])},22983,93268,66818,e=>{"use strict";var t=e.i(1262),r=e.i(45971),s=e.i(33789),n=e.i(44344),a=e.i(86892),o=e.i(8536),l=e.i(23878),i=e.i(30544);e.s(["BoxTable",0,function({boxes:e}){let c=(0,r.useRouter)();return(0,t.jsx)(o.Card,{className:"overflow-hidden",children:(0,t.jsxs)(l.Table,{children:[(0,t.jsx)(l.TableHeader,{children:(0,t.jsxs)(l.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(l.TableHead,{className:"w-[38%]",children:"Task"}),(0,t.jsx)(l.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,t.jsx)(l.TableHead,{className:"max-md:hidden",children:"Status"}),(0,t.jsx)(l.TableHead,{className:"text-right",children:"Actions"})]})}),(0,t.jsx)(l.TableBody,{children:e.map(e=>(0,t.jsxs)(l.TableRow,{className:"cursor-pointer",onClick:()=>c.push("/boxes/"+e.id),children:[(0,t.jsxs)(l.TableCell,{children:[(0,t.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:e.task}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.id," · ",e.host]})]}),(0,t.jsxs)(l.TableCell,{className:"max-md:hidden",children:[(0,t.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,t.jsx)(n.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.branch})]}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.agent," · ",(0,t.jsx)(s.Ago,{ms:e.lastActivity})]})]}),(0,t.jsx)(l.TableCell,{className:"max-md:hidden",children:(0,t.jsx)(a.StatusBadge,{status:e.status})}),(0,t.jsx)(l.TableCell,{className:"text-right",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(i.BoxActions,{box:e})})]},e.id))})]})})}],22983);var c=e.i(54129),d=e.i(64595),u=e.i(69377),x=e.i(95141),m=e.i(3060),p=e.i(49604),b=e.i(65232);function h({className:e,...r}){return(0,t.jsx)("textarea",{className:(0,b.cn)("flex min-h-[76px] w-full resize-y rounded-lg border border-input bg-card px-3 py-2 text-sm leading-normal shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...r})}var f=e.i(9383);let g=(0,f.createServerReference)("4070192706087364b8c7d220576a6f3e4d3e5c532b",f.callServer,void 0,f.findSourceMapURL,"createBoxAction"),j=(0,f.createServerReference)("40386bdce4d894a318a969412fa1299d2704ccdfb3",f.callServer,void 0,f.findSourceMapURL,"listBranchesAction");var v=e.i(96621),N=e.i(86184);let S=[{id:"docker",label:"Docker (local)",configured:!0}];function y({project:e,projects:s,onClose:a}){let o=(0,r.useRouter)(),{state:l}=(0,v.useStore)(),i=l.providers.length?l.providers:S,[d,f]=(0,c.useTransition)(),[C,B]=(0,c.useState)(e?.id??s[0]?.id??""),[R,I]=(0,c.useState)("claude"),[T,D]=(0,c.useState)("docker"),[A,L]=(0,c.useState)(""),[P,z]=(0,c.useState)(""),[E,U]=(0,c.useState)(""),[M,H]=(0,c.useState)(null),[O,F]=(0,c.useState)(!1),[$,_]=(0,c.useState)(!1),[J,K]=(0,c.useState)(null),[q,W]=(0,c.useState)(null),[V,Y]=(0,c.useState)("streaming"),[G,Q]=(0,c.useState)(null),[X,Z]=(0,c.useState)(null),[ee,et]=(0,c.useState)(!1),[er,es]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/v1/providers?freshness=1",{credentials:"same-origin"});if(!t.ok)return;let r=await t.json();if(e)return;let s={};for(let e of r.providers??[])s[e.id]={baseStatus:e.baseStatus,baseStaleReason:e.baseStaleReason,jobId:e.jobId};es(s)}catch{}})(),()=>{e=!0}},[]);let en=s.find(e=>e.id===C)??e,ea=T??"docker",eo=i.find(e=>e.id===ea),el=er?.[ea],ei=!!el&&(!!el.jobId||"unprepared"===el.baseStatus||"stale"===el.baseStatus);(0,c.useEffect)(()=>{if(!C||q)return;F(en?.needsSetup??!1),D("docker");let e=!1;return H(null),U(en?.currentBranch??""),j(C).then(t=>{if(e||!t.ok){e||t.ok||H([]);return}H(t.branches),t.current&&t.branches.includes(t.current)&&U(t.current)}),()=>{e=!0}},[C,q]);let ec=()=>{K(null);let e=el?.jobId;e?Z(e):f(async()=>{try{let e=await fetch(`/api/v1/providers/${encodeURIComponent(ea)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({})}),t=await e.json().catch(()=>null);if(!e.ok||!t?.jobId)return void K(t?.error?.message??`base image build request failed (${e.status})`);Z(t.jobId)}catch(e){K(e instanceof Error?e.message:String(e))}})},ed=()=>{K(null),f(async()=>{let e=await g({projectId:C,agent:R,provider:T,name:A.trim()||void 0,prompt:"none"===R?void 0:P.trim()||void 0,fromBranch:E.trim()&&E.trim()!==en?.currentBranch?E.trim():void 0,setupWizard:"none"!==R&&O});e.ok?(W(e.jobId),o.refresh()):K(e.error)})};return(0,t.jsxs)(x.Dialog,{onClose:a,className:q||X?"max-w-[900px]":"max-w-[560px]",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogIcon,{children:(0,t.jsx)(n.Icons.box,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x.DialogTitle,{children:!q&&X?"Building base image":"Create box"}),(0,t.jsx)(x.DialogDescription,{children:en?en.name:"Start a box in a project"})]}),q||X?(0,t.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,t.jsx)(w,{status:V,loginPhase:G})}):null]}),(0,t.jsx)(x.DialogBody,{className:"flex flex-col gap-4",children:q?(0,t.jsx)(N.JobLogStream,{jobId:q,onStatus:Y,onDone:()=>o.refresh(),onLogin:e=>Q(e?.phase??null)}):X?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["Building the ",eo?.label??ea," base image — one-time, can take several minutes. The box is created automatically when it finishes."]}),(0,t.jsx)(N.JobLogStream,{jobId:X,onStatus:Y,onDone:e=>{"done"===e?ed():K(`base image build ${e}`)}}),J?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:J}):null]}):(0,t.jsxs)(t.Fragment,{children:[e?null:(0,t.jsx)(k,{label:"Project",children:(0,t.jsxs)(p.Select,{value:C,onChange:e=>B(e.target.value),children:[0===s.length?(0,t.jsx)("option",{value:"",children:"No projects — add one first"}):null,s.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,t.jsx)(k,{label:"Provider",children:(0,t.jsx)(p.Select,{value:T,onChange:e=>D(e.target.value),children:i.map(e=>(0,t.jsxs)("option",{value:e.id,disabled:!e.configured,title:e.reason,children:[e.label,e.configured?"":" — not configured"]},e.id))})}),ei?(0,t.jsx)("p",{className:"-mt-2 font-mono text-xs text-amber-600 dark:text-amber-400",title:el?.baseStaleReason,children:el?.jobId?"A base-image build is already running — the box will be created when it finishes.":el?.baseStatus==="unprepared"?"First use of this provider: the base image will be downloaded or built first (can take 5–10 minutes).":"The base image is out of date and will be rebuilt first (can take 5–10 minutes)."}):null,(0,t.jsx)(k,{label:"Agent",children:(0,t.jsxs)(p.Select,{value:R,onChange:e=>I(e.target.value),children:[(0,t.jsx)("option",{value:"claude",children:"Claude"}),(0,t.jsx)("option",{value:"codex",children:"Codex"}),(0,t.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,t.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,t.jsx)(k,{label:"Name (optional)",children:(0,t.jsx)(m.Input,{value:A,onChange:e=>L(e.target.value),placeholder:"auto"})}),en?.needsSetup&&"none"!==R?(0,t.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",checked:O,onChange:e=>F(e.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"This project has no agentbox.yaml — the agent explores the repo and proposes one on its first turn."})]})]}):null,"none"===R?(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["The box is created and left running with no agent — attach later from a terminal or SSH (",(0,t.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>_(e=>!e),className:"flex cursor-pointer items-center gap-1.5 self-start text-xs font-medium text-secondary-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(n.Icons.chevR,{className:(0,b.cn)("size-3.5 transition-transform",$&&"rotate-90")}),"Advanced"]}),$?(0,t.jsxs)(t.Fragment,{children:[null===M?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsx)(p.Select,{value:"",disabled:!0,children:(0,t.jsx)("option",{value:"",children:"Loading branches…"})})}):M.length>0?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsxs)(p.Select,{value:E,onChange:e=>U(e.target.value),children:[en?.currentBranch&&!M.includes(en.currentBranch)?(0,t.jsxs)("option",{value:"",children:[en.currentBranch," (current)"]}):null,M.map(e=>(0,t.jsxs)("option",{value:e,children:[e,e===en?.currentBranch?" (current)":""]},e))]})}):null,"none"!==R?(0,t.jsx)(k,{label:"Initial prompt (optional)",children:(0,t.jsx)(h,{value:P,onChange:e=>z(e.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),J?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:J}):null]})}),(0,t.jsx)(x.DialogFooter,{children:q||X?(0,t.jsxs)(t.Fragment,{children:["streaming"===V?(0,t.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:q?"The box + agent start in the background — you can close this.":"Keep this open — the box is created when the build finishes."}):null,(0,t.jsx)(u.Button,{onClick:a,children:"Close"})]}):ee?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",title:el?.baseStaleReason,children:["The ",eo?.label??ea," base image is out of date."]}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>et(!1),disabled:d,children:"Cancel"}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>{et(!1),ed()},disabled:d,children:"Use existing image"}),(0,t.jsx)(u.Button,{onClick:()=>{et(!1),ec()},disabled:d,children:"Rebuild & create"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Button,{variant:"outline",onClick:a,disabled:d,children:"Cancel"}),(0,t.jsx)(u.Button,{onClick:()=>{(K(null),C)?ei?"docker"===ea||el?.baseStatus!=="stale"||el.jobId?ec():et(!0):ed():K("pick a project")},disabled:d||!C,children:d?"Starting…":"Create box"})]})})]})}function w({status:e,loginPhase:r}){return"done"===e?(0,t.jsxs)(d.Badge,{className:"badge-run",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===e||"error"===e||"cancelled"===e?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===r?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===r||"starting"===r||"exchanging"===r?(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Working…"]})}function k({label:e,children:r}){return(0,t.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:e}),r]})}e.s(["CreateBoxButton",0,function({project:e,projects:r,variant:s,size:a,className:o}){let[l,i]=(0,c.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.Button,{variant:s,size:a,className:o,onClick:()=>i(!0),children:[(0,t.jsx)(n.Icons.plus,{}),"Create box"]}),l?(0,t.jsx)(y,{project:e,projects:r??(e?[e]:[]),onClose:()=>i(!1)}):null]})}],93268);let C=(0,f.createServerReference)("40c7856bd78dddab224344045df78d51620e411335",f.callServer,void 0,f.findSourceMapURL,"removeProjectAction");e.s(["DeleteProjectButton",0,function({project:e,size:s,className:a,redirectHome:o}){let l=(0,r.useRouter)(),[i,d]=(0,c.useTransition)();return(0,t.jsxs)(u.Button,{variant:"destructive",size:s,className:a,title:"Delete project",disabled:i,onClick:t=>{t.stopPropagation(),t.preventDefault(),window.confirm(`Remove project "${e.name}" from the hub? Its folder and files are NOT deleted — this only unregisters it (and any hub-set project settings). This cannot be undone.`)&&d(async()=>{let t=await C(e.id);t.ok?o?l.push("/"):l.refresh():window.alert(`Delete failed: ${t.error}`)})},children:[(0,t.jsx)(n.Icons.trash,{}),"Delete"]})}],66818)},87340,e=>{"use strict";var t=e.i(1262),r=e.i(51096),s=e.i(44344),n=e.i(96621),a=e.i(88451);function o(){let{state:e,box:o}=(0,n.useStore)();if(0===e.approvals.length)return null;let l=[...e.approvals].sort((e,t)=>e.createdAt-t.createdAt),i=l[0],c=o(i.boxId);return(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-3 rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)] p-4",children:[(0,t.jsx)(s.Icons.shield,{className:"mt-0.5 size-4 flex-none text-[var(--amber)]"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[c?(0,t.jsx)(r.default,{className:"text-[13.5px] font-semibold hover:text-[var(--green-ink)]",href:"/boxes/"+c.id,children:c.task}):(0,t.jsx)("span",{className:"text-[13.5px] font-semibold",children:i.boxId}),(0,t.jsx)("span",{className:"truncate font-mono text-[12.5px] text-secondary-foreground",children:i.command??i.message})]}),i.detail?(0,t.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:i.detail}):null,i.cwd?(0,t.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:i.cwd}):null]}),(0,t.jsxs)("div",{className:"flex flex-none items-center gap-3",children:[l.length>1?(0,t.jsxs)("div",{className:"hidden items-center gap-2 sm:flex",children:[(0,t.jsxs)("span",{className:"font-mono text-[11.5px] text-[var(--amber)]",children:[l.length," pending"]}),(0,t.jsx)(r.default,{className:"font-mono text-[11.5px] text-muted-foreground hover:text-[var(--green-ink)]",href:"/approvals",children:"View all"})]}):null,(0,t.jsx)(a.ApprovalActions,{id:i.id})]})]})}var l=e.i(45971),i=e.i(54129),c=e.i(69377),d=e.i(95141),u=e.i(3060),x=e.i(9383);let m=(0,x.createServerReference)("4087bb6da1f4834ca146bcc8cb7c69295dbeda0bdc",x.callServer,void 0,x.findSourceMapURL,"addProjectAction"),p=(0,x.createServerReference)("40942714d29a270a6816a39cd419b4f09f50fc19b1",x.callServer,void 0,x.findSourceMapURL,"browseDirAction");function b(){let[e,r]=(0,i.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.Button,{onClick:()=>r(!0),children:[(0,t.jsx)(s.Icons.plus,{}),"New project"]}),e?(0,t.jsx)(h,{onClose:()=>r(!1)}):null]})}function h({onClose:e}){let r=(0,l.useRouter)(),[n,a]=(0,i.useTransition)(),[o,x]=(0,i.useState)(""),[b,f]=(0,i.useState)(null),[g,j]=(0,i.useState)([]),[v,N]=(0,i.useState)(!0),[S,y]=(0,i.useState)(null),w=(0,i.useCallback)(async e=>{N(!0),y(null);let t=await p(e);if(!t.ok){y(t.error),N(!1);return}x(t.path),f(t.parent),j(t.entries),N(!1)},[]);return(0,i.useEffect)(()=>{w()},[w]),(0,t.jsxs)(d.Dialog,{onClose:e,children:[(0,t.jsxs)(d.DialogHeader,{children:[(0,t.jsx)(d.DialogIcon,{children:(0,t.jsx)(s.Icons.folder,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.DialogTitle,{children:"Add project"}),(0,t.jsx)(d.DialogDescription,{children:"Pick a folder on this machine"})]})]}),(0,t.jsxs)(d.DialogBody,{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Button,{variant:"outline",className:"flex-none px-2.5",onClick:()=>void w(b??void 0),disabled:!b||v,title:"Up one level","aria-label":"Up one level",children:(0,t.jsx)(s.Icons.arrowUp,{})}),(0,t.jsx)(u.Input,{value:o,onChange:e=>x(e.target.value),placeholder:"/Users/you/Projects/my-app",className:"font-mono text-xs",onKeyDown:e=>{"Enter"===e.key&&w(o)}})]}),(0,t.jsx)("div",{className:"h-56 overflow-y-auto rounded-lg border border-border bg-background",children:v?(0,t.jsx)("div",{className:"px-3 py-2.5 font-mono text-xs text-muted-foreground",children:"Loading…"}):0===g.length?(0,t.jsx)("div",{className:"px-3 py-2.5 font-mono text-xs text-muted-foreground",children:"No subfolders here"}):g.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>void w(e.path),className:"flex w-full cursor-pointer items-center gap-2 border-0 border-b border-border/60 bg-transparent px-3 py-2 text-left text-[13px] transition-colors last:border-b-0 hover:bg-secondary",children:[(0,t.jsx)(s.Icons.folder,{className:"size-4 flex-none text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.name}),e.isProject?(0,t.jsx)("span",{className:"ml-auto flex-none rounded border border-[var(--green-line)] bg-accent px-1.5 py-px font-mono text-[10px] uppercase tracking-wide text-primary",children:"project"}):(0,t.jsx)(s.Icons.chevR,{className:"ml-auto size-3.5 flex-none text-[#a4a9b0]"})]},e.path))}),S?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:S}):null]}),(0,t.jsxs)(d.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:e,disabled:n,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:()=>{y(null);let t=o.trim();t?a(async()=>{let s=await m(t);s.ok?(r.refresh(),e()):y(s.error)}):y("choose a folder")},disabled:n||v,children:n?"Adding…":"Add this folder"})]})]})}var f=e.i(22983),g=e.i(93268),j=e.i(66818),v=e.i(31758),N=e.i(1485);e.s(["default",0,function(){let{state:e,boxesFor:a}=(0,n.useStore)(),l=e.projects.map(e=>({p:e,boxes:a(e.id)})).sort((e,t)=>(e.boxes.length>0?0:1)-(t.boxes.length>0?0:1)),i=e.boxes.filter(e=>"running"===e.status).length;return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,t.jsx)(o,{}),(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Boxes"}),(0,t.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:i})," running across"," ",(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:e.projects.length})," ","project",1===e.projects.length?"":"s"," on this machine."]})]}),(0,t.jsx)("div",{className:"ml-auto flex flex-none gap-2",children:(0,t.jsx)(b,{})})]}),(0,t.jsx)(N.SectionLabel,{children:"Projects"}),0===l.length?(0,t.jsxs)(v.EmptyBox,{children:[(0,t.jsx)("div",{children:"No projects on this machine yet."}),(0,t.jsx)("div",{className:"mt-1.5 font-mono text-xs text-muted-foreground",children:"Add one with “New project”, or run `agentbox create` in a folder."})]}):null,l.map(({p:e,boxes:n})=>(0,t.jsxs)("div",{className:"mb-7",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-1 pb-3",children:[(0,t.jsxs)(r.default,{className:"flex cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-[15px] font-semibold tracking-[-0.01em] text-foreground hover:text-[var(--green-ink)]",href:"/projects/"+e.id,children:[(0,t.jsx)("span",{className:"grid h-[22px] w-[22px] flex-none place-items-center rounded-md border border-[var(--green-line)] bg-accent text-primary",children:(0,t.jsx)(s.Icons.folder,{className:"size-[13px]"})}),e.name]}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.repo}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsxs)("span",{className:"font-mono text-[11.5px] text-[#a4a9b0]",children:[n.length," box",1===n.length?"":"es"]}),(0,t.jsx)(g.CreateBoxButton,{project:e,variant:"outline",size:"sm",className:"font-mono text-xs"}),0===n.length?(0,t.jsx)(j.DeleteProjectButton,{project:e,size:"sm",className:"font-mono text-xs"}):null]}),n.length?(0,t.jsx)(f.BoxTable,{boxes:n}):(0,t.jsx)(v.EmptyBox,{children:(0,t.jsxs)("div",{children:["No boxes in ",(0,t.jsx)("b",{className:"font-semibold text-secondary-foreground",children:e.name})," yet."]})})]},e.id))]})}],87340)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86892,30544,e=>{"use strict";var t=e.i(1262),r=e.i(64595);let a={running:{label:"running",badgeClass:"badge-run"},paused:{label:"paused",badgeClass:"badge-pause"},stopped:{label:"stopped",badgeClass:"badge-stop"},creating:{label:"creating",badgeClass:"badge-create"},error:{label:"error",badgeClass:"badge-err"}};e.s(["StatusBadge",0,function({status:e}){let n=a[e]??a.stopped;return(0,t.jsxs)(r.Badge,{className:n.badgeClass,children:[(0,t.jsx)("span",{className:"badge-dot"}),n.label]})}],86892);var n=e.i(45971),s=e.i(54129),o=e.i(65232),l=e.i(69377),i=e.i(44344),c=e.i(9383);let d=(0,c.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",c.callServer,void 0,c.findSourceMapURL,"destroyBoxAction"),u=(0,c.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",c.callServer,void 0,c.findSourceMapURL,"pauseBoxAction"),x=(0,c.createServerReference)("6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb",c.callServer,void 0,c.findSourceMapURL,"renameBoxAction"),m=(0,c.createServerReference)("4071308a0e1675de302803bb969800c52d79f11e13",c.callServer,void 0,c.findSourceMapURL,"resumeBoxAction"),p=(0,c.createServerReference)("40e545c7dd69b4a1d410deb9c94101099961d3af7a",c.callServer,void 0,c.findSourceMapURL,"stopBoxAction");e.s(["BoxActions",0,function({box:e,size:r}){let a=(0,n.useRouter)(),[c,b]=(0,s.useTransition)(),h="running"===e.status,f="paused"===e.status,g="stopped"===e.status,j="lg"===r,v=j?"sm":"icon-sm",N=(t,r,n)=>{t.stopPropagation(),(!n||window.confirm(n))&&b(async()=>{let t=await r(e.id);t.ok||window.alert(`Action failed: ${t.error}`),a.refresh()})};return(0,t.jsxs)("div",{className:(0,o.cn)("flex gap-1.5",j?"":"justify-end"),children:[f?(0,t.jsxs)(l.Button,{variant:j?"default":"outline",size:v,title:"Resume",disabled:c,className:j?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:e=>N(e,m),children:[(0,t.jsx)(i.Icons.play,{}),j?"Resume":null]}):(0,t.jsxs)(l.Button,{variant:"outline",size:v,disabled:c||!h,title:"Pause",className:j?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:e=>N(e,u),children:[(0,t.jsx)(i.Icons.pause,{}),j?"Pause":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:v,disabled:c||g,title:"Stop",onClick:e=>N(e,p),children:[(0,t.jsx)(i.Icons.stop,{}),j?"Stop":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:v,disabled:c,title:"Rename",onClick:t=>{t.stopPropagation();let r=window.prompt("Rename box (label only — leave blank to reset)",e.displayName??e.task);null!==r&&b(async()=>{let t=await x(e.id,r.trim());t.ok||window.alert(`Rename failed: ${t.error}`),a.refresh()})},children:[(0,t.jsx)(i.Icons.pencil,{}),j?"Rename":null]}),(0,t.jsxs)(l.Button,{variant:"destructive",size:v,title:"Destroy",disabled:c,onClick:t=>N(t,d,`Destroy box ${e.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,t.jsx)(i.Icons.trash,{}),j?"Destroy":null]})]})}],30544)},95141,e=>{"use strict";var t=e.i(1262),r=e.i(54129),a=e.i(65232),n=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:s,children:o}){return(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{className:"anim-fade fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-[rgba(20,24,30,.42)] p-6 backdrop-blur-[2px]",onClick:e,children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,a.cn)("anim-pop relative m-auto w-full max-w-[500px] rounded-2xl border border-border bg-card shadow-[0_40px_80px_-30px_rgba(20,24,30,.5)]",s),onClick:e=>e.stopPropagation(),children:[o,(0,t.jsx)("button",{className:"absolute right-4 top-4 grid h-7 w-7 cursor-pointer place-items-center rounded-md border-0 bg-transparent text-[#a4a9b0] transition-colors hover:bg-secondary hover:text-foreground",onClick:e,"aria-label":"Close",children:(0,t.jsx)(n.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("px-5 py-4",e),...r})},"DialogDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("mt-1 font-mono text-xs text-muted-foreground",e),...r})},"DialogFooter",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",e),...r})},"DialogHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",e),...r})},"DialogIcon",0,function({children:e}){return(0,t.jsx)("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-lg border border-[var(--green-line)] bg-accent text-primary [&_svg]:size-[17px]",children:e})},"DialogTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("text-base font-semibold leading-tight tracking-tight",e),...r})}])},49604,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Select",0,function({wrapperClassName:e,className:a,children:n,...s}){return(0,t.jsxs)("span",{className:(0,r.cn)("relative inline-flex",e),children:[(0,t.jsx)("select",{className:(0,r.cn)("h-9 w-full cursor-pointer appearance-none rounded-lg border border-input bg-card py-1 pl-3 pr-9 text-[13px] shadow-sm focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",a),...s,children:n}),(0,t.jsx)("svg",{className:"pointer-events-none absolute right-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:(0,t.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}])},80922,35594,e=>{"use strict";var t=e.i(1262),r=e.i(51096),a=e.i(44344);e.s(["BackLink",0,function({to:e,children:n}){return(0,t.jsxs)(r.default,{className:"mb-3.5 inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-mono text-xs text-muted-foreground hover:text-primary",href:e,children:[(0,t.jsx)(a.Icons.arrowL,{className:"size-[13px]"}),n]})}],80922);var n=e.i(65232),s=e.i(8536);e.s(["Stat",0,function({k:e,v:r,mono:a,icon:s}){return(0,t.jsxs)("div",{className:"px-4.5 p-4",children:[(0,t.jsx)("div",{className:"mb-1.5 font-mono text-[10.5px] uppercase tracking-[.06em] text-[#a4a9b0]",children:e}),(0,t.jsxs)("div",{className:(0,n.cn)("flex items-center gap-2 font-semibold tracking-[-0.01em]",a?"font-mono text-sm font-medium":"text-base"),children:[s?(0,t.jsx)(s,{className:"size-[15px] text-muted-foreground"}):null,r]})]})},"StatGrid",0,function({children:e}){return(0,t.jsx)(s.Card,{className:"grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] divide-x divide-border/60 overflow-hidden",children:e})}],35594)},8536,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Card",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("p-5 pt-0",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[12.5px] text-muted-foreground",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-1 p-5",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...a})}])},3060,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Input",0,function({className:e,...a}){return(0,t.jsx)("input",{className:(0,r.cn)("flex h-10 w-full rounded-lg border border-input bg-card px-3 py-1 text-sm shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...a})}])},86184,e=>{"use strict";var t=e.i(1262),r=e.i(54129),a=e.i(69377),n=e.i(3060);function s({jobId:e,login:o}){let[l,i]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[u,x]=(0,r.useState)(null),m="exchanging"===o.phase,p=async()=>{let t=l.trim();if(t&&!c){d(!0),x(null);try{let r=await fetch(`/api/v1/jobs/${encodeURIComponent(e)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})});if(!r.ok){let e=await r.json().catch(()=>null);x(e?.error?.message??`request failed (${r.status})`);return}i("")}catch(e){x(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,t.jsx)("p",{className:"text-xs text-amber-100/80",children:"Your saved Claude login is expired. Open the sign-in page, approve access, then paste the code Claude shows you."}),o.url?(0,t.jsx)("a",{href:o.url,target:"_blank",rel:"noreferrer",className:"w-fit rounded-md bg-amber-500/20 px-2.5 py-1 text-xs font-medium text-amber-100 underline decoration-amber-400/50 underline-offset-2 hover:bg-amber-500/30",children:"Open Claude sign-in ↗"}):(0,t.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,t.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,t.jsx)(n.Input,{value:l,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&p()},placeholder:"Paste approval code",disabled:m,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(a.Button,{type:"button",onClick:()=>void p(),disabled:!l.trim()||c||m,children:m?"Verifying…":c?"Submitting…":"Submit"})]}),o.lastError?(0,t.jsx)("p",{className:"text-xs text-amber-300",children:o.lastError}):null,"error"===o.phase&&o.error?(0,t.jsx)("p",{className:"text-xs text-red-400",children:o.error}):null,u?(0,t.jsx)("p",{className:"text-xs text-red-400",children:u}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:a,onDone:n,onStatus:o,onLogin:l}){let[i,c]=(0,r.useState)([]),[d,u]=(0,r.useState)(null),x=(0,r.useRef)(null),m=(0,r.useRef)(n);m.current=n;let p=(0,r.useRef)(o);p.current=o;let b=(0,r.useRef)(l);return b.current=l,(0,r.useEffect)(()=>{p.current?.("streaming");let t=new EventSource(a??`/api/jobs/${encodeURIComponent(e)}/logs`);return t.addEventListener("log",e=>{let t=JSON.parse(e.data);c(e=>[...e,t])}),t.addEventListener("login",e=>{let t=JSON.parse(e.data);u(t),b.current?.(t)}),t.addEventListener("end",e=>{let r=JSON.parse(e.data);p.current?.(r.status),m.current?.(r.status),t.close()}),()=>t.close()},[e,a]),(0,r.useEffect)(()=>{let e=x.current;e&&(e.scrollTop=e.scrollHeight)},[i]),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[d&&"done"!==d.phase?(0,t.jsx)(s,{jobId:e,login:d}):null,(0,t.jsx)("pre",{ref:x,className:"max-h-[440px] min-h-[220px] overflow-auto whitespace-pre rounded-lg bg-[#16181c] p-3 font-mono text-[11.5px] leading-relaxed text-[#d6d9de]",children:0===i.length?"starting…":i.join("\n")})]})}])},33789,1485,e=>{"use strict";var t=e.i(1262),r=e.i(54129);e.s(["Ago",0,function({ms:e}){let[a,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>n(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:a?function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return t+"s ago";let r=Math.floor(t/60);if(r<60)return r+"m ago";let a=Math.floor(r/60);return a<24?a+"h ago":Math.floor(a/24)+"d ago"}(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:r}){return(0,t.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[e,(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),r??null]})}],1485)},9383,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={callServer:function(){return s.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=e.r(57855),o=e.r(61414),l=e.r(97615)},31758,e=>{"use strict";var t=e.i(1262),r=e.i(44344);e.s(["EmptyBox",0,function({children:e}){return(0,t.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-card px-5 py-9 text-center text-[13.5px] text-muted-foreground",children:[(0,t.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,t.jsx)(r.Icons.box,{className:"size-5"})}),e]})}])},23878,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Table",0,function({className:e,...a}){return(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...a})},"TableBody",0,function({className:e,...a}){return(0,t.jsx)("tbody",{className:(0,r.cn)("[&_tr:last-child]:border-0",e),...a})},"TableCell",0,function({className:e,...a}){return(0,t.jsx)("td",{className:(0,r.cn)("px-4 py-3 align-middle",e),...a})},"TableHead",0,function({className:e,...a}){return(0,t.jsx)("th",{className:(0,r.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",e),...a})},"TableHeader",0,function({className:e,...a}){return(0,t.jsx)("thead",{className:(0,r.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",e),...a})},"TableRow",0,function({className:e,...a}){return(0,t.jsx)("tr",{className:(0,r.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",e),...a})}])},22983,93268,66818,e=>{"use strict";var t=e.i(1262),r=e.i(45971),a=e.i(33789),n=e.i(44344),s=e.i(86892),o=e.i(8536),l=e.i(23878),i=e.i(30544);e.s(["BoxTable",0,function({boxes:e}){let c=(0,r.useRouter)();return(0,t.jsx)(o.Card,{className:"overflow-hidden",children:(0,t.jsxs)(l.Table,{children:[(0,t.jsx)(l.TableHeader,{children:(0,t.jsxs)(l.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(l.TableHead,{className:"w-[38%]",children:"Task"}),(0,t.jsx)(l.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,t.jsx)(l.TableHead,{className:"max-md:hidden",children:"Status"}),(0,t.jsx)(l.TableHead,{className:"text-right",children:"Actions"})]})}),(0,t.jsx)(l.TableBody,{children:e.map(e=>(0,t.jsxs)(l.TableRow,{className:"cursor-pointer",onClick:()=>c.push("/boxes/"+e.id),children:[(0,t.jsxs)(l.TableCell,{children:[(0,t.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:e.task}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.id," · ",e.host]})]}),(0,t.jsxs)(l.TableCell,{className:"max-md:hidden",children:[(0,t.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,t.jsx)(n.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.branch})]}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.agent," · ",(0,t.jsx)(a.Ago,{ms:e.lastActivity})]})]}),(0,t.jsx)(l.TableCell,{className:"max-md:hidden",children:(0,t.jsx)(s.StatusBadge,{status:e.status})}),(0,t.jsx)(l.TableCell,{className:"text-right",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(i.BoxActions,{box:e})})]},e.id))})]})})}],22983);var c=e.i(54129),d=e.i(64595),u=e.i(69377),x=e.i(95141),m=e.i(3060),p=e.i(49604),b=e.i(65232);function h({className:e,...r}){return(0,t.jsx)("textarea",{className:(0,b.cn)("flex min-h-[76px] w-full resize-y rounded-lg border border-input bg-card px-3 py-2 text-sm leading-normal shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...r})}var f=e.i(9383);let g=(0,f.createServerReference)("4070192706087364b8c7d220576a6f3e4d3e5c532b",f.callServer,void 0,f.findSourceMapURL,"createBoxAction"),j=(0,f.createServerReference)("40386bdce4d894a318a969412fa1299d2704ccdfb3",f.callServer,void 0,f.findSourceMapURL,"listBranchesAction");var v=e.i(96621),N=e.i(86184);let S=[{id:"docker",label:"Docker (local)",configured:!0}];function y({project:e,projects:a,onClose:s}){let o=(0,r.useRouter)(),{state:l}=(0,v.useStore)(),i=l.providers.length?l.providers:S,[d,f]=(0,c.useTransition)(),[C,B]=(0,c.useState)(e?.id??a[0]?.id??""),[R,T]=(0,c.useState)("claude"),[I,D]=(0,c.useState)("docker"),[L,A]=(0,c.useState)(""),[P,E]=(0,c.useState)(""),[z,U]=(0,c.useState)(""),[H,M]=(0,c.useState)(null),[O,F]=(0,c.useState)(!1),[$,_]=(0,c.useState)(!1),[J,q]=(0,c.useState)(null),[K,W]=(0,c.useState)(null),[G,V]=(0,c.useState)("streaming"),[Y,Q]=(0,c.useState)(null),[X,Z]=(0,c.useState)(null),[ee,et]=(0,c.useState)(!1),[er,ea]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/v1/providers?freshness=1",{credentials:"same-origin"});if(!t.ok)return;let r=await t.json();if(e)return;let a={};for(let e of r.providers??[])a[e.id]={baseStatus:e.baseStatus,baseStaleReason:e.baseStaleReason,jobId:e.jobId};ea(a)}catch{}})(),()=>{e=!0}},[]);let en=a.find(e=>e.id===C)??e,es=I??"docker",eo=i.find(e=>e.id===es),el=er?.[es],ei=!!el&&(!!el.jobId||"unprepared"===el.baseStatus||"stale"===el.baseStatus);(0,c.useEffect)(()=>{if(!C||K)return;F(en?.needsSetup??!1),D("docker");let e=!1;return M(null),U(en?.currentBranch??""),j(C).then(t=>{if(e||!t.ok){e||t.ok||M([]);return}M(t.branches),t.current&&t.branches.includes(t.current)&&U(t.current)}),()=>{e=!0}},[C,K]);let ec=()=>{q(null);let e=el?.jobId;e?Z(e):f(async()=>{try{let e=await fetch(`/api/v1/providers/${encodeURIComponent(es)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({})}),t=await e.json().catch(()=>null);if(!e.ok||!t?.jobId)return void q(t?.error?.message??`base image build request failed (${e.status})`);Z(t.jobId)}catch(e){q(e instanceof Error?e.message:String(e))}})},ed=()=>{q(null),f(async()=>{let e=await g({projectId:C,agent:R,provider:I,name:L.trim()||void 0,prompt:"none"===R?void 0:P.trim()||void 0,fromBranch:z.trim()&&z.trim()!==en?.currentBranch?z.trim():void 0,setupWizard:"none"!==R&&O});e.ok?(W(e.jobId),o.refresh()):q(e.error)})};return(0,t.jsxs)(x.Dialog,{onClose:s,className:K||X?"max-w-[900px]":"max-w-[560px]",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogIcon,{children:(0,t.jsx)(n.Icons.box,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x.DialogTitle,{children:!K&&X?"Building base image":"Create box"}),(0,t.jsx)(x.DialogDescription,{children:en?en.name:"Start a box in a project"})]}),K||X?(0,t.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,t.jsx)(w,{status:G,loginPhase:Y})}):null]}),(0,t.jsx)(x.DialogBody,{className:"flex flex-col gap-4",children:K?(0,t.jsx)(N.JobLogStream,{jobId:K,onStatus:V,onDone:()=>o.refresh(),onLogin:e=>Q(e?.phase??null)}):X?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["Building the ",eo?.label??es," base image — one-time, can take several minutes. The box is created automatically when it finishes."]}),(0,t.jsx)(N.JobLogStream,{jobId:X,onStatus:V,onDone:e=>{"done"===e?ed():q(`base image build ${e}`)}}),J?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:J}):null]}):(0,t.jsxs)(t.Fragment,{children:[e?null:(0,t.jsx)(k,{label:"Project",children:(0,t.jsxs)(p.Select,{value:C,onChange:e=>B(e.target.value),children:[0===a.length?(0,t.jsx)("option",{value:"",children:"No projects — add one first"}):null,a.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,t.jsx)(k,{label:"Provider",children:(0,t.jsx)(p.Select,{value:I,onChange:e=>D(e.target.value),children:i.map(e=>(0,t.jsxs)("option",{value:e.id,disabled:!e.configured,title:e.reason,children:[e.label,e.configured?"":" — not configured"]},e.id))})}),ei?(0,t.jsx)("p",{className:"-mt-2 font-mono text-xs text-amber-600 dark:text-amber-400",title:el?.baseStaleReason,children:el?.jobId?"A base-image build is already running — the box will be created when it finishes.":el?.baseStatus==="unprepared"?"First use of this provider: the base image will be downloaded or built first (can take 5–10 minutes).":"The base image is out of date and will be rebuilt first (can take 5–10 minutes)."}):null,(0,t.jsx)(k,{label:"Agent",children:(0,t.jsxs)(p.Select,{value:R,onChange:e=>T(e.target.value),children:[(0,t.jsx)("option",{value:"claude",children:"Claude"}),(0,t.jsx)("option",{value:"codex",children:"Codex"}),(0,t.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,t.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,t.jsx)(k,{label:"Name (optional)",children:(0,t.jsx)(m.Input,{value:L,onChange:e=>A(e.target.value),placeholder:"auto"})}),en?.needsSetup&&"none"!==R?(0,t.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",checked:O,onChange:e=>F(e.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"This project has no agentbox.yaml — the agent explores the repo and proposes one on its first turn."})]})]}):null,"none"===R?(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["The box is created and left running with no agent — attach later from a terminal or SSH (",(0,t.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>_(e=>!e),className:"flex cursor-pointer items-center gap-1.5 self-start text-xs font-medium text-secondary-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(n.Icons.chevR,{className:(0,b.cn)("size-3.5 transition-transform",$&&"rotate-90")}),"Advanced"]}),$?(0,t.jsxs)(t.Fragment,{children:[null===H?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsx)(p.Select,{value:"",disabled:!0,children:(0,t.jsx)("option",{value:"",children:"Loading branches…"})})}):H.length>0?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsxs)(p.Select,{value:z,onChange:e=>U(e.target.value),children:[en?.currentBranch&&!H.includes(en.currentBranch)?(0,t.jsxs)("option",{value:"",children:[en.currentBranch," (current)"]}):null,H.map(e=>(0,t.jsxs)("option",{value:e,children:[e,e===en?.currentBranch?" (current)":""]},e))]})}):null,"none"!==R?(0,t.jsx)(k,{label:"Initial prompt (optional)",children:(0,t.jsx)(h,{value:P,onChange:e=>E(e.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),J?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:J}):null]})}),(0,t.jsx)(x.DialogFooter,{children:K||X?(0,t.jsxs)(t.Fragment,{children:["streaming"===G?(0,t.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:K?"The box + agent start in the background — you can close this.":"Keep this open — the box is created when the build finishes."}):null,(0,t.jsx)(u.Button,{onClick:s,children:"Close"})]}):ee?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",title:el?.baseStaleReason,children:["The ",eo?.label??es," base image is out of date."]}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>et(!1),disabled:d,children:"Cancel"}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>{et(!1),ed()},disabled:d,children:"Use existing image"}),(0,t.jsx)(u.Button,{onClick:()=>{et(!1),ec()},disabled:d,children:"Rebuild & create"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Button,{variant:"outline",onClick:s,disabled:d,children:"Cancel"}),(0,t.jsx)(u.Button,{onClick:()=>{(q(null),C)?ei?"docker"===es||el?.baseStatus!=="stale"||el.jobId?ec():et(!0):ed():q("pick a project")},disabled:d||!C,children:d?"Starting…":"Create box"})]})})]})}function w({status:e,loginPhase:r}){return"done"===e?(0,t.jsxs)(d.Badge,{className:"badge-run",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===e||"error"===e||"cancelled"===e?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===r?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===r||"starting"===r||"exchanging"===r?(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Working…"]})}function k({label:e,children:r}){return(0,t.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:e}),r]})}e.s(["CreateBoxButton",0,function({project:e,projects:r,variant:a,size:s,className:o}){let[l,i]=(0,c.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.Button,{variant:a,size:s,className:o,onClick:()=>i(!0),children:[(0,t.jsx)(n.Icons.plus,{}),"Create box"]}),l?(0,t.jsx)(y,{project:e,projects:r??(e?[e]:[]),onClose:()=>i(!1)}):null]})}],93268);let C=(0,f.createServerReference)("40c7856bd78dddab224344045df78d51620e411335",f.callServer,void 0,f.findSourceMapURL,"removeProjectAction");e.s(["DeleteProjectButton",0,function({project:e,size:a,className:s,redirectHome:o}){let l=(0,r.useRouter)(),[i,d]=(0,c.useTransition)();return(0,t.jsxs)(u.Button,{variant:"destructive",size:a,className:s,title:"Delete project",disabled:i,onClick:t=>{t.stopPropagation(),t.preventDefault(),window.confirm(`Remove project "${e.name}" from the hub? Its folder and files are NOT deleted — this only unregisters it (and any hub-set project settings). This cannot be undone.`)&&d(async()=>{let t=await C(e.id);t.ok?o?l.push("/"):l.refresh():window.alert(`Delete failed: ${t.error}`)})},children:[(0,t.jsx)(n.Icons.trash,{}),"Delete"]})}],66818)},86691,e=>{"use strict";var t=e.i(1262),r=e.i(45971),a=e.i(33789),n=e.i(44344),s=e.i(96621),o=e.i(80922),l=e.i(22983),i=e.i(93268),c=e.i(66818),d=e.i(31758),u=e.i(1485),x=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,r.useParams)(),{project:m,boxesFor:p}=(0,s.useStore)(),b=m(e);if(!b)return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,t.jsx)(o.BackLink,{to:"/",children:"Dashboard"}),(0,t.jsx)(d.EmptyBox,{children:"Project not found."})]});let h=p(e),f=h.filter(e=>"running"===e.status).length;return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,t.jsx)(o.BackLink,{to:"/",children:"All projects"}),(0,t.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("h1",{className:"flex items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[(0,t.jsx)("span",{className:"grid h-[26px] w-[26px] flex-none place-items-center rounded-md border border-[var(--green-line)] bg-accent text-primary",children:(0,t.jsx)(n.Icons.folder,{className:"size-[15px]"})}),b.name]}),(0,t.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:b.repo})," · ",b.provider]})]}),(0,t.jsxs)("div",{className:"ml-auto flex flex-none gap-2 max-md:ml-0",children:[(0,t.jsx)(i.CreateBoxButton,{project:b}),0===h.length?(0,t.jsx)(c.DeleteProjectButton,{project:b,redirectHome:!0}):null]})]}),(0,t.jsx)("div",{className:"mt-5",children:(0,t.jsxs)(x.StatGrid,{children:[(0,t.jsx)(x.Stat,{k:"Boxes",v:h.length,icon:n.Icons.box}),(0,t.jsx)(x.Stat,{k:"Running",v:f,icon:n.Icons.activity}),(0,t.jsx)(x.Stat,{k:"Provider",v:b.provider,mono:!0}),(0,t.jsx)(x.Stat,{k:"Created",v:(0,t.jsx)(a.Ago,{ms:b.createdAt}),mono:!0})]})}),(0,t.jsx)(u.SectionLabel,{children:"Boxes"}),h.length?(0,t.jsx)(l.BoxTable,{boxes:h}):(0,t.jsx)(d.EmptyBox,{children:(0,t.jsx)("div",{children:"No boxes yet."})})]})}])}]);
@@ -3,8 +3,8 @@ import {
3
3
  AUTH_DB_PATH,
4
4
  cookieSecure,
5
5
  hubProfile
6
- } from "./chunk-OBKLTPIR.js";
7
- import "./chunk-AKLBSCSZ.js";
6
+ } from "./chunk-56YQBVN2.js";
7
+ import "./chunk-EXQCBM5Q.js";
8
8
  import "./chunk-TZFWAJVB.js";
9
9
 
10
10
  // lib/auth.ts
@@ -7,8 +7,8 @@ import {
7
7
  authMode,
8
8
  cookieSecure,
9
9
  hubProfile
10
- } from "./chunk-OBKLTPIR.js";
11
- import "./chunk-AKLBSCSZ.js";
10
+ } from "./chunk-56YQBVN2.js";
11
+ import "./chunk-EXQCBM5Q.js";
12
12
  import "./chunk-TZFWAJVB.js";
13
13
  export {
14
14
  AUTH_DB_PATH,
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __cr } from 'node:module'; import { fileURLToPath as __f } from 'node:url'; import { dirname as __d } from 'node:path'; const require = __cr(import.meta.url); const __filename = __f(import.meta.url); const __dirname = __d(__filename);
2
2
  import {
3
3
  STATE_DIR
4
- } from "./chunk-AKLBSCSZ.js";
4
+ } from "./chunk-EXQCBM5Q.js";
5
5
 
6
6
  // lib/auth-config.ts
7
7
  import { join } from "node:path";
@@ -21,14 +21,7 @@ import {
21
21
  portlessUnalias,
22
22
  registerBoxWithRelay,
23
23
  syncClaudeCredentials
24
- } from "./chunk-V5KGFHCF.js";
25
- import {
26
- hashProjectPath,
27
- loadEffectiveConfig,
28
- projectDirSegment,
29
- require_dist,
30
- sanitizeMnemonic
31
- } from "./chunk-AKLBSCSZ.js";
24
+ } from "./chunk-JQFB2CNA.js";
32
25
  import {
33
26
  BOX_DYNAMIC_SYNC_MANIFEST,
34
27
  BOX_HOME,
@@ -67,10 +60,17 @@ import {
67
60
  stageOpencodeCredentialsForUpload,
68
61
  stageOpencodeStateForUpload,
69
62
  stageOpencodeStaticForUpload
70
- } from "./chunk-LJG4CEGS.js";
63
+ } from "./chunk-K6RA5GJI.js";
71
64
  import {
72
65
  execa
73
66
  } from "./chunk-EFW34I43.js";
67
+ import {
68
+ hashProjectPath,
69
+ loadEffectiveConfig,
70
+ projectDirSegment,
71
+ require_dist,
72
+ sanitizeMnemonic
73
+ } from "./chunk-EXQCBM5Q.js";
74
74
  import {
75
75
  __toESM
76
76
  } from "./chunk-TZFWAJVB.js";
@@ -7533,6 +7533,9 @@ var BUILT_IN_DEFAULTS = {
7533
7533
  pruneProjectConfigs: true,
7534
7534
  pruneProjectConfigsEvery: 50
7535
7535
  },
7536
+ update: {
7537
+ check: true
7538
+ },
7536
7539
  integrations: {
7537
7540
  notion: { enabled: false },
7538
7541
  linear: { enabled: false }
@@ -7901,6 +7904,11 @@ var KEY_REGISTRY = [
7901
7904
  type: "int",
7902
7905
  description: "Run the orphan project-config sweep every N successful `agentbox create`."
7903
7906
  },
7907
+ {
7908
+ key: "update.check",
7909
+ type: "bool",
7910
+ description: 'Daily background check for a newer published agentbox (npm registry) and menu-bar app (release sha sidecar), plus the "newer version available" nudge. At most one network probe per 24h; false disables both.'
7911
+ },
7904
7912
  {
7905
7913
  key: "integrations.notion.enabled",
7906
7914
  type: "bool",
@@ -1,18 +1,8 @@
1
1
  import { createRequire as __cr } from 'node:module'; import { fileURLToPath as __f } from 'node:url'; import { dirname as __d } from 'node:path'; const require = __cr(import.meta.url); const __filename = __f(import.meta.url); const __dirname = __d(__filename);
2
- import {
3
- BUILT_IN_DEFAULTS,
4
- GLOBAL_CONFIG_FILE,
5
- hashProjectPath,
6
- loadEffectiveConfig,
7
- parseUserConfig,
8
- projectDirSegment,
9
- require_dist,
10
- sanitizeMnemonic,
11
- setConfigValue
12
- } from "./chunk-AKLBSCSZ.js";
13
2
  import {
14
3
  AmbiguousBoxError,
15
4
  BOX_HOME,
5
+ BUILD_CONTEXT_DIR,
16
6
  BoxNotFoundError,
17
7
  DEFAULT_BOX_IMAGE,
18
8
  DEFAULT_ENV_PATTERNS,
@@ -46,6 +36,7 @@ import {
46
36
  looksLikeSecret,
47
37
  makeHostGitPorts,
48
38
  makeSyncContext,
39
+ mintSshKey,
49
40
  parseDownloadKind,
50
41
  parseReplacements,
51
42
  pickFreshBranch,
@@ -71,12 +62,24 @@ import {
71
62
  sanitizeGitArgs,
72
63
  seedAgentsVolume,
73
64
  setInstallMethodNative,
65
+ syncAgentboxSshConfig,
74
66
  trustWorkspace,
75
67
  upstreamRef
76
- } from "./chunk-LJG4CEGS.js";
68
+ } from "./chunk-K6RA5GJI.js";
77
69
  import {
78
70
  execa
79
71
  } from "./chunk-EFW34I43.js";
72
+ import {
73
+ BUILT_IN_DEFAULTS,
74
+ GLOBAL_CONFIG_FILE,
75
+ hashProjectPath,
76
+ loadEffectiveConfig,
77
+ parseUserConfig,
78
+ projectDirSegment,
79
+ require_dist,
80
+ sanitizeMnemonic,
81
+ setConfigValue
82
+ } from "./chunk-EXQCBM5Q.js";
80
83
  import {
81
84
  __toESM
82
85
  } from "./chunk-TZFWAJVB.js";
@@ -9090,6 +9093,53 @@ function buildVncUrls(record, engine) {
9090
9093
  }
9091
9094
  return urls;
9092
9095
  }
9096
+ var SSH_CONTAINER_PORT = 22;
9097
+ async function launchSshdDaemon(container, timeoutMs = 5e3) {
9098
+ const result = await execInBox(container, ["/usr/local/bin/agentbox-sshd-start"], {
9099
+ user: "root",
9100
+ detach: true
9101
+ });
9102
+ if (result.exitCode !== 0) {
9103
+ return { up: false, reason: `docker exec failed: ${result.stderr || result.stdout}` };
9104
+ }
9105
+ const deadline = Date.now() + timeoutMs;
9106
+ while (Date.now() < deadline) {
9107
+ const probe = await execInBox(
9108
+ container,
9109
+ ["bash", "-lc", "(echo > /dev/tcp/127.0.0.1/22) 2>/dev/null"],
9110
+ { user: "vscode" }
9111
+ );
9112
+ if (probe.exitCode === 0) return { up: true };
9113
+ await new Promise((r) => setTimeout(r, 150));
9114
+ }
9115
+ return { up: false, reason: `sshd did not bind 22 within ${String(timeoutMs)}ms` };
9116
+ }
9117
+ async function installAuthorizedKey(container, publicKey) {
9118
+ const script = "set -e; install -d -m 700 -o vscode -g vscode /home/vscode/.ssh; cat > /home/vscode/.ssh/authorized_keys; chown vscode:vscode /home/vscode/.ssh/authorized_keys; chmod 600 /home/vscode/.ssh/authorized_keys";
9119
+ const result = await execa(
9120
+ "docker",
9121
+ ["exec", "--user", "root", "-i", container, "sh", "-c", script],
9122
+ { input: publicKey.endsWith("\n") ? publicKey : `${publicKey}
9123
+ `, reject: false }
9124
+ );
9125
+ if (result.exitCode !== 0) {
9126
+ return {
9127
+ ok: false,
9128
+ reason: `docker exec failed (exit ${String(result.exitCode)}): ${(result.stderr ?? "").toString().slice(0, 400)}`
9129
+ };
9130
+ }
9131
+ return { ok: true };
9132
+ }
9133
+ async function setUpBoxSshd(container, sshDir, comment) {
9134
+ const key = await mintSshKey(sshDir, comment);
9135
+ const installed = await installAuthorizedKey(container, key.publicKey);
9136
+ if (!installed.ok) {
9137
+ return { sshHostPort: null, identityFile: key.privatePath, up: false, reason: installed.reason };
9138
+ }
9139
+ const launch = await launchSshdDaemon(container);
9140
+ const sshHostPort = await publishedHostPort(container, SSH_CONTAINER_PORT);
9141
+ return { sshHostPort, identityFile: key.privatePath, up: launch.up, reason: launch.reason };
9142
+ }
9093
9143
  var WEB_CONTAINER_PORT = 80;
9094
9144
  var PORTLESS_BIN = "portless";
9095
9145
  var SUB_VERSION = ["--version"];
@@ -10363,8 +10413,8 @@ async function ensureAgentboxTasksFile(container, services, opts = {}) {
10363
10413
  return { status: "wrote" };
10364
10414
  }
10365
10415
  async function writeFileInBox(container, path, content) {
10366
- const { execa: execa20 } = await import("./execa-4DLVNM6E.js");
10367
- const result = await execa20(
10416
+ const { execa: execa21 } = await import("./execa-4DLVNM6E.js");
10417
+ const result = await execa21(
10368
10418
  "docker",
10369
10419
  ["exec", "-i", "--user", "vscode", container, "sh", "-c", `cat > ${shellQuote2(path)}`],
10370
10420
  { input: content, reject: false }
@@ -10732,6 +10782,9 @@ async function createBox(opts) {
10732
10782
  const webPortMappings = [
10733
10783
  { hostPort: 0, containerPort: WEB_CONTAINER_PORT, hostIp: "127.0.0.1" }
10734
10784
  ];
10785
+ const sshPortMappings = [
10786
+ { hostPort: 0, containerPort: SSH_CONTAINER_PORT, hostIp: "127.0.0.1" }
10787
+ ];
10735
10788
  const agentboxEnv = {
10736
10789
  AGENTBOX: "1",
10737
10790
  AGENTBOX_BOX_NAME: name,
@@ -10781,6 +10834,8 @@ async function createBox(opts) {
10781
10834
  vncContainerPort: vncEnabled ? VNC_CONTAINER_PORT : void 0,
10782
10835
  vncPassword,
10783
10836
  webContainerPort: WEB_CONTAINER_PORT,
10837
+ sshEnabled: true,
10838
+ sshContainerPort: SSH_CONTAINER_PORT,
10784
10839
  dockerVolume,
10785
10840
  dockerCacheShared: dockerCacheShared || void 0,
10786
10841
  projectRoot: opts.projectRoot,
@@ -10795,7 +10850,7 @@ async function createBox(opts) {
10795
10850
  image: imageRef,
10796
10851
  extraVolumes,
10797
10852
  limits: effectiveLimits,
10798
- portMappings: [...vncPortMappings, ...webPortMappings],
10853
+ portMappings: [...vncPortMappings, ...webPortMappings, ...sshPortMappings],
10799
10854
  env: {
10800
10855
  AGENTBOX_BOX_ID: id,
10801
10856
  ...agentboxEnv,
@@ -10951,6 +11006,16 @@ async function createBox(opts) {
10951
11006
  `web port reserved on host 127.0.0.1:${String(webHostPort)} (forwards to the web service once agentbox.yaml sets a service expose:)`
10952
11007
  );
10953
11008
  }
11009
+ const ssh = await setUpBoxSshd(
11010
+ containerName,
11011
+ join12(boxDir, "ssh"),
11012
+ `agentbox-${name}-${id}`
11013
+ );
11014
+ if (ssh.up && ssh.sshHostPort) {
11015
+ log(`sshd up on host 127.0.0.1:${String(ssh.sshHostPort)} (loopback-only)`);
11016
+ } else {
11017
+ log(`sshd did not come up: ${ssh.reason ?? "unknown"} (open/SSH unavailable; docker exec still works)`);
11018
+ }
10954
11019
  let portlessAliasName;
10955
11020
  let portlessUrl;
10956
11021
  let portlessVncAliasName;
@@ -11001,12 +11066,25 @@ async function createBox(opts) {
11001
11066
  carry: carrySummary,
11002
11067
  vncHostPort: vncHostPort ?? void 0,
11003
11068
  webHostPort: webHostPort ?? void 0,
11069
+ sshHostPort: ssh.sshHostPort ?? void 0,
11070
+ // Only advertise an ssh-config alias when sshd actually bound (`up`). Docker
11071
+ // publishes the -p 0:22 host port regardless, so gating on the port alone
11072
+ // would point `~/.ssh/config` at a dead loopback port when sshd failed to
11073
+ // start. A later `start`/`open` re-runs setUpBoxSshd and records it once up.
11074
+ ssh: ssh.up && ssh.sshHostPort ? { host: "127.0.0.1", user: "vscode", identityFile: ssh.identityFile, port: ssh.sshHostPort } : void 0,
11004
11075
  portlessAlias: portlessAliasName,
11005
11076
  portlessUrl,
11006
11077
  portlessVncAlias: portlessVncAliasName,
11007
11078
  portlessVncUrl
11008
11079
  };
11009
11080
  await recordBox(record);
11081
+ if (record.ssh) {
11082
+ try {
11083
+ await syncAgentboxSshConfig();
11084
+ } catch (err) {
11085
+ log(`ssh-config sync failed (best-effort): ${err instanceof Error ? err.message : String(err)}`);
11086
+ }
11087
+ }
11010
11088
  return { record, imageBuilt: built, resync: resyncResult };
11011
11089
  }
11012
11090
  var DEFAULT_SHELL_SESSION = "shell";
@@ -11330,6 +11408,27 @@ async function resyncBox(idOrName, onLog) {
11330
11408
  const hadConflicts = repos.some((r) => r.mergeConflicts.length > 0 || r.overlaySkipped.length > 0);
11331
11409
  return { repos, hadConflicts };
11332
11410
  }
11411
+ async function refreshBoxSshd(box) {
11412
+ if (!box.sshEnabled) return box;
11413
+ const ssh = await setUpBoxSshd(
11414
+ box.container,
11415
+ join14(boxRunDirFor2(box), "ssh"),
11416
+ `agentbox-${box.name}-${box.id}`
11417
+ );
11418
+ if (!ssh.up || !ssh.sshHostPort) return box;
11419
+ const port = ssh.sshHostPort;
11420
+ const changed = port !== box.sshHostPort || box.ssh?.port !== port;
11421
+ box.sshHostPort = port;
11422
+ box.ssh = { host: "127.0.0.1", user: "vscode", identityFile: ssh.identityFile, port };
11423
+ if (changed) {
11424
+ await recordBox(box);
11425
+ try {
11426
+ await syncAgentboxSshConfig();
11427
+ } catch {
11428
+ }
11429
+ }
11430
+ return box;
11431
+ }
11333
11432
  async function startBox(idOrName) {
11334
11433
  const box = await resolveBox(idOrName);
11335
11434
  for (const w of box.gitWorktrees ?? []) {
@@ -11375,6 +11474,7 @@ async function startBox(idOrName) {
11375
11474
  await recordBox(box);
11376
11475
  }
11377
11476
  }
11477
+ await refreshBoxSshd(box);
11378
11478
  if (box.portlessAlias && box.webHostPort || box.portlessVncAlias && box.vncHostPort) {
11379
11479
  try {
11380
11480
  const portless = await detectPortless();
@@ -11558,6 +11658,12 @@ async function destroyBox(idOrName, opts = {}) {
11558
11658
  } catch {
11559
11659
  }
11560
11660
  await removeBoxRecord(box.id);
11661
+ if (box.ssh) {
11662
+ try {
11663
+ await syncAgentboxSshConfig();
11664
+ } catch {
11665
+ }
11666
+ }
11561
11667
  return { record: box, removedContainer, removedVolumes, removedSnapshot };
11562
11668
  }
11563
11669
  async function listSnapshotDirs() {
@@ -12342,7 +12448,12 @@ async function spawnHub(hubServer, cliEntry, log, portlessEnabled) {
12342
12448
  NODE_ENV: "production",
12343
12449
  AGENTBOX_CLI_ENTRY: cliEntry,
12344
12450
  // The hub is the localhost profile (token gate); bind loopback.
12345
- AGENTBOX_HUB_HOST: HOST
12451
+ AGENTBOX_HUB_HOST: HOST,
12452
+ // The hub bundle ships no staged docker build context of its own, so its
12453
+ // in-process docker base-freshness check couldn't fingerprint (degrading
12454
+ // to 'unknown'). Hand it the CLI's resolved context so hub-side
12455
+ // fingerprints match what the create/prepare workers compute.
12456
+ AGENTBOX_DOCKER_CONTEXT: BUILD_CONTEXT_DIR
12346
12457
  }
12347
12458
  });
12348
12459
  child.unref();
@@ -12583,6 +12694,10 @@ export {
12583
12694
  generateVncPassword,
12584
12695
  VNC_CONTAINER_PORT,
12585
12696
  buildVncUrls,
12697
+ SSH_CONTAINER_PORT,
12698
+ launchSshdDaemon,
12699
+ installAuthorizedKey,
12700
+ setUpBoxSshd,
12586
12701
  PORTLESS_PROXY_PORT,
12587
12702
  detectPortless,
12588
12703
  resetPortlessCache,
@@ -12658,6 +12773,7 @@ export {
12658
12773
  unpauseBox,
12659
12774
  stopBox,
12660
12775
  resyncBox,
12776
+ refreshBoxSshd,
12661
12777
  startBox,
12662
12778
  openBoxInFinder,
12663
12779
  getBoxHostPaths,