@madarco/agentbox 0.27.0 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/_cloud-attach-WDGM6FL5.js +0 -0
  3. package/dist/chunk-26IKZRTT.js +0 -0
  4. package/dist/chunk-G3H2L3O2.js +0 -0
  5. package/dist/chunk-HR7NHH5J.js +0 -0
  6. package/dist/chunk-IDH5A4RR.js +0 -0
  7. package/dist/chunk-JE6UI5YR.js +0 -0
  8. package/dist/chunk-JGZSA5ZI.js +0 -0
  9. package/dist/chunk-KWOEUFVA.js +0 -0
  10. package/dist/chunk-LL7NCMUU.js +0 -0
  11. package/dist/chunk-NEF6MDJO.js +0 -0
  12. package/dist/chunk-SJ75AIA2.js +0 -0
  13. package/dist/chunk-UJEH2NJT.js +0 -0
  14. package/dist/chunk-V5XXJH63.js +0 -0
  15. package/dist/chunk-WJFZJZIM.js +0 -0
  16. package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
  17. package/dist/dist-FTKS2GI4.js +0 -0
  18. package/dist/dist-KQTMCVME.js +0 -0
  19. package/dist/dist-O3LKOIE7.js +0 -0
  20. package/dist/dist-OO52HARR.js +0 -0
  21. package/dist/dist-TSFVB7AI.js +0 -0
  22. package/dist/dist-U2SVLJUQ.js +0 -0
  23. package/dist/dist-WVYAURMF.js +0 -0
  24. package/dist/dist-Z6L5MM5D.js +0 -0
  25. package/dist/index.js +2 -2
  26. package/dist/prepared-state-75DIZ55S-TNJXWMXV.js +0 -0
  27. package/package.json +31 -29
  28. package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
  29. package/runtime/_shared/agentbox-dockerd-start +0 -0
  30. package/runtime/_shared/agentbox-open +0 -0
  31. package/runtime/_shared/agentbox-portless-trust +0 -0
  32. package/runtime/_shared/agentbox-vnc-start +0 -0
  33. package/runtime/_shared/ctl.cjs +0 -0
  34. package/runtime/_shared/gh-shim +0 -0
  35. package/runtime/_shared/git-shim +0 -0
  36. package/runtime/_shared/linear-shim +0 -0
  37. package/runtime/_shared/ntn-shim +0 -0
  38. package/runtime/digitalocean/agentbox-checkpoint-cleanup +0 -0
  39. package/runtime/digitalocean/agentbox-dockerd-start +0 -0
  40. package/runtime/digitalocean/agentbox-open +0 -0
  41. package/runtime/digitalocean/agentbox-portless-trust +0 -0
  42. package/runtime/digitalocean/agentbox-vnc-start +0 -0
  43. package/runtime/digitalocean/ctl.cjs +0 -0
  44. package/runtime/digitalocean/gh-shim +0 -0
  45. package/runtime/digitalocean/git-shim +0 -0
  46. package/runtime/digitalocean/linear-shim +0 -0
  47. package/runtime/digitalocean/ntn-shim +0 -0
  48. package/runtime/digitalocean/scripts/install-box.sh +0 -0
  49. package/runtime/docker/packages/ctl/dist/bin.cjs +0 -0
  50. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
  51. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
  52. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
  53. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
  54. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +0 -0
  55. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
  56. package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
  57. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
  58. package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
  59. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
  60. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
  61. package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
  62. package/runtime/e2b/agentbox-dockerd-start +0 -0
  63. package/runtime/e2b/agentbox-open +0 -0
  64. package/runtime/e2b/agentbox-vnc-start +0 -0
  65. package/runtime/e2b/ctl.cjs +0 -0
  66. package/runtime/e2b/gh-shim +0 -0
  67. package/runtime/e2b/git-shim +0 -0
  68. package/runtime/e2b/linear-shim +0 -0
  69. package/runtime/e2b/ntn-shim +0 -0
  70. package/runtime/e2b/scripts/build-template.sh +0 -0
  71. package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
  72. package/runtime/hetzner/agentbox-dockerd-start +0 -0
  73. package/runtime/hetzner/agentbox-open +0 -0
  74. package/runtime/hetzner/agentbox-portless-trust +0 -0
  75. package/runtime/hetzner/agentbox-vnc-start +0 -0
  76. package/runtime/hetzner/ctl.cjs +0 -0
  77. package/runtime/hetzner/gh-shim +0 -0
  78. package/runtime/hetzner/git-shim +0 -0
  79. package/runtime/hetzner/linear-shim +0 -0
  80. package/runtime/hetzner/ntn-shim +0 -0
  81. package/runtime/hetzner/scripts/install-box.sh +0 -0
  82. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  83. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  84. package/runtime/hub/apps/hub/.next/prerender-manifest.json +3 -3
  85. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js +1 -1
  86. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +1 -1
  87. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/server-reference-manifest.json +1 -1
  88. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  89. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/server-reference-manifest.json +12 -12
  90. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  91. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/server-reference-manifest.json +11 -11
  92. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  93. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/server-reference-manifest.json +8 -8
  94. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  95. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  96. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  97. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  98. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  99. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  100. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  101. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  102. package/runtime/hub/apps/hub/.next/server/chunks/0zhp_better-auth_dist_adapters_kysely-adapter_index_mjs_1rl4qnh._.js +3 -0
  103. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +5 -5
  104. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-9g0ae._.js +1 -1
  105. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1k8g143._.js → [root-of-the-server]__19pc87s._.js} +2 -2
  106. package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +4 -4
  107. package/runtime/hub/apps/hub/.next/server/chunks/ssr/044u_hub__next-internal_server_app_(dashboard)_projects_[id]_page_actions_15f56np.js +1 -1
  108. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_0xy-j7z._.js +1 -1
  109. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_010858m.js +1 -1
  110. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_04zwxnx.js +1 -1
  111. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_06exuc7.js +1 -1
  112. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2ldrt.js +1 -1
  113. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2tzep.js +1 -1
  114. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_116nh32.js +1 -1
  115. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_11dyjcb.js +1 -1
  116. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_1_4knli.js +1 -1
  117. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__08-1wwu._.js +1 -1
  118. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0c9mbcn._.js +1 -1
  119. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0gdfxj4._.js +1 -1
  120. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0kc-hwp._.js +1 -1
  121. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0lu73p6._.js +1 -1
  122. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__10bfmwi._.js +1 -1
  123. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__18qvdzb._.js +1 -1
  124. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1l2urlw._.js +1 -1
  125. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_03s-ah2._.js +1 -1
  126. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0kpdmm-._.js +1 -1
  127. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ozyjt1._.js +1 -1
  128. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r4px38._.js +1 -1
  129. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_18w2zeh._.js +1 -1
  130. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_approvals_page_actions_1mi0bpn.js +1 -1
  131. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_boxes_[id]_page_actions_0k7kgn2.js +1 -1
  132. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_page_actions_1t3u0xy.js +1 -1
  133. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
  134. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +1 -1
  135. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  136. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  137. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.js +1 -1
  138. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.json +18 -18
  139. package/runtime/hub/apps/hub/.next/static/chunks/{26rwu1f2gzemi.js → 070w7h5rh5ja6.js} +1 -1
  140. package/runtime/hub/apps/hub/.next/static/chunks/{000a1sa7te1h8.js → 2awpm9w8crker.js} +1 -1
  141. package/runtime/hub/apps/hub/.next/static/chunks/{3-zanu4ioia5i.js → 2gfw8-qyx5xi_.js} +1 -1
  142. package/runtime/hub/apps/hub/.next/static/chunks/{44j61g8lm9nvw.js → 30de2x24ntwkg.js} +1 -1
  143. package/runtime/hub/apps/hub/.next/static/chunks/{3v6kx35_lwjs8.js → 3e5n630psqst8.js} +1 -1
  144. package/runtime/hub/apps/hub/.next/static/chunks/{0xdtiy_m2ygv8.js → 3tqnniym2yvpb.js} +1 -1
  145. package/runtime/relay/bin.cjs +0 -0
  146. package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
  147. package/runtime/vercel/agentbox-dockerd-start +0 -0
  148. package/runtime/vercel/agentbox-open +0 -0
  149. package/runtime/vercel/agentbox-vnc-start +0 -0
  150. package/runtime/vercel/ctl.cjs +0 -0
  151. package/runtime/vercel/gh-shim +0 -0
  152. package/runtime/vercel/git-shim +0 -0
  153. package/runtime/vercel/linear-shim +0 -0
  154. package/runtime/vercel/ntn-shim +0 -0
  155. package/runtime/vercel/scripts/provision.sh +0 -0
  156. package/LICENSE +0 -21
  157. package/runtime/hub/apps/hub/.next/server/chunks/0-fj_better-auth_dist_adapters_kysely-adapter_index_mjs_0btft52._.js +0 -3
  158. /package/runtime/hub/apps/hub/.next/static/{S-yw9-SVffiEHRGm85NzP → PWF2iHQOg9-rRyfqVDLrh}/_buildManifest.js +0 -0
  159. /package/runtime/hub/apps/hub/.next/static/{S-yw9-SVffiEHRGm85NzP → PWF2iHQOg9-rRyfqVDLrh}/_clientMiddlewareManifest.js +0 -0
  160. /package/runtime/hub/apps/hub/.next/static/{S-yw9-SVffiEHRGm85NzP → PWF2iHQOg9-rRyfqVDLrh}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "node": {
3
- "60ff5520393ac26282f15f58e0b073a0c45b3ba7e5": {
3
+ "60e3280ae2ee5aa5fbbb2e64245d61d5ea3df1cf32": {
4
4
  "workers": {
5
5
  "app/(dashboard)/approvals/page": {
6
6
  "moduleId": 1720,
@@ -24,7 +24,7 @@
24
24
  "filename": "apps/hub/lib/boxes/actions.ts",
25
25
  "exportedName": "answerApprovalAction"
26
26
  },
27
- "4087bb6da1f4834ca146bcc8cb7c69295dbeda0bdc": {
27
+ "4052a82ff3493d4a1fc0afdabf6c8d7fee43497f6e": {
28
28
  "workers": {
29
29
  "app/(dashboard)/page": {
30
30
  "moduleId": 12901,
@@ -36,7 +36,7 @@
36
36
  "filename": "apps/hub/lib/boxes/actions.ts",
37
37
  "exportedName": "addProjectAction"
38
38
  },
39
- "40942714d29a270a6816a39cd419b4f09f50fc19b1": {
39
+ "4086527e113d7df8e3523c9fe79e8fe180da7102db": {
40
40
  "workers": {
41
41
  "app/(dashboard)/page": {
42
42
  "moduleId": 12901,
@@ -48,7 +48,7 @@
48
48
  "filename": "apps/hub/lib/boxes/actions.ts",
49
49
  "exportedName": "browseDirAction"
50
50
  },
51
- "40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7": {
51
+ "406145ed27942ca988f613b59ab48f5aefbcfd4f05": {
52
52
  "workers": {
53
53
  "app/(dashboard)/boxes/[id]/page": {
54
54
  "moduleId": 73968,
@@ -72,7 +72,7 @@
72
72
  "filename": "apps/hub/lib/boxes/actions.ts",
73
73
  "exportedName": "destroyBoxAction"
74
74
  },
75
- "40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c": {
75
+ "4038bed43a23f173fc52655549d6d6afca3e1c3fd7": {
76
76
  "workers": {
77
77
  "app/(dashboard)/boxes/[id]/page": {
78
78
  "moduleId": 73968,
@@ -96,7 +96,7 @@
96
96
  "filename": "apps/hub/lib/boxes/actions.ts",
97
97
  "exportedName": "pauseBoxAction"
98
98
  },
99
- "6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb": {
99
+ "60bc3399c1ca903d8aa98c6fe53f386830b88ddd8e": {
100
100
  "workers": {
101
101
  "app/(dashboard)/boxes/[id]/page": {
102
102
  "moduleId": 73968,
@@ -120,7 +120,7 @@
120
120
  "filename": "apps/hub/lib/boxes/actions.ts",
121
121
  "exportedName": "renameBoxAction"
122
122
  },
123
- "4071308a0e1675de302803bb969800c52d79f11e13": {
123
+ "40b7ede3d7f39c93f9e96a161499dbfe08b57f1184": {
124
124
  "workers": {
125
125
  "app/(dashboard)/boxes/[id]/page": {
126
126
  "moduleId": 73968,
@@ -144,7 +144,7 @@
144
144
  "filename": "apps/hub/lib/boxes/actions.ts",
145
145
  "exportedName": "resumeBoxAction"
146
146
  },
147
- "40e545c7dd69b4a1d410deb9c94101099961d3af7a": {
147
+ "4085c8b8ede98e4ff6f88f8f1be93170cf50d68e3f": {
148
148
  "workers": {
149
149
  "app/(dashboard)/boxes/[id]/page": {
150
150
  "moduleId": 73968,
@@ -168,7 +168,7 @@
168
168
  "filename": "apps/hub/lib/boxes/actions.ts",
169
169
  "exportedName": "stopBoxAction"
170
170
  },
171
- "4070192706087364b8c7d220576a6f3e4d3e5c532b": {
171
+ "402e69872ac5cc7b84479325d8b18020d181f0ccb2": {
172
172
  "workers": {
173
173
  "app/(dashboard)/page": {
174
174
  "moduleId": 12901,
@@ -186,7 +186,7 @@
186
186
  "filename": "apps/hub/lib/boxes/actions.ts",
187
187
  "exportedName": "createBoxAction"
188
188
  },
189
- "40386bdce4d894a318a969412fa1299d2704ccdfb3": {
189
+ "40b21c2ad91fa1708c513ab1647dc78fa0d7e56f70": {
190
190
  "workers": {
191
191
  "app/(dashboard)/page": {
192
192
  "moduleId": 12901,
@@ -204,7 +204,7 @@
204
204
  "filename": "apps/hub/lib/boxes/actions.ts",
205
205
  "exportedName": "listBranchesAction"
206
206
  },
207
- "40c7856bd78dddab224344045df78d51620e411335": {
207
+ "4030be3a72d5d8e0f43e0cb8632561b0a65ad269f2": {
208
208
  "workers": {
209
209
  "app/(dashboard)/page": {
210
210
  "moduleId": 12901,
@@ -222,7 +222,7 @@
222
222
  "filename": "apps/hub/lib/boxes/actions.ts",
223
223
  "exportedName": "removeProjectAction"
224
224
  },
225
- "70fd109611adee18e2a11d04af4332c29e796848e9": {
225
+ "7046ef1a22ef35c2ac4e283b89fbbd152677ee1823": {
226
226
  "workers": {
227
227
  "app/(dashboard)/boxes/[id]/page": {
228
228
  "moduleId": 73968,
@@ -234,7 +234,7 @@
234
234
  "filename": "apps/hub/lib/boxes/actions.ts",
235
235
  "exportedName": "gitBranchAction"
236
236
  },
237
- "600e7ece96e4038f118842cef0ebcf51dadf743c9b": {
237
+ "60c7dbb7902d69abccc3c979da46261bb43a24a0a8": {
238
238
  "workers": {
239
239
  "app/(dashboard)/boxes/[id]/page": {
240
240
  "moduleId": 73968,
@@ -246,7 +246,7 @@
246
246
  "filename": "apps/hub/lib/boxes/actions.ts",
247
247
  "exportedName": "gitCheckoutAction"
248
248
  },
249
- "605f4904ee0814a4a51c0445aa18e7dfbde590c7e5": {
249
+ "6034abeee79a93747466212d3a9009fe1994b5395d": {
250
250
  "workers": {
251
251
  "app/(dashboard)/boxes/[id]/page": {
252
252
  "moduleId": 73968,
@@ -258,7 +258,7 @@
258
258
  "filename": "apps/hub/lib/boxes/actions.ts",
259
259
  "exportedName": "gitPullAction"
260
260
  },
261
- "60675b1179af1a57b7c4bb6e4d893805dd8f7b0b66": {
261
+ "60bb24bff65e6ce9139843f080bf35a0e07563b9cd": {
262
262
  "workers": {
263
263
  "app/(dashboard)/boxes/[id]/page": {
264
264
  "moduleId": 73968,
@@ -270,7 +270,7 @@
270
270
  "filename": "apps/hub/lib/boxes/actions.ts",
271
271
  "exportedName": "gitPushAction"
272
272
  },
273
- "607692631dd5973ad6071d94f3fee9c7da56a766db": {
273
+ "60843ce1357b9d46461a9556b844aa02d3726ede23": {
274
274
  "workers": {
275
275
  "app/(dashboard)/boxes/[id]/page": {
276
276
  "moduleId": 73968,
@@ -282,7 +282,7 @@
282
282
  "filename": "apps/hub/lib/boxes/actions.ts",
283
283
  "exportedName": "gitPushHostAction"
284
284
  },
285
- "6096ff4dd5616157cf1da6a977c271641a3ddce491": {
285
+ "60b48213a6a3e796c8acac95ca2d4ceace06a88bf8": {
286
286
  "workers": {
287
287
  "app/(dashboard)/boxes/[id]/page": {
288
288
  "moduleId": 73968,
@@ -296,5 +296,5 @@
296
296
  }
297
297
  },
298
298
  "edge": {},
299
- "encryptionKey": "l/jVp5ofrn54w5VblHtNOWoHvpxpGPH7zAJomYO9pQ0="
299
+ "encryptionKey": "9clIjy2nnGsT7IslT+oJnzuB6fGp6U2u7cMZIof63EM="
300
300
  }
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86892,30544,49604,e=>{"use strict";var t=e.i(1262),r=e.i(64595);let a={running:{label:"running",badgeClass:"badge-run"},paused:{label:"paused",badgeClass:"badge-pause"},stopped:{label:"stopped",badgeClass:"badge-stop"},creating:{label:"creating",badgeClass:"badge-create"},error:{label:"error",badgeClass:"badge-err"}};e.s(["StatusBadge",0,function({status:e}){let s=a[e]??a.stopped;return(0,t.jsxs)(r.Badge,{className:s.badgeClass,children:[(0,t.jsx)("span",{className:"badge-dot"}),s.label]})}],86892);var s=e.i(45971),n=e.i(54129),o=e.i(65232),l=e.i(69377),i=e.i(44344),c=e.i(9383);let d=(0,c.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",c.callServer,void 0,c.findSourceMapURL,"destroyBoxAction"),u=(0,c.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",c.callServer,void 0,c.findSourceMapURL,"pauseBoxAction"),x=(0,c.createServerReference)("6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb",c.callServer,void 0,c.findSourceMapURL,"renameBoxAction"),m=(0,c.createServerReference)("4071308a0e1675de302803bb969800c52d79f11e13",c.callServer,void 0,c.findSourceMapURL,"resumeBoxAction"),p=(0,c.createServerReference)("40e545c7dd69b4a1d410deb9c94101099961d3af7a",c.callServer,void 0,c.findSourceMapURL,"stopBoxAction");e.s(["BoxActions",0,function({box:e,size:r}){let a=(0,s.useRouter)(),[c,b]=(0,n.useTransition)(),h="running"===e.status,f="paused"===e.status,g="stopped"===e.status,j=e.id.startsWith("job:"),v="lg"===r,N=v?"sm":"icon-sm",S=(t,r,s)=>{t.stopPropagation(),(!s||window.confirm(s))&&b(async()=>{let t=await r(e.id);t.ok||window.alert(`Action failed: ${t.error}`),a.refresh()})};return j?(0,t.jsx)("div",{className:(0,o.cn)("flex gap-1.5",v?"":"justify-end"),children:(0,t.jsxs)(l.Button,{variant:"destructive",size:N,title:"Dismiss",disabled:c||"error"!==e.status,onClick:t=>S(t,d,`Dismiss failed box ${e.id}? This clears the failed create.`),children:[(0,t.jsx)(i.Icons.trash,{}),v?"Dismiss":null]})}):(0,t.jsxs)("div",{className:(0,o.cn)("flex gap-1.5",v?"":"justify-end"),children:[f?(0,t.jsxs)(l.Button,{variant:v?"default":"outline",size:N,title:"Resume",disabled:c,className:v?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:e=>S(e,m),children:[(0,t.jsx)(i.Icons.play,{}),v?"Resume":null]}):(0,t.jsxs)(l.Button,{variant:"outline",size:N,disabled:c||!h,title:"Pause",className:v?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:e=>S(e,u),children:[(0,t.jsx)(i.Icons.pause,{}),v?"Pause":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:N,disabled:c||g,title:"Stop",onClick:e=>S(e,p),children:[(0,t.jsx)(i.Icons.stop,{}),v?"Stop":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:N,disabled:c,title:"Rename",onClick:t=>{t.stopPropagation();let r=window.prompt("Rename box (label only — leave blank to reset)",e.displayName??e.task);null!==r&&b(async()=>{let t=await x(e.id,r.trim());t.ok||window.alert(`Rename failed: ${t.error}`),a.refresh()})},children:[(0,t.jsx)(i.Icons.pencil,{}),v?"Rename":null]}),(0,t.jsxs)(l.Button,{variant:"destructive",size:N,title:"Destroy",disabled:c,onClick:t=>S(t,d,`Destroy box ${e.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,t.jsx)(i.Icons.trash,{}),v?"Destroy":null]})]})}],30544),e.s(["Select",0,function({wrapperClassName:e,className:r,children:a,...s}){return(0,t.jsxs)("span",{className:(0,o.cn)("relative inline-flex",e),children:[(0,t.jsx)("select",{className:(0,o.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",r),...s,children:a}),(0,t.jsx)("svg",{className:"pointer-events-none absolute right-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:(0,t.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}],49604)},80922,35594,e=>{"use strict";var t=e.i(1262),r=e.i(51096),a=e.i(44344);e.s(["BackLink",0,function({to:e,children:s}){return(0,t.jsxs)(r.default,{className:"mb-3.5 inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-mono text-xs text-muted-foreground hover:text-primary",href:e,children:[(0,t.jsx)(a.Icons.arrowL,{className:"size-[13px]"}),s]})}],80922);var s=e.i(65232),n=e.i(8536);e.s(["Stat",0,function({k:e,v:r,mono:a,icon:n}){return(0,t.jsxs)("div",{className:"px-4.5 p-4",children:[(0,t.jsx)("div",{className:"mb-1.5 font-mono text-[10.5px] uppercase tracking-[.06em] text-[#a4a9b0]",children:e}),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-center gap-2 font-semibold tracking-[-0.01em]",a?"font-mono text-sm font-medium":"text-base"),children:[n?(0,t.jsx)(n,{className:"size-[15px] text-muted-foreground"}):null,r]})]})},"StatGrid",0,function({children:e}){return(0,t.jsx)(n.Card,{className:"grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] divide-x divide-border/60 overflow-hidden",children:e})}],35594)},8536,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Card",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("p-5 pt-0",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[12.5px] text-muted-foreground",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-1 p-5",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...a})}])},3060,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Input",0,function({className:e,...a}){return(0,t.jsx)("input",{className:(0,r.cn)("flex h-10 w-full rounded-lg border border-input bg-card px-3 py-1 text-sm shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...a})}])},95141,e=>{"use strict";var t=e.i(1262),r=e.i(54129),a=e.i(65232),s=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:n,children:o}){return(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{className:"anim-fade fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-[rgba(20,24,30,.42)] p-6 backdrop-blur-[2px]",onClick:e,children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,a.cn)("anim-pop relative m-auto w-full max-w-[500px] rounded-2xl border border-border bg-card shadow-[0_40px_80px_-30px_rgba(20,24,30,.5)]",n),onClick:e=>e.stopPropagation(),children:[o,(0,t.jsx)("button",{className:"absolute right-4 top-4 grid h-7 w-7 cursor-pointer place-items-center rounded-md border-0 bg-transparent text-[#a4a9b0] transition-colors hover:bg-secondary hover:text-foreground",onClick:e,"aria-label":"Close",children:(0,t.jsx)(s.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("px-5 py-4",e),...r})},"DialogDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("mt-1 font-mono text-xs text-muted-foreground",e),...r})},"DialogFooter",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",e),...r})},"DialogHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",e),...r})},"DialogIcon",0,function({children:e}){return(0,t.jsx)("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-lg border border-[var(--green-line)] bg-accent text-primary [&_svg]:size-[17px]",children:e})},"DialogTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("text-base font-semibold leading-tight tracking-tight",e),...r})}])},86184,e=>{"use strict";var t=e.i(1262),r=e.i(54129),a=e.i(69377),s=e.i(3060);function n({jobId:e,login:o}){let[l,i]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[u,x]=(0,r.useState)(null),m="exchanging"===o.phase,p=async()=>{let t=l.trim();if(t&&!c){d(!0),x(null);try{let r=await fetch(`/api/v1/jobs/${encodeURIComponent(e)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})});if(!r.ok){let e=await r.json().catch(()=>null);x(e?.error?.message??`request failed (${r.status})`);return}i("")}catch(e){x(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,t.jsx)("p",{className:"text-xs text-amber-100/80",children:"Your saved Claude login is expired. Open the sign-in page, approve access, then paste the code Claude shows you."}),o.url?(0,t.jsx)("a",{href:o.url,target:"_blank",rel:"noreferrer",className:"w-fit rounded-md bg-amber-500/20 px-2.5 py-1 text-xs font-medium text-amber-100 underline decoration-amber-400/50 underline-offset-2 hover:bg-amber-500/30",children:"Open Claude sign-in ↗"}):(0,t.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,t.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,t.jsx)(s.Input,{value:l,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&p()},placeholder:"Paste approval code",disabled:m,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(a.Button,{type:"button",onClick:()=>void p(),disabled:!l.trim()||c||m,children:m?"Verifying…":c?"Submitting…":"Submit"})]}),o.lastError?(0,t.jsx)("p",{className:"text-xs text-amber-300",children:o.lastError}):null,"error"===o.phase&&o.error?(0,t.jsx)("p",{className:"text-xs text-red-400",children:o.error}):null,u?(0,t.jsx)("p",{className:"text-xs text-red-400",children:u}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:a,onDone:s,onStatus:o,onLogin:l}){let[i,c]=(0,r.useState)([]),[d,u]=(0,r.useState)(null),x=(0,r.useRef)(null),m=(0,r.useRef)(s);m.current=s;let p=(0,r.useRef)(o);p.current=o;let b=(0,r.useRef)(l);return b.current=l,(0,r.useEffect)(()=>{p.current?.("streaming");let t=new EventSource(a??`/api/jobs/${encodeURIComponent(e)}/logs`);return t.addEventListener("log",e=>{let t=JSON.parse(e.data);c(e=>[...e,t])}),t.addEventListener("login",e=>{let t=JSON.parse(e.data);u(t),b.current?.(t)}),t.addEventListener("end",e=>{let r=JSON.parse(e.data);p.current?.(r.status),m.current?.(r.status),t.close()}),()=>t.close()},[e,a]),(0,r.useEffect)(()=>{let e=x.current;e&&(e.scrollTop=e.scrollHeight)},[i]),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[d&&"done"!==d.phase?(0,t.jsx)(n,{jobId:e,login:d}):null,(0,t.jsx)("pre",{ref:x,className:"max-h-[440px] min-h-[220px] overflow-auto whitespace-pre rounded-lg bg-[#16181c] p-3 font-mono text-[11.5px] leading-relaxed text-[#d6d9de]",children:0===i.length?"starting…":i.join("\n")})]})}])},33789,1485,e=>{"use strict";var t=e.i(1262),r=e.i(54129);e.s(["Ago",0,function({ms:e}){let[a,s]=(0,r.useState)(!1);return(0,r.useEffect)(()=>s(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:a?function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return t+"s ago";let r=Math.floor(t/60);if(r<60)return r+"m ago";let a=Math.floor(r/60);return a<24?a+"h ago":Math.floor(a/24)+"d ago"}(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:r}){return(0,t.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[e,(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),r??null]})}],1485)},9383,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={callServer:function(){return n.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]});let n=e.r(57855),o=e.r(61414),l=e.r(97615)},31758,e=>{"use strict";var t=e.i(1262),r=e.i(44344);e.s(["EmptyBox",0,function({children:e}){return(0,t.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-card px-5 py-9 text-center text-[13.5px] text-muted-foreground",children:[(0,t.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,t.jsx)(r.Icons.box,{className:"size-5"})}),e]})}])},23878,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Table",0,function({className:e,...a}){return(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...a})},"TableBody",0,function({className:e,...a}){return(0,t.jsx)("tbody",{className:(0,r.cn)("[&_tr:last-child]:border-0",e),...a})},"TableCell",0,function({className:e,...a}){return(0,t.jsx)("td",{className:(0,r.cn)("px-4 py-3 align-middle",e),...a})},"TableHead",0,function({className:e,...a}){return(0,t.jsx)("th",{className:(0,r.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",e),...a})},"TableHeader",0,function({className:e,...a}){return(0,t.jsx)("thead",{className:(0,r.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",e),...a})},"TableRow",0,function({className:e,...a}){return(0,t.jsx)("tr",{className:(0,r.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",e),...a})}])},22983,93268,66818,e=>{"use strict";var t=e.i(1262),r=e.i(45971),a=e.i(33789),s=e.i(44344),n=e.i(86892),o=e.i(8536),l=e.i(23878),i=e.i(30544);e.s(["BoxTable",0,function({boxes:e}){let c=(0,r.useRouter)();return(0,t.jsx)(o.Card,{className:"overflow-hidden",children:(0,t.jsxs)(l.Table,{children:[(0,t.jsx)(l.TableHeader,{children:(0,t.jsxs)(l.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(l.TableHead,{className:"w-[38%]",children:"Task"}),(0,t.jsx)(l.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,t.jsx)(l.TableHead,{className:"max-md:hidden",children:"Status"}),(0,t.jsx)(l.TableHead,{className:"text-right",children:"Actions"})]})}),(0,t.jsx)(l.TableBody,{children:e.map(e=>(0,t.jsxs)(l.TableRow,{className:"cursor-pointer",onClick:()=>c.push("/boxes/"+e.id),children:[(0,t.jsxs)(l.TableCell,{children:[(0,t.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:e.task}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.id," · ",e.host]})]}),(0,t.jsxs)(l.TableCell,{className:"max-md:hidden",children:[(0,t.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,t.jsx)(s.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.branch})]}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.agent," · ",(0,t.jsx)(a.Ago,{ms:e.lastActivity})]})]}),(0,t.jsx)(l.TableCell,{className:"max-md:hidden",children:(0,t.jsx)(n.StatusBadge,{status:e.status})}),(0,t.jsx)(l.TableCell,{className:"text-right",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(i.BoxActions,{box:e})})]},e.id))})]})})}],22983);var c=e.i(54129),d=e.i(64595),u=e.i(69377),x=e.i(95141),m=e.i(3060),p=e.i(49604),b=e.i(65232);function h({className:e,...r}){return(0,t.jsx)("textarea",{className:(0,b.cn)("flex min-h-[76px] w-full resize-y rounded-lg border border-input bg-card px-3 py-2 text-sm leading-normal shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...r})}var f=e.i(9383);let g=(0,f.createServerReference)("4070192706087364b8c7d220576a6f3e4d3e5c532b",f.callServer,void 0,f.findSourceMapURL,"createBoxAction"),j=(0,f.createServerReference)("40386bdce4d894a318a969412fa1299d2704ccdfb3",f.callServer,void 0,f.findSourceMapURL,"listBranchesAction");var v=e.i(96621),N=e.i(86184);let S=[{id:"docker",label:"Docker (local)",configured:!0}];function y({project:e,projects:a,onClose:n}){let o=(0,r.useRouter)(),{state:l}=(0,v.useStore)(),[i,d]=(0,c.useState)(null),f=i??(l.providers.length?l.providers:S),[C,B]=(0,c.useTransition)(),[R,T]=(0,c.useState)(e?.id??a[0]?.id??""),[I,D]=(0,c.useState)("claude"),[L,A]=(0,c.useState)("docker"),[P,E]=(0,c.useState)(""),[z,U]=(0,c.useState)(""),[H,M]=(0,c.useState)(""),[O,$]=(0,c.useState)(null),[F,_]=(0,c.useState)(!1),[J,W]=(0,c.useState)(!1),[q,K]=(0,c.useState)(null),[G,V]=(0,c.useState)(null),[Y,Q]=(0,c.useState)("streaming"),[X,Z]=(0,c.useState)(null),[ee,et]=(0,c.useState)(null),[er,ea]=(0,c.useState)(!1),[es,en]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/v1/providers?freshness=1&hosts=expand",{credentials:"same-origin"});if(!t.ok)return;let r=await t.json();if(e)return;let a=r.providers??[];d(a);let s={};for(let e of a)s[e.id]={baseStatus:e.baseStatus,baseStaleReason:e.baseStaleReason,jobId:e.jobId};en(s)}catch{}})(),()=>{e=!0}},[]);let eo=a.find(e=>e.id===R)??e,el=L??"docker",ei=f.find(e=>e.id===el),ec=es?.[el],ed=!!ec&&(!!ec.jobId||"unprepared"===ec.baseStatus||"stale"===ec.baseStatus);(0,c.useEffect)(()=>{if(!R||G)return;_(eo?.needsSetup??!1),A("docker");let e=!1;return $(null),M(eo?.currentBranch??""),j(R).then(t=>{if(e||!t.ok){e||t.ok||$([]);return}$(t.branches),t.current&&t.branches.includes(t.current)&&M(t.current)}),()=>{e=!0}},[R,G]);let eu=()=>{K(null);let e=ec?.jobId;e?et(e):B(async()=>{try{let e=await fetch(`/api/v1/providers/${encodeURIComponent(el)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({})}),t=await e.json().catch(()=>null);if(!e.ok||!t?.jobId)return void K(t?.error?.message??`base image build request failed (${e.status})`);et(t.jobId)}catch(e){K(e instanceof Error?e.message:String(e))}})},ex=()=>{K(null),B(async()=>{let e=await g({projectId:R,agent:I,provider:L,name:P.trim()||void 0,prompt:"none"===I?void 0:z.trim()||void 0,fromBranch:H.trim()&&H.trim()!==eo?.currentBranch?H.trim():void 0,setupWizard:"none"!==I&&F});e.ok?(V(e.jobId),o.refresh()):K(e.error)})};return(0,t.jsxs)(x.Dialog,{onClose:n,className:G||ee?"max-w-[900px]":"max-w-[560px]",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogIcon,{children:(0,t.jsx)(s.Icons.box,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x.DialogTitle,{children:!G&&ee?"Building base image":"Create box"}),(0,t.jsx)(x.DialogDescription,{children:eo?eo.name:"Start a box in a project"})]}),G||ee?(0,t.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,t.jsx)(w,{status:Y,loginPhase:X})}):null]}),(0,t.jsx)(x.DialogBody,{className:"flex flex-col gap-4",children:G?(0,t.jsx)(N.JobLogStream,{jobId:G,onStatus:Q,onDone:()=>o.refresh(),onLogin:e=>Z(e?.phase??null)}):ee?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["Building the ",ei?.label??el," base image — one-time, can take several minutes. The box is created automatically when it finishes."]}),(0,t.jsx)(N.JobLogStream,{jobId:ee,onStatus:Q,onDone:e=>{"done"===e?ex():K(`base image build ${e}`)}}),q?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:q}):null]}):(0,t.jsxs)(t.Fragment,{children:[e?null:(0,t.jsx)(k,{label:"Project",children:(0,t.jsxs)(p.Select,{value:R,onChange:e=>T(e.target.value),children:[0===a.length?(0,t.jsx)("option",{value:"",children:"No projects — add one first"}):null,a.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,t.jsx)(k,{label:"Provider",children:(0,t.jsx)(p.Select,{value:L,onChange:e=>A(e.target.value),children:f.map(e=>(0,t.jsxs)("option",{value:e.id,disabled:!e.configured,title:e.reason,children:[e.label,e.configured?"":" — not configured"]},e.id))})}),ed?(0,t.jsx)("p",{className:"-mt-2 font-mono text-xs text-amber-600 dark:text-amber-400",title:ec?.baseStaleReason,children:ec?.jobId?"A base-image build is already running — the box will be created when it finishes.":ec?.baseStatus==="unprepared"?"First use of this provider: the base image will be downloaded or built first (can take 5–10 minutes).":"The base image is out of date and will be rebuilt first (can take 5–10 minutes)."}):null,(0,t.jsx)(k,{label:"Agent",children:(0,t.jsxs)(p.Select,{value:I,onChange:e=>D(e.target.value),children:[(0,t.jsx)("option",{value:"claude",children:"Claude"}),(0,t.jsx)("option",{value:"codex",children:"Codex"}),(0,t.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,t.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,t.jsx)(k,{label:"Name (optional)",children:(0,t.jsx)(m.Input,{value:P,onChange:e=>E(e.target.value),placeholder:"auto"})}),eo?.needsSetup&&"none"!==I?(0,t.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",checked:F,onChange:e=>_(e.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"This project has no agentbox.yaml — the agent explores the repo and proposes one on its first turn."})]})]}):null,"none"===I?(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["The box is created and left running with no agent — attach later from a terminal or SSH (",(0,t.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>W(e=>!e),className:"flex cursor-pointer items-center gap-1.5 self-start text-xs font-medium text-secondary-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(s.Icons.chevR,{className:(0,b.cn)("size-3.5 transition-transform",J&&"rotate-90")}),"Advanced"]}),J?(0,t.jsxs)(t.Fragment,{children:[null===O?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsx)(p.Select,{value:"",disabled:!0,children:(0,t.jsx)("option",{value:"",children:"Loading branches…"})})}):O.length>0?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsxs)(p.Select,{value:H,onChange:e=>M(e.target.value),children:[eo?.currentBranch&&!O.includes(eo.currentBranch)?(0,t.jsxs)("option",{value:"",children:[eo.currentBranch," (current)"]}):null,O.map(e=>(0,t.jsxs)("option",{value:e,children:[e,e===eo?.currentBranch?" (current)":""]},e))]})}):null,"none"!==I?(0,t.jsx)(k,{label:"Initial prompt (optional)",children:(0,t.jsx)(h,{value:z,onChange:e=>U(e.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),q?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:q}):null]})}),(0,t.jsx)(x.DialogFooter,{children:G||ee?(0,t.jsxs)(t.Fragment,{children:["streaming"===Y?(0,t.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:G?"The box + agent start in the background — you can close this.":"Keep this open — the box is created when the build finishes."}):null,(0,t.jsx)(u.Button,{onClick:n,children:"Close"})]}):er?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",title:ec?.baseStaleReason,children:["The ",ei?.label??el," base image is out of date."]}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>ea(!1),disabled:C,children:"Cancel"}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>{ea(!1),ex()},disabled:C,children:"Use existing image"}),(0,t.jsx)(u.Button,{onClick:()=>{ea(!1),eu()},disabled:C,children:"Rebuild & create"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Button,{variant:"outline",onClick:n,disabled:C,children:"Cancel"}),(0,t.jsx)(u.Button,{onClick:()=>{(K(null),R)?ed?"docker"===el||ec?.baseStatus!=="stale"||ec.jobId?eu():ea(!0):ex():K("pick a project")},disabled:C||!R,children:C?"Starting…":"Create box"})]})})]})}function w({status:e,loginPhase:r}){return"done"===e?(0,t.jsxs)(d.Badge,{className:"badge-run",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===e||"error"===e||"cancelled"===e?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===r?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===r||"starting"===r||"exchanging"===r?(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Working…"]})}function k({label:e,children:r}){return(0,t.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:e}),r]})}e.s(["CreateBoxButton",0,function({project:e,projects:r,variant:a,size:n,className:o}){let[l,i]=(0,c.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.Button,{variant:a,size:n,className:o,onClick:()=>i(!0),children:[(0,t.jsx)(s.Icons.plus,{}),"Create box"]}),l?(0,t.jsx)(y,{project:e,projects:r??(e?[e]:[]),onClose:()=>i(!1)}):null]})}],93268);let C=(0,f.createServerReference)("40c7856bd78dddab224344045df78d51620e411335",f.callServer,void 0,f.findSourceMapURL,"removeProjectAction");e.s(["DeleteProjectButton",0,function({project:e,size:a,className:n,redirectHome:o}){let l=(0,r.useRouter)(),[i,d]=(0,c.useTransition)();return(0,t.jsxs)(u.Button,{variant:"destructive",size:a,className:n,title:"Delete project",disabled:i,onClick:t=>{t.stopPropagation(),t.preventDefault(),window.confirm(`Remove project "${e.name}" from the hub? Its folder and files are NOT deleted — this only unregisters it (and any hub-set project settings). This cannot be undone.`)&&d(async()=>{let t=await C(e.id);t.ok?o?l.push("/"):l.refresh():window.alert(`Delete failed: ${t.error}`)})},children:[(0,t.jsx)(s.Icons.trash,{}),"Delete"]})}],66818)},86691,e=>{"use strict";var t=e.i(1262),r=e.i(45971),a=e.i(33789),s=e.i(44344),n=e.i(96621),o=e.i(80922),l=e.i(22983),i=e.i(93268),c=e.i(66818),d=e.i(31758),u=e.i(1485),x=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,r.useParams)(),{project:m,boxesFor:p}=(0,n.useStore)(),b=m(e);if(!b)return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,t.jsx)(o.BackLink,{to:"/",children:"Dashboard"}),(0,t.jsx)(d.EmptyBox,{children:"Project not found."})]});let h=p(e),f=h.filter(e=>"running"===e.status).length;return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,t.jsx)(o.BackLink,{to:"/",children:"All projects"}),(0,t.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("h1",{className:"flex items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[(0,t.jsx)("span",{className:"grid h-[26px] w-[26px] flex-none place-items-center rounded-md border border-[var(--green-line)] bg-accent text-primary",children:(0,t.jsx)(s.Icons.folder,{className:"size-[15px]"})}),b.name]}),(0,t.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:b.repo})," · ",b.provider]})]}),(0,t.jsxs)("div",{className:"ml-auto flex flex-none gap-2 max-md:ml-0",children:[(0,t.jsx)(i.CreateBoxButton,{project:b}),0===h.length?(0,t.jsx)(c.DeleteProjectButton,{project:b,redirectHome:!0}):null]})]}),(0,t.jsx)("div",{className:"mt-5",children:(0,t.jsxs)(x.StatGrid,{children:[(0,t.jsx)(x.Stat,{k:"Boxes",v:h.length,icon:s.Icons.box}),(0,t.jsx)(x.Stat,{k:"Running",v:f,icon:s.Icons.activity}),(0,t.jsx)(x.Stat,{k:"Provider",v:b.provider,mono:!0}),(0,t.jsx)(x.Stat,{k:"Created",v:(0,t.jsx)(a.Ago,{ms:b.createdAt}),mono:!0})]})}),(0,t.jsx)(u.SectionLabel,{children:"Boxes"}),h.length?(0,t.jsx)(l.BoxTable,{boxes:h}):(0,t.jsx)(d.EmptyBox,{children:(0,t.jsx)("div",{children:"No boxes yet."})})]})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86892,30544,49604,e=>{"use strict";var t=e.i(1262),r=e.i(64595);let a={running:{label:"running",badgeClass:"badge-run"},paused:{label:"paused",badgeClass:"badge-pause"},stopped:{label:"stopped",badgeClass:"badge-stop"},creating:{label:"creating",badgeClass:"badge-create"},error:{label:"error",badgeClass:"badge-err"}};e.s(["StatusBadge",0,function({status:e}){let s=a[e]??a.stopped;return(0,t.jsxs)(r.Badge,{className:s.badgeClass,children:[(0,t.jsx)("span",{className:"badge-dot"}),s.label]})}],86892);var s=e.i(45971),n=e.i(54129),o=e.i(65232),l=e.i(69377),i=e.i(44344),c=e.i(9383);let d=(0,c.createServerReference)("406145ed27942ca988f613b59ab48f5aefbcfd4f05",c.callServer,void 0,c.findSourceMapURL,"destroyBoxAction"),u=(0,c.createServerReference)("4038bed43a23f173fc52655549d6d6afca3e1c3fd7",c.callServer,void 0,c.findSourceMapURL,"pauseBoxAction"),x=(0,c.createServerReference)("60bc3399c1ca903d8aa98c6fe53f386830b88ddd8e",c.callServer,void 0,c.findSourceMapURL,"renameBoxAction"),m=(0,c.createServerReference)("40b7ede3d7f39c93f9e96a161499dbfe08b57f1184",c.callServer,void 0,c.findSourceMapURL,"resumeBoxAction"),p=(0,c.createServerReference)("4085c8b8ede98e4ff6f88f8f1be93170cf50d68e3f",c.callServer,void 0,c.findSourceMapURL,"stopBoxAction");e.s(["BoxActions",0,function({box:e,size:r}){let a=(0,s.useRouter)(),[c,b]=(0,n.useTransition)(),f="running"===e.status,h="paused"===e.status,g="stopped"===e.status,j=e.id.startsWith("job:"),v="lg"===r,N=v?"sm":"icon-sm",S=(t,r,s)=>{t.stopPropagation(),(!s||window.confirm(s))&&b(async()=>{let t=await r(e.id);t.ok||window.alert(`Action failed: ${t.error}`),a.refresh()})};return j?(0,t.jsx)("div",{className:(0,o.cn)("flex gap-1.5",v?"":"justify-end"),children:(0,t.jsxs)(l.Button,{variant:"destructive",size:N,title:"Dismiss",disabled:c||"error"!==e.status,onClick:t=>S(t,d,`Dismiss failed box ${e.id}? This clears the failed create.`),children:[(0,t.jsx)(i.Icons.trash,{}),v?"Dismiss":null]})}):(0,t.jsxs)("div",{className:(0,o.cn)("flex gap-1.5",v?"":"justify-end"),children:[h?(0,t.jsxs)(l.Button,{variant:v?"default":"outline",size:N,title:"Resume",disabled:c,className:v?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:e=>S(e,m),children:[(0,t.jsx)(i.Icons.play,{}),v?"Resume":null]}):(0,t.jsxs)(l.Button,{variant:"outline",size:N,disabled:c||!f,title:"Pause",className:v?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:e=>S(e,u),children:[(0,t.jsx)(i.Icons.pause,{}),v?"Pause":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:N,disabled:c||g,title:"Stop",onClick:e=>S(e,p),children:[(0,t.jsx)(i.Icons.stop,{}),v?"Stop":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:N,disabled:c,title:"Rename",onClick:t=>{t.stopPropagation();let r=window.prompt("Rename box (label only — leave blank to reset)",e.displayName??e.task);null!==r&&b(async()=>{let t=await x(e.id,r.trim());t.ok||window.alert(`Rename failed: ${t.error}`),a.refresh()})},children:[(0,t.jsx)(i.Icons.pencil,{}),v?"Rename":null]}),(0,t.jsxs)(l.Button,{variant:"destructive",size:N,title:"Destroy",disabled:c,onClick:t=>S(t,d,`Destroy box ${e.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,t.jsx)(i.Icons.trash,{}),v?"Destroy":null]})]})}],30544),e.s(["Select",0,function({wrapperClassName:e,className:r,children:a,...s}){return(0,t.jsxs)("span",{className:(0,o.cn)("relative inline-flex",e),children:[(0,t.jsx)("select",{className:(0,o.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",r),...s,children:a}),(0,t.jsx)("svg",{className:"pointer-events-none absolute right-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:(0,t.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}],49604)},80922,35594,e=>{"use strict";var t=e.i(1262),r=e.i(51096),a=e.i(44344);e.s(["BackLink",0,function({to:e,children:s}){return(0,t.jsxs)(r.default,{className:"mb-3.5 inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-mono text-xs text-muted-foreground hover:text-primary",href:e,children:[(0,t.jsx)(a.Icons.arrowL,{className:"size-[13px]"}),s]})}],80922);var s=e.i(65232),n=e.i(8536);e.s(["Stat",0,function({k:e,v:r,mono:a,icon:n}){return(0,t.jsxs)("div",{className:"px-4.5 p-4",children:[(0,t.jsx)("div",{className:"mb-1.5 font-mono text-[10.5px] uppercase tracking-[.06em] text-[#a4a9b0]",children:e}),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-center gap-2 font-semibold tracking-[-0.01em]",a?"font-mono text-sm font-medium":"text-base"),children:[n?(0,t.jsx)(n,{className:"size-[15px] text-muted-foreground"}):null,r]})]})},"StatGrid",0,function({children:e}){return(0,t.jsx)(n.Card,{className:"grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] divide-x divide-border/60 overflow-hidden",children:e})}],35594)},8536,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Card",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("p-5 pt-0",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[12.5px] text-muted-foreground",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-1 p-5",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...a})}])},3060,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Input",0,function({className:e,...a}){return(0,t.jsx)("input",{className:(0,r.cn)("flex h-10 w-full rounded-lg border border-input bg-card px-3 py-1 text-sm shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...a})}])},95141,e=>{"use strict";var t=e.i(1262),r=e.i(54129),a=e.i(65232),s=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:n,children:o}){return(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{className:"anim-fade fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-[rgba(20,24,30,.42)] p-6 backdrop-blur-[2px]",onClick:e,children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,a.cn)("anim-pop relative m-auto w-full max-w-[500px] rounded-2xl border border-border bg-card shadow-[0_40px_80px_-30px_rgba(20,24,30,.5)]",n),onClick:e=>e.stopPropagation(),children:[o,(0,t.jsx)("button",{className:"absolute right-4 top-4 grid h-7 w-7 cursor-pointer place-items-center rounded-md border-0 bg-transparent text-[#a4a9b0] transition-colors hover:bg-secondary hover:text-foreground",onClick:e,"aria-label":"Close",children:(0,t.jsx)(s.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("px-5 py-4",e),...r})},"DialogDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("mt-1 font-mono text-xs text-muted-foreground",e),...r})},"DialogFooter",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",e),...r})},"DialogHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",e),...r})},"DialogIcon",0,function({children:e}){return(0,t.jsx)("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-lg border border-[var(--green-line)] bg-accent text-primary [&_svg]:size-[17px]",children:e})},"DialogTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,a.cn)("text-base font-semibold leading-tight tracking-tight",e),...r})}])},86184,e=>{"use strict";var t=e.i(1262),r=e.i(54129),a=e.i(69377),s=e.i(3060);function n({jobId:e,login:o}){let[l,i]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[u,x]=(0,r.useState)(null),m="exchanging"===o.phase,p=async()=>{let t=l.trim();if(t&&!c){d(!0),x(null);try{let r=await fetch(`/api/v1/jobs/${encodeURIComponent(e)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})});if(!r.ok){let e=await r.json().catch(()=>null);x(e?.error?.message??`request failed (${r.status})`);return}i("")}catch(e){x(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,t.jsx)("p",{className:"text-xs text-amber-100/80",children:"Your saved Claude login is expired. Open the sign-in page, approve access, then paste the code Claude shows you."}),o.url?(0,t.jsx)("a",{href:o.url,target:"_blank",rel:"noreferrer",className:"w-fit rounded-md bg-amber-500/20 px-2.5 py-1 text-xs font-medium text-amber-100 underline decoration-amber-400/50 underline-offset-2 hover:bg-amber-500/30",children:"Open Claude sign-in ↗"}):(0,t.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,t.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,t.jsx)(s.Input,{value:l,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&p()},placeholder:"Paste approval code",disabled:m,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(a.Button,{type:"button",onClick:()=>void p(),disabled:!l.trim()||c||m,children:m?"Verifying…":c?"Submitting…":"Submit"})]}),o.lastError?(0,t.jsx)("p",{className:"text-xs text-amber-300",children:o.lastError}):null,"error"===o.phase&&o.error?(0,t.jsx)("p",{className:"text-xs text-red-400",children:o.error}):null,u?(0,t.jsx)("p",{className:"text-xs text-red-400",children:u}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:a,onDone:s,onStatus:o,onLogin:l}){let[i,c]=(0,r.useState)([]),[d,u]=(0,r.useState)(null),x=(0,r.useRef)(null),m=(0,r.useRef)(s);m.current=s;let p=(0,r.useRef)(o);p.current=o;let b=(0,r.useRef)(l);return b.current=l,(0,r.useEffect)(()=>{p.current?.("streaming");let t=new EventSource(a??`/api/jobs/${encodeURIComponent(e)}/logs`);return t.addEventListener("log",e=>{let t=JSON.parse(e.data);c(e=>[...e,t])}),t.addEventListener("login",e=>{let t=JSON.parse(e.data);u(t),b.current?.(t)}),t.addEventListener("end",e=>{let r=JSON.parse(e.data);p.current?.(r.status),m.current?.(r.status),t.close()}),()=>t.close()},[e,a]),(0,r.useEffect)(()=>{let e=x.current;e&&(e.scrollTop=e.scrollHeight)},[i]),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[d&&"done"!==d.phase?(0,t.jsx)(n,{jobId:e,login:d}):null,(0,t.jsx)("pre",{ref:x,className:"max-h-[440px] min-h-[220px] overflow-auto whitespace-pre rounded-lg bg-[#16181c] p-3 font-mono text-[11.5px] leading-relaxed text-[#d6d9de]",children:0===i.length?"starting…":i.join("\n")})]})}])},33789,1485,e=>{"use strict";var t=e.i(1262),r=e.i(54129);e.s(["Ago",0,function({ms:e}){let[a,s]=(0,r.useState)(!1);return(0,r.useEffect)(()=>s(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:a?function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return t+"s ago";let r=Math.floor(t/60);if(r<60)return r+"m ago";let a=Math.floor(r/60);return a<24?a+"h ago":Math.floor(a/24)+"d ago"}(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:r}){return(0,t.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[e,(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),r??null]})}],1485)},9383,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={callServer:function(){return n.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]});let n=e.r(57855),o=e.r(61414),l=e.r(97615)},31758,e=>{"use strict";var t=e.i(1262),r=e.i(44344);e.s(["EmptyBox",0,function({children:e}){return(0,t.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-card px-5 py-9 text-center text-[13.5px] text-muted-foreground",children:[(0,t.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,t.jsx)(r.Icons.box,{className:"size-5"})}),e]})}])},23878,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Table",0,function({className:e,...a}){return(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...a})},"TableBody",0,function({className:e,...a}){return(0,t.jsx)("tbody",{className:(0,r.cn)("[&_tr:last-child]:border-0",e),...a})},"TableCell",0,function({className:e,...a}){return(0,t.jsx)("td",{className:(0,r.cn)("px-4 py-3 align-middle",e),...a})},"TableHead",0,function({className:e,...a}){return(0,t.jsx)("th",{className:(0,r.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",e),...a})},"TableHeader",0,function({className:e,...a}){return(0,t.jsx)("thead",{className:(0,r.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",e),...a})},"TableRow",0,function({className:e,...a}){return(0,t.jsx)("tr",{className:(0,r.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",e),...a})}])},22983,93268,66818,e=>{"use strict";var t=e.i(1262),r=e.i(45971),a=e.i(33789),s=e.i(44344),n=e.i(86892),o=e.i(8536),l=e.i(23878),i=e.i(30544);e.s(["BoxTable",0,function({boxes:e}){let c=(0,r.useRouter)();return(0,t.jsx)(o.Card,{className:"overflow-hidden",children:(0,t.jsxs)(l.Table,{children:[(0,t.jsx)(l.TableHeader,{children:(0,t.jsxs)(l.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(l.TableHead,{className:"w-[38%]",children:"Task"}),(0,t.jsx)(l.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,t.jsx)(l.TableHead,{className:"max-md:hidden",children:"Status"}),(0,t.jsx)(l.TableHead,{className:"text-right",children:"Actions"})]})}),(0,t.jsx)(l.TableBody,{children:e.map(e=>(0,t.jsxs)(l.TableRow,{className:"cursor-pointer",onClick:()=>c.push("/boxes/"+e.id),children:[(0,t.jsxs)(l.TableCell,{children:[(0,t.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:e.task}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.id," · ",e.host]})]}),(0,t.jsxs)(l.TableCell,{className:"max-md:hidden",children:[(0,t.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,t.jsx)(s.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.branch})]}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.agent," · ",(0,t.jsx)(a.Ago,{ms:e.lastActivity})]})]}),(0,t.jsx)(l.TableCell,{className:"max-md:hidden",children:(0,t.jsx)(n.StatusBadge,{status:e.status})}),(0,t.jsx)(l.TableCell,{className:"text-right",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(i.BoxActions,{box:e})})]},e.id))})]})})}],22983);var c=e.i(54129),d=e.i(64595),u=e.i(69377),x=e.i(95141),m=e.i(3060),p=e.i(49604),b=e.i(65232);function f({className:e,...r}){return(0,t.jsx)("textarea",{className:(0,b.cn)("flex min-h-[76px] w-full resize-y rounded-lg border border-input bg-card px-3 py-2 text-sm leading-normal shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...r})}var h=e.i(9383);let g=(0,h.createServerReference)("402e69872ac5cc7b84479325d8b18020d181f0ccb2",h.callServer,void 0,h.findSourceMapURL,"createBoxAction"),j=(0,h.createServerReference)("40b21c2ad91fa1708c513ab1647dc78fa0d7e56f70",h.callServer,void 0,h.findSourceMapURL,"listBranchesAction");var v=e.i(96621),N=e.i(86184);let S=[{id:"docker",label:"Docker (local)",configured:!0}];function y({project:e,projects:a,onClose:n}){let o=(0,r.useRouter)(),{state:l}=(0,v.useStore)(),[i,d]=(0,c.useState)(null),h=i??(l.providers.length?l.providers:S),[C,B]=(0,c.useTransition)(),[R,T]=(0,c.useState)(e?.id??a[0]?.id??""),[I,D]=(0,c.useState)("claude"),[L,A]=(0,c.useState)("docker"),[P,E]=(0,c.useState)(""),[z,U]=(0,c.useState)(""),[H,M]=(0,c.useState)(""),[O,$]=(0,c.useState)(null),[F,_]=(0,c.useState)(!1),[J,W]=(0,c.useState)(!1),[q,K]=(0,c.useState)(null),[G,V]=(0,c.useState)(null),[Y,Q]=(0,c.useState)("streaming"),[X,Z]=(0,c.useState)(null),[ee,et]=(0,c.useState)(null),[er,ea]=(0,c.useState)(!1),[es,en]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/v1/providers?freshness=1&hosts=expand",{credentials:"same-origin"});if(!t.ok)return;let r=await t.json();if(e)return;let a=r.providers??[];d(a);let s={};for(let e of a)s[e.id]={baseStatus:e.baseStatus,baseStaleReason:e.baseStaleReason,jobId:e.jobId};en(s)}catch{}})(),()=>{e=!0}},[]);let eo=a.find(e=>e.id===R)??e,el=L??"docker",ei=h.find(e=>e.id===el),ec=es?.[el],ed=!!ec&&(!!ec.jobId||"unprepared"===ec.baseStatus||"stale"===ec.baseStatus);(0,c.useEffect)(()=>{if(!R||G)return;_(eo?.needsSetup??!1),A("docker");let e=!1;return $(null),M(eo?.currentBranch??""),j(R).then(t=>{if(e||!t.ok){e||t.ok||$([]);return}$(t.branches),t.current&&t.branches.includes(t.current)&&M(t.current)}),()=>{e=!0}},[R,G]);let eu=()=>{K(null);let e=ec?.jobId;e?et(e):B(async()=>{try{let e=await fetch(`/api/v1/providers/${encodeURIComponent(el)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({})}),t=await e.json().catch(()=>null);if(!e.ok||!t?.jobId)return void K(t?.error?.message??`base image build request failed (${e.status})`);et(t.jobId)}catch(e){K(e instanceof Error?e.message:String(e))}})},ex=()=>{K(null),B(async()=>{let e=await g({projectId:R,agent:I,provider:L,name:P.trim()||void 0,prompt:"none"===I?void 0:z.trim()||void 0,fromBranch:H.trim()&&H.trim()!==eo?.currentBranch?H.trim():void 0,setupWizard:"none"!==I&&F});e.ok?(V(e.jobId),o.refresh()):K(e.error)})};return(0,t.jsxs)(x.Dialog,{onClose:n,className:G||ee?"max-w-[900px]":"max-w-[560px]",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogIcon,{children:(0,t.jsx)(s.Icons.box,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x.DialogTitle,{children:!G&&ee?"Building base image":"Create box"}),(0,t.jsx)(x.DialogDescription,{children:eo?eo.name:"Start a box in a project"})]}),G||ee?(0,t.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,t.jsx)(w,{status:Y,loginPhase:X})}):null]}),(0,t.jsx)(x.DialogBody,{className:"flex flex-col gap-4",children:G?(0,t.jsx)(N.JobLogStream,{jobId:G,onStatus:Q,onDone:()=>o.refresh(),onLogin:e=>Z(e?.phase??null)}):ee?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["Building the ",ei?.label??el," base image — one-time, can take several minutes. The box is created automatically when it finishes."]}),(0,t.jsx)(N.JobLogStream,{jobId:ee,onStatus:Q,onDone:e=>{"done"===e?ex():K(`base image build ${e}`)}}),q?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:q}):null]}):(0,t.jsxs)(t.Fragment,{children:[e?null:(0,t.jsx)(k,{label:"Project",children:(0,t.jsxs)(p.Select,{value:R,onChange:e=>T(e.target.value),children:[0===a.length?(0,t.jsx)("option",{value:"",children:"No projects — add one first"}):null,a.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,t.jsx)(k,{label:"Provider",children:(0,t.jsx)(p.Select,{value:L,onChange:e=>A(e.target.value),children:h.map(e=>(0,t.jsxs)("option",{value:e.id,disabled:!e.configured,title:e.reason,children:[e.label,e.configured?"":" — not configured"]},e.id))})}),ed?(0,t.jsx)("p",{className:"-mt-2 font-mono text-xs text-amber-600 dark:text-amber-400",title:ec?.baseStaleReason,children:ec?.jobId?"A base-image build is already running — the box will be created when it finishes.":ec?.baseStatus==="unprepared"?"First use of this provider: the base image will be downloaded or built first (can take 5–10 minutes).":"The base image is out of date and will be rebuilt first (can take 5–10 minutes)."}):null,(0,t.jsx)(k,{label:"Agent",children:(0,t.jsxs)(p.Select,{value:I,onChange:e=>D(e.target.value),children:[(0,t.jsx)("option",{value:"claude",children:"Claude"}),(0,t.jsx)("option",{value:"codex",children:"Codex"}),(0,t.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,t.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,t.jsx)(k,{label:"Name (optional)",children:(0,t.jsx)(m.Input,{value:P,onChange:e=>E(e.target.value),placeholder:"auto"})}),eo?.needsSetup&&"none"!==I?(0,t.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",checked:F,onChange:e=>_(e.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"This project has no agentbox.yaml — the agent explores the repo and proposes one on its first turn."})]})]}):null,"none"===I?(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["The box is created and left running with no agent — attach later from a terminal or SSH (",(0,t.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>W(e=>!e),className:"flex cursor-pointer items-center gap-1.5 self-start text-xs font-medium text-secondary-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(s.Icons.chevR,{className:(0,b.cn)("size-3.5 transition-transform",J&&"rotate-90")}),"Advanced"]}),J?(0,t.jsxs)(t.Fragment,{children:[null===O?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsx)(p.Select,{value:"",disabled:!0,children:(0,t.jsx)("option",{value:"",children:"Loading branches…"})})}):O.length>0?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsxs)(p.Select,{value:H,onChange:e=>M(e.target.value),children:[eo?.currentBranch&&!O.includes(eo.currentBranch)?(0,t.jsxs)("option",{value:"",children:[eo.currentBranch," (current)"]}):null,O.map(e=>(0,t.jsxs)("option",{value:e,children:[e,e===eo?.currentBranch?" (current)":""]},e))]})}):null,"none"!==I?(0,t.jsx)(k,{label:"Initial prompt (optional)",children:(0,t.jsx)(f,{value:z,onChange:e=>U(e.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),q?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:q}):null]})}),(0,t.jsx)(x.DialogFooter,{children:G||ee?(0,t.jsxs)(t.Fragment,{children:["streaming"===Y?(0,t.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:G?"The box + agent start in the background — you can close this.":"Keep this open — the box is created when the build finishes."}):null,(0,t.jsx)(u.Button,{onClick:n,children:"Close"})]}):er?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",title:ec?.baseStaleReason,children:["The ",ei?.label??el," base image is out of date."]}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>ea(!1),disabled:C,children:"Cancel"}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>{ea(!1),ex()},disabled:C,children:"Use existing image"}),(0,t.jsx)(u.Button,{onClick:()=>{ea(!1),eu()},disabled:C,children:"Rebuild & create"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Button,{variant:"outline",onClick:n,disabled:C,children:"Cancel"}),(0,t.jsx)(u.Button,{onClick:()=>{(K(null),R)?ed?"docker"===el||ec?.baseStatus!=="stale"||ec.jobId?eu():ea(!0):ex():K("pick a project")},disabled:C||!R,children:C?"Starting…":"Create box"})]})})]})}function w({status:e,loginPhase:r}){return"done"===e?(0,t.jsxs)(d.Badge,{className:"badge-run",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===e||"error"===e||"cancelled"===e?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===r?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===r||"starting"===r||"exchanging"===r?(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Working…"]})}function k({label:e,children:r}){return(0,t.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:e}),r]})}e.s(["CreateBoxButton",0,function({project:e,projects:r,variant:a,size:n,className:o}){let[l,i]=(0,c.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.Button,{variant:a,size:n,className:o,onClick:()=>i(!0),children:[(0,t.jsx)(s.Icons.plus,{}),"Create box"]}),l?(0,t.jsx)(y,{project:e,projects:r??(e?[e]:[]),onClose:()=>i(!1)}):null]})}],93268);let C=(0,h.createServerReference)("4030be3a72d5d8e0f43e0cb8632561b0a65ad269f2",h.callServer,void 0,h.findSourceMapURL,"removeProjectAction");e.s(["DeleteProjectButton",0,function({project:e,size:a,className:n,redirectHome:o}){let l=(0,r.useRouter)(),[i,d]=(0,c.useTransition)();return(0,t.jsxs)(u.Button,{variant:"destructive",size:a,className:n,title:"Delete project",disabled:i,onClick:t=>{t.stopPropagation(),t.preventDefault(),window.confirm(`Remove project "${e.name}" from the hub? Its folder and files are NOT deleted — this only unregisters it (and any hub-set project settings). This cannot be undone.`)&&d(async()=>{let t=await C(e.id);t.ok?o?l.push("/"):l.refresh():window.alert(`Delete failed: ${t.error}`)})},children:[(0,t.jsx)(s.Icons.trash,{}),"Delete"]})}],66818)},86691,e=>{"use strict";var t=e.i(1262),r=e.i(45971),a=e.i(33789),s=e.i(44344),n=e.i(96621),o=e.i(80922),l=e.i(22983),i=e.i(93268),c=e.i(66818),d=e.i(31758),u=e.i(1485),x=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,r.useParams)(),{project:m,boxesFor:p}=(0,n.useStore)(),b=m(e);if(!b)return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,t.jsx)(o.BackLink,{to:"/",children:"Dashboard"}),(0,t.jsx)(d.EmptyBox,{children:"Project not found."})]});let f=p(e),h=f.filter(e=>"running"===e.status).length;return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,t.jsx)(o.BackLink,{to:"/",children:"All projects"}),(0,t.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("h1",{className:"flex items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[(0,t.jsx)("span",{className:"grid h-[26px] w-[26px] flex-none place-items-center rounded-md border border-[var(--green-line)] bg-accent text-primary",children:(0,t.jsx)(s.Icons.folder,{className:"size-[15px]"})}),b.name]}),(0,t.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:b.repo})," · ",b.provider]})]}),(0,t.jsxs)("div",{className:"ml-auto flex flex-none gap-2 max-md:ml-0",children:[(0,t.jsx)(i.CreateBoxButton,{project:b}),0===f.length?(0,t.jsx)(c.DeleteProjectButton,{project:b,redirectHome:!0}):null]})]}),(0,t.jsx)("div",{className:"mt-5",children:(0,t.jsxs)(x.StatGrid,{children:[(0,t.jsx)(x.Stat,{k:"Boxes",v:f.length,icon:s.Icons.box}),(0,t.jsx)(x.Stat,{k:"Running",v:h,icon:s.Icons.activity}),(0,t.jsx)(x.Stat,{k:"Provider",v:b.provider,mono:!0}),(0,t.jsx)(x.Stat,{k:"Created",v:(0,t.jsx)(a.Ago,{ms:b.createdAt}),mono:!0})]})}),(0,t.jsx)(u.SectionLabel,{children:"Boxes"}),f.length?(0,t.jsx)(l.BoxTable,{boxes:f}):(0,t.jsx)(d.EmptyBox,{children:(0,t.jsx)("div",{children:"No boxes yet."})})]})}])}]);