@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
@@ -1,3 +1,3 @@
1
- module.exports=[17607,3015,a=>{"use strict";var b=a.i(33552),c=a.i(50253);a.s(["Ago",0,function({ms:a}){let[d,e]=(0,c.useState)(!1);return(0,c.useEffect)(()=>e(!0),[]),(0,b.jsx)("span",{suppressHydrationWarning:!0,children:d?function(a){let b=Math.floor((Date.now()-a)/1e3);if(b<60)return b+"s ago";let c=Math.floor(b/60);if(c<60)return c+"m ago";let d=Math.floor(c/60);return d<24?d+"h ago":Math.floor(d/24)+"d ago"}(a):new Date(a).toLocaleDateString()})}],17607),a.s(["SectionLabel",0,function({children:a,right:c}){return(0,b.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[a,(0,b.jsx)("span",{className:"h-px flex-1 bg-border"}),c??null]})}],3015)},96664,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(6451),g=a.r(74786),h=a.r(50495)},12019,a=>{"use strict";var b=a.i(33552),c=a.i(97187);a.s(["EmptyBox",0,function({children:a}){return(0,b.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,b.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,b.jsx)(c.Icons.box,{className:"size-5"})}),a]})}])},24985,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Table",0,function({className:a,...d}){return(0,b.jsx)("table",{className:(0,c.cn)("w-full caption-bottom text-sm",a),...d})},"TableBody",0,function({className:a,...d}){return(0,b.jsx)("tbody",{className:(0,c.cn)("[&_tr:last-child]:border-0",a),...d})},"TableCell",0,function({className:a,...d}){return(0,b.jsx)("td",{className:(0,c.cn)("px-4 py-3 align-middle",a),...d})},"TableHead",0,function({className:a,...d}){return(0,b.jsx)("th",{className:(0,c.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",a),...d})},"TableHeader",0,function({className:a,...d}){return(0,b.jsx)("thead",{className:(0,c.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",a),...d})},"TableRow",0,function({className:a,...d}){return(0,b.jsx)("tr",{className:(0,c.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",a),...d})}])},87883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Card",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("rounded-xl border border-border bg-card text-card-foreground",a),...d})},"CardContent",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("p-5 pt-0",a),...d})},"CardDescription",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[12.5px] text-muted-foreground",a),...d})},"CardHeader",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("flex flex-col space-y-1 p-5",a),...d})},"CardTitle",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[15px] font-semibold leading-none tracking-tight",a),...d})}])},85883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Input",0,function({className:a,...d}){return(0,b.jsx)("input",{className:(0,c.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",a),...d})}])},94290,a=>{"use strict";var b=a.i(33552),c=a.i(50253),d=a.i(18071),e=a.i(85883);function f({jobId:a,login:g}){let[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null),n="exchanging"===g.phase,o=async()=>{let b=h.trim();if(b&&!j){k(!0),m(null);try{let c=await fetch(`/api/v1/jobs/${encodeURIComponent(a)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:b})});if(!c.ok){let a=await c.json().catch(()=>null);m(a?.error?.message??`request failed (${c.status})`);return}i("")}catch(a){m(a instanceof Error?a.message:String(a))}finally{k(!1)}}};return(0,b.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,b.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,b.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."}),g.url?(0,b.jsx)("a",{href:g.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,b.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,b.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,b.jsx)(e.Input,{value:h,onChange:a=>i(a.target.value),onKeyDown:a=>{"Enter"===a.key&&o()},placeholder:"Paste approval code",disabled:n,className:"flex-1 font-mono text-xs"}),(0,b.jsx)(d.Button,{type:"button",onClick:()=>void o(),disabled:!h.trim()||j||n,children:n?"Verifying…":j?"Submitting…":"Submit"})]}),g.lastError?(0,b.jsx)("p",{className:"text-xs text-amber-300",children:g.lastError}):null,"error"===g.phase&&g.error?(0,b.jsx)("p",{className:"text-xs text-red-400",children:g.error}):null,l?(0,b.jsx)("p",{className:"text-xs text-red-400",children:l}):null]})}a.s(["JobLogStream",0,function({jobId:a,endpoint:d,onDone:e,onStatus:g,onLogin:h}){let[i,j]=(0,c.useState)([]),[k,l]=(0,c.useState)(null),m=(0,c.useRef)(null),n=(0,c.useRef)(e);n.current=e;let o=(0,c.useRef)(g);o.current=g;let p=(0,c.useRef)(h);return p.current=h,(0,c.useEffect)(()=>{o.current?.("streaming");let b=new EventSource(d??`/api/jobs/${encodeURIComponent(a)}/logs`);return b.addEventListener("log",a=>{let b=JSON.parse(a.data);j(a=>[...a,b])}),b.addEventListener("login",a=>{let b=JSON.parse(a.data);l(b),p.current?.(b)}),b.addEventListener("end",a=>{let c=JSON.parse(a.data);o.current?.(c.status),n.current?.(c.status),b.close()}),()=>b.close()},[a,d]),(0,c.useEffect)(()=>{let a=m.current;a&&(a.scrollTop=a.scrollHeight)},[i]),(0,b.jsxs)("div",{className:"flex flex-col gap-3",children:[k&&"done"!==k.phase?(0,b.jsx)(f,{jobId:a,login:k}):null,(0,b.jsx)("pre",{ref:m,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")})]})}])},71152,17236,a=>{"use strict";var b=a.i(33552),c=a.i(54473);let d={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"}};a.s(["StatusBadge",0,function({status:a}){let e=d[a]??d.stopped;return(0,b.jsxs)(c.Badge,{className:e.badgeClass,children:[(0,b.jsx)("span",{className:"badge-dot"}),e.label]})}],71152);var e=a.i(74455),f=a.i(50253),g=a.i(86834),h=a.i(18071),i=a.i(97187),j=a.i(96664);let k=(0,j.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",j.callServer,void 0,j.findSourceMapURL,"destroyBoxAction"),l=(0,j.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",j.callServer,void 0,j.findSourceMapURL,"pauseBoxAction"),m=(0,j.createServerReference)("4071308a0e1675de302803bb969800c52d79f11e13",j.callServer,void 0,j.findSourceMapURL,"resumeBoxAction"),n=(0,j.createServerReference)("40e545c7dd69b4a1d410deb9c94101099961d3af7a",j.callServer,void 0,j.findSourceMapURL,"stopBoxAction");a.s(["BoxActions",0,function({box:a,size:c}){let d=(0,e.useRouter)(),[j,o]=(0,f.useTransition)(),p="running"===a.status,q="paused"===a.status,r="stopped"===a.status,s="lg"===c,t=s?"sm":"icon-sm",u=(b,c,e)=>{b.stopPropagation(),(!e||window.confirm(e))&&o(async()=>{let b=await c(a.id);b.ok||window.alert(`Action failed: ${b.error}`),d.refresh()})};return(0,b.jsxs)("div",{className:(0,g.cn)("flex gap-1.5",s?"":"justify-end"),children:[q?(0,b.jsxs)(h.Button,{variant:s?"default":"outline",size:t,title:"Resume",disabled:j,className:s?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:a=>u(a,m),children:[(0,b.jsx)(i.Icons.play,{}),s?"Resume":null]}):(0,b.jsxs)(h.Button,{variant:"outline",size:t,disabled:j||!p,title:"Pause",className:s?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:a=>u(a,l),children:[(0,b.jsx)(i.Icons.pause,{}),s?"Pause":null]}),(0,b.jsxs)(h.Button,{variant:"outline",size:t,disabled:j||r,title:"Stop",onClick:a=>u(a,n),children:[(0,b.jsx)(i.Icons.stop,{}),s?"Stop":null]}),(0,b.jsxs)(h.Button,{variant:"destructive",size:t,title:"Destroy",disabled:j,onClick:b=>u(b,k,`Destroy box ${a.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,b.jsx)(i.Icons.trash,{}),s?"Destroy":null]})]})}],17236)},45515,a=>{"use strict";var b=a.i(33552),c=a.i(50253),d=a.i(86834),e=a.i(97187);a.s(["Dialog",0,function({onClose:a,className:f,children:g}){return(0,c.useEffect)(()=>{let b=b=>{"Escape"===b.key&&a()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a]),(0,b.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:a,children:(0,b.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,d.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)]",f),onClick:a=>a.stopPropagation(),children:[g,(0,b.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:a,"aria-label":"Close",children:(0,b.jsx)(e.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("px-5 py-4",a),...c})},"DialogDescription",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("mt-1 font-mono text-xs text-muted-foreground",a),...c})},"DialogFooter",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",a),...c})},"DialogHeader",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",a),...c})},"DialogIcon",0,function({children:a}){return(0,b.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:a})},"DialogTitle",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("text-base font-semibold leading-tight tracking-tight",a),...c})}])},53596,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Select",0,function({wrapperClassName:a,className:d,children:e,...f}){return(0,b.jsxs)("span",{className:(0,c.cn)("relative inline-flex",a),children:[(0,b.jsx)("select",{className:(0,c.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",d),...f,children:e}),(0,b.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,b.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}])},24288,82337,a=>{"use strict";var b=a.i(33552),c=a.i(51363),d=a.i(97187);a.s(["BackLink",0,function({to:a,children:e}){return(0,b.jsxs)(c.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:a,children:[(0,b.jsx)(d.Icons.arrowL,{className:"size-[13px]"}),e]})}],24288);var e=a.i(86834),f=a.i(87883);a.s(["Stat",0,function({k:a,v:c,mono:d,icon:f}){return(0,b.jsxs)("div",{className:"px-4.5 p-4",children:[(0,b.jsx)("div",{className:"mb-1.5 font-mono text-[10.5px] uppercase tracking-[.06em] text-[#a4a9b0]",children:a}),(0,b.jsxs)("div",{className:(0,e.cn)("flex items-center gap-2 font-semibold tracking-[-0.01em]",d?"font-mono text-sm font-medium":"text-base"),children:[f?(0,b.jsx)(f,{className:"size-[15px] text-muted-foreground"}):null,c]})]})},"StatGrid",0,function({children:a}){return(0,b.jsx)(f.Card,{className:"grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] divide-x divide-border/60 overflow-hidden",children:a})}],82337)},3385,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(17607),e=a.i(97187),f=a.i(80007),g=a.i(24288),h=a.i(61688),i=a.i(10511),j=a.i(47685),k=a.i(12019),l=a.i(3015),m=a.i(82337);a.s(["default",0,function(){let{id:a}=(0,c.useParams)(),{project:n,boxesFor:o}=(0,f.useStore)(),p=n(a);if(!p)return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,b.jsx)(g.BackLink,{to:"/",children:"Dashboard"}),(0,b.jsx)(k.EmptyBox,{children:"Project not found."})]});let q=o(a),r=q.filter(a=>"running"===a.status).length;return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,b.jsx)(g.BackLink,{to:"/",children:"All projects"}),(0,b.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("h1",{className:"flex items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[(0,b.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,b.jsx)(e.Icons.folder,{className:"size-[15px]"})}),p.name]}),(0,b.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:p.repo})," · ",p.provider]})]}),(0,b.jsxs)("div",{className:"ml-auto flex flex-none gap-2 max-md:ml-0",children:[(0,b.jsx)(i.CreateBoxButton,{project:p}),0===q.length?(0,b.jsx)(j.DeleteProjectButton,{project:p,redirectHome:!0}):null]})]}),(0,b.jsx)("div",{className:"mt-5",children:(0,b.jsxs)(m.StatGrid,{children:[(0,b.jsx)(m.Stat,{k:"Boxes",v:q.length,icon:e.Icons.box}),(0,b.jsx)(m.Stat,{k:"Running",v:r,icon:e.Icons.activity}),(0,b.jsx)(m.Stat,{k:"Provider",v:p.provider,mono:!0}),(0,b.jsx)(m.Stat,{k:"Created",v:(0,b.jsx)(d.Ago,{ms:p.createdAt}),mono:!0})]})}),(0,b.jsx)(l.SectionLabel,{children:"Boxes"}),q.length?(0,b.jsx)(h.BoxTable,{boxes:q}):(0,b.jsx)(k.EmptyBox,{children:(0,b.jsx)("div",{children:"No boxes yet."})})]})}])}];
1
+ module.exports=[17607,3015,a=>{"use strict";var b=a.i(33552),c=a.i(50253);a.s(["Ago",0,function({ms:a}){let[d,e]=(0,c.useState)(!1);return(0,c.useEffect)(()=>e(!0),[]),(0,b.jsx)("span",{suppressHydrationWarning:!0,children:d?function(a){let b=Math.floor((Date.now()-a)/1e3);if(b<60)return b+"s ago";let c=Math.floor(b/60);if(c<60)return c+"m ago";let d=Math.floor(c/60);return d<24?d+"h ago":Math.floor(d/24)+"d ago"}(a):new Date(a).toLocaleDateString()})}],17607),a.s(["SectionLabel",0,function({children:a,right:c}){return(0,b.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[a,(0,b.jsx)("span",{className:"h-px flex-1 bg-border"}),c??null]})}],3015)},96664,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(6451),g=a.r(74786),h=a.r(50495)},12019,a=>{"use strict";var b=a.i(33552),c=a.i(97187);a.s(["EmptyBox",0,function({children:a}){return(0,b.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,b.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,b.jsx)(c.Icons.box,{className:"size-5"})}),a]})}])},24985,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Table",0,function({className:a,...d}){return(0,b.jsx)("table",{className:(0,c.cn)("w-full caption-bottom text-sm",a),...d})},"TableBody",0,function({className:a,...d}){return(0,b.jsx)("tbody",{className:(0,c.cn)("[&_tr:last-child]:border-0",a),...d})},"TableCell",0,function({className:a,...d}){return(0,b.jsx)("td",{className:(0,c.cn)("px-4 py-3 align-middle",a),...d})},"TableHead",0,function({className:a,...d}){return(0,b.jsx)("th",{className:(0,c.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",a),...d})},"TableHeader",0,function({className:a,...d}){return(0,b.jsx)("thead",{className:(0,c.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",a),...d})},"TableRow",0,function({className:a,...d}){return(0,b.jsx)("tr",{className:(0,c.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",a),...d})}])},87883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Card",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("rounded-xl border border-border bg-card text-card-foreground",a),...d})},"CardContent",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("p-5 pt-0",a),...d})},"CardDescription",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[12.5px] text-muted-foreground",a),...d})},"CardHeader",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("flex flex-col space-y-1 p-5",a),...d})},"CardTitle",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[15px] font-semibold leading-none tracking-tight",a),...d})}])},85883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Input",0,function({className:a,...d}){return(0,b.jsx)("input",{className:(0,c.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",a),...d})}])},94290,a=>{"use strict";var b=a.i(33552),c=a.i(50253),d=a.i(18071),e=a.i(85883);function f({jobId:a,login:g}){let[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null),n="exchanging"===g.phase,o=async()=>{let b=h.trim();if(b&&!j){k(!0),m(null);try{let c=await fetch(`/api/v1/jobs/${encodeURIComponent(a)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:b})});if(!c.ok){let a=await c.json().catch(()=>null);m(a?.error?.message??`request failed (${c.status})`);return}i("")}catch(a){m(a instanceof Error?a.message:String(a))}finally{k(!1)}}};return(0,b.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,b.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,b.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."}),g.url?(0,b.jsx)("a",{href:g.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,b.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,b.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,b.jsx)(e.Input,{value:h,onChange:a=>i(a.target.value),onKeyDown:a=>{"Enter"===a.key&&o()},placeholder:"Paste approval code",disabled:n,className:"flex-1 font-mono text-xs"}),(0,b.jsx)(d.Button,{type:"button",onClick:()=>void o(),disabled:!h.trim()||j||n,children:n?"Verifying…":j?"Submitting…":"Submit"})]}),g.lastError?(0,b.jsx)("p",{className:"text-xs text-amber-300",children:g.lastError}):null,"error"===g.phase&&g.error?(0,b.jsx)("p",{className:"text-xs text-red-400",children:g.error}):null,l?(0,b.jsx)("p",{className:"text-xs text-red-400",children:l}):null]})}a.s(["JobLogStream",0,function({jobId:a,endpoint:d,onDone:e,onStatus:g,onLogin:h}){let[i,j]=(0,c.useState)([]),[k,l]=(0,c.useState)(null),m=(0,c.useRef)(null),n=(0,c.useRef)(e);n.current=e;let o=(0,c.useRef)(g);o.current=g;let p=(0,c.useRef)(h);return p.current=h,(0,c.useEffect)(()=>{o.current?.("streaming");let b=new EventSource(d??`/api/jobs/${encodeURIComponent(a)}/logs`);return b.addEventListener("log",a=>{let b=JSON.parse(a.data);j(a=>[...a,b])}),b.addEventListener("login",a=>{let b=JSON.parse(a.data);l(b),p.current?.(b)}),b.addEventListener("end",a=>{let c=JSON.parse(a.data);o.current?.(c.status),n.current?.(c.status),b.close()}),()=>b.close()},[a,d]),(0,c.useEffect)(()=>{let a=m.current;a&&(a.scrollTop=a.scrollHeight)},[i]),(0,b.jsxs)("div",{className:"flex flex-col gap-3",children:[k&&"done"!==k.phase?(0,b.jsx)(f,{jobId:a,login:k}):null,(0,b.jsx)("pre",{ref:m,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")})]})}])},71152,17236,a=>{"use strict";var b=a.i(33552),c=a.i(54473);let d={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"}};a.s(["StatusBadge",0,function({status:a}){let e=d[a]??d.stopped;return(0,b.jsxs)(c.Badge,{className:e.badgeClass,children:[(0,b.jsx)("span",{className:"badge-dot"}),e.label]})}],71152);var e=a.i(74455),f=a.i(50253),g=a.i(86834),h=a.i(18071),i=a.i(97187),j=a.i(96664);let k=(0,j.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",j.callServer,void 0,j.findSourceMapURL,"destroyBoxAction"),l=(0,j.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",j.callServer,void 0,j.findSourceMapURL,"pauseBoxAction"),m=(0,j.createServerReference)("6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb",j.callServer,void 0,j.findSourceMapURL,"renameBoxAction"),n=(0,j.createServerReference)("4071308a0e1675de302803bb969800c52d79f11e13",j.callServer,void 0,j.findSourceMapURL,"resumeBoxAction"),o=(0,j.createServerReference)("40e545c7dd69b4a1d410deb9c94101099961d3af7a",j.callServer,void 0,j.findSourceMapURL,"stopBoxAction");a.s(["BoxActions",0,function({box:a,size:c}){let d=(0,e.useRouter)(),[j,p]=(0,f.useTransition)(),q="running"===a.status,r="paused"===a.status,s="stopped"===a.status,t="lg"===c,u=t?"sm":"icon-sm",v=(b,c,e)=>{b.stopPropagation(),(!e||window.confirm(e))&&p(async()=>{let b=await c(a.id);b.ok||window.alert(`Action failed: ${b.error}`),d.refresh()})};return(0,b.jsxs)("div",{className:(0,g.cn)("flex gap-1.5",t?"":"justify-end"),children:[r?(0,b.jsxs)(h.Button,{variant:t?"default":"outline",size:u,title:"Resume",disabled:j,className:t?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:a=>v(a,n),children:[(0,b.jsx)(i.Icons.play,{}),t?"Resume":null]}):(0,b.jsxs)(h.Button,{variant:"outline",size:u,disabled:j||!q,title:"Pause",className:t?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:a=>v(a,l),children:[(0,b.jsx)(i.Icons.pause,{}),t?"Pause":null]}),(0,b.jsxs)(h.Button,{variant:"outline",size:u,disabled:j||s,title:"Stop",onClick:a=>v(a,o),children:[(0,b.jsx)(i.Icons.stop,{}),t?"Stop":null]}),(0,b.jsxs)(h.Button,{variant:"outline",size:u,disabled:j,title:"Rename",onClick:b=>{b.stopPropagation();let c=window.prompt("Rename box (label only — leave blank to reset)",a.displayName??a.task);null!==c&&p(async()=>{let b=await m(a.id,c.trim());b.ok||window.alert(`Rename failed: ${b.error}`),d.refresh()})},children:[(0,b.jsx)(i.Icons.pencil,{}),t?"Rename":null]}),(0,b.jsxs)(h.Button,{variant:"destructive",size:u,title:"Destroy",disabled:j,onClick:b=>v(b,k,`Destroy box ${a.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,b.jsx)(i.Icons.trash,{}),t?"Destroy":null]})]})}],17236)},45515,a=>{"use strict";var b=a.i(33552),c=a.i(50253),d=a.i(86834),e=a.i(97187);a.s(["Dialog",0,function({onClose:a,className:f,children:g}){return(0,c.useEffect)(()=>{let b=b=>{"Escape"===b.key&&a()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a]),(0,b.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:a,children:(0,b.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,d.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)]",f),onClick:a=>a.stopPropagation(),children:[g,(0,b.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:a,"aria-label":"Close",children:(0,b.jsx)(e.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("px-5 py-4",a),...c})},"DialogDescription",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("mt-1 font-mono text-xs text-muted-foreground",a),...c})},"DialogFooter",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",a),...c})},"DialogHeader",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",a),...c})},"DialogIcon",0,function({children:a}){return(0,b.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:a})},"DialogTitle",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("text-base font-semibold leading-tight tracking-tight",a),...c})}])},53596,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Select",0,function({wrapperClassName:a,className:d,children:e,...f}){return(0,b.jsxs)("span",{className:(0,c.cn)("relative inline-flex",a),children:[(0,b.jsx)("select",{className:(0,c.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",d),...f,children:e}),(0,b.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,b.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}])},24288,82337,a=>{"use strict";var b=a.i(33552),c=a.i(51363),d=a.i(97187);a.s(["BackLink",0,function({to:a,children:e}){return(0,b.jsxs)(c.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:a,children:[(0,b.jsx)(d.Icons.arrowL,{className:"size-[13px]"}),e]})}],24288);var e=a.i(86834),f=a.i(87883);a.s(["Stat",0,function({k:a,v:c,mono:d,icon:f}){return(0,b.jsxs)("div",{className:"px-4.5 p-4",children:[(0,b.jsx)("div",{className:"mb-1.5 font-mono text-[10.5px] uppercase tracking-[.06em] text-[#a4a9b0]",children:a}),(0,b.jsxs)("div",{className:(0,e.cn)("flex items-center gap-2 font-semibold tracking-[-0.01em]",d?"font-mono text-sm font-medium":"text-base"),children:[f?(0,b.jsx)(f,{className:"size-[15px] text-muted-foreground"}):null,c]})]})},"StatGrid",0,function({children:a}){return(0,b.jsx)(f.Card,{className:"grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] divide-x divide-border/60 overflow-hidden",children:a})}],82337)},3385,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(17607),e=a.i(97187),f=a.i(80007),g=a.i(24288),h=a.i(61688),i=a.i(10511),j=a.i(47685),k=a.i(12019),l=a.i(3015),m=a.i(82337);a.s(["default",0,function(){let{id:a}=(0,c.useParams)(),{project:n,boxesFor:o}=(0,f.useStore)(),p=n(a);if(!p)return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,b.jsx)(g.BackLink,{to:"/",children:"Dashboard"}),(0,b.jsx)(k.EmptyBox,{children:"Project not found."})]});let q=o(a),r=q.filter(a=>"running"===a.status).length;return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,b.jsx)(g.BackLink,{to:"/",children:"All projects"}),(0,b.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("h1",{className:"flex items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[(0,b.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,b.jsx)(e.Icons.folder,{className:"size-[15px]"})}),p.name]}),(0,b.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:p.repo})," · ",p.provider]})]}),(0,b.jsxs)("div",{className:"ml-auto flex flex-none gap-2 max-md:ml-0",children:[(0,b.jsx)(i.CreateBoxButton,{project:p}),0===q.length?(0,b.jsx)(j.DeleteProjectButton,{project:p,redirectHome:!0}):null]})]}),(0,b.jsx)("div",{className:"mt-5",children:(0,b.jsxs)(m.StatGrid,{children:[(0,b.jsx)(m.Stat,{k:"Boxes",v:q.length,icon:e.Icons.box}),(0,b.jsx)(m.Stat,{k:"Running",v:r,icon:e.Icons.activity}),(0,b.jsx)(m.Stat,{k:"Provider",v:p.provider,mono:!0}),(0,b.jsx)(m.Stat,{k:"Created",v:(0,b.jsx)(d.Ago,{ms:p.createdAt}),mono:!0})]})}),(0,b.jsx)(l.SectionLabel,{children:"Boxes"}),q.length?(0,b.jsx)(h.BoxTable,{boxes:q}):(0,b.jsx)(k.EmptyBox,{children:(0,b.jsx)("div",{children:"No boxes yet."})})]})}])}];
2
2
 
3
3
  //# sourceMappingURL=_0tgpglr._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[60401,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(50253),e=a.i(97187),f=a.i(18071),g=a.i(96664);let h=(0,g.createServerReference)("60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",g.callServer,void 0,g.findSourceMapURL,"answerApprovalAction");a.s(["ApprovalActions",0,function({id:a}){let g=(0,c.useRouter)(),[i,j]=(0,d.useTransition)(),k=b=>{j(async()=>{let c=await h(a,b);c.ok||window.alert(`Failed: ${c.error}`),g.refresh()})};return(0,b.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,b.jsxs)(f.Button,{variant:"outline",size:"sm",disabled:i,className:"hover:border-[var(--red-line)] hover:bg-[var(--red-soft)] hover:text-[var(--red)]",onClick:()=>k("n"),children:[(0,b.jsx)(e.Icons.x,{}),"Deny"]}),(0,b.jsxs)(f.Button,{size:"sm",disabled:i,onClick:()=>k("y"),children:[(0,b.jsx)(e.Icons.check,{}),"Approve"]})]})}],60401)},17607,3015,a=>{"use strict";var b=a.i(33552),c=a.i(50253);a.s(["Ago",0,function({ms:a}){let[d,e]=(0,c.useState)(!1);return(0,c.useEffect)(()=>e(!0),[]),(0,b.jsx)("span",{suppressHydrationWarning:!0,children:d?function(a){let b=Math.floor((Date.now()-a)/1e3);if(b<60)return b+"s ago";let c=Math.floor(b/60);if(c<60)return c+"m ago";let d=Math.floor(c/60);return d<24?d+"h ago":Math.floor(d/24)+"d ago"}(a):new Date(a).toLocaleDateString()})}],17607),a.s(["SectionLabel",0,function({children:a,right:c}){return(0,b.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[a,(0,b.jsx)("span",{className:"h-px flex-1 bg-border"}),c??null]})}],3015)},96664,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(6451),g=a.r(74786),h=a.r(50495)},12019,a=>{"use strict";var b=a.i(33552),c=a.i(97187);a.s(["EmptyBox",0,function({children:a}){return(0,b.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,b.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,b.jsx)(c.Icons.box,{className:"size-5"})}),a]})}])},24985,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Table",0,function({className:a,...d}){return(0,b.jsx)("table",{className:(0,c.cn)("w-full caption-bottom text-sm",a),...d})},"TableBody",0,function({className:a,...d}){return(0,b.jsx)("tbody",{className:(0,c.cn)("[&_tr:last-child]:border-0",a),...d})},"TableCell",0,function({className:a,...d}){return(0,b.jsx)("td",{className:(0,c.cn)("px-4 py-3 align-middle",a),...d})},"TableHead",0,function({className:a,...d}){return(0,b.jsx)("th",{className:(0,c.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",a),...d})},"TableHeader",0,function({className:a,...d}){return(0,b.jsx)("thead",{className:(0,c.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",a),...d})},"TableRow",0,function({className:a,...d}){return(0,b.jsx)("tr",{className:(0,c.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",a),...d})}])},87883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Card",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("rounded-xl border border-border bg-card text-card-foreground",a),...d})},"CardContent",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("p-5 pt-0",a),...d})},"CardDescription",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[12.5px] text-muted-foreground",a),...d})},"CardHeader",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("flex flex-col space-y-1 p-5",a),...d})},"CardTitle",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[15px] font-semibold leading-none tracking-tight",a),...d})}])},85883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Input",0,function({className:a,...d}){return(0,b.jsx)("input",{className:(0,c.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",a),...d})}])},94290,a=>{"use strict";var b=a.i(33552),c=a.i(50253),d=a.i(18071),e=a.i(85883);function f({jobId:a,login:g}){let[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null),n="exchanging"===g.phase,o=async()=>{let b=h.trim();if(b&&!j){k(!0),m(null);try{let c=await fetch(`/api/v1/jobs/${encodeURIComponent(a)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:b})});if(!c.ok){let a=await c.json().catch(()=>null);m(a?.error?.message??`request failed (${c.status})`);return}i("")}catch(a){m(a instanceof Error?a.message:String(a))}finally{k(!1)}}};return(0,b.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,b.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,b.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."}),g.url?(0,b.jsx)("a",{href:g.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,b.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,b.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,b.jsx)(e.Input,{value:h,onChange:a=>i(a.target.value),onKeyDown:a=>{"Enter"===a.key&&o()},placeholder:"Paste approval code",disabled:n,className:"flex-1 font-mono text-xs"}),(0,b.jsx)(d.Button,{type:"button",onClick:()=>void o(),disabled:!h.trim()||j||n,children:n?"Verifying…":j?"Submitting…":"Submit"})]}),g.lastError?(0,b.jsx)("p",{className:"text-xs text-amber-300",children:g.lastError}):null,"error"===g.phase&&g.error?(0,b.jsx)("p",{className:"text-xs text-red-400",children:g.error}):null,l?(0,b.jsx)("p",{className:"text-xs text-red-400",children:l}):null]})}a.s(["JobLogStream",0,function({jobId:a,endpoint:d,onDone:e,onStatus:g,onLogin:h}){let[i,j]=(0,c.useState)([]),[k,l]=(0,c.useState)(null),m=(0,c.useRef)(null),n=(0,c.useRef)(e);n.current=e;let o=(0,c.useRef)(g);o.current=g;let p=(0,c.useRef)(h);return p.current=h,(0,c.useEffect)(()=>{o.current?.("streaming");let b=new EventSource(d??`/api/jobs/${encodeURIComponent(a)}/logs`);return b.addEventListener("log",a=>{let b=JSON.parse(a.data);j(a=>[...a,b])}),b.addEventListener("login",a=>{let b=JSON.parse(a.data);l(b),p.current?.(b)}),b.addEventListener("end",a=>{let c=JSON.parse(a.data);o.current?.(c.status),n.current?.(c.status),b.close()}),()=>b.close()},[a,d]),(0,c.useEffect)(()=>{let a=m.current;a&&(a.scrollTop=a.scrollHeight)},[i]),(0,b.jsxs)("div",{className:"flex flex-col gap-3",children:[k&&"done"!==k.phase?(0,b.jsx)(f,{jobId:a,login:k}):null,(0,b.jsx)("pre",{ref:m,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")})]})}])},45515,a=>{"use strict";var b=a.i(33552),c=a.i(50253),d=a.i(86834),e=a.i(97187);a.s(["Dialog",0,function({onClose:a,className:f,children:g}){return(0,c.useEffect)(()=>{let b=b=>{"Escape"===b.key&&a()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a]),(0,b.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:a,children:(0,b.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,d.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)]",f),onClick:a=>a.stopPropagation(),children:[g,(0,b.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:a,"aria-label":"Close",children:(0,b.jsx)(e.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("px-5 py-4",a),...c})},"DialogDescription",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("mt-1 font-mono text-xs text-muted-foreground",a),...c})},"DialogFooter",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",a),...c})},"DialogHeader",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",a),...c})},"DialogIcon",0,function({children:a}){return(0,b.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:a})},"DialogTitle",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("text-base font-semibold leading-tight tracking-tight",a),...c})}])},71152,17236,a=>{"use strict";var b=a.i(33552),c=a.i(54473);let d={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"}};a.s(["StatusBadge",0,function({status:a}){let e=d[a]??d.stopped;return(0,b.jsxs)(c.Badge,{className:e.badgeClass,children:[(0,b.jsx)("span",{className:"badge-dot"}),e.label]})}],71152);var e=a.i(74455),f=a.i(50253),g=a.i(86834),h=a.i(18071),i=a.i(97187),j=a.i(96664);let k=(0,j.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",j.callServer,void 0,j.findSourceMapURL,"destroyBoxAction"),l=(0,j.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",j.callServer,void 0,j.findSourceMapURL,"pauseBoxAction"),m=(0,j.createServerReference)("4071308a0e1675de302803bb969800c52d79f11e13",j.callServer,void 0,j.findSourceMapURL,"resumeBoxAction"),n=(0,j.createServerReference)("40e545c7dd69b4a1d410deb9c94101099961d3af7a",j.callServer,void 0,j.findSourceMapURL,"stopBoxAction");a.s(["BoxActions",0,function({box:a,size:c}){let d=(0,e.useRouter)(),[j,o]=(0,f.useTransition)(),p="running"===a.status,q="paused"===a.status,r="stopped"===a.status,s="lg"===c,t=s?"sm":"icon-sm",u=(b,c,e)=>{b.stopPropagation(),(!e||window.confirm(e))&&o(async()=>{let b=await c(a.id);b.ok||window.alert(`Action failed: ${b.error}`),d.refresh()})};return(0,b.jsxs)("div",{className:(0,g.cn)("flex gap-1.5",s?"":"justify-end"),children:[q?(0,b.jsxs)(h.Button,{variant:s?"default":"outline",size:t,title:"Resume",disabled:j,className:s?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:a=>u(a,m),children:[(0,b.jsx)(i.Icons.play,{}),s?"Resume":null]}):(0,b.jsxs)(h.Button,{variant:"outline",size:t,disabled:j||!p,title:"Pause",className:s?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:a=>u(a,l),children:[(0,b.jsx)(i.Icons.pause,{}),s?"Pause":null]}),(0,b.jsxs)(h.Button,{variant:"outline",size:t,disabled:j||r,title:"Stop",onClick:a=>u(a,n),children:[(0,b.jsx)(i.Icons.stop,{}),s?"Stop":null]}),(0,b.jsxs)(h.Button,{variant:"destructive",size:t,title:"Destroy",disabled:j,onClick:b=>u(b,k,`Destroy box ${a.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,b.jsx)(i.Icons.trash,{}),s?"Destroy":null]})]})}],17236)},53596,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Select",0,function({wrapperClassName:a,className:d,children:e,...f}){return(0,b.jsxs)("span",{className:(0,c.cn)("relative inline-flex",a),children:[(0,b.jsx)("select",{className:(0,c.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",d),...f,children:e}),(0,b.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,b.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}])},26638,a=>{"use strict";var b=a.i(33552),c=a.i(51363),d=a.i(97187),e=a.i(80007),f=a.i(60401);function g(){let{state:a,box:g}=(0,e.useStore)();if(0===a.approvals.length)return null;let h=[...a.approvals].sort((a,b)=>a.createdAt-b.createdAt),i=h[0],j=g(i.boxId);return(0,b.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,b.jsx)(d.Icons.shield,{className:"mt-0.5 size-4 flex-none text-[var(--amber)]"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[j?(0,b.jsx)(c.default,{className:"text-[13.5px] font-semibold hover:text-[var(--green-ink)]",href:"/boxes/"+j.id,children:j.task}):(0,b.jsx)("span",{className:"text-[13.5px] font-semibold",children:i.boxId}),(0,b.jsx)("span",{className:"truncate font-mono text-[12.5px] text-secondary-foreground",children:i.command??i.message})]}),i.detail?(0,b.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:i.detail}):null,i.cwd?(0,b.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:i.cwd}):null]}),(0,b.jsxs)("div",{className:"flex flex-none items-center gap-3",children:[h.length>1?(0,b.jsxs)("div",{className:"hidden items-center gap-2 sm:flex",children:[(0,b.jsxs)("span",{className:"font-mono text-[11.5px] text-[var(--amber)]",children:[h.length," pending"]}),(0,b.jsx)(c.default,{className:"font-mono text-[11.5px] text-muted-foreground hover:text-[var(--green-ink)]",href:"/approvals",children:"View all"})]}):null,(0,b.jsx)(f.ApprovalActions,{id:i.id})]})]})}var h=a.i(74455),i=a.i(50253),j=a.i(18071),k=a.i(45515),l=a.i(85883),m=a.i(96664);let n=(0,m.createServerReference)("4087bb6da1f4834ca146bcc8cb7c69295dbeda0bdc",m.callServer,void 0,m.findSourceMapURL,"addProjectAction"),o=(0,m.createServerReference)("40942714d29a270a6816a39cd419b4f09f50fc19b1",m.callServer,void 0,m.findSourceMapURL,"browseDirAction");function p(){let[a,c]=(0,i.useState)(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(j.Button,{onClick:()=>c(!0),children:[(0,b.jsx)(d.Icons.plus,{}),"New project"]}),a?(0,b.jsx)(q,{onClose:()=>c(!1)}):null]})}function q({onClose:a}){let c=(0,h.useRouter)(),[e,f]=(0,i.useTransition)(),[g,m]=(0,i.useState)(""),[p,r]=(0,i.useState)(null),[s,t]=(0,i.useState)([]),[u,v]=(0,i.useState)(!0),[w,x]=(0,i.useState)(null),y=(0,i.useCallback)(async a=>{v(!0),x(null);let b=await o(a);if(!b.ok){x(b.error),v(!1);return}m(b.path),r(b.parent),t(b.entries),v(!1)},[]);return(0,i.useEffect)(()=>{y()},[y]),(0,b.jsxs)(k.Dialog,{onClose:a,children:[(0,b.jsxs)(k.DialogHeader,{children:[(0,b.jsx)(k.DialogIcon,{children:(0,b.jsx)(d.Icons.folder,{})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(k.DialogTitle,{children:"Add project"}),(0,b.jsx)(k.DialogDescription,{children:"Pick a folder on this machine"})]})]}),(0,b.jsxs)(k.DialogBody,{className:"flex flex-col gap-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(j.Button,{variant:"outline",className:"flex-none px-2.5",onClick:()=>void y(p??void 0),disabled:!p||u,title:"Up one level","aria-label":"Up one level",children:(0,b.jsx)(d.Icons.arrowUp,{})}),(0,b.jsx)(l.Input,{value:g,onChange:a=>m(a.target.value),placeholder:"/Users/you/Projects/my-app",className:"font-mono text-xs",onKeyDown:a=>{"Enter"===a.key&&y(g)}})]}),(0,b.jsx)("div",{className:"h-56 overflow-y-auto rounded-lg border border-border bg-background",children:u?(0,b.jsx)("div",{className:"px-3 py-2.5 font-mono text-xs text-muted-foreground",children:"Loading…"}):0===s.length?(0,b.jsx)("div",{className:"px-3 py-2.5 font-mono text-xs text-muted-foreground",children:"No subfolders here"}):s.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>void y(a.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,b.jsx)(d.Icons.folder,{className:"size-4 flex-none text-muted-foreground"}),(0,b.jsx)("span",{className:"truncate",children:a.name}),a.isProject?(0,b.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,b.jsx)(d.Icons.chevR,{className:"ml-auto size-3.5 flex-none text-[#a4a9b0]"})]},a.path))}),w?(0,b.jsx)("div",{className:"font-mono text-xs text-destructive",children:w}):null]}),(0,b.jsxs)(k.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:a,disabled:e,children:"Cancel"}),(0,b.jsx)(j.Button,{onClick:()=>{x(null);let b=g.trim();b?f(async()=>{let d=await n(b);d.ok?(c.refresh(),a()):x(d.error)}):x("choose a folder")},disabled:e||u,children:e?"Adding…":"Add this folder"})]})]})}var r=a.i(61688),s=a.i(10511),t=a.i(47685),u=a.i(12019),v=a.i(3015);a.s(["default",0,function(){let{state:a,boxesFor:f}=(0,e.useStore)(),h=a.projects.map(a=>({p:a,boxes:f(a.id)})).sort((a,b)=>(a.boxes.length>0?0:1)-(b.boxes.length>0?0:1)),i=a.boxes.filter(a=>"running"===a.status).length;return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,b.jsx)(g,{}),(0,b.jsxs)("div",{className:"flex items-start gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Boxes"}),(0,b.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:i})," running across"," ",(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:a.projects.length})," ","project",1===a.projects.length?"":"s"," on this machine."]})]}),(0,b.jsx)("div",{className:"ml-auto flex flex-none gap-2",children:(0,b.jsx)(p,{})})]}),(0,b.jsx)(v.SectionLabel,{children:"Projects"}),0===h.length?(0,b.jsxs)(u.EmptyBox,{children:[(0,b.jsx)("div",{children:"No projects on this machine yet."}),(0,b.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,h.map(({p:a,boxes:e})=>(0,b.jsxs)("div",{className:"mb-7",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 px-1 pb-3",children:[(0,b.jsxs)(c.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/"+a.id,children:[(0,b.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,b.jsx)(d.Icons.folder,{className:"size-[13px]"})}),a.name]}),(0,b.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:a.repo}),(0,b.jsx)("span",{className:"flex-1"}),(0,b.jsxs)("span",{className:"font-mono text-[11.5px] text-[#a4a9b0]",children:[e.length," box",1===e.length?"":"es"]}),(0,b.jsx)(s.CreateBoxButton,{project:a,variant:"outline",size:"sm",className:"font-mono text-xs"}),0===e.length?(0,b.jsx)(t.DeleteProjectButton,{project:a,size:"sm",className:"font-mono text-xs"}):null]}),e.length?(0,b.jsx)(r.BoxTable,{boxes:e}):(0,b.jsx)(u.EmptyBox,{children:(0,b.jsxs)("div",{children:["No boxes in ",(0,b.jsx)("b",{className:"font-semibold text-secondary-foreground",children:a.name})," yet."]})})]},a.id))]})}],26638)}];
1
+ module.exports=[60401,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(50253),e=a.i(97187),f=a.i(18071),g=a.i(96664);let h=(0,g.createServerReference)("60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",g.callServer,void 0,g.findSourceMapURL,"answerApprovalAction");a.s(["ApprovalActions",0,function({id:a}){let g=(0,c.useRouter)(),[i,j]=(0,d.useTransition)(),k=b=>{j(async()=>{let c=await h(a,b);c.ok||window.alert(`Failed: ${c.error}`),g.refresh()})};return(0,b.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,b.jsxs)(f.Button,{variant:"outline",size:"sm",disabled:i,className:"hover:border-[var(--red-line)] hover:bg-[var(--red-soft)] hover:text-[var(--red)]",onClick:()=>k("n"),children:[(0,b.jsx)(e.Icons.x,{}),"Deny"]}),(0,b.jsxs)(f.Button,{size:"sm",disabled:i,onClick:()=>k("y"),children:[(0,b.jsx)(e.Icons.check,{}),"Approve"]})]})}],60401)},17607,3015,a=>{"use strict";var b=a.i(33552),c=a.i(50253);a.s(["Ago",0,function({ms:a}){let[d,e]=(0,c.useState)(!1);return(0,c.useEffect)(()=>e(!0),[]),(0,b.jsx)("span",{suppressHydrationWarning:!0,children:d?function(a){let b=Math.floor((Date.now()-a)/1e3);if(b<60)return b+"s ago";let c=Math.floor(b/60);if(c<60)return c+"m ago";let d=Math.floor(c/60);return d<24?d+"h ago":Math.floor(d/24)+"d ago"}(a):new Date(a).toLocaleDateString()})}],17607),a.s(["SectionLabel",0,function({children:a,right:c}){return(0,b.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[a,(0,b.jsx)("span",{className:"h-px flex-1 bg-border"}),c??null]})}],3015)},96664,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(6451),g=a.r(74786),h=a.r(50495)},12019,a=>{"use strict";var b=a.i(33552),c=a.i(97187);a.s(["EmptyBox",0,function({children:a}){return(0,b.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,b.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,b.jsx)(c.Icons.box,{className:"size-5"})}),a]})}])},24985,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Table",0,function({className:a,...d}){return(0,b.jsx)("table",{className:(0,c.cn)("w-full caption-bottom text-sm",a),...d})},"TableBody",0,function({className:a,...d}){return(0,b.jsx)("tbody",{className:(0,c.cn)("[&_tr:last-child]:border-0",a),...d})},"TableCell",0,function({className:a,...d}){return(0,b.jsx)("td",{className:(0,c.cn)("px-4 py-3 align-middle",a),...d})},"TableHead",0,function({className:a,...d}){return(0,b.jsx)("th",{className:(0,c.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",a),...d})},"TableHeader",0,function({className:a,...d}){return(0,b.jsx)("thead",{className:(0,c.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",a),...d})},"TableRow",0,function({className:a,...d}){return(0,b.jsx)("tr",{className:(0,c.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",a),...d})}])},87883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Card",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("rounded-xl border border-border bg-card text-card-foreground",a),...d})},"CardContent",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("p-5 pt-0",a),...d})},"CardDescription",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[12.5px] text-muted-foreground",a),...d})},"CardHeader",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("flex flex-col space-y-1 p-5",a),...d})},"CardTitle",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[15px] font-semibold leading-none tracking-tight",a),...d})}])},85883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Input",0,function({className:a,...d}){return(0,b.jsx)("input",{className:(0,c.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",a),...d})}])},94290,a=>{"use strict";var b=a.i(33552),c=a.i(50253),d=a.i(18071),e=a.i(85883);function f({jobId:a,login:g}){let[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null),n="exchanging"===g.phase,o=async()=>{let b=h.trim();if(b&&!j){k(!0),m(null);try{let c=await fetch(`/api/v1/jobs/${encodeURIComponent(a)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:b})});if(!c.ok){let a=await c.json().catch(()=>null);m(a?.error?.message??`request failed (${c.status})`);return}i("")}catch(a){m(a instanceof Error?a.message:String(a))}finally{k(!1)}}};return(0,b.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,b.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,b.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."}),g.url?(0,b.jsx)("a",{href:g.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,b.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,b.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,b.jsx)(e.Input,{value:h,onChange:a=>i(a.target.value),onKeyDown:a=>{"Enter"===a.key&&o()},placeholder:"Paste approval code",disabled:n,className:"flex-1 font-mono text-xs"}),(0,b.jsx)(d.Button,{type:"button",onClick:()=>void o(),disabled:!h.trim()||j||n,children:n?"Verifying…":j?"Submitting…":"Submit"})]}),g.lastError?(0,b.jsx)("p",{className:"text-xs text-amber-300",children:g.lastError}):null,"error"===g.phase&&g.error?(0,b.jsx)("p",{className:"text-xs text-red-400",children:g.error}):null,l?(0,b.jsx)("p",{className:"text-xs text-red-400",children:l}):null]})}a.s(["JobLogStream",0,function({jobId:a,endpoint:d,onDone:e,onStatus:g,onLogin:h}){let[i,j]=(0,c.useState)([]),[k,l]=(0,c.useState)(null),m=(0,c.useRef)(null),n=(0,c.useRef)(e);n.current=e;let o=(0,c.useRef)(g);o.current=g;let p=(0,c.useRef)(h);return p.current=h,(0,c.useEffect)(()=>{o.current?.("streaming");let b=new EventSource(d??`/api/jobs/${encodeURIComponent(a)}/logs`);return b.addEventListener("log",a=>{let b=JSON.parse(a.data);j(a=>[...a,b])}),b.addEventListener("login",a=>{let b=JSON.parse(a.data);l(b),p.current?.(b)}),b.addEventListener("end",a=>{let c=JSON.parse(a.data);o.current?.(c.status),n.current?.(c.status),b.close()}),()=>b.close()},[a,d]),(0,c.useEffect)(()=>{let a=m.current;a&&(a.scrollTop=a.scrollHeight)},[i]),(0,b.jsxs)("div",{className:"flex flex-col gap-3",children:[k&&"done"!==k.phase?(0,b.jsx)(f,{jobId:a,login:k}):null,(0,b.jsx)("pre",{ref:m,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")})]})}])},45515,a=>{"use strict";var b=a.i(33552),c=a.i(50253),d=a.i(86834),e=a.i(97187);a.s(["Dialog",0,function({onClose:a,className:f,children:g}){return(0,c.useEffect)(()=>{let b=b=>{"Escape"===b.key&&a()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a]),(0,b.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:a,children:(0,b.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,d.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)]",f),onClick:a=>a.stopPropagation(),children:[g,(0,b.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:a,"aria-label":"Close",children:(0,b.jsx)(e.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("px-5 py-4",a),...c})},"DialogDescription",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("mt-1 font-mono text-xs text-muted-foreground",a),...c})},"DialogFooter",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",a),...c})},"DialogHeader",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",a),...c})},"DialogIcon",0,function({children:a}){return(0,b.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:a})},"DialogTitle",0,function({className:a,...c}){return(0,b.jsx)("div",{className:(0,d.cn)("text-base font-semibold leading-tight tracking-tight",a),...c})}])},71152,17236,a=>{"use strict";var b=a.i(33552),c=a.i(54473);let d={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"}};a.s(["StatusBadge",0,function({status:a}){let e=d[a]??d.stopped;return(0,b.jsxs)(c.Badge,{className:e.badgeClass,children:[(0,b.jsx)("span",{className:"badge-dot"}),e.label]})}],71152);var e=a.i(74455),f=a.i(50253),g=a.i(86834),h=a.i(18071),i=a.i(97187),j=a.i(96664);let k=(0,j.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",j.callServer,void 0,j.findSourceMapURL,"destroyBoxAction"),l=(0,j.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",j.callServer,void 0,j.findSourceMapURL,"pauseBoxAction"),m=(0,j.createServerReference)("6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb",j.callServer,void 0,j.findSourceMapURL,"renameBoxAction"),n=(0,j.createServerReference)("4071308a0e1675de302803bb969800c52d79f11e13",j.callServer,void 0,j.findSourceMapURL,"resumeBoxAction"),o=(0,j.createServerReference)("40e545c7dd69b4a1d410deb9c94101099961d3af7a",j.callServer,void 0,j.findSourceMapURL,"stopBoxAction");a.s(["BoxActions",0,function({box:a,size:c}){let d=(0,e.useRouter)(),[j,p]=(0,f.useTransition)(),q="running"===a.status,r="paused"===a.status,s="stopped"===a.status,t="lg"===c,u=t?"sm":"icon-sm",v=(b,c,e)=>{b.stopPropagation(),(!e||window.confirm(e))&&p(async()=>{let b=await c(a.id);b.ok||window.alert(`Action failed: ${b.error}`),d.refresh()})};return(0,b.jsxs)("div",{className:(0,g.cn)("flex gap-1.5",t?"":"justify-end"),children:[r?(0,b.jsxs)(h.Button,{variant:t?"default":"outline",size:u,title:"Resume",disabled:j,className:t?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:a=>v(a,n),children:[(0,b.jsx)(i.Icons.play,{}),t?"Resume":null]}):(0,b.jsxs)(h.Button,{variant:"outline",size:u,disabled:j||!q,title:"Pause",className:t?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:a=>v(a,l),children:[(0,b.jsx)(i.Icons.pause,{}),t?"Pause":null]}),(0,b.jsxs)(h.Button,{variant:"outline",size:u,disabled:j||s,title:"Stop",onClick:a=>v(a,o),children:[(0,b.jsx)(i.Icons.stop,{}),t?"Stop":null]}),(0,b.jsxs)(h.Button,{variant:"outline",size:u,disabled:j,title:"Rename",onClick:b=>{b.stopPropagation();let c=window.prompt("Rename box (label only — leave blank to reset)",a.displayName??a.task);null!==c&&p(async()=>{let b=await m(a.id,c.trim());b.ok||window.alert(`Rename failed: ${b.error}`),d.refresh()})},children:[(0,b.jsx)(i.Icons.pencil,{}),t?"Rename":null]}),(0,b.jsxs)(h.Button,{variant:"destructive",size:u,title:"Destroy",disabled:j,onClick:b=>v(b,k,`Destroy box ${a.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,b.jsx)(i.Icons.trash,{}),t?"Destroy":null]})]})}],17236)},53596,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Select",0,function({wrapperClassName:a,className:d,children:e,...f}){return(0,b.jsxs)("span",{className:(0,c.cn)("relative inline-flex",a),children:[(0,b.jsx)("select",{className:(0,c.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",d),...f,children:e}),(0,b.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,b.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}])},26638,a=>{"use strict";var b=a.i(33552),c=a.i(51363),d=a.i(97187),e=a.i(80007),f=a.i(60401);function g(){let{state:a,box:g}=(0,e.useStore)();if(0===a.approvals.length)return null;let h=[...a.approvals].sort((a,b)=>a.createdAt-b.createdAt),i=h[0],j=g(i.boxId);return(0,b.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,b.jsx)(d.Icons.shield,{className:"mt-0.5 size-4 flex-none text-[var(--amber)]"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[j?(0,b.jsx)(c.default,{className:"text-[13.5px] font-semibold hover:text-[var(--green-ink)]",href:"/boxes/"+j.id,children:j.task}):(0,b.jsx)("span",{className:"text-[13.5px] font-semibold",children:i.boxId}),(0,b.jsx)("span",{className:"truncate font-mono text-[12.5px] text-secondary-foreground",children:i.command??i.message})]}),i.detail?(0,b.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:i.detail}):null,i.cwd?(0,b.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:i.cwd}):null]}),(0,b.jsxs)("div",{className:"flex flex-none items-center gap-3",children:[h.length>1?(0,b.jsxs)("div",{className:"hidden items-center gap-2 sm:flex",children:[(0,b.jsxs)("span",{className:"font-mono text-[11.5px] text-[var(--amber)]",children:[h.length," pending"]}),(0,b.jsx)(c.default,{className:"font-mono text-[11.5px] text-muted-foreground hover:text-[var(--green-ink)]",href:"/approvals",children:"View all"})]}):null,(0,b.jsx)(f.ApprovalActions,{id:i.id})]})]})}var h=a.i(74455),i=a.i(50253),j=a.i(18071),k=a.i(45515),l=a.i(85883),m=a.i(96664);let n=(0,m.createServerReference)("4087bb6da1f4834ca146bcc8cb7c69295dbeda0bdc",m.callServer,void 0,m.findSourceMapURL,"addProjectAction"),o=(0,m.createServerReference)("40942714d29a270a6816a39cd419b4f09f50fc19b1",m.callServer,void 0,m.findSourceMapURL,"browseDirAction");function p(){let[a,c]=(0,i.useState)(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(j.Button,{onClick:()=>c(!0),children:[(0,b.jsx)(d.Icons.plus,{}),"New project"]}),a?(0,b.jsx)(q,{onClose:()=>c(!1)}):null]})}function q({onClose:a}){let c=(0,h.useRouter)(),[e,f]=(0,i.useTransition)(),[g,m]=(0,i.useState)(""),[p,r]=(0,i.useState)(null),[s,t]=(0,i.useState)([]),[u,v]=(0,i.useState)(!0),[w,x]=(0,i.useState)(null),y=(0,i.useCallback)(async a=>{v(!0),x(null);let b=await o(a);if(!b.ok){x(b.error),v(!1);return}m(b.path),r(b.parent),t(b.entries),v(!1)},[]);return(0,i.useEffect)(()=>{y()},[y]),(0,b.jsxs)(k.Dialog,{onClose:a,children:[(0,b.jsxs)(k.DialogHeader,{children:[(0,b.jsx)(k.DialogIcon,{children:(0,b.jsx)(d.Icons.folder,{})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(k.DialogTitle,{children:"Add project"}),(0,b.jsx)(k.DialogDescription,{children:"Pick a folder on this machine"})]})]}),(0,b.jsxs)(k.DialogBody,{className:"flex flex-col gap-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(j.Button,{variant:"outline",className:"flex-none px-2.5",onClick:()=>void y(p??void 0),disabled:!p||u,title:"Up one level","aria-label":"Up one level",children:(0,b.jsx)(d.Icons.arrowUp,{})}),(0,b.jsx)(l.Input,{value:g,onChange:a=>m(a.target.value),placeholder:"/Users/you/Projects/my-app",className:"font-mono text-xs",onKeyDown:a=>{"Enter"===a.key&&y(g)}})]}),(0,b.jsx)("div",{className:"h-56 overflow-y-auto rounded-lg border border-border bg-background",children:u?(0,b.jsx)("div",{className:"px-3 py-2.5 font-mono text-xs text-muted-foreground",children:"Loading…"}):0===s.length?(0,b.jsx)("div",{className:"px-3 py-2.5 font-mono text-xs text-muted-foreground",children:"No subfolders here"}):s.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>void y(a.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,b.jsx)(d.Icons.folder,{className:"size-4 flex-none text-muted-foreground"}),(0,b.jsx)("span",{className:"truncate",children:a.name}),a.isProject?(0,b.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,b.jsx)(d.Icons.chevR,{className:"ml-auto size-3.5 flex-none text-[#a4a9b0]"})]},a.path))}),w?(0,b.jsx)("div",{className:"font-mono text-xs text-destructive",children:w}):null]}),(0,b.jsxs)(k.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:a,disabled:e,children:"Cancel"}),(0,b.jsx)(j.Button,{onClick:()=>{x(null);let b=g.trim();b?f(async()=>{let d=await n(b);d.ok?(c.refresh(),a()):x(d.error)}):x("choose a folder")},disabled:e||u,children:e?"Adding…":"Add this folder"})]})]})}var r=a.i(61688),s=a.i(10511),t=a.i(47685),u=a.i(12019),v=a.i(3015);a.s(["default",0,function(){let{state:a,boxesFor:f}=(0,e.useStore)(),h=a.projects.map(a=>({p:a,boxes:f(a.id)})).sort((a,b)=>(a.boxes.length>0?0:1)-(b.boxes.length>0?0:1)),i=a.boxes.filter(a=>"running"===a.status).length;return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,b.jsx)(g,{}),(0,b.jsxs)("div",{className:"flex items-start gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Boxes"}),(0,b.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:i})," running across"," ",(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:a.projects.length})," ","project",1===a.projects.length?"":"s"," on this machine."]})]}),(0,b.jsx)("div",{className:"ml-auto flex flex-none gap-2",children:(0,b.jsx)(p,{})})]}),(0,b.jsx)(v.SectionLabel,{children:"Projects"}),0===h.length?(0,b.jsxs)(u.EmptyBox,{children:[(0,b.jsx)("div",{children:"No projects on this machine yet."}),(0,b.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,h.map(({p:a,boxes:e})=>(0,b.jsxs)("div",{className:"mb-7",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 px-1 pb-3",children:[(0,b.jsxs)(c.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/"+a.id,children:[(0,b.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,b.jsx)(d.Icons.folder,{className:"size-[13px]"})}),a.name]}),(0,b.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:a.repo}),(0,b.jsx)("span",{className:"flex-1"}),(0,b.jsxs)("span",{className:"font-mono text-[11.5px] text-[#a4a9b0]",children:[e.length," box",1===e.length?"":"es"]}),(0,b.jsx)(s.CreateBoxButton,{project:a,variant:"outline",size:"sm",className:"font-mono text-xs"}),0===e.length?(0,b.jsx)(t.DeleteProjectButton,{project:a,size:"sm",className:"font-mono text-xs"}):null]}),e.length?(0,b.jsx)(r.BoxTable,{boxes:e}):(0,b.jsx)(u.EmptyBox,{children:(0,b.jsxs)("div",{children:["No boxes in ",(0,b.jsx)("b",{className:"font-semibold text-secondary-foreground",children:a.name})," yet."]})})]},a.id))]})}],26638)}];
2
2
 
3
3
  //# sourceMappingURL=_1laion6._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[17607,3015,a=>{"use strict";var b=a.i(33552),c=a.i(50253);a.s(["Ago",0,function({ms:a}){let[d,e]=(0,c.useState)(!1);return(0,c.useEffect)(()=>e(!0),[]),(0,b.jsx)("span",{suppressHydrationWarning:!0,children:d?function(a){let b=Math.floor((Date.now()-a)/1e3);if(b<60)return b+"s ago";let c=Math.floor(b/60);if(c<60)return c+"m ago";let d=Math.floor(c/60);return d<24?d+"h ago":Math.floor(d/24)+"d ago"}(a):new Date(a).toLocaleDateString()})}],17607),a.s(["SectionLabel",0,function({children:a,right:c}){return(0,b.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[a,(0,b.jsx)("span",{className:"h-px flex-1 bg-border"}),c??null]})}],3015)},87883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Card",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("rounded-xl border border-border bg-card text-card-foreground",a),...d})},"CardContent",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("p-5 pt-0",a),...d})},"CardDescription",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[12.5px] text-muted-foreground",a),...d})},"CardHeader",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("flex flex-col space-y-1 p-5",a),...d})},"CardTitle",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[15px] font-semibold leading-none tracking-tight",a),...d})}])},85883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Input",0,function({className:a,...d}){return(0,b.jsx)("input",{className:(0,c.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",a),...d})}])},94290,a=>{"use strict";var b=a.i(33552),c=a.i(50253),d=a.i(18071),e=a.i(85883);function f({jobId:a,login:g}){let[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null),n="exchanging"===g.phase,o=async()=>{let b=h.trim();if(b&&!j){k(!0),m(null);try{let c=await fetch(`/api/v1/jobs/${encodeURIComponent(a)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:b})});if(!c.ok){let a=await c.json().catch(()=>null);m(a?.error?.message??`request failed (${c.status})`);return}i("")}catch(a){m(a instanceof Error?a.message:String(a))}finally{k(!1)}}};return(0,b.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,b.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,b.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."}),g.url?(0,b.jsx)("a",{href:g.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,b.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,b.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,b.jsx)(e.Input,{value:h,onChange:a=>i(a.target.value),onKeyDown:a=>{"Enter"===a.key&&o()},placeholder:"Paste approval code",disabled:n,className:"flex-1 font-mono text-xs"}),(0,b.jsx)(d.Button,{type:"button",onClick:()=>void o(),disabled:!h.trim()||j||n,children:n?"Verifying…":j?"Submitting…":"Submit"})]}),g.lastError?(0,b.jsx)("p",{className:"text-xs text-amber-300",children:g.lastError}):null,"error"===g.phase&&g.error?(0,b.jsx)("p",{className:"text-xs text-red-400",children:g.error}):null,l?(0,b.jsx)("p",{className:"text-xs text-red-400",children:l}):null]})}a.s(["JobLogStream",0,function({jobId:a,endpoint:d,onDone:e,onStatus:g,onLogin:h}){let[i,j]=(0,c.useState)([]),[k,l]=(0,c.useState)(null),m=(0,c.useRef)(null),n=(0,c.useRef)(e);n.current=e;let o=(0,c.useRef)(g);o.current=g;let p=(0,c.useRef)(h);return p.current=h,(0,c.useEffect)(()=>{o.current?.("streaming");let b=new EventSource(d??`/api/jobs/${encodeURIComponent(a)}/logs`);return b.addEventListener("log",a=>{let b=JSON.parse(a.data);j(a=>[...a,b])}),b.addEventListener("login",a=>{let b=JSON.parse(a.data);l(b),p.current?.(b)}),b.addEventListener("end",a=>{let c=JSON.parse(a.data);o.current?.(c.status),n.current?.(c.status),b.close()}),()=>b.close()},[a,d]),(0,c.useEffect)(()=>{let a=m.current;a&&(a.scrollTop=a.scrollHeight)},[i]),(0,b.jsxs)("div",{className:"flex flex-col gap-3",children:[k&&"done"!==k.phase?(0,b.jsx)(f,{jobId:a,login:k}):null,(0,b.jsx)("pre",{ref:m,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")})]})}])},9247,a=>{"use strict";var b=a.i(33552),c=a.i(17607),d=a.i(97187),e=a.i(54473),f=a.i(87883),g=a.i(86834);function h({className:a,...c}){return(0,b.jsx)("div",{className:(0,g.cn)("h-px w-full shrink-0 bg-border",a),...c})}var i=a.i(80007),j=a.i(3015),k=a.i(50253),l=a.i(74455),m=a.i(18071),n=a.i(85883),o=a.i(94290);let p={docker:[],e2b:[{key:"apiKey",label:"API key",placeholder:"e2b_…"}],daytona:[{key:"apiKey",label:"API key",placeholder:"dtn_…"}],hetzner:[{key:"token",label:"API token",placeholder:"project read+write token"}],vercel:[{key:"token",label:"Access token",placeholder:"vercel token"},{key:"teamId",label:"Team ID",placeholder:"team_… (optional)",optional:!0},{key:"projectId",label:"Project ID",placeholder:"prj_… (optional)",optional:!0}]};function q(){let{state:a}=(0,i.useStore)(),[c,d]=(0,k.useState)({});return(0,k.useEffect)(()=>{let a=!1;return(async()=>{try{let b=await fetch("/api/v1/providers?freshness=1",{credentials:"same-origin"});if(!b.ok)return;let c=await b.json();if(a)return;let e={};for(let a of c.providers??[])e[a.id]={baseStatus:a.baseStatus,baseStaleReason:a.baseStaleReason};d(e)}catch{}})(),()=>{a=!0}},[a.providers]),(0,b.jsx)(f.Card,{className:"divide-y divide-border/60 overflow-hidden",children:a.providers.map(a=>(0,b.jsx)(r,{provider:{...a,...c[a.id]}},a.id))})}function r({provider:a}){var c;let f=(0,l.useRouter)(),h=p[a.id]??[],i=new Set(h.filter(a=>!a.optional).map(a=>a.key)),[j,q]=(0,k.useState)({}),[s,t]=(0,k.useState)(()=>a.hasCredentials?Object.fromEntries(h.filter(a=>!a.optional).map(a=>[a.key,!0])):{}),[u,v]=(0,k.useState)(!1),[w,x]=(0,k.useState)(null),[y,z]=(0,k.useState)(!a.hasCredentials&&h.length>0),[A,B]=(0,k.useState)(a.jobId??null),[C,D]=(0,k.useState)(!1),[E,F]=(0,k.useState)(null),G=async()=>{v(!0),x(null);try{let b={};for(let a of h){if(s[a.key])continue;let c=(j[a.key]??"").trim();c&&(b[a.key]=c)}let c=await fetch(`/api/v1/providers/${encodeURIComponent(a.id)}/credentials`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(b)});if(!c.ok){let a=await c.json().catch(()=>null);x(a?.error?.message??`request failed (${c.status})`);return}q({}),t(Object.fromEntries([...i].map(a=>[a,!0]))),z(!1),f.refresh()}catch(a){x(a instanceof Error?a.message:String(a))}finally{v(!1)}},H=async()=>{D(!0),F(null);try{let b=await fetch(`/api/v1/providers/${encodeURIComponent(a.id)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(a.configured?{force:!0}:{})}),c=await b.json().catch(()=>null);if(!b.ok||!c?.jobId)return void F(c?.error?.message??`request failed (${b.status})`);B(c.jobId)}catch(a){F(a instanceof Error?a.message:String(a))}finally{D(!1)}},I="docker"===a.id||a.hasCredentials,J=h.length>0;return(0,b.jsxs)("div",{className:"flex flex-col gap-3 p-4 px-5",children:[(0,b.jsxs)("div",{className:(0,g.cn)("flex items-center gap-3",J&&"cursor-pointer"),onClick:J?()=>z(a=>!a):void 0,children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[a.label,(c=a).configured?"stale"===c.baseStatus?(0,b.jsx)(e.Badge,{className:"badge-warn gap-1.5 normal-case",title:c.baseStaleReason,children:"stale — re-bake"}):(0,b.jsxs)(e.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,b.jsx)("span",{className:"badge-dot"}),"ready"]}):c.hasCredentials?(0,b.jsx)(e.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,b.jsx)(e.Badge,{className:"gap-1.5 normal-case",children:"needs credentials"})]}),a.reason?(0,b.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:a.reason}):null]}),(0,b.jsx)("div",{className:"flex flex-none items-center gap-2",onClick:a=>a.stopPropagation(),children:(0,b.jsxs)(m.Button,{type:"button",size:"sm",variant:a.configured?"outline":"default",disabled:!I||C||!!A,onClick:()=>void H(),title:I?void 0:"Add credentials first",children:[(0,b.jsx)(d.Icons.refresh,{className:"size-3.5"}),A?"Baking…":C?"Starting…":a.configured?"Re-bake":"Bake image"]})}),J?(0,b.jsx)(d.Icons.chevR,{className:(0,g.cn)("size-4 flex-none text-muted-foreground transition-transform",y&&"rotate-90")}):(0,b.jsx)("span",{className:"size-4 flex-none","aria-hidden":!0})]}),y&&h.length>0?(0,b.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border/70 bg-card/50 p-3",children:[h.map(a=>(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsxs)("label",{className:"text-[11.5px] font-medium text-muted-foreground",children:[a.label,a.optional?" (optional)":""]}),(0,b.jsx)(n.Input,{type:"password",autoComplete:"off",value:s[a.key]?"••••••••••••":j[a.key]??"",placeholder:a.placeholder,onFocus:()=>{s[a.key]&&(t(b=>({...b,[a.key]:!1})),q(b=>({...b,[a.key]:""})))},onBlur:()=>{i.has(a.key)&&!(j[a.key]??"").trim()&&t(b=>({...b,[a.key]:!0}))},onChange:b=>q(c=>({...c,[a.key]:b.target.value})),className:"font-mono text-xs"})]},a.key)),(0,b.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,b.jsx)(m.Button,{type:"button",size:"sm",disabled:u,onClick:()=>void G(),children:u?"Saving…":"Save credentials"}),w?(0,b.jsx)("span",{className:"text-xs text-red-400",children:w}):null]})]}):null,E?(0,b.jsx)("div",{className:"text-xs text-red-400",children:E}):null,A?(0,b.jsx)(o.JobLogStream,{jobId:A,endpoint:`/api/v1/jobs/${encodeURIComponent(A)}/logs`,onDone:()=>{B(null),f.refresh()}}):null]})}a.s(["default",0,function(){let{state:a}=(0,i.useStore)(),k=a.github;return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,b.jsx)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Settings"}),(0,b.jsx)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:"Providers, GitHub access & hub configuration."}),(0,b.jsx)(j.SectionLabel,{right:(0,b.jsx)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:"credentials & base images"}),children:"Sandbox providers"}),(0,b.jsx)(q,{}),(0,b.jsx)(j.SectionLabel,{children:"GitHub App"}),k.available?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.Card,{className:"overflow-hidden",children:(0,b.jsxs)("div",{className:"flex items-center gap-4 p-5",children:[(0,b.jsx)("span",{className:"grid h-11 w-11 flex-none place-items-center rounded-xl bg-foreground text-background",children:(0,b.jsx)(d.Icons.github,{className:"size-6"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[14.5px] font-semibold",children:[k.appName,k.installed?(0,b.jsxs)(e.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,b.jsx)("span",{className:"badge-dot"}),"installed"]}):null]}),(0,b.jsx)("div",{className:"mt-0.5 font-mono text-[12.5px] text-muted-foreground",children:k.installed?`@${k.account}`:"Not installed"})]})]})}),(0,b.jsx)(j.SectionLabel,{right:(0,b.jsxs)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:[k.repos.length," repos"]}),children:"Authorized repositories"}),(0,b.jsx)(f.Card,{className:"divide-y divide-border/60 overflow-hidden",children:k.repos.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3",children:[(0,b.jsx)("span",{className:"grid h-[30px] w-[30px] flex-none place-items-center rounded-md border border-border bg-background text-secondary-foreground",children:(0,b.jsx)(d.Icons.repo,{className:"size-[15px]"})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,b.jsx)("span",{className:"block font-mono text-[13px] font-medium",children:a.full}),(0,b.jsxs)("span",{className:"mt-0.5 flex items-center gap-3 font-mono text-[11.5px] text-muted-foreground",children:[(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,b.jsx)(d.LangDot,{lang:a.lang}),a.lang]}),(0,b.jsxs)("span",{children:["updated ",(0,b.jsx)(c.Ago,{ms:a.pushedAt})]}),(0,b.jsx)(e.Badge,{className:(0,g.cn)("px-1.5 py-0 text-[10px] uppercase tracking-[.03em]",a.private?"":"border-[var(--green-line)] text-primary"),children:a.private?"private":"public"})]})]})]},a.id))})]}):(0,b.jsxs)(f.Card,{className:"overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4 p-5",children:[(0,b.jsx)("span",{className:"grid h-11 w-11 flex-none place-items-center rounded-xl bg-secondary text-muted-foreground",children:(0,b.jsx)(d.Icons.github,{className:"size-6"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[14.5px] font-semibold",children:["GitHub App",(0,b.jsx)(e.Badge,{className:"gap-1.5 normal-case",children:"not available"})]}),(0,b.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:"The GitHub App leases repo-scoped tokens to cloud boxes from the hosted hub. On a local machine boxes use your own git credentials directly, so there is nothing to configure here."})]})]}),(0,b.jsx)(h,{}),(0,b.jsxs)("div",{className:"flex items-start gap-3 p-4 px-5 text-[12.5px] text-muted-foreground",children:[(0,b.jsx)(d.Icons.shield,{className:"mt-0.5 size-[15px] flex-none text-primary"}),(0,b.jsx)("span",{children:"Available when the hub runs in a hosted profile (hetzner or vercel)."})]})]})]})}],9247)}];
1
+ module.exports=[17607,3015,a=>{"use strict";var b=a.i(33552),c=a.i(50253);a.s(["Ago",0,function({ms:a}){let[d,e]=(0,c.useState)(!1);return(0,c.useEffect)(()=>e(!0),[]),(0,b.jsx)("span",{suppressHydrationWarning:!0,children:d?function(a){let b=Math.floor((Date.now()-a)/1e3);if(b<60)return b+"s ago";let c=Math.floor(b/60);if(c<60)return c+"m ago";let d=Math.floor(c/60);return d<24?d+"h ago":Math.floor(d/24)+"d ago"}(a):new Date(a).toLocaleDateString()})}],17607),a.s(["SectionLabel",0,function({children:a,right:c}){return(0,b.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[a,(0,b.jsx)("span",{className:"h-px flex-1 bg-border"}),c??null]})}],3015)},87883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Card",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("rounded-xl border border-border bg-card text-card-foreground",a),...d})},"CardContent",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("p-5 pt-0",a),...d})},"CardDescription",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[12.5px] text-muted-foreground",a),...d})},"CardHeader",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("flex flex-col space-y-1 p-5",a),...d})},"CardTitle",0,function({className:a,...d}){return(0,b.jsx)("div",{className:(0,c.cn)("text-[15px] font-semibold leading-none tracking-tight",a),...d})}])},85883,a=>{"use strict";var b=a.i(33552),c=a.i(86834);a.s(["Input",0,function({className:a,...d}){return(0,b.jsx)("input",{className:(0,c.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",a),...d})}])},94290,a=>{"use strict";var b=a.i(33552),c=a.i(50253),d=a.i(18071),e=a.i(85883);function f({jobId:a,login:g}){let[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null),n="exchanging"===g.phase,o=async()=>{let b=h.trim();if(b&&!j){k(!0),m(null);try{let c=await fetch(`/api/v1/jobs/${encodeURIComponent(a)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:b})});if(!c.ok){let a=await c.json().catch(()=>null);m(a?.error?.message??`request failed (${c.status})`);return}i("")}catch(a){m(a instanceof Error?a.message:String(a))}finally{k(!1)}}};return(0,b.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,b.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,b.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."}),g.url?(0,b.jsx)("a",{href:g.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,b.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,b.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,b.jsx)(e.Input,{value:h,onChange:a=>i(a.target.value),onKeyDown:a=>{"Enter"===a.key&&o()},placeholder:"Paste approval code",disabled:n,className:"flex-1 font-mono text-xs"}),(0,b.jsx)(d.Button,{type:"button",onClick:()=>void o(),disabled:!h.trim()||j||n,children:n?"Verifying…":j?"Submitting…":"Submit"})]}),g.lastError?(0,b.jsx)("p",{className:"text-xs text-amber-300",children:g.lastError}):null,"error"===g.phase&&g.error?(0,b.jsx)("p",{className:"text-xs text-red-400",children:g.error}):null,l?(0,b.jsx)("p",{className:"text-xs text-red-400",children:l}):null]})}a.s(["JobLogStream",0,function({jobId:a,endpoint:d,onDone:e,onStatus:g,onLogin:h}){let[i,j]=(0,c.useState)([]),[k,l]=(0,c.useState)(null),m=(0,c.useRef)(null),n=(0,c.useRef)(e);n.current=e;let o=(0,c.useRef)(g);o.current=g;let p=(0,c.useRef)(h);return p.current=h,(0,c.useEffect)(()=>{o.current?.("streaming");let b=new EventSource(d??`/api/jobs/${encodeURIComponent(a)}/logs`);return b.addEventListener("log",a=>{let b=JSON.parse(a.data);j(a=>[...a,b])}),b.addEventListener("login",a=>{let b=JSON.parse(a.data);l(b),p.current?.(b)}),b.addEventListener("end",a=>{let c=JSON.parse(a.data);o.current?.(c.status),n.current?.(c.status),b.close()}),()=>b.close()},[a,d]),(0,c.useEffect)(()=>{let a=m.current;a&&(a.scrollTop=a.scrollHeight)},[i]),(0,b.jsxs)("div",{className:"flex flex-col gap-3",children:[k&&"done"!==k.phase?(0,b.jsx)(f,{jobId:a,login:k}):null,(0,b.jsx)("pre",{ref:m,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")})]})}])},9247,a=>{"use strict";var b=a.i(33552),c=a.i(17607),d=a.i(97187),e=a.i(54473),f=a.i(87883),g=a.i(86834);function h({className:a,...c}){return(0,b.jsx)("div",{className:(0,g.cn)("h-px w-full shrink-0 bg-border",a),...c})}var i=a.i(80007),j=a.i(3015),k=a.i(50253),l=a.i(74455),m=a.i(18071),n=a.i(85883),o=a.i(94290);let p={docker:[],e2b:[{key:"apiKey",label:"API key",placeholder:"e2b_…"}],daytona:[{key:"apiKey",label:"API key",placeholder:"dtn_…"}],hetzner:[{key:"token",label:"API token",placeholder:"project read+write token"}],vercel:[{key:"token",label:"Access token",placeholder:"vercel token"},{key:"teamId",label:"Team ID",placeholder:"team_… (optional)",optional:!0},{key:"projectId",label:"Project ID",placeholder:"prj_… (optional)",optional:!0}]};function q(){let{state:a}=(0,i.useStore)(),[c,d]=(0,k.useState)({});return(0,k.useEffect)(()=>{let a=!1;return(async()=>{try{let b=await fetch("/api/v1/providers?freshness=1",{credentials:"same-origin"});if(!b.ok)return;let c=await b.json();if(a)return;let e={};for(let a of c.providers??[])e[a.id]={baseStatus:a.baseStatus,baseStaleReason:a.baseStaleReason};d(e)}catch{}})(),()=>{a=!0}},[a.providers]),(0,b.jsx)(f.Card,{className:"divide-y divide-border/60 overflow-hidden",children:a.providers.map(a=>(0,b.jsx)(r,{provider:{...a,...c[a.id]}},a.id))})}function r({provider:a}){var c;let f=(0,l.useRouter)(),h=p[a.id]??[],i=new Set(h.filter(a=>!a.optional).map(a=>a.key)),[j,q]=(0,k.useState)({}),[s,t]=(0,k.useState)(()=>a.hasCredentials?Object.fromEntries(h.filter(a=>!a.optional).map(a=>[a.key,!0])):{}),[u,v]=(0,k.useState)(!1),[w,x]=(0,k.useState)(null),[y,z]=(0,k.useState)(!a.hasCredentials&&h.length>0),[A,B]=(0,k.useState)(a.jobId??null),[C,D]=(0,k.useState)(!1),[E,F]=(0,k.useState)(null),G=async()=>{v(!0),x(null);try{let b={};for(let a of h){if(s[a.key])continue;let c=(j[a.key]??"").trim();c&&(b[a.key]=c)}let c=await fetch(`/api/v1/providers/${encodeURIComponent(a.id)}/credentials`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(b)});if(!c.ok){let a=await c.json().catch(()=>null);x(a?.error?.message??`request failed (${c.status})`);return}q({}),t(Object.fromEntries([...i].map(a=>[a,!0]))),z(!1),f.refresh()}catch(a){x(a instanceof Error?a.message:String(a))}finally{v(!1)}},H=async()=>{D(!0),F(null);try{let b=await fetch(`/api/v1/providers/${encodeURIComponent(a.id)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(a.configured?{force:!0}:{})}),c=await b.json().catch(()=>null);if(!b.ok||!c?.jobId)return void F(c?.error?.message??`request failed (${b.status})`);B(c.jobId)}catch(a){F(a instanceof Error?a.message:String(a))}finally{D(!1)}},I="docker"===a.id||a.hasCredentials,J=h.length>0;return(0,b.jsxs)("div",{className:"flex flex-col gap-3 p-4 px-5",children:[(0,b.jsxs)("div",{className:(0,g.cn)("flex items-center gap-3",J&&"cursor-pointer"),onClick:J?()=>z(a=>!a):void 0,children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[a.label,(c=a).configured?"stale"===c.baseStatus?(0,b.jsx)(e.Badge,{className:"badge-warn gap-1.5 normal-case",title:c.baseStaleReason,children:"stale — re-bake"}):"unprepared"===c.baseStatus?(0,b.jsx)(e.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,b.jsxs)(e.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,b.jsx)("span",{className:"badge-dot"}),"ready"]}):c.hasCredentials?(0,b.jsx)(e.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,b.jsx)(e.Badge,{className:"gap-1.5 normal-case",children:"needs credentials"})]}),a.reason?(0,b.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:a.reason}):null]}),(0,b.jsx)("div",{className:"flex flex-none items-center gap-2",onClick:a=>a.stopPropagation(),children:(0,b.jsxs)(m.Button,{type:"button",size:"sm",variant:a.configured?"outline":"default",disabled:!I||C||!!A,onClick:()=>void H(),title:I?void 0:"Add credentials first",children:[(0,b.jsx)(d.Icons.refresh,{className:"size-3.5"}),A?"Baking…":C?"Starting…":a.configured?"Re-bake":"Bake image"]})}),J?(0,b.jsx)(d.Icons.chevR,{className:(0,g.cn)("size-4 flex-none text-muted-foreground transition-transform",y&&"rotate-90")}):(0,b.jsx)("span",{className:"size-4 flex-none","aria-hidden":!0})]}),y&&h.length>0?(0,b.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border/70 bg-card/50 p-3",children:[h.map(a=>(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsxs)("label",{className:"text-[11.5px] font-medium text-muted-foreground",children:[a.label,a.optional?" (optional)":""]}),(0,b.jsx)(n.Input,{type:"password",autoComplete:"off",value:s[a.key]?"••••••••••••":j[a.key]??"",placeholder:a.placeholder,onFocus:()=>{s[a.key]&&(t(b=>({...b,[a.key]:!1})),q(b=>({...b,[a.key]:""})))},onBlur:()=>{i.has(a.key)&&!(j[a.key]??"").trim()&&t(b=>({...b,[a.key]:!0}))},onChange:b=>q(c=>({...c,[a.key]:b.target.value})),className:"font-mono text-xs"})]},a.key)),(0,b.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,b.jsx)(m.Button,{type:"button",size:"sm",disabled:u,onClick:()=>void G(),children:u?"Saving…":"Save credentials"}),w?(0,b.jsx)("span",{className:"text-xs text-red-400",children:w}):null]})]}):null,E?(0,b.jsx)("div",{className:"text-xs text-red-400",children:E}):null,A?(0,b.jsx)(o.JobLogStream,{jobId:A,endpoint:`/api/v1/jobs/${encodeURIComponent(A)}/logs`,onDone:()=>{B(null),f.refresh()}}):null]})}a.s(["default",0,function(){let{state:a}=(0,i.useStore)(),k=a.github;return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,b.jsx)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Settings"}),(0,b.jsx)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:"Providers, GitHub access & hub configuration."}),(0,b.jsx)(j.SectionLabel,{right:(0,b.jsx)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:"credentials & base images"}),children:"Sandbox providers"}),(0,b.jsx)(q,{}),(0,b.jsx)(j.SectionLabel,{children:"GitHub App"}),k.available?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.Card,{className:"overflow-hidden",children:(0,b.jsxs)("div",{className:"flex items-center gap-4 p-5",children:[(0,b.jsx)("span",{className:"grid h-11 w-11 flex-none place-items-center rounded-xl bg-foreground text-background",children:(0,b.jsx)(d.Icons.github,{className:"size-6"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[14.5px] font-semibold",children:[k.appName,k.installed?(0,b.jsxs)(e.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,b.jsx)("span",{className:"badge-dot"}),"installed"]}):null]}),(0,b.jsx)("div",{className:"mt-0.5 font-mono text-[12.5px] text-muted-foreground",children:k.installed?`@${k.account}`:"Not installed"})]})]})}),(0,b.jsx)(j.SectionLabel,{right:(0,b.jsxs)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:[k.repos.length," repos"]}),children:"Authorized repositories"}),(0,b.jsx)(f.Card,{className:"divide-y divide-border/60 overflow-hidden",children:k.repos.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3",children:[(0,b.jsx)("span",{className:"grid h-[30px] w-[30px] flex-none place-items-center rounded-md border border-border bg-background text-secondary-foreground",children:(0,b.jsx)(d.Icons.repo,{className:"size-[15px]"})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,b.jsx)("span",{className:"block font-mono text-[13px] font-medium",children:a.full}),(0,b.jsxs)("span",{className:"mt-0.5 flex items-center gap-3 font-mono text-[11.5px] text-muted-foreground",children:[(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,b.jsx)(d.LangDot,{lang:a.lang}),a.lang]}),(0,b.jsxs)("span",{children:["updated ",(0,b.jsx)(c.Ago,{ms:a.pushedAt})]}),(0,b.jsx)(e.Badge,{className:(0,g.cn)("px-1.5 py-0 text-[10px] uppercase tracking-[.03em]",a.private?"":"border-[var(--green-line)] text-primary"),children:a.private?"private":"public"})]})]})]},a.id))})]}):(0,b.jsxs)(f.Card,{className:"overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4 p-5",children:[(0,b.jsx)("span",{className:"grid h-11 w-11 flex-none place-items-center rounded-xl bg-secondary text-muted-foreground",children:(0,b.jsx)(d.Icons.github,{className:"size-6"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[14.5px] font-semibold",children:["GitHub App",(0,b.jsx)(e.Badge,{className:"gap-1.5 normal-case",children:"not available"})]}),(0,b.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:"The GitHub App leases repo-scoped tokens to cloud boxes from the hosted hub. On a local machine boxes use your own git credentials directly, so there is nothing to configure here."})]})]}),(0,b.jsx)(h,{}),(0,b.jsxs)("div",{className:"flex items-start gap-3 p-4 px-5 text-[12.5px] text-muted-foreground",children:[(0,b.jsx)(d.Icons.shield,{className:"mt-0.5 size-[15px] flex-none text-primary"}),(0,b.jsx)("span",{children:"Available when the hub runs in a hosted profile (hetzner or vercel)."})]})]})]})}],9247)}];
2
2
 
3
3
  //# sourceMappingURL=apps_hub_0b_hsjl._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[73968,a=>{"use strict";var b=a.i(56539);a.s([],39249),a.i(39249),a.s(["4071308a0e1675de302803bb969800c52d79f11e13",()=>b.resumeBoxAction,"40e545c7dd69b4a1d410deb9c94101099961d3af7a",()=>b.stopBoxAction,"40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",()=>b.pauseBoxAction,"40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",()=>b.destroyBoxAction,"600e7ece96e4038f118842cef0ebcf51dadf743c9b",()=>b.gitCheckoutAction,"605f4904ee0814a4a51c0445aa18e7dfbde590c7e5",()=>b.gitPullAction,"60675b1179af1a57b7c4bb6e4d893805dd8f7b0b66",()=>b.gitPushAction,"607692631dd5973ad6071d94f3fee9c7da56a766db",()=>b.gitPushHostAction,"6096ff4dd5616157cf1da6a977c271641a3ddce491",()=>b.restartServiceAction,"60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",()=>b.answerApprovalAction,"70fd109611adee18e2a11d04af4332c29e796848e9",()=>b.gitBranchAction],73968)}];
1
+ module.exports=[73968,a=>{"use strict";var b=a.i(56539);a.s([],39249),a.i(39249),a.s(["4071308a0e1675de302803bb969800c52d79f11e13",()=>b.resumeBoxAction,"40e545c7dd69b4a1d410deb9c94101099961d3af7a",()=>b.stopBoxAction,"40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",()=>b.pauseBoxAction,"40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",()=>b.destroyBoxAction,"600e7ece96e4038f118842cef0ebcf51dadf743c9b",()=>b.gitCheckoutAction,"605f4904ee0814a4a51c0445aa18e7dfbde590c7e5",()=>b.gitPullAction,"60675b1179af1a57b7c4bb6e4d893805dd8f7b0b66",()=>b.gitPushAction,"607692631dd5973ad6071d94f3fee9c7da56a766db",()=>b.gitPushHostAction,"6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb",()=>b.renameBoxAction,"6096ff4dd5616157cf1da6a977c271641a3ddce491",()=>b.restartServiceAction,"60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",()=>b.answerApprovalAction,"70fd109611adee18e2a11d04af4332c29e796848e9",()=>b.gitBranchAction],73968)}];
2
2
 
3
3
  //# sourceMappingURL=apps_hub__next-internal_server_app_%28dashboard%29_boxes_%5Bid%5D_page_actions_0k7kgn2.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[12901,a=>{"use strict";var b=a.i(56539);a.s([],77267),a.i(77267),a.s(["40386bdce4d894a318a969412fa1299d2704ccdfb3",()=>b.listBranchesAction,"4070192706087364b8c7d220576a6f3e4d3e5c532b",()=>b.createBoxAction,"4071308a0e1675de302803bb969800c52d79f11e13",()=>b.resumeBoxAction,"4087bb6da1f4834ca146bcc8cb7c69295dbeda0bdc",()=>b.addProjectAction,"40942714d29a270a6816a39cd419b4f09f50fc19b1",()=>b.browseDirAction,"40c7856bd78dddab224344045df78d51620e411335",()=>b.removeProjectAction,"40e545c7dd69b4a1d410deb9c94101099961d3af7a",()=>b.stopBoxAction,"40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",()=>b.pauseBoxAction,"40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",()=>b.destroyBoxAction,"60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",()=>b.answerApprovalAction],12901)}];
1
+ module.exports=[12901,a=>{"use strict";var b=a.i(56539);a.s([],77267),a.i(77267),a.s(["40386bdce4d894a318a969412fa1299d2704ccdfb3",()=>b.listBranchesAction,"4070192706087364b8c7d220576a6f3e4d3e5c532b",()=>b.createBoxAction,"4071308a0e1675de302803bb969800c52d79f11e13",()=>b.resumeBoxAction,"4087bb6da1f4834ca146bcc8cb7c69295dbeda0bdc",()=>b.addProjectAction,"40942714d29a270a6816a39cd419b4f09f50fc19b1",()=>b.browseDirAction,"40c7856bd78dddab224344045df78d51620e411335",()=>b.removeProjectAction,"40e545c7dd69b4a1d410deb9c94101099961d3af7a",()=>b.stopBoxAction,"40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",()=>b.pauseBoxAction,"40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",()=>b.destroyBoxAction,"6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb",()=>b.renameBoxAction,"60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",()=>b.answerApprovalAction],12901)}];
2
2
 
3
3
  //# sourceMappingURL=apps_hub__next-internal_server_app_%28dashboard%29_page_actions_1t3u0xy.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[58099,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(17607),e=a.i(97187),f=a.i(71152),g=a.i(86834);function h({className:a,icon:c,title:d,children:e}){return(0,b.jsxs)("div",{className:(0,g.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",a),children:[c?(0,b.jsx)(c,{className:"mt-0.5 size-4 flex-none"}):null,(0,b.jsxs)("div",{className:"min-w-0",children:[d?(0,b.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:d}):null,(0,b.jsx)("div",{className:"text-[12.5px] leading-normal",children:e})]})]})}var i=a.i(87883),j=a.i(80007),k=a.i(60401);function l({boxId:a}){let{state:c}=(0,j.useStore)(),f=c.approvals.filter(b=>b.boxId===a).sort((a,b)=>a.createdAt-b.createdAt);return 0===f.length?null:(0,b.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,b.jsx)(e.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,b.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[f.length," pending approval",1===f.length?"":"s"]}),(0,b.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,b.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:f.map(a=>(0,b.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:a.command??a.message}),a.detail?(0,b.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:a.detail}):null,a.cwd?(0,b.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:a.cwd}):null,(0,b.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,b.jsx)(d.Ago,{ms:a.createdAt})})]}),(0,b.jsx)("div",{className:"flex-none pt-0.5",children:(0,b.jsx)(k.ApprovalActions,{id:a.id})})]},a.id))})]})}var m=a.i(50253),n=a.i(18071);function o({url:a}){let[c,d]=(0,m.useState)(!1),f=(0,m.useRef)(null);(0,m.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]);let g=(0,m.useCallback)(async()=>{try{await navigator.clipboard.writeText(a),d(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>d(!1),1500)}catch{}},[a]);return(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",onClick:g,children:[c?(0,b.jsx)(e.Icons.check,{}):(0,b.jsx)(e.Icons.copy,{}),c?"Copied":"Copy URL"]})}function p({webUrl:a,vncUrl:c}){return a||c?(0,b.jsx)(i.Card,{className:"divide-y divide-border/60 overflow-hidden",children:(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,b.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,b.jsx)("div",{className:"text-[13.5px] font-medium",children:a?"Web":"VNC"}),(0,b.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:a??"Remote desktop"})]}),(0,b.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[a?(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",href:a,target:"_blank",rel:"noreferrer",children:[(0,b.jsx)(e.Icons.ext,{}),"Open web"]}):null,a?(0,b.jsx)(o,{url:a}):null,c?(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",href:c,target:"_blank",rel:"noreferrer",children:[(0,b.jsx)(e.Icons.ext,{}),"Open VNC"]}):null]})]})}):null}var q=a.i(24288),r=a.i(17236),s=a.i(51363);function t({k:a,v:c,mono:d,link:e}){return(0,b.jsxs)("div",{className:"grid grid-cols-[156px_1fr] items-baseline gap-4 px-4.5 p-3 max-sm:grid-cols-1 max-sm:gap-1",children:[(0,b.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:a}),(0,b.jsx)("div",{className:(0,g.cn)("min-w-0 text-[13.5px]",d?"font-mono text-[13px]":""),children:e?(0,b.jsx)(s.default,{className:"cursor-pointer text-primary",href:e,children:c}):c})]})}var u=a.i(12019),v=a.i(45515),w=a.i(85883),x=a.i(34537),y=a.i(53596),z=a.i(96664);let A=(0,z.createServerReference)("70fd109611adee18e2a11d04af4332c29e796848e9",z.callServer,void 0,z.findSourceMapURL,"gitBranchAction"),B=(0,z.createServerReference)("600e7ece96e4038f118842cef0ebcf51dadf743c9b",z.callServer,void 0,z.findSourceMapURL,"gitCheckoutAction"),C=(0,z.createServerReference)("605f4904ee0814a4a51c0445aa18e7dfbde590c7e5",z.callServer,void 0,z.findSourceMapURL,"gitPullAction"),D=(0,z.createServerReference)("60675b1179af1a57b7c4bb6e4d893805dd8f7b0b66",z.callServer,void 0,z.findSourceMapURL,"gitPushAction"),E=(0,z.createServerReference)("607692631dd5973ad6071d94f3fee9c7da56a766db",z.callServer,void 0,z.findSourceMapURL,"gitPushHostAction"),F=0;function G({toasts:a,dismiss:c}){return(0,b.jsx)("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex w-[340px] max-w-[calc(100vw-40px)] flex-col gap-2",children:a.map(a=>(0,b.jsxs)("div",{className:"anim-pop pointer-events-auto relative flex items-start gap-3 rounded-xl border border-border bg-card p-3.5 pr-9 shadow-[0_16px_40px_-18px_rgba(20,24,30,.35)]",children:[(0,b.jsx)("span",{className:(0,g.cn)("mt-0.5 grid h-6 w-6 flex-none place-items-center rounded-md border","error"===a.variant?"border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]":"border-[var(--green-line)] bg-accent text-primary"),children:"error"===a.variant?(0,b.jsx)(e.Icons.warn,{className:"size-3.5"}):(0,b.jsx)(e.Icons.check,{className:"size-3.5"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:a.title}),a.detail?(0,b.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:a.detail}):null]}),(0,b.jsx)("button",{className:"absolute right-2.5 top-2.5 grid h-5 w-5 cursor-pointer place-items-center rounded border-0 bg-transparent text-[#a4a9b0] hover:text-foreground",onClick:()=>c(a.id),"aria-label":"Dismiss",children:(0,b.jsx)(e.Icons.x,{className:"size-3"})})]},a.id))})}function H({label:a,desc:c,children:d}){return(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,b.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,b.jsx)("div",{className:"text-[13.5px] font-medium",children:a}),(0,b.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:c})]}),(0,b.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:d})]})}function I({icon:a,disabled:c,onRun:d,children:e}){let[f,g]=(0,m.useState)(!1),h=async()=>{g(!0);try{await d()}finally{g(!1)}};return(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:c||f,onClick:h,children:[f?(0,b.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,b.jsx)(a,{}),e]})}function J(a,b){let c=(a??"").trim()||(b??"").trim();return c?c.split("\n")[0]:void 0}function K({box:a}){let d=(0,c.useRouter)(),{toasts:f,push:h,dismiss:j}=function(){let[a,b]=(0,m.useState)([]),c=(0,m.useCallback)(a=>b(b=>b.filter(b=>b.id!==a)),[]);return{toasts:a,push:(0,m.useCallback)(a=>{let d=++F;b(b=>[...b,{id:d,...a}]),setTimeout(()=>c(d),4200)},[c]),dismiss:c}}(),[k,l]=(0,m.useState)(null),[o,p]=(0,m.useState)(null),q="running"!==a.status,r=(0,m.useCallback)(async()=>{try{let b=await fetch(`/api/v1/boxes/${encodeURIComponent(a.id)}/git`,{credentials:"same-origin"});l(b.ok?await b.json():null)}catch{l(null)}},[a.id]);(0,m.useEffect)(()=>{r()},[r]);let s=k?.ok&&k.branch?k.branch:a.branch||"—",t=()=>{r(),d.refresh()},u=async(a,b)=>{let c=await b();c.ok?(h({title:a,detail:J(c.stdout,c.stderr)}),t()):h({variant:"error",title:`${a} failed`,detail:c.error})};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(i.Card,{className:(0,g.cn)("divide-y divide-border/60 overflow-hidden",q?"opacity-90":""),children:[q?(0,b.jsxs)("div",{className:"flex items-center gap-2.5 bg-[var(--amber-soft)] px-4.5 p-2.5 text-[12.5px] text-[var(--amber)]",children:[(0,b.jsx)(e.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",a.status," — git operations need a running box."]}):null,(0,b.jsxs)(H,{label:"Sync",desc:`origin ↔ ${s}`,children:[(0,b.jsx)(I,{icon:e.Icons.arrowL,disabled:q,onRun:()=>u("Pulled from origin",()=>C(a.id)),children:"Pull"}),(0,b.jsx)(I,{icon:e.Icons.ext,disabled:q,onRun:()=>u("Pushed to origin",()=>D(a.id)),children:"Push"}),(0,b.jsx)(I,{icon:e.Icons.host,disabled:q,onRun:()=>u("Pushed to host",()=>E(a.id)),children:"Push to host"})]}),(0,b.jsxs)(H,{label:"Branch",desc:`currently on ${s}`,children:[(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:q,onClick:()=>p("change"),children:[(0,b.jsx)(e.Icons.branch,{}),"Change branch"]}),(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:q,onClick:()=>p("new"),children:[(0,b.jsx)(e.Icons.plus,{}),"New branch"]})]})]}),"change"===o?(0,b.jsx)(N,{box:a,branch:s,onClose:()=>p(null),onDone:h,onRefresh:t}):null,"new"===o?(0,b.jsx)(O,{box:a,onClose:()=>p(null),onDone:h,onRefresh:t}):null,(0,b.jsx)(G,{toasts:f,dismiss:j})]})}let L="__manual__";function M({boxId:a,value:c,onChange:d,id:e,headLabel:f,currentBranch:g}){let[h,i]=(0,m.useState)(null),[j,k]=(0,m.useState)(g??null),[l,n]=(0,m.useState)(!1);return((0,m.useEffect)(()=>{let b=!1;return(async()=>{try{let c=await fetch(`/api/v1/boxes/${encodeURIComponent(a)}/branches`,{credentials:"same-origin"}),d=c.ok?await c.json():null;if(b)return;d&&Array.isArray(d.branches)&&d.branches.length>0?(i(d.branches),g||"string"!=typeof d.current||k(d.current)):(i([]),n(!0))}catch{b||(i([]),n(!0))}})(),()=>{b=!0}},[a,g]),null===h)?(0,b.jsx)(y.Select,{id:e,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,b.jsx)("option",{value:"",children:"Loading branches…"})}):l?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(w.Input,{id:e,className:"font-mono text-[13px]",autoFocus:!0,value:c,onChange:a=>d(a.target.value),placeholder:f?"HEAD":"feature-x"}),h.length>0?(0,b.jsx)("button",{type:"button",onClick:()=>{n(!1),d("")},className:"mt-1.5 cursor-pointer text-xs text-secondary-foreground underline-offset-2 hover:underline",children:"← Back to branch list"}):null]}):(0,b.jsxs)(y.Select,{id:e,value:c,wrapperClassName:"w-full",onChange:a=>{if(a.target.value===L){n(!0),d("");return}d(a.target.value)},children:[f?(0,b.jsx)("option",{value:"",children:f}):(0,b.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,b.jsx)("option",{value:L,children:"Other / type manually…"}),(0,b.jsx)("option",{disabled:!0,children:"────────────"}),h.map(a=>(0,b.jsxs)("option",{value:a,children:[a,a===j?" (current)":""]},a))]})}function N({box:a,branch:c,onClose:d,onDone:f,onRefresh:g}){let[h,i]=(0,m.useState)(""),[j,k]=(0,m.useState)(!1),[l,o]=(0,m.useState)(null),p=h.trim().length>0;return(0,b.jsxs)(v.Dialog,{onClose:d,className:"max-w-[440px]",children:[(0,b.jsxs)(v.DialogHeader,{children:[(0,b.jsx)(v.DialogIcon,{children:(0,b.jsx)(e.Icons.branch,{})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(v.DialogTitle,{children:"Change branch"}),(0,b.jsxs)(v.DialogDescription,{children:[a.id," · currently on ",c]})]})]}),(0,b.jsxs)(v.DialogBody,{children:[(0,b.jsx)(x.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,b.jsx)(M,{boxId:a.id,id:"gb-branch",value:h,onChange:i,currentBranch:c}),(0,b.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"The branch must exist and not be checked out in another worktree."}),l?(0,b.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:l}):null]}),(0,b.jsxs)(v.DialogFooter,{children:[(0,b.jsx)(n.Button,{variant:"outline",onClick:d,disabled:j,children:"Cancel"}),(0,b.jsxs)(n.Button,{onClick:()=>{p&&!j&&(k(!0),o(null),(async()=>{let b=await B(a.id,h.trim());b.ok?(f({title:"Branch changed",detail:J(b.stdout,b.stderr)}),d(),g()):(o(b.error),k(!1))})())},disabled:!p||j,children:[j?(0,b.jsx)("span",{className:"spin"}):(0,b.jsx)(e.Icons.check,{}),j?"Checking out…":"Change branch"]})]})]})}function O({box:a,onClose:c,onDone:d,onRefresh:f}){let[g,h]=(0,m.useState)(""),[i,j]=(0,m.useState)(""),[k,l]=(0,m.useState)(!1),[o,p]=(0,m.useState)(null),q=g.trim().length>0,r=()=>{q&&!k&&(l(!0),p(null),(async()=>{let b=await A(a.id,g.trim(),i.trim()||void 0);b.ok?(d({title:"Branch created",detail:J(b.stdout,b.stderr)}),c(),f()):(p(b.error),l(!1))})())};return(0,b.jsxs)(v.Dialog,{onClose:c,className:"max-w-[440px]",children:[(0,b.jsxs)(v.DialogHeader,{children:[(0,b.jsx)(v.DialogIcon,{children:(0,b.jsx)(e.Icons.branch,{})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(v.DialogTitle,{children:"New branch"}),(0,b.jsxs)(v.DialogDescription,{children:[a.id," · branching in the box workspace"]})]})]}),(0,b.jsxs)(v.DialogBody,{children:[(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsx)(x.Label,{htmlFor:"nb-name",children:"Name"}),(0,b.jsx)(w.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"===a.key&&r()},placeholder:"my-branch"}),(0,b.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,b.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,b.jsxs)(x.Label,{htmlFor:"nb-from",children:["Base ref ",(0,b.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,b.jsx)(M,{boxId:a.id,id:"nb-from",value:i,onChange:j,headLabel:"Current HEAD (default)"}),(0,b.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),o?(0,b.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:o}):null]}),(0,b.jsxs)(v.DialogFooter,{children:[(0,b.jsx)(n.Button,{variant:"outline",onClick:c,disabled:k,children:"Cancel"}),(0,b.jsxs)(n.Button,{onClick:r,disabled:!q||k,children:[k?(0,b.jsx)("span",{className:"spin"}):(0,b.jsx)(e.Icons.plus,{}),k?"Creating…":"Create branch"]})]})]})}var P=a.i(3015);let Q=(0,z.createServerReference)("6096ff4dd5616157cf1da6a977c271641a3ddce491",z.callServer,void 0,z.findSourceMapURL,"restartServiceAction"),R=new Set(["ready","running","done"]),S=new Set(["crashed","unhealthy","backoff","failed"]),T={up:"bg-[var(--green)]",bad:"bg-[var(--red)]",idle:"bg-[var(--amber)]"},U={up:"text-[var(--green-ink)]",bad:"text-[var(--red)]",idle:"text-[var(--amber)]"};function V({svc:a,disabled:c,onRestart:d}){var f;let h=(f=a.state,R.has(f)?"up":S.has(f)?"bad":"idle");return(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,b.jsx)("span",{className:(0,g.cn)("badge-dot",T[h]),"aria-hidden":!0}),(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:a.name}),(0,b.jsx)("span",{className:(0,g.cn)("font-mono text-xs",U[h]),children:a.state}),a.restarts>0?(0,b.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",a.restarts]}):null,(0,b.jsx)(n.Button,{variant:"outline",size:"icon-sm",title:`Restart ${a.name}`,disabled:c,onClick:()=>d(a.name),children:(0,b.jsx)(e.Icons.refresh,{})})]})}function W({id:a,running:c}){let[d,f]=(0,m.useState)(null),[g,h]=(0,m.useState)(null),[j,k]=(0,m.useTransition)(),l=(0,m.useCallback)(async()=>{try{let b=await fetch(`/api/v1/boxes/${encodeURIComponent(a)}/services`,{credentials:"same-origin"});if(!b.ok)return void h(`status ${String(b.status)}`);f(await b.json()),h(null)}catch(a){h(a instanceof Error?a.message:String(a))}},[a]);(0,m.useEffect)(()=>{if(l(),!c)return;let a=setInterval(()=>void l(),4e3);return()=>clearInterval(a)},[l,c]);let o=b=>{k(async()=>{let c=await Q(a,b);c.ok||window.alert(`Restart failed: ${c.error}`),await l()})},p=d?.services??[],q=p.length>0;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(P.SectionLabel,{right:q?(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:!c||j,onClick:()=>o(void 0),children:[(0,b.jsx)(e.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,b.jsx)(i.Card,{className:"divide-y divide-border/60 overflow-hidden",children:d||g?g?(0,b.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",g,")."]}):q?(0,b.jsxs)(b.Fragment,{children:[d?.source==="persisted"?(0,b.jsx)("div",{className:"bg-muted/30 px-4 py-1.5 font-mono text-[11px] text-muted-foreground",children:"persisted snapshot — box not running"}):null,p.map(a=>(0,b.jsx)(V,{svc:a,disabled:!c||j,onRestart:a=>o(a)},a.name))]}):(0,b.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:d?.source==="unavailable"?"No service status (box not running or no snapshot yet).":"No services declared in agentbox.yaml."}):(0,b.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var X=a.i(82337);a.s(["default",0,function(){let{id:a}=(0,c.useParams)(),{box:g,project:k}=(0,j.useStore)(),m=g(a);if(!m)return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,b.jsx)(q.BackLink,{to:"/",children:"All boxes"}),(0,b.jsx)(u.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let n=k(m.projectId);return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,b.jsx)(q.BackLink,{to:"/projects/"+m.projectId,children:n?n.name:"Project"}),(0,b.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[m.task,(0,b.jsx)(f.StatusBadge,{status:m.status})]}),(0,b.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:m.id})," ·"," ",(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:m.repo})," · ",m.host]})]}),(0,b.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,b.jsx)(r.BoxActions,{box:m,size:"lg"})})]}),m.error?(0,b.jsx)(h,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:e.Icons.warn,title:"Box errored",children:(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:m.error})}):null,(0,b.jsx)(l,{boxId:m.id}),(0,b.jsx)(P.SectionLabel,{children:"Overview"}),(0,b.jsxs)(X.StatGrid,{children:[(0,b.jsx)(X.Stat,{k:"Status",v:(0,b.jsx)(f.StatusBadge,{status:m.status})}),(0,b.jsx)(X.Stat,{k:"Agent CLI",v:m.agent,mono:!0}),(0,b.jsx)(X.Stat,{k:"Commits",v:m.commits??"—",icon:e.Icons.commit}),(0,b.jsx)(X.Stat,{k:"Files touched",v:m.filesTouched??"—",icon:e.Icons.file}),(0,b.jsx)(X.Stat,{k:"Last activity",v:(0,b.jsx)(d.Ago,{ms:m.lastActivity}),mono:!0})]}),m.webUrl||m.vncUrl?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(P.SectionLabel,{children:"Access"}),(0,b.jsx)(p,{webUrl:m.webUrl,vncUrl:m.vncUrl})]}):null,(0,b.jsx)(P.SectionLabel,{children:"Git operations"}),(0,b.jsx)(K,{box:m}),(0,b.jsx)(W,{id:m.id,running:"running"===m.status}),(0,b.jsx)(P.SectionLabel,{children:"Details"}),(0,b.jsxs)(i.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,b.jsx)(t,{k:"Box ID",v:m.id,mono:!0}),(0,b.jsx)(t,{k:"Project",v:n?n.name:"—",link:n?"/projects/"+m.projectId:null}),(0,b.jsx)(t,{k:"Repository",v:m.repo,mono:!0}),(0,b.jsx)(t,{k:"Branch",v:m.branch,mono:!0}),(0,b.jsx)(t,{k:"Host",v:m.host,mono:!0}),(0,b.jsx)(t,{k:"Created",v:new Date(m.createdAt).toLocaleString(),mono:!0})]})]})}],58099)}];
1
+ module.exports=[58099,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(17607),e=a.i(97187),f=a.i(71152),g=a.i(86834);function h({className:a,icon:c,title:d,children:e}){return(0,b.jsxs)("div",{className:(0,g.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",a),children:[c?(0,b.jsx)(c,{className:"mt-0.5 size-4 flex-none"}):null,(0,b.jsxs)("div",{className:"min-w-0",children:[d?(0,b.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:d}):null,(0,b.jsx)("div",{className:"text-[12.5px] leading-normal",children:e})]})]})}var i=a.i(87883),j=a.i(80007),k=a.i(60401);function l({boxId:a}){let{state:c}=(0,j.useStore)(),f=c.approvals.filter(b=>b.boxId===a).sort((a,b)=>a.createdAt-b.createdAt);return 0===f.length?null:(0,b.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,b.jsx)(e.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,b.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[f.length," pending approval",1===f.length?"":"s"]}),(0,b.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,b.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:f.map(a=>(0,b.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:a.command??a.message}),a.detail?(0,b.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:a.detail}):null,a.cwd?(0,b.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:a.cwd}):null,(0,b.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,b.jsx)(d.Ago,{ms:a.createdAt})})]}),(0,b.jsx)("div",{className:"flex-none pt-0.5",children:(0,b.jsx)(k.ApprovalActions,{id:a.id})})]},a.id))})]})}var m=a.i(50253),n=a.i(18071),o=a.i(3015);let p=[{app:"claude",label:"Claude",icon:"claude"},{app:"codex",label:"Codex",icon:"codex"},{app:"vscode",label:"VS Code",icon:"ext"},{app:"cmux",label:"cmux",icon:"terminal"},{app:"herdr",label:"Herdr",icon:"terminal"},{app:"iterm2",label:"iTerm2",icon:"terminal"},{app:"finder",label:"Finder",icon:"folder"}];function q({url:a}){let[c,d]=(0,m.useState)(!1),f=(0,m.useRef)(null);(0,m.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]);let g=(0,m.useCallback)(async()=>{try{await navigator.clipboard.writeText(a),d(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>d(!1),1500)}catch{}},[a]);return(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",onClick:g,children:[c?(0,b.jsx)(e.Icons.check,{}):(0,b.jsx)(e.Icons.copy,{}),c?"Copied":"Copy URL"]})}function r({box:a}){let{webUrl:c,vncUrl:d}=a,{eligible:f,pending:g,launch:h}=function(a){let[b,c]=(0,m.useState)(null),[d,e]=(0,m.useState)(null);(0,m.useEffect)(()=>{let a=!0;return(async()=>{try{let b=await fetch("/api/v1/open-targets",{credentials:"same-origin"});a&&c(b.ok?await b.json():null)}catch{a&&c(null)}})(),()=>{a=!1}},[]);let f=(0,m.useCallback)(async b=>{e(b);try{let c=await fetch(`/api/v1/boxes/${encodeURIComponent(a.id)}/open`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({app:b})});if(!c.ok){let a=await c.json().catch(()=>null);window.alert(`Open in ${b} failed: ${a?.error?.message??`HTTP ${c.status}`}`)}}catch(a){window.alert(`Open in ${b} failed: ${a instanceof Error?a.message:String(a)}`)}finally{e(null)}},[a.id]),g=b?.supported?b.targets:null;return{eligible:g?p.filter(({app:b})=>{let c=g[b];return c.available&&(!c.providers||c.providers.includes(a.provider))}):[],pending:d,launch:f}}(a);return c||d||0!==f.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o.SectionLabel,{children:"Access"}),(0,b.jsxs)(i.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[c||d?(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,b.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,b.jsx)("div",{className:"text-[13.5px] font-medium",children:c?"Web":"VNC"}),(0,b.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:c??"Remote desktop"})]}),(0,b.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[c?(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",href:c,target:"_blank",rel:"noreferrer",children:[(0,b.jsx)(e.Icons.ext,{}),"Open web"]}):null,c?(0,b.jsx)(q,{url:c}):null,d?(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",href:d,target:"_blank",rel:"noreferrer",children:[(0,b.jsx)(e.Icons.ext,{}),"Open VNC"]}):null]})]}):null,f.length>0?(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,b.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,b.jsx)("div",{className:"text-[13.5px] font-medium",children:"Apps"}),(0,b.jsx)("div",{className:"mt-0.5 text-[11.5px] text-muted-foreground",children:"Open the box project from the host"})]}),(0,b.jsx)("div",{className:"flex flex-none flex-wrap justify-end gap-1.5",children:f.map(({app:a,label:c,icon:d})=>{let f=e.Icons[d];return(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:null!==g,onClick:()=>void h(a),children:[(0,b.jsx)(f,{}),c]},a)})})]}):null]})]}):null}var s=a.i(24288),t=a.i(17236),u=a.i(51363);function v({k:a,v:c,mono:d,link:e}){return(0,b.jsxs)("div",{className:"grid grid-cols-[156px_1fr] items-baseline gap-4 px-4.5 p-3 max-sm:grid-cols-1 max-sm:gap-1",children:[(0,b.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:a}),(0,b.jsx)("div",{className:(0,g.cn)("min-w-0 text-[13.5px]",d?"font-mono text-[13px]":""),children:e?(0,b.jsx)(u.default,{className:"cursor-pointer text-primary",href:e,children:c}):c})]})}var w=a.i(12019),x=a.i(45515),y=a.i(85883),z=a.i(34537),A=a.i(53596),B=a.i(96664);let C=(0,B.createServerReference)("70fd109611adee18e2a11d04af4332c29e796848e9",B.callServer,void 0,B.findSourceMapURL,"gitBranchAction"),D=(0,B.createServerReference)("600e7ece96e4038f118842cef0ebcf51dadf743c9b",B.callServer,void 0,B.findSourceMapURL,"gitCheckoutAction"),E=(0,B.createServerReference)("605f4904ee0814a4a51c0445aa18e7dfbde590c7e5",B.callServer,void 0,B.findSourceMapURL,"gitPullAction"),F=(0,B.createServerReference)("60675b1179af1a57b7c4bb6e4d893805dd8f7b0b66",B.callServer,void 0,B.findSourceMapURL,"gitPushAction"),G=(0,B.createServerReference)("607692631dd5973ad6071d94f3fee9c7da56a766db",B.callServer,void 0,B.findSourceMapURL,"gitPushHostAction"),H=0;function I({toasts:a,dismiss:c}){return(0,b.jsx)("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex w-[340px] max-w-[calc(100vw-40px)] flex-col gap-2",children:a.map(a=>(0,b.jsxs)("div",{className:"anim-pop pointer-events-auto relative flex items-start gap-3 rounded-xl border border-border bg-card p-3.5 pr-9 shadow-[0_16px_40px_-18px_rgba(20,24,30,.35)]",children:[(0,b.jsx)("span",{className:(0,g.cn)("mt-0.5 grid h-6 w-6 flex-none place-items-center rounded-md border","error"===a.variant?"border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]":"border-[var(--green-line)] bg-accent text-primary"),children:"error"===a.variant?(0,b.jsx)(e.Icons.warn,{className:"size-3.5"}):(0,b.jsx)(e.Icons.check,{className:"size-3.5"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:a.title}),a.detail?(0,b.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:a.detail}):null]}),(0,b.jsx)("button",{className:"absolute right-2.5 top-2.5 grid h-5 w-5 cursor-pointer place-items-center rounded border-0 bg-transparent text-[#a4a9b0] hover:text-foreground",onClick:()=>c(a.id),"aria-label":"Dismiss",children:(0,b.jsx)(e.Icons.x,{className:"size-3"})})]},a.id))})}function J({label:a,desc:c,children:d}){return(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,b.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,b.jsx)("div",{className:"text-[13.5px] font-medium",children:a}),(0,b.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:c})]}),(0,b.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:d})]})}function K({icon:a,disabled:c,onRun:d,children:e}){let[f,g]=(0,m.useState)(!1),h=async()=>{g(!0);try{await d()}finally{g(!1)}};return(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:c||f,onClick:h,children:[f?(0,b.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,b.jsx)(a,{}),e]})}function L(a,b){let c=(a??"").trim()||(b??"").trim();return c?c.split("\n")[0]:void 0}function M({box:a}){let d=(0,c.useRouter)(),{toasts:f,push:h,dismiss:j}=function(){let[a,b]=(0,m.useState)([]),c=(0,m.useCallback)(a=>b(b=>b.filter(b=>b.id!==a)),[]);return{toasts:a,push:(0,m.useCallback)(a=>{let d=++H;b(b=>[...b,{id:d,...a}]),setTimeout(()=>c(d),4200)},[c]),dismiss:c}}(),[k,l]=(0,m.useState)(null),[o,p]=(0,m.useState)(null),q="running"!==a.status,r=(0,m.useCallback)(async()=>{try{let b=await fetch(`/api/v1/boxes/${encodeURIComponent(a.id)}/git`,{credentials:"same-origin"});l(b.ok?await b.json():null)}catch{l(null)}},[a.id]);(0,m.useEffect)(()=>{r()},[r]);let s=k?.ok&&k.branch?k.branch:a.branch||"—",t=()=>{r(),d.refresh()},u=async(a,b)=>{let c=await b();c.ok?(h({title:a,detail:L(c.stdout,c.stderr)}),t()):h({variant:"error",title:`${a} failed`,detail:c.error})};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(i.Card,{className:(0,g.cn)("divide-y divide-border/60 overflow-hidden",q?"opacity-90":""),children:[q?(0,b.jsxs)("div",{className:"flex items-center gap-2.5 bg-[var(--amber-soft)] px-4.5 p-2.5 text-[12.5px] text-[var(--amber)]",children:[(0,b.jsx)(e.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",a.status," — git operations need a running box."]}):null,(0,b.jsxs)(J,{label:"Sync",desc:`origin ↔ ${s}`,children:[(0,b.jsx)(K,{icon:e.Icons.arrowL,disabled:q,onRun:()=>u("Pulled from origin",()=>E(a.id)),children:"Pull"}),(0,b.jsx)(K,{icon:e.Icons.ext,disabled:q,onRun:()=>u("Pushed to origin",()=>F(a.id)),children:"Push"}),(0,b.jsx)(K,{icon:e.Icons.host,disabled:q,onRun:()=>u("Pushed to host",()=>G(a.id)),children:"Push to host"})]}),(0,b.jsxs)(J,{label:"Branch",desc:`currently on ${s}`,children:[(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:q,onClick:()=>p("change"),children:[(0,b.jsx)(e.Icons.branch,{}),"Change branch"]}),(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:q,onClick:()=>p("new"),children:[(0,b.jsx)(e.Icons.plus,{}),"New branch"]})]})]}),"change"===o?(0,b.jsx)(P,{box:a,branch:s,onClose:()=>p(null),onDone:h,onRefresh:t}):null,"new"===o?(0,b.jsx)(Q,{box:a,onClose:()=>p(null),onDone:h,onRefresh:t}):null,(0,b.jsx)(I,{toasts:f,dismiss:j})]})}let N="__manual__";function O({boxId:a,value:c,onChange:d,id:e,headLabel:f,currentBranch:g}){let[h,i]=(0,m.useState)(null),[j,k]=(0,m.useState)(g??null),[l,n]=(0,m.useState)(!1);return((0,m.useEffect)(()=>{let b=!1;return(async()=>{try{let c=await fetch(`/api/v1/boxes/${encodeURIComponent(a)}/branches`,{credentials:"same-origin"}),d=c.ok?await c.json():null;if(b)return;d&&Array.isArray(d.branches)&&d.branches.length>0?(i(d.branches),g||"string"!=typeof d.current||k(d.current)):(i([]),n(!0))}catch{b||(i([]),n(!0))}})(),()=>{b=!0}},[a,g]),null===h)?(0,b.jsx)(A.Select,{id:e,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,b.jsx)("option",{value:"",children:"Loading branches…"})}):l?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(y.Input,{id:e,className:"font-mono text-[13px]",autoFocus:!0,value:c,onChange:a=>d(a.target.value),placeholder:f?"HEAD":"feature-x"}),h.length>0?(0,b.jsx)("button",{type:"button",onClick:()=>{n(!1),d("")},className:"mt-1.5 cursor-pointer text-xs text-secondary-foreground underline-offset-2 hover:underline",children:"← Back to branch list"}):null]}):(0,b.jsxs)(A.Select,{id:e,value:c,wrapperClassName:"w-full",onChange:a=>{if(a.target.value===N){n(!0),d("");return}d(a.target.value)},children:[f?(0,b.jsx)("option",{value:"",children:f}):(0,b.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,b.jsx)("option",{value:N,children:"Other / type manually…"}),(0,b.jsx)("option",{disabled:!0,children:"────────────"}),h.map(a=>(0,b.jsxs)("option",{value:a,children:[a,a===j?" (current)":""]},a))]})}function P({box:a,branch:c,onClose:d,onDone:f,onRefresh:g}){let[h,i]=(0,m.useState)(""),[j,k]=(0,m.useState)(!1),[l,o]=(0,m.useState)(null),p=h.trim().length>0;return(0,b.jsxs)(x.Dialog,{onClose:d,className:"max-w-[440px]",children:[(0,b.jsxs)(x.DialogHeader,{children:[(0,b.jsx)(x.DialogIcon,{children:(0,b.jsx)(e.Icons.branch,{})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.DialogTitle,{children:"Change branch"}),(0,b.jsxs)(x.DialogDescription,{children:[a.id," · currently on ",c]})]})]}),(0,b.jsxs)(x.DialogBody,{children:[(0,b.jsx)(z.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,b.jsx)(O,{boxId:a.id,id:"gb-branch",value:h,onChange:i,currentBranch:c}),(0,b.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"The branch must exist and not be checked out in another worktree."}),l?(0,b.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:l}):null]}),(0,b.jsxs)(x.DialogFooter,{children:[(0,b.jsx)(n.Button,{variant:"outline",onClick:d,disabled:j,children:"Cancel"}),(0,b.jsxs)(n.Button,{onClick:()=>{p&&!j&&(k(!0),o(null),(async()=>{let b=await D(a.id,h.trim());b.ok?(f({title:"Branch changed",detail:L(b.stdout,b.stderr)}),d(),g()):(o(b.error),k(!1))})())},disabled:!p||j,children:[j?(0,b.jsx)("span",{className:"spin"}):(0,b.jsx)(e.Icons.check,{}),j?"Checking out…":"Change branch"]})]})]})}function Q({box:a,onClose:c,onDone:d,onRefresh:f}){let[g,h]=(0,m.useState)(""),[i,j]=(0,m.useState)(""),[k,l]=(0,m.useState)(!1),[o,p]=(0,m.useState)(null),q=g.trim().length>0,r=()=>{q&&!k&&(l(!0),p(null),(async()=>{let b=await C(a.id,g.trim(),i.trim()||void 0);b.ok?(d({title:"Branch created",detail:L(b.stdout,b.stderr)}),c(),f()):(p(b.error),l(!1))})())};return(0,b.jsxs)(x.Dialog,{onClose:c,className:"max-w-[440px]",children:[(0,b.jsxs)(x.DialogHeader,{children:[(0,b.jsx)(x.DialogIcon,{children:(0,b.jsx)(e.Icons.branch,{})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.DialogTitle,{children:"New branch"}),(0,b.jsxs)(x.DialogDescription,{children:[a.id," · branching in the box workspace"]})]})]}),(0,b.jsxs)(x.DialogBody,{children:[(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsx)(z.Label,{htmlFor:"nb-name",children:"Name"}),(0,b.jsx)(y.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"===a.key&&r()},placeholder:"my-branch"}),(0,b.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,b.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,b.jsxs)(z.Label,{htmlFor:"nb-from",children:["Base ref ",(0,b.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,b.jsx)(O,{boxId:a.id,id:"nb-from",value:i,onChange:j,headLabel:"Current HEAD (default)"}),(0,b.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),o?(0,b.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:o}):null]}),(0,b.jsxs)(x.DialogFooter,{children:[(0,b.jsx)(n.Button,{variant:"outline",onClick:c,disabled:k,children:"Cancel"}),(0,b.jsxs)(n.Button,{onClick:r,disabled:!q||k,children:[k?(0,b.jsx)("span",{className:"spin"}):(0,b.jsx)(e.Icons.plus,{}),k?"Creating…":"Create branch"]})]})]})}let R=(0,B.createServerReference)("6096ff4dd5616157cf1da6a977c271641a3ddce491",B.callServer,void 0,B.findSourceMapURL,"restartServiceAction"),S=new Set(["ready","running","done"]),T=new Set(["crashed","unhealthy","backoff","failed"]),U={up:"bg-[var(--green)]",bad:"bg-[var(--red)]",idle:"bg-[var(--amber)]"},V={up:"text-[var(--green-ink)]",bad:"text-[var(--red)]",idle:"text-[var(--amber)]"};function W({svc:a,disabled:c,onRestart:d}){var f;let h=(f=a.state,S.has(f)?"up":T.has(f)?"bad":"idle");return(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,b.jsx)("span",{className:(0,g.cn)("badge-dot",U[h]),"aria-hidden":!0}),(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:a.name}),(0,b.jsx)("span",{className:(0,g.cn)("font-mono text-xs",V[h]),children:a.state}),a.restarts>0?(0,b.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",a.restarts]}):null,(0,b.jsx)(n.Button,{variant:"outline",size:"icon-sm",title:`Restart ${a.name}`,disabled:c,onClick:()=>d(a.name),children:(0,b.jsx)(e.Icons.refresh,{})})]})}function X({id:a,running:c}){let[d,f]=(0,m.useState)(null),[g,h]=(0,m.useState)(null),[j,k]=(0,m.useTransition)(),l=(0,m.useCallback)(async()=>{try{let b=await fetch(`/api/v1/boxes/${encodeURIComponent(a)}/services`,{credentials:"same-origin"});if(!b.ok)return void h(`status ${String(b.status)}`);f(await b.json()),h(null)}catch(a){h(a instanceof Error?a.message:String(a))}},[a]);(0,m.useEffect)(()=>{if(l(),!c)return;let a=setInterval(()=>void l(),4e3);return()=>clearInterval(a)},[l,c]);let p=b=>{k(async()=>{let c=await R(a,b);c.ok||window.alert(`Restart failed: ${c.error}`),await l()})},q=d?.services??[],r=q.length>0;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o.SectionLabel,{right:r?(0,b.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:!c||j,onClick:()=>p(void 0),children:[(0,b.jsx)(e.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,b.jsx)(i.Card,{className:"divide-y divide-border/60 overflow-hidden",children:d||g?g?(0,b.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",g,")."]}):r?(0,b.jsxs)(b.Fragment,{children:[d?.source==="persisted"?(0,b.jsx)("div",{className:"bg-muted/30 px-4 py-1.5 font-mono text-[11px] text-muted-foreground",children:"persisted snapshot — box not running"}):null,q.map(a=>(0,b.jsx)(W,{svc:a,disabled:!c||j,onRestart:a=>p(a)},a.name))]}):(0,b.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:d?.source==="unavailable"?"No service status (box not running or no snapshot yet).":"No services declared in agentbox.yaml."}):(0,b.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var Y=a.i(82337);a.s(["default",0,function(){let{id:a}=(0,c.useParams)(),{box:g,project:k}=(0,j.useStore)(),m=g(a);if(!m)return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,b.jsx)(s.BackLink,{to:"/",children:"All boxes"}),(0,b.jsx)(w.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let n=k(m.projectId);return(0,b.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,b.jsx)(s.BackLink,{to:"/projects/"+m.projectId,children:n?n.name:"Project"}),(0,b.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[m.task,(0,b.jsx)(f.StatusBadge,{status:m.status})]}),(0,b.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:m.id})," ·"," ",(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:m.repo})," · ",m.host]})]}),(0,b.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,b.jsx)(t.BoxActions,{box:m,size:"lg"})})]}),m.error?(0,b.jsx)(h,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:e.Icons.warn,title:"Box errored",children:(0,b.jsx)("span",{className:"font-mono text-secondary-foreground",children:m.error})}):null,(0,b.jsx)(l,{boxId:m.id}),(0,b.jsx)(o.SectionLabel,{children:"Overview"}),(0,b.jsxs)(Y.StatGrid,{children:[(0,b.jsx)(Y.Stat,{k:"Status",v:(0,b.jsx)(f.StatusBadge,{status:m.status})}),(0,b.jsx)(Y.Stat,{k:"Agent CLI",v:m.agent,mono:!0}),(0,b.jsx)(Y.Stat,{k:"Commits",v:m.commits??"—",icon:e.Icons.commit}),(0,b.jsx)(Y.Stat,{k:"Files touched",v:m.filesTouched??"—",icon:e.Icons.file}),(0,b.jsx)(Y.Stat,{k:"Last activity",v:(0,b.jsx)(d.Ago,{ms:m.lastActivity}),mono:!0})]}),(0,b.jsx)(r,{box:m}),(0,b.jsx)(o.SectionLabel,{children:"Git operations"}),(0,b.jsx)(M,{box:m}),(0,b.jsx)(X,{id:m.id,running:"running"===m.status}),(0,b.jsx)(o.SectionLabel,{children:"Details"}),(0,b.jsxs)(i.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,b.jsx)(v,{k:"Box ID",v:m.id,mono:!0}),(0,b.jsx)(v,{k:"Project",v:n?n.name:"—",link:n?"/projects/"+m.projectId:null}),(0,b.jsx)(v,{k:"Repository",v:m.repo,mono:!0}),(0,b.jsx)(v,{k:"Branch",v:m.branch,mono:!0}),(0,b.jsx)(v,{k:"Host",v:m.host,mono:!0}),(0,b.jsx)(v,{k:"Created",v:new Date(m.createdAt).toLocaleString(),mono:!0})]})]})}],58099)}];
2
2
 
3
3
  //# sourceMappingURL=apps_hub_app_%28dashboard%29_boxes_%5Bid%5D_page_tsx_1-j_972._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[61688,10511,47685,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(17607),e=a.i(97187),f=a.i(71152),g=a.i(87883),h=a.i(24985),i=a.i(17236);a.s(["BoxTable",0,function({boxes:a}){let j=(0,c.useRouter)();return(0,b.jsx)(g.Card,{className:"overflow-hidden",children:(0,b.jsxs)(h.Table,{children:[(0,b.jsx)(h.TableHeader,{children:(0,b.jsxs)(h.TableRow,{className:"hover:bg-transparent",children:[(0,b.jsx)(h.TableHead,{className:"w-[38%]",children:"Task"}),(0,b.jsx)(h.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,b.jsx)(h.TableHead,{className:"max-md:hidden",children:"Status"}),(0,b.jsx)(h.TableHead,{className:"text-right",children:"Actions"})]})}),(0,b.jsx)(h.TableBody,{children:a.map(a=>(0,b.jsxs)(h.TableRow,{className:"cursor-pointer",onClick:()=>j.push("/boxes/"+a.id),children:[(0,b.jsxs)(h.TableCell,{children:[(0,b.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:a.task}),(0,b.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[a.id," · ",a.host]})]}),(0,b.jsxs)(h.TableCell,{className:"max-md:hidden",children:[(0,b.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,b.jsx)(e.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,b.jsx)("span",{className:"truncate",children:a.branch})]}),(0,b.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[a.agent," · ",(0,b.jsx)(d.Ago,{ms:a.lastActivity})]})]}),(0,b.jsx)(h.TableCell,{className:"max-md:hidden",children:(0,b.jsx)(f.StatusBadge,{status:a.status})}),(0,b.jsx)(h.TableCell,{className:"text-right",onClick:a=>a.stopPropagation(),children:(0,b.jsx)(i.BoxActions,{box:a})})]},a.id))})]})})}],61688);var j=a.i(50253),k=a.i(54473),l=a.i(18071),m=a.i(45515),n=a.i(85883),o=a.i(53596),p=a.i(86834);function q({className:a,...c}){return(0,b.jsx)("textarea",{className:(0,p.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",a),...c})}var r=a.i(96664);let s=(0,r.createServerReference)("4070192706087364b8c7d220576a6f3e4d3e5c532b",r.callServer,void 0,r.findSourceMapURL,"createBoxAction"),t=(0,r.createServerReference)("40386bdce4d894a318a969412fa1299d2704ccdfb3",r.callServer,void 0,r.findSourceMapURL,"listBranchesAction");var u=a.i(80007),v=a.i(94290);let w=[{id:"docker",label:"Docker (local)",configured:!0}];function x({project:a,projects:d,onClose:f}){let g=(0,c.useRouter)(),{state:h}=(0,u.useStore)(),i=h.providers.length?h.providers:w,[k,r]=(0,j.useTransition)(),[A,B]=(0,j.useState)(a?.id??d[0]?.id??""),[C,D]=(0,j.useState)("claude"),[E,F]=(0,j.useState)("docker"),[G,H]=(0,j.useState)(""),[I,J]=(0,j.useState)(""),[K,L]=(0,j.useState)(""),[M,N]=(0,j.useState)(null),[O,P]=(0,j.useState)(!1),[Q,R]=(0,j.useState)(!1),[S,T]=(0,j.useState)(null),[U,V]=(0,j.useState)(null),[W,X]=(0,j.useState)("streaming"),[Y,Z]=(0,j.useState)(null),$=d.find(a=>a.id===A)??a;return(0,j.useEffect)(()=>{if(!A||U)return;P($?.needsSetup??!1),F("docker");let a=!1;return N(null),L($?.currentBranch??""),t(A).then(b=>{if(a||!b.ok){a||b.ok||N([]);return}N(b.branches),b.current&&b.branches.includes(b.current)&&L(b.current)}),()=>{a=!0}},[A,U]),(0,b.jsxs)(m.Dialog,{onClose:f,className:U?"max-w-[900px]":"max-w-[560px]",children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogIcon,{children:(0,b.jsx)(e.Icons.box,{})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.DialogTitle,{children:"Create box"}),(0,b.jsx)(m.DialogDescription,{children:$?$.name:"Start a box in a project"})]}),U?(0,b.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,b.jsx)(y,{status:W,loginPhase:Y})}):null]}),(0,b.jsx)(m.DialogBody,{className:"flex flex-col gap-4",children:U?(0,b.jsx)(v.JobLogStream,{jobId:U,onStatus:X,onDone:()=>g.refresh(),onLogin:a=>Z(a?.phase??null)}):(0,b.jsxs)(b.Fragment,{children:[a?null:(0,b.jsx)(z,{label:"Project",children:(0,b.jsxs)(o.Select,{value:A,onChange:a=>B(a.target.value),children:[0===d.length?(0,b.jsx)("option",{value:"",children:"No projects — add one first"}):null,d.map(a=>(0,b.jsx)("option",{value:a.id,children:a.name},a.id))]})}),(0,b.jsx)(z,{label:"Provider",children:(0,b.jsx)(o.Select,{value:E,onChange:a=>F(a.target.value),children:i.map(a=>(0,b.jsxs)("option",{value:a.id,disabled:!a.configured,title:a.reason,children:[a.label,a.configured?"":" — not configured"]},a.id))})}),(0,b.jsx)(z,{label:"Agent",children:(0,b.jsxs)(o.Select,{value:C,onChange:a=>D(a.target.value),children:[(0,b.jsx)("option",{value:"claude",children:"Claude"}),(0,b.jsx)("option",{value:"codex",children:"Codex"}),(0,b.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,b.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,b.jsx)(z,{label:"Name (optional)",children:(0,b.jsx)(n.Input,{value:G,onChange:a=>H(a.target.value),placeholder:"auto"})}),$?.needsSetup&&"none"!==C?(0,b.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",checked:O,onChange:a=>P(a.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,b.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"===C?(0,b.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,b.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>R(a=>!a),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,b.jsx)(e.Icons.chevR,{className:(0,p.cn)("size-3.5 transition-transform",Q&&"rotate-90")}),"Advanced"]}),Q?(0,b.jsxs)(b.Fragment,{children:[null===M?(0,b.jsx)(z,{label:"Base branch",children:(0,b.jsx)(o.Select,{value:"",disabled:!0,children:(0,b.jsx)("option",{value:"",children:"Loading branches…"})})}):M.length>0?(0,b.jsx)(z,{label:"Base branch",children:(0,b.jsxs)(o.Select,{value:K,onChange:a=>L(a.target.value),children:[$?.currentBranch&&!M.includes($.currentBranch)?(0,b.jsxs)("option",{value:"",children:[$.currentBranch," (current)"]}):null,M.map(a=>(0,b.jsxs)("option",{value:a,children:[a,a===$?.currentBranch?" (current)":""]},a))]})}):null,"none"!==C?(0,b.jsx)(z,{label:"Initial prompt (optional)",children:(0,b.jsx)(q,{value:I,onChange:a=>J(a.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),S?(0,b.jsx)("div",{className:"font-mono text-xs text-destructive",children:S}):null]})}),(0,b.jsx)(m.DialogFooter,{children:U?(0,b.jsxs)(b.Fragment,{children:["streaming"===W?(0,b.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:"The box + agent start in the background — you can close this."}):null,(0,b.jsx)(l.Button,{onClick:f,children:"Close"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.Button,{variant:"outline",onClick:f,disabled:k,children:"Cancel"}),(0,b.jsx)(l.Button,{onClick:()=>{(T(null),A)?r(async()=>{let a=await s({projectId:A,agent:C,provider:E,name:G.trim()||void 0,prompt:"none"===C?void 0:I.trim()||void 0,fromBranch:K.trim()&&K.trim()!==$?.currentBranch?K.trim():void 0,setupWizard:"none"!==C&&O});a.ok?(V(a.jobId),g.refresh()):T(a.error)}):T("pick a project")},disabled:k||!A,children:k?"Starting…":"Create box"})]})})]})}function y({status:a,loginPhase:c}){return"done"===a?(0,b.jsxs)(k.Badge,{className:"badge-run",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===a||"error"===a||"cancelled"===a?(0,b.jsxs)(k.Badge,{className:"badge-err",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===c?(0,b.jsxs)(k.Badge,{className:"badge-err",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===c||"starting"===c||"exchanging"===c?(0,b.jsxs)(k.Badge,{className:"badge-create",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,b.jsxs)(k.Badge,{className:"badge-create",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Working…"]})}function z({label:a,children:c}){return(0,b.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:a}),c]})}a.s(["CreateBoxButton",0,function({project:a,projects:c,variant:d,size:f,className:g}){let[h,i]=(0,j.useState)(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(l.Button,{variant:d,size:f,className:g,onClick:()=>i(!0),children:[(0,b.jsx)(e.Icons.plus,{}),"Create box"]}),h?(0,b.jsx)(x,{project:a,projects:c??(a?[a]:[]),onClose:()=>i(!1)}):null]})}],10511);let A=(0,r.createServerReference)("40c7856bd78dddab224344045df78d51620e411335",r.callServer,void 0,r.findSourceMapURL,"removeProjectAction");a.s(["DeleteProjectButton",0,function({project:a,size:d,className:f,redirectHome:g}){let h=(0,c.useRouter)(),[i,k]=(0,j.useTransition)();return(0,b.jsxs)(l.Button,{variant:"destructive",size:d,className:f,title:"Delete project",disabled:i,onClick:b=>{b.stopPropagation(),b.preventDefault(),window.confirm(`Remove project "${a.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.`)&&k(async()=>{let b=await A(a.id);b.ok?g?h.push("/"):h.refresh():window.alert(`Delete failed: ${b.error}`)})},children:[(0,b.jsx)(e.Icons.trash,{}),"Delete"]})}],47685)}];
1
+ module.exports=[61688,10511,47685,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(17607),e=a.i(97187),f=a.i(71152),g=a.i(87883),h=a.i(24985),i=a.i(17236);a.s(["BoxTable",0,function({boxes:a}){let j=(0,c.useRouter)();return(0,b.jsx)(g.Card,{className:"overflow-hidden",children:(0,b.jsxs)(h.Table,{children:[(0,b.jsx)(h.TableHeader,{children:(0,b.jsxs)(h.TableRow,{className:"hover:bg-transparent",children:[(0,b.jsx)(h.TableHead,{className:"w-[38%]",children:"Task"}),(0,b.jsx)(h.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,b.jsx)(h.TableHead,{className:"max-md:hidden",children:"Status"}),(0,b.jsx)(h.TableHead,{className:"text-right",children:"Actions"})]})}),(0,b.jsx)(h.TableBody,{children:a.map(a=>(0,b.jsxs)(h.TableRow,{className:"cursor-pointer",onClick:()=>j.push("/boxes/"+a.id),children:[(0,b.jsxs)(h.TableCell,{children:[(0,b.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:a.task}),(0,b.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[a.id," · ",a.host]})]}),(0,b.jsxs)(h.TableCell,{className:"max-md:hidden",children:[(0,b.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,b.jsx)(e.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,b.jsx)("span",{className:"truncate",children:a.branch})]}),(0,b.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[a.agent," · ",(0,b.jsx)(d.Ago,{ms:a.lastActivity})]})]}),(0,b.jsx)(h.TableCell,{className:"max-md:hidden",children:(0,b.jsx)(f.StatusBadge,{status:a.status})}),(0,b.jsx)(h.TableCell,{className:"text-right",onClick:a=>a.stopPropagation(),children:(0,b.jsx)(i.BoxActions,{box:a})})]},a.id))})]})})}],61688);var j=a.i(50253),k=a.i(54473),l=a.i(18071),m=a.i(45515),n=a.i(85883),o=a.i(53596),p=a.i(86834);function q({className:a,...c}){return(0,b.jsx)("textarea",{className:(0,p.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",a),...c})}var r=a.i(96664);let s=(0,r.createServerReference)("4070192706087364b8c7d220576a6f3e4d3e5c532b",r.callServer,void 0,r.findSourceMapURL,"createBoxAction"),t=(0,r.createServerReference)("40386bdce4d894a318a969412fa1299d2704ccdfb3",r.callServer,void 0,r.findSourceMapURL,"listBranchesAction");var u=a.i(80007),v=a.i(94290);let w=[{id:"docker",label:"Docker (local)",configured:!0}];function x({project:a,projects:d,onClose:f}){let g=(0,c.useRouter)(),{state:h}=(0,u.useStore)(),i=h.providers.length?h.providers:w,[k,r]=(0,j.useTransition)(),[A,B]=(0,j.useState)(a?.id??d[0]?.id??""),[C,D]=(0,j.useState)("claude"),[E,F]=(0,j.useState)("docker"),[G,H]=(0,j.useState)(""),[I,J]=(0,j.useState)(""),[K,L]=(0,j.useState)(""),[M,N]=(0,j.useState)(null),[O,P]=(0,j.useState)(!1),[Q,R]=(0,j.useState)(!1),[S,T]=(0,j.useState)(null),[U,V]=(0,j.useState)(null),[W,X]=(0,j.useState)("streaming"),[Y,Z]=(0,j.useState)(null),[$,_]=(0,j.useState)(null),[aa,ab]=(0,j.useState)(!1),[ac,ad]=(0,j.useState)(null);(0,j.useEffect)(()=>{let a=!1;return(async()=>{try{let b=await fetch("/api/v1/providers?freshness=1",{credentials:"same-origin"});if(!b.ok)return;let c=await b.json();if(a)return;let d={};for(let a of c.providers??[])d[a.id]={baseStatus:a.baseStatus,baseStaleReason:a.baseStaleReason,jobId:a.jobId};ad(d)}catch{}})(),()=>{a=!0}},[]);let ae=d.find(a=>a.id===A)??a,af=E??"docker",ag=i.find(a=>a.id===af),ah=ac?.[af],ai=!!ah&&(!!ah.jobId||"unprepared"===ah.baseStatus||"stale"===ah.baseStatus);(0,j.useEffect)(()=>{if(!A||U)return;P(ae?.needsSetup??!1),F("docker");let a=!1;return N(null),L(ae?.currentBranch??""),t(A).then(b=>{if(a||!b.ok){a||b.ok||N([]);return}N(b.branches),b.current&&b.branches.includes(b.current)&&L(b.current)}),()=>{a=!0}},[A,U]);let aj=()=>{T(null);let a=ah?.jobId;a?_(a):r(async()=>{try{let a=await fetch(`/api/v1/providers/${encodeURIComponent(af)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({})}),b=await a.json().catch(()=>null);if(!a.ok||!b?.jobId)return void T(b?.error?.message??`base image build request failed (${a.status})`);_(b.jobId)}catch(a){T(a instanceof Error?a.message:String(a))}})},ak=()=>{T(null),r(async()=>{let a=await s({projectId:A,agent:C,provider:E,name:G.trim()||void 0,prompt:"none"===C?void 0:I.trim()||void 0,fromBranch:K.trim()&&K.trim()!==ae?.currentBranch?K.trim():void 0,setupWizard:"none"!==C&&O});a.ok?(V(a.jobId),g.refresh()):T(a.error)})};return(0,b.jsxs)(m.Dialog,{onClose:f,className:U||$?"max-w-[900px]":"max-w-[560px]",children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogIcon,{children:(0,b.jsx)(e.Icons.box,{})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.DialogTitle,{children:!U&&$?"Building base image":"Create box"}),(0,b.jsx)(m.DialogDescription,{children:ae?ae.name:"Start a box in a project"})]}),U||$?(0,b.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,b.jsx)(y,{status:W,loginPhase:Y})}):null]}),(0,b.jsx)(m.DialogBody,{className:"flex flex-col gap-4",children:U?(0,b.jsx)(v.JobLogStream,{jobId:U,onStatus:X,onDone:()=>g.refresh(),onLogin:a=>Z(a?.phase??null)}):$?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["Building the ",ag?.label??af," base image — one-time, can take several minutes. The box is created automatically when it finishes."]}),(0,b.jsx)(v.JobLogStream,{jobId:$,onStatus:X,onDone:a=>{"done"===a?ak():T(`base image build ${a}`)}}),S?(0,b.jsx)("div",{className:"font-mono text-xs text-destructive",children:S}):null]}):(0,b.jsxs)(b.Fragment,{children:[a?null:(0,b.jsx)(z,{label:"Project",children:(0,b.jsxs)(o.Select,{value:A,onChange:a=>B(a.target.value),children:[0===d.length?(0,b.jsx)("option",{value:"",children:"No projects — add one first"}):null,d.map(a=>(0,b.jsx)("option",{value:a.id,children:a.name},a.id))]})}),(0,b.jsx)(z,{label:"Provider",children:(0,b.jsx)(o.Select,{value:E,onChange:a=>F(a.target.value),children:i.map(a=>(0,b.jsxs)("option",{value:a.id,disabled:!a.configured,title:a.reason,children:[a.label,a.configured?"":" — not configured"]},a.id))})}),ai?(0,b.jsx)("p",{className:"-mt-2 font-mono text-xs text-amber-600 dark:text-amber-400",title:ah?.baseStaleReason,children:ah?.jobId?"A base-image build is already running — the box will be created when it finishes.":ah?.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,b.jsx)(z,{label:"Agent",children:(0,b.jsxs)(o.Select,{value:C,onChange:a=>D(a.target.value),children:[(0,b.jsx)("option",{value:"claude",children:"Claude"}),(0,b.jsx)("option",{value:"codex",children:"Codex"}),(0,b.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,b.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,b.jsx)(z,{label:"Name (optional)",children:(0,b.jsx)(n.Input,{value:G,onChange:a=>H(a.target.value),placeholder:"auto"})}),ae?.needsSetup&&"none"!==C?(0,b.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",checked:O,onChange:a=>P(a.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,b.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"===C?(0,b.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,b.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>R(a=>!a),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,b.jsx)(e.Icons.chevR,{className:(0,p.cn)("size-3.5 transition-transform",Q&&"rotate-90")}),"Advanced"]}),Q?(0,b.jsxs)(b.Fragment,{children:[null===M?(0,b.jsx)(z,{label:"Base branch",children:(0,b.jsx)(o.Select,{value:"",disabled:!0,children:(0,b.jsx)("option",{value:"",children:"Loading branches…"})})}):M.length>0?(0,b.jsx)(z,{label:"Base branch",children:(0,b.jsxs)(o.Select,{value:K,onChange:a=>L(a.target.value),children:[ae?.currentBranch&&!M.includes(ae.currentBranch)?(0,b.jsxs)("option",{value:"",children:[ae.currentBranch," (current)"]}):null,M.map(a=>(0,b.jsxs)("option",{value:a,children:[a,a===ae?.currentBranch?" (current)":""]},a))]})}):null,"none"!==C?(0,b.jsx)(z,{label:"Initial prompt (optional)",children:(0,b.jsx)(q,{value:I,onChange:a=>J(a.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),S?(0,b.jsx)("div",{className:"font-mono text-xs text-destructive",children:S}):null]})}),(0,b.jsx)(m.DialogFooter,{children:U||$?(0,b.jsxs)(b.Fragment,{children:["streaming"===W?(0,b.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:U?"The box + agent start in the background — you can close this.":"Keep this open — the box is created when the build finishes."}):null,(0,b.jsx)(l.Button,{onClick:f,children:"Close"})]}):aa?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",title:ah?.baseStaleReason,children:["The ",ag?.label??af," base image is out of date."]}),(0,b.jsx)(l.Button,{variant:"outline",onClick:()=>ab(!1),disabled:k,children:"Cancel"}),(0,b.jsx)(l.Button,{variant:"outline",onClick:()=>{ab(!1),ak()},disabled:k,children:"Use existing image"}),(0,b.jsx)(l.Button,{onClick:()=>{ab(!1),aj()},disabled:k,children:"Rebuild & create"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.Button,{variant:"outline",onClick:f,disabled:k,children:"Cancel"}),(0,b.jsx)(l.Button,{onClick:()=>{(T(null),A)?ai?"docker"===af||ah?.baseStatus!=="stale"||ah.jobId?aj():ab(!0):ak():T("pick a project")},disabled:k||!A,children:k?"Starting…":"Create box"})]})})]})}function y({status:a,loginPhase:c}){return"done"===a?(0,b.jsxs)(k.Badge,{className:"badge-run",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===a||"error"===a||"cancelled"===a?(0,b.jsxs)(k.Badge,{className:"badge-err",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===c?(0,b.jsxs)(k.Badge,{className:"badge-err",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===c||"starting"===c||"exchanging"===c?(0,b.jsxs)(k.Badge,{className:"badge-create",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,b.jsxs)(k.Badge,{className:"badge-create",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Working…"]})}function z({label:a,children:c}){return(0,b.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:a}),c]})}a.s(["CreateBoxButton",0,function({project:a,projects:c,variant:d,size:f,className:g}){let[h,i]=(0,j.useState)(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(l.Button,{variant:d,size:f,className:g,onClick:()=>i(!0),children:[(0,b.jsx)(e.Icons.plus,{}),"Create box"]}),h?(0,b.jsx)(x,{project:a,projects:c??(a?[a]:[]),onClose:()=>i(!1)}):null]})}],10511);let A=(0,r.createServerReference)("40c7856bd78dddab224344045df78d51620e411335",r.callServer,void 0,r.findSourceMapURL,"removeProjectAction");a.s(["DeleteProjectButton",0,function({project:a,size:d,className:f,redirectHome:g}){let h=(0,c.useRouter)(),[i,k]=(0,j.useTransition)();return(0,b.jsxs)(l.Button,{variant:"destructive",size:d,className:f,title:"Delete project",disabled:i,onClick:b=>{b.stopPropagation(),b.preventDefault(),window.confirm(`Remove project "${a.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.`)&&k(async()=>{let b=await A(a.id);b.ok?g?h.push("/"):h.refresh():window.alert(`Delete failed: ${b.error}`)})},children:[(0,b.jsx)(e.Icons.trash,{}),"Delete"]})}],47685)}];
2
2
 
3
3
  //# sourceMappingURL=apps_hub_app_%28dashboard%29_boxes_components_box-table_tsx_0a9pyn_._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[97187,80007,a=>{"use strict";var b=a.i(33552);let c=(a,c)=>d=>(0,b.jsx)("svg",{viewBox:"0 0 24 24",fill:c?"currentColor":"none",stroke:c?"none":"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",...d,children:a.map((a,c)=>(0,b.jsx)("path",{d:a},c))}),d={grid:c(["M4 4h7v7H4zM13 4h7v7h-7zM13 13h7v7h-7zM4 13h7v7H4z"]),box:c(["M12 20.5 5 17V7l7-3.5L19 7v10Z","m5 7 7 3.5L19 7M12 10.5V20"]),folder:c(["M4 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"]),settings:c(["M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","M19.4 15a1.6 1.6 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.6 1.6 0 0 0-2.7 1.1V21a2 2 0 1 1-4 0v-.1A1.6 1.6 0 0 0 7.5 19.4a1.6 1.6 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.6 1.6 0 0 0-1.1-2.7H1a2 2 0 1 1 0-4h.1A1.6 1.6 0 0 0 2.6 7.5a1.6 1.6 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.6 1.6 0 0 0 2.7-1.1V1a2 2 0 1 1 4 0v.1a1.6 1.6 0 0 0 2.7 1.1 1.6 1.6 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.6 1.6 0 0 0 1.1 2.7H21a2 2 0 1 1 0 4h-.1a1.6 1.6 0 0 0-1.5 1Z"]),book:c(["M4 19.5A2.5 2.5 0 0 1 6.5 17H20","M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z"]),branch:c(["M6 3v12","M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","M18 9a9 9 0 0 1-9 9"]),plus:c(["M12 5v14M5 12h14"]),pause:c(["M9 4H6v16h3zM18 4h-3v16h3z"]),play:c(["M6 4l14 8-14 8Z"]),refresh:c(["M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8","M3 3v5h5","M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16","M21 21v-5h-5"]),stop:c(["M7 7h10v10H7z"]),trash:c(["M3 6h18","M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2","M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"]),chevR:c(["m9 6 6 6-6 6"]),arrowL:c(["M19 12H5","m12 19-7-7 7-7"]),arrowUp:c(["M12 19V5","m5 12 7-7 7 7"]),ext:c(["M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6","M15 3h6v6","M10 14 21 3"]),copy:c(["M9 9h11a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2Z","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"]),x:c(["M18 6 6 18M6 6l12 12"]),check:c(["M20 6 9 17l-5-5"]),clock:c(["M12 7v5l3 2","M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z"]),server:c(["M3 4h18v6H3zM3 14h18v6H3z","M7 7h.01M7 17h.01"]),host:c(["M5 4h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z","M5 14h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2Z","M7 7h.01M7 17h.01"]),repo:c(["M4 19.5A2.5 2.5 0 0 1 6.5 17H20","M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z"]),search:c(["M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z","m20 20-3.5-3.5"]),menu:c(["M4 7h16M4 12h16M4 17h16"]),terminal:c(["m6 9 3 3-3 3","M13 15h5","M4 4h16v16H4z"]),warn:c(["M10.3 4.3 2.5 18a1.8 1.8 0 0 0 1.6 2.7h15.8A1.8 1.8 0 0 0 21.5 18L13.7 4.3a1.8 1.8 0 0 0-3.1 0Z","M12 9v4M12 17h.01"]),activity:c(["M22 12h-4l-3 9L9 3l-3 9H2"]),commit:c(["M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","M3 12h6M15 12h6"]),file:c(["M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z","M14 2v6h6"]),shield:c(["M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z"]),claude:c(["M12 3v18M3 12h18M5.5 5.5l13 13M18.5 5.5l-13 13"]),codex:a=>(0,b.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",...a,children:(0,b.jsx)("path",{d:"M12 2.6 3.2 7v10l8.8 4.4L20.8 17V7L12 2.6Zm0 3.1a6.3 6.3 0 1 1 0 12.6 6.3 6.3 0 0 1 0-12.6Zm0 2.4a3.9 3.9 0 1 0 0 7.8 3.9 3.9 0 0 0 0-7.8Z"})}),opencode:c(["M9 8l-4 4 4 4","M15 8l4 4-4 4","M13 6l-2 12"]),github:a=>(0,b.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",...a,children:(0,b.jsx)("path",{d:"M12 1.5A10.5 10.5 0 0 0 8.7 22c.5.1.7-.2.7-.5v-1.8c-2.9.6-3.5-1.4-3.5-1.4-.5-1.2-1.2-1.5-1.2-1.5-.9-.6.1-.6.1-.6 1 .1 1.6 1 1.6 1 .9 1.6 2.4 1.1 3 .9.1-.7.4-1.1.6-1.4-2.3-.3-4.7-1.2-4.7-5.1 0-1.1.4-2 1-2.7-.1-.3-.5-1.4.1-2.8 0 0 .9-.3 2.8 1a9.6 9.6 0 0 1 5 0c1.9-1.3 2.8-1 2.8-1 .6 1.4.2 2.5.1 2.8.7.7 1 1.6 1 2.7 0 3.9-2.4 4.8-4.6 5 .4.3.7.9.7 1.9v2.8c0 .3.2.6.7.5A10.5 10.5 0 0 0 12 1.5Z"})})},e={TypeScript:"#3178c6",Go:"#00add8",Astro:"#ff5d01",MDX:"#f9a03c",JavaScript:"#f1e05a",Python:"#3572a5"};d.claude,d.codex,d.opencode,d.terminal,a.s(["Icons",0,d,"LangDot",0,function({lang:a}){return(0,b.jsx)("span",{className:"inline-block h-2 w-2 flex-none rounded-full",style:{background:e[a]??"#9aa0a6"}})}],97187);var f=a.i(50253);let g=(0,f.createContext)(null);a.s(["HubProvider",0,function({data:a,children:c}){let d=(0,f.useMemo)(()=>({state:a,project:b=>a.projects.find(a=>a.id===b),box:b=>a.boxes.find(a=>a.id===b),boxesFor:b=>a.boxes.filter(a=>a.projectId===b),repo:b=>a.github.repos.find(a=>a.full===b)}),[a]);return(0,b.jsx)(g.Provider,{value:d,children:c})},"useStore",0,function(){let a=(0,f.useContext)(g);if(!a)throw Error("useStore must be used within HubProvider");return a}],80007)},54473,a=>{"use strict";var b=a.i(33552),c=a.i(86834);let d={default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-muted-foreground border-border"};a.s(["Badge",0,function({className:a,variant:e="outline",...f}){return(0,b.jsx)("span",{className:(0,c.cn)("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-[2px] font-mono text-[11px] font-medium tracking-[.01em]",d[e],a),...f})}])},49240,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(50253),e=a.i(51363),f=a.i(86834),g=a.i(97187);function h({className:a,fallback:c,...d}){return(0,b.jsx)("span",{className:(0,f.cn)("grid h-7 w-7 flex-none place-items-center rounded-full bg-primary font-mono text-xs font-semibold text-primary-foreground",a),...d,children:c})}var i=a.i(54473),j=a.i(80007);function k({active:a,to:c,href:d,icon:h,label:j,count:l,ext:m}){let n=(0,f.cn)("flex w-full cursor-pointer items-center gap-2.5 rounded-lg border-0 bg-transparent px-2 py-[7px] text-left text-[13.5px] transition-colors",a?"bg-accent font-medium text-accent-foreground":"text-secondary-foreground hover:bg-secondary hover:text-foreground"),o=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h,{className:(0,f.cn)("size-4 flex-none",a?"text-primary":"text-muted-foreground")}),j,void 0!==l?(0,b.jsx)(i.Badge,{className:(0,f.cn)("ml-auto border-transparent px-2 py-0 text-[11px]",a?"bg-card text-primary":"bg-secondary text-[#a4a9b0]"),children:l}):null,m?(0,b.jsx)(g.Icons.ext,{className:"ml-auto size-[13px] text-[#a4a9b0]"}):null]});return d?(0,b.jsx)("a",{className:n,href:d,target:"_blank",rel:"noopener",children:o}):(0,b.jsx)(e.default,{className:n,href:c??"#",children:o})}function l({children:a}){return(0,b.jsx)("div",{className:"px-2 pb-1.5 pt-4 font-mono text-[10.5px] uppercase tracking-[.1em] text-[#a4a9b0]",children:a})}function m(){let{state:a,boxesFor:d}=(0,j.useStore)(),e=(0,c.usePathname)(),f="/"===e||e.startsWith("/boxes");return(0,b.jsxs)("aside",{className:"shad-side sticky top-0 z-50 flex h-screen flex-col self-start overflow-y-auto border-r border-border bg-background px-3.5 pb-4 pt-4 max-md:w-64",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5 px-2 pb-4 font-mono text-sm font-semibold",children:[(0,b.jsx)("img",{src:"/logo.svg",alt:"",width:20,height:20,className:"h-5 w-5"}),"agentbox",(0,b.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"/ hub"})]}),(0,b.jsx)(l,{children:"Workspace"}),(0,b.jsxs)("nav",{className:"flex flex-col gap-px",children:[(0,b.jsx)(k,{active:f,to:"/",icon:g.Icons.grid,label:"Dashboard",count:a.boxes.length}),(0,b.jsx)(k,{active:e.startsWith("/approvals"),to:"/approvals",icon:g.Icons.shield,label:"Approvals",count:a.approvals.length}),(0,b.jsx)(k,{active:e.startsWith("/settings"),to:"/settings",icon:g.Icons.settings,label:"Settings"}),(0,b.jsx)(k,{href:"https://agent-box.sh/docs",icon:g.Icons.book,label:"Docs",ext:!0}),(0,b.jsx)(k,{href:"/api/v1/docs",icon:g.Icons.terminal,label:"API",ext:!0})]}),(0,b.jsx)(l,{children:"Projects"}),(0,b.jsx)("nav",{className:"flex flex-col gap-px",children:a.projects.map(a=>(0,b.jsx)(k,{active:e==="/projects/"+a.id,to:"/projects/"+a.id,icon:g.Icons.folder,label:a.name,count:d(a.id).length},a.id))}),(0,b.jsx)("div",{className:"mt-auto border-t border-border pt-2.5",children:(0,b.jsxs)("div",{className:"flex items-center gap-2.5 px-1.5 pt-1.5",children:[(0,b.jsx)(h,{fallback:"M"}),(0,b.jsxs)("div",{className:"text-[12.5px] leading-tight",children:[a.user.name,(0,b.jsxs)("span",{className:"block font-mono text-[11px] text-muted-foreground",children:["@",a.user.login]})]})]})})]})}function n(){let a=(0,c.useRouter)();return(0,d.useEffect)(()=>{let b=null,c=()=>{document.hidden||b||(b=setTimeout(()=>{b=null,a.refresh()},250))},d=new EventSource("/api/events");return d.addEventListener("change",c),d.addEventListener("ping",c),()=>{b&&clearTimeout(b),d.close()}},[a]),null}var o=a.i(18071),p=a.i(54250);function q({to:a,children:c,current:d}){return d?(0,b.jsx)("b",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-medium text-secondary-foreground",children:c}):(0,b.jsx)(e.default,{className:"cursor-pointer hover:text-primary",href:a??"#",children:c})}function r(){return(0,b.jsx)("span",{className:"text-border",children:"/"})}function s(){let a=(0,c.usePathname)(),{project:d,box:e}=(0,j.useStore)(),f=[(0,b.jsx)(q,{to:"/",children:"hub"},"h")],g=a.split("/").filter(Boolean);if("projects"===g[0]&&g[1]){let a=d(g[1]);f.push((0,b.jsx)(r,{},"s1"),(0,b.jsx)(q,{current:!0,children:a?a.name:"project"},"p"))}else if("boxes"===g[0]&&g[1]){let a=e(g[1]),c=a?d(a.projectId):void 0;c&&f.push((0,b.jsx)(r,{},"s1"),(0,b.jsx)(q,{to:"/projects/"+c.id,children:c.name},"p")),f.push((0,b.jsx)(r,{},"s2"),(0,b.jsx)(q,{current:!0,children:a?a.id:"box"},"b"))}else"settings"===g[0]?f.push((0,b.jsx)(r,{},"s1"),(0,b.jsx)(q,{current:!0,children:"settings"},"se")):f.push((0,b.jsx)(r,{},"s1"),(0,b.jsx)(q,{current:!0,children:"dashboard"},"d"));return(0,b.jsx)("div",{className:"flex min-w-0 items-center gap-2 font-mono text-[12.5px] text-[#a4a9b0]",children:f})}function t(){let a=(0,c.useRouter)(),{state:d}=(0,j.useStore)();return(0,b.jsxs)("div",{className:"sticky top-0 z-30 flex h-[54px] items-center gap-3 border-b border-border bg-[rgba(246,246,243,.86)] px-6 backdrop-blur-md",children:[(0,b.jsx)(o.Button,{variant:"outline",size:"icon-sm",className:"hidden max-md:inline-flex","aria-label":"Menu",onClick:()=>document.body.classList.toggle("nav-open"),children:(0,b.jsx)(g.Icons.menu,{})}),(0,b.jsx)(s,{}),(0,b.jsx)("span",{className:"flex-1"}),(0,b.jsxs)(o.Button,{variant:"ghost",size:"sm",href:"https://agent-box.sh/docs",target:"_blank",rel:"noopener",children:[(0,b.jsx)(g.Icons.book,{}),"Docs"]}),(0,b.jsxs)(o.Button,{variant:"ghost",size:"sm",href:"/api/v1/docs",target:"_blank",rel:"noopener",children:[(0,b.jsx)(g.Icons.terminal,{}),"API"]}),"password"===d.authMode?(0,b.jsx)(o.Button,{variant:"ghost",size:"sm",onClick:()=>{(0,p.signOut)().then(()=>{a.push("/signin"),a.refresh()})},children:"Sign out"}):null]})}function u({children:a}){let e=(0,c.usePathname)();return(0,d.useEffect)(()=>{document.body.classList.remove("nav-open")},[e]),(0,b.jsxs)("div",{className:"grid min-h-screen grid-cols-[232px_minmax(0,1fr)] max-md:grid-cols-1",children:[(0,b.jsx)("div",{className:"pointer-events-none fixed inset-0 z-40 bg-[rgba(20,24,30,.4)] opacity-0 transition-opacity [body.nav-open_&]:pointer-events-auto [body.nav-open_&]:opacity-100",onClick:()=>document.body.classList.remove("nav-open")}),(0,b.jsx)(m,{}),(0,b.jsxs)("main",{className:"flex min-w-0 flex-col",children:[(0,b.jsx)(t,{}),a]})]})}a.s(["HubShell",0,function({data:a,children:c}){return(0,b.jsxs)(j.HubProvider,{data:a,children:[(0,b.jsx)(n,{}),(0,b.jsx)(u,{children:c})]})}],49240)}];
1
+ module.exports=[97187,80007,a=>{"use strict";var b=a.i(33552);let c=(a,c)=>d=>(0,b.jsx)("svg",{viewBox:"0 0 24 24",fill:c?"currentColor":"none",stroke:c?"none":"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",...d,children:a.map((a,c)=>(0,b.jsx)("path",{d:a},c))}),d={grid:c(["M4 4h7v7H4zM13 4h7v7h-7zM13 13h7v7h-7zM4 13h7v7H4z"]),box:c(["M12 20.5 5 17V7l7-3.5L19 7v10Z","m5 7 7 3.5L19 7M12 10.5V20"]),folder:c(["M4 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"]),settings:c(["M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","M19.4 15a1.6 1.6 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.6 1.6 0 0 0-2.7 1.1V21a2 2 0 1 1-4 0v-.1A1.6 1.6 0 0 0 7.5 19.4a1.6 1.6 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.6 1.6 0 0 0-1.1-2.7H1a2 2 0 1 1 0-4h.1A1.6 1.6 0 0 0 2.6 7.5a1.6 1.6 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.6 1.6 0 0 0 2.7-1.1V1a2 2 0 1 1 4 0v.1a1.6 1.6 0 0 0 2.7 1.1 1.6 1.6 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.6 1.6 0 0 0 1.1 2.7H21a2 2 0 1 1 0 4h-.1a1.6 1.6 0 0 0-1.5 1Z"]),book:c(["M4 19.5A2.5 2.5 0 0 1 6.5 17H20","M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z"]),branch:c(["M6 3v12","M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","M18 9a9 9 0 0 1-9 9"]),plus:c(["M12 5v14M5 12h14"]),pencil:c(["M12 20h9","M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"]),pause:c(["M9 4H6v16h3zM18 4h-3v16h3z"]),play:c(["M6 4l14 8-14 8Z"]),refresh:c(["M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8","M3 3v5h5","M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16","M21 21v-5h-5"]),stop:c(["M7 7h10v10H7z"]),trash:c(["M3 6h18","M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2","M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"]),chevR:c(["m9 6 6 6-6 6"]),arrowL:c(["M19 12H5","m12 19-7-7 7-7"]),arrowUp:c(["M12 19V5","m5 12 7-7 7 7"]),ext:c(["M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6","M15 3h6v6","M10 14 21 3"]),copy:c(["M9 9h11a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2Z","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"]),x:c(["M18 6 6 18M6 6l12 12"]),check:c(["M20 6 9 17l-5-5"]),clock:c(["M12 7v5l3 2","M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z"]),server:c(["M3 4h18v6H3zM3 14h18v6H3z","M7 7h.01M7 17h.01"]),host:c(["M5 4h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z","M5 14h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2Z","M7 7h.01M7 17h.01"]),repo:c(["M4 19.5A2.5 2.5 0 0 1 6.5 17H20","M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z"]),search:c(["M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z","m20 20-3.5-3.5"]),menu:c(["M4 7h16M4 12h16M4 17h16"]),terminal:c(["m6 9 3 3-3 3","M13 15h5","M4 4h16v16H4z"]),warn:c(["M10.3 4.3 2.5 18a1.8 1.8 0 0 0 1.6 2.7h15.8A1.8 1.8 0 0 0 21.5 18L13.7 4.3a1.8 1.8 0 0 0-3.1 0Z","M12 9v4M12 17h.01"]),activity:c(["M22 12h-4l-3 9L9 3l-3 9H2"]),commit:c(["M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z","M3 12h6M15 12h6"]),file:c(["M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z","M14 2v6h6"]),shield:c(["M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z"]),claude:c(["M12 3v18M3 12h18M5.5 5.5l13 13M18.5 5.5l-13 13"]),codex:a=>(0,b.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",...a,children:(0,b.jsx)("path",{d:"M12 2.6 3.2 7v10l8.8 4.4L20.8 17V7L12 2.6Zm0 3.1a6.3 6.3 0 1 1 0 12.6 6.3 6.3 0 0 1 0-12.6Zm0 2.4a3.9 3.9 0 1 0 0 7.8 3.9 3.9 0 0 0 0-7.8Z"})}),opencode:c(["M9 8l-4 4 4 4","M15 8l4 4-4 4","M13 6l-2 12"]),github:a=>(0,b.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",...a,children:(0,b.jsx)("path",{d:"M12 1.5A10.5 10.5 0 0 0 8.7 22c.5.1.7-.2.7-.5v-1.8c-2.9.6-3.5-1.4-3.5-1.4-.5-1.2-1.2-1.5-1.2-1.5-.9-.6.1-.6.1-.6 1 .1 1.6 1 1.6 1 .9 1.6 2.4 1.1 3 .9.1-.7.4-1.1.6-1.4-2.3-.3-4.7-1.2-4.7-5.1 0-1.1.4-2 1-2.7-.1-.3-.5-1.4.1-2.8 0 0 .9-.3 2.8 1a9.6 9.6 0 0 1 5 0c1.9-1.3 2.8-1 2.8-1 .6 1.4.2 2.5.1 2.8.7.7 1 1.6 1 2.7 0 3.9-2.4 4.8-4.6 5 .4.3.7.9.7 1.9v2.8c0 .3.2.6.7.5A10.5 10.5 0 0 0 12 1.5Z"})})},e={TypeScript:"#3178c6",Go:"#00add8",Astro:"#ff5d01",MDX:"#f9a03c",JavaScript:"#f1e05a",Python:"#3572a5"};d.claude,d.codex,d.opencode,d.terminal,a.s(["Icons",0,d,"LangDot",0,function({lang:a}){return(0,b.jsx)("span",{className:"inline-block h-2 w-2 flex-none rounded-full",style:{background:e[a]??"#9aa0a6"}})}],97187);var f=a.i(50253);let g=(0,f.createContext)(null);a.s(["HubProvider",0,function({data:a,children:c}){let d=(0,f.useMemo)(()=>({state:a,project:b=>a.projects.find(a=>a.id===b),box:b=>a.boxes.find(a=>a.id===b),boxesFor:b=>a.boxes.filter(a=>a.projectId===b),repo:b=>a.github.repos.find(a=>a.full===b)}),[a]);return(0,b.jsx)(g.Provider,{value:d,children:c})},"useStore",0,function(){let a=(0,f.useContext)(g);if(!a)throw Error("useStore must be used within HubProvider");return a}],80007)},54473,a=>{"use strict";var b=a.i(33552),c=a.i(86834);let d={default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-muted-foreground border-border"};a.s(["Badge",0,function({className:a,variant:e="outline",...f}){return(0,b.jsx)("span",{className:(0,c.cn)("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-[2px] font-mono text-[11px] font-medium tracking-[.01em]",d[e],a),...f})}])},49240,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(50253),e=a.i(51363),f=a.i(86834),g=a.i(97187);function h({className:a,fallback:c,...d}){return(0,b.jsx)("span",{className:(0,f.cn)("grid h-7 w-7 flex-none place-items-center rounded-full bg-primary font-mono text-xs font-semibold text-primary-foreground",a),...d,children:c})}var i=a.i(54473),j=a.i(80007);function k({active:a,to:c,href:d,icon:h,label:j,count:l,ext:m}){let n=(0,f.cn)("flex w-full cursor-pointer items-center gap-2.5 rounded-lg border-0 bg-transparent px-2 py-[7px] text-left text-[13.5px] transition-colors",a?"bg-accent font-medium text-accent-foreground":"text-secondary-foreground hover:bg-secondary hover:text-foreground"),o=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h,{className:(0,f.cn)("size-4 flex-none",a?"text-primary":"text-muted-foreground")}),j,void 0!==l?(0,b.jsx)(i.Badge,{className:(0,f.cn)("ml-auto border-transparent px-2 py-0 text-[11px]",a?"bg-card text-primary":"bg-secondary text-[#a4a9b0]"),children:l}):null,m?(0,b.jsx)(g.Icons.ext,{className:"ml-auto size-[13px] text-[#a4a9b0]"}):null]});return d?(0,b.jsx)("a",{className:n,href:d,target:"_blank",rel:"noopener",children:o}):(0,b.jsx)(e.default,{className:n,href:c??"#",children:o})}function l({children:a}){return(0,b.jsx)("div",{className:"px-2 pb-1.5 pt-4 font-mono text-[10.5px] uppercase tracking-[.1em] text-[#a4a9b0]",children:a})}function m(){let{state:a,boxesFor:d}=(0,j.useStore)(),e=(0,c.usePathname)(),f="/"===e||e.startsWith("/boxes");return(0,b.jsxs)("aside",{className:"shad-side sticky top-0 z-50 flex h-screen flex-col self-start overflow-y-auto border-r border-border bg-background px-3.5 pb-4 pt-4 max-md:w-64",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5 px-2 pb-4 font-mono text-sm font-semibold",children:[(0,b.jsx)("img",{src:"/logo.svg",alt:"",width:20,height:20,className:"h-5 w-5"}),"agentbox",(0,b.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"/ hub"})]}),(0,b.jsx)(l,{children:"Workspace"}),(0,b.jsxs)("nav",{className:"flex flex-col gap-px",children:[(0,b.jsx)(k,{active:f,to:"/",icon:g.Icons.grid,label:"Dashboard",count:a.boxes.length}),(0,b.jsx)(k,{active:e.startsWith("/approvals"),to:"/approvals",icon:g.Icons.shield,label:"Approvals",count:a.approvals.length}),(0,b.jsx)(k,{active:e.startsWith("/settings"),to:"/settings",icon:g.Icons.settings,label:"Settings"}),(0,b.jsx)(k,{href:"https://agent-box.sh/docs",icon:g.Icons.book,label:"Docs",ext:!0}),(0,b.jsx)(k,{href:"/api/v1/docs",icon:g.Icons.terminal,label:"API",ext:!0})]}),(0,b.jsx)(l,{children:"Projects"}),(0,b.jsx)("nav",{className:"flex flex-col gap-px",children:a.projects.map(a=>(0,b.jsx)(k,{active:e==="/projects/"+a.id,to:"/projects/"+a.id,icon:g.Icons.folder,label:a.name,count:d(a.id).length},a.id))}),(0,b.jsx)("div",{className:"mt-auto border-t border-border pt-2.5",children:(0,b.jsxs)("div",{className:"flex items-center gap-2.5 px-1.5 pt-1.5",children:[(0,b.jsx)(h,{fallback:"M"}),(0,b.jsxs)("div",{className:"text-[12.5px] leading-tight",children:[a.user.name,(0,b.jsxs)("span",{className:"block font-mono text-[11px] text-muted-foreground",children:["@",a.user.login]})]})]})})]})}function n(){let a=(0,c.useRouter)();return(0,d.useEffect)(()=>{let b=null,c=()=>{document.hidden||b||(b=setTimeout(()=>{b=null,a.refresh()},250))},d=new EventSource("/api/events");return d.addEventListener("change",c),d.addEventListener("ping",c),()=>{b&&clearTimeout(b),d.close()}},[a]),null}var o=a.i(18071),p=a.i(54250);function q({to:a,children:c,current:d}){return d?(0,b.jsx)("b",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-medium text-secondary-foreground",children:c}):(0,b.jsx)(e.default,{className:"cursor-pointer hover:text-primary",href:a??"#",children:c})}function r(){return(0,b.jsx)("span",{className:"text-border",children:"/"})}function s(){let a=(0,c.usePathname)(),{project:d,box:e}=(0,j.useStore)(),f=[(0,b.jsx)(q,{to:"/",children:"hub"},"h")],g=a.split("/").filter(Boolean);if("projects"===g[0]&&g[1]){let a=d(g[1]);f.push((0,b.jsx)(r,{},"s1"),(0,b.jsx)(q,{current:!0,children:a?a.name:"project"},"p"))}else if("boxes"===g[0]&&g[1]){let a=e(g[1]),c=a?d(a.projectId):void 0;c&&f.push((0,b.jsx)(r,{},"s1"),(0,b.jsx)(q,{to:"/projects/"+c.id,children:c.name},"p")),f.push((0,b.jsx)(r,{},"s2"),(0,b.jsx)(q,{current:!0,children:a?a.id:"box"},"b"))}else"settings"===g[0]?f.push((0,b.jsx)(r,{},"s1"),(0,b.jsx)(q,{current:!0,children:"settings"},"se")):f.push((0,b.jsx)(r,{},"s1"),(0,b.jsx)(q,{current:!0,children:"dashboard"},"d"));return(0,b.jsx)("div",{className:"flex min-w-0 items-center gap-2 font-mono text-[12.5px] text-[#a4a9b0]",children:f})}function t(){let a=(0,c.useRouter)(),{state:d}=(0,j.useStore)();return(0,b.jsxs)("div",{className:"sticky top-0 z-30 flex h-[54px] items-center gap-3 border-b border-border bg-[rgba(246,246,243,.86)] px-6 backdrop-blur-md",children:[(0,b.jsx)(o.Button,{variant:"outline",size:"icon-sm",className:"hidden max-md:inline-flex","aria-label":"Menu",onClick:()=>document.body.classList.toggle("nav-open"),children:(0,b.jsx)(g.Icons.menu,{})}),(0,b.jsx)(s,{}),(0,b.jsx)("span",{className:"flex-1"}),(0,b.jsxs)(o.Button,{variant:"ghost",size:"sm",href:"https://agent-box.sh/docs",target:"_blank",rel:"noopener",children:[(0,b.jsx)(g.Icons.book,{}),"Docs"]}),(0,b.jsxs)(o.Button,{variant:"ghost",size:"sm",href:"/api/v1/docs",target:"_blank",rel:"noopener",children:[(0,b.jsx)(g.Icons.terminal,{}),"API"]}),"password"===d.authMode?(0,b.jsx)(o.Button,{variant:"ghost",size:"sm",onClick:()=>{(0,p.signOut)().then(()=>{a.push("/signin"),a.refresh()})},children:"Sign out"}):null]})}function u({children:a}){let e=(0,c.usePathname)();return(0,d.useEffect)(()=>{document.body.classList.remove("nav-open")},[e]),(0,b.jsxs)("div",{className:"grid min-h-screen grid-cols-[232px_minmax(0,1fr)] max-md:grid-cols-1",children:[(0,b.jsx)("div",{className:"pointer-events-none fixed inset-0 z-40 bg-[rgba(20,24,30,.4)] opacity-0 transition-opacity [body.nav-open_&]:pointer-events-auto [body.nav-open_&]:opacity-100",onClick:()=>document.body.classList.remove("nav-open")}),(0,b.jsx)(m,{}),(0,b.jsxs)("main",{className:"flex min-w-0 flex-col",children:[(0,b.jsx)(t,{}),a]})]})}a.s(["HubShell",0,function({data:a,children:c}){return(0,b.jsxs)(j.HubProvider,{data:a,children:[(0,b.jsx)(n,{}),(0,b.jsx)(u,{children:c})]})}],49240)}];
2
2
 
3
3
  //# sourceMappingURL=apps_hub_components_1z1p98f._.js.map
@@ -22,6 +22,8 @@
22
22
  "/api/v1/boxes/[id]/branches": {},
23
23
  "/api/v1/boxes/[id]/git": {},
24
24
  "/api/v1/boxes/[id]/git/[op]": {},
25
+ "/api/v1/boxes/[id]/open": {},
26
+ "/api/v1/boxes/[id]/rename": {},
25
27
  "/api/v1/boxes/[id]/services": {},
26
28
  "/api/v1/boxes/[id]/services/restart": {},
27
29
  "/api/v1/docs": {},
@@ -29,6 +31,7 @@
29
31
  "/api/v1/jobs/[id]": {},
30
32
  "/api/v1/jobs/[id]/login-code": {},
31
33
  "/api/v1/jobs/[id]/logs": {},
34
+ "/api/v1/open-targets": {},
32
35
  "/api/v1/openapi.json": {},
33
36
  "/api/v1/projects": {},
34
37
  "/api/v1/projects/[id]": {},