@madarco/agentbox 0.23.4 → 0.24.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 (193) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3 -2
  4. package/dist/{_cloud-attach-BQRWX3J2.js → _cloud-attach-T6GPR6LJ.js} +5 -5
  5. package/dist/{chunk-GGRZ3GZO.js → chunk-5KHEH47T.js} +91 -79
  6. package/dist/chunk-5KHEH47T.js.map +1 -0
  7. package/dist/{chunk-I6ZRWTPR.js → chunk-6U2S6QWD.js} +219 -18
  8. package/dist/chunk-6U2S6QWD.js.map +1 -0
  9. package/dist/{chunk-LK2JT2OO.js → chunk-DEDTPG2D.js} +880 -146
  10. package/dist/chunk-DEDTPG2D.js.map +1 -0
  11. package/dist/chunk-G3H2L3O2.js +0 -0
  12. package/dist/{chunk-LA4JMS27.js → chunk-I654PBHA.js} +290 -330
  13. package/dist/chunk-I654PBHA.js.map +1 -0
  14. package/dist/{chunk-W3FQPFP7.js → chunk-K2EDQGZP.js} +18 -4
  15. package/dist/chunk-K2EDQGZP.js.map +1 -0
  16. package/dist/{chunk-LSQXT5WZ.js → chunk-LC4E2EIZ.js} +3 -3
  17. package/dist/{chunk-LSQXT5WZ.js.map → chunk-LC4E2EIZ.js.map} +1 -1
  18. package/dist/{chunk-SFA57TGX.js → chunk-NACA6AM7.js} +183 -49
  19. package/dist/chunk-NACA6AM7.js.map +1 -0
  20. package/dist/{chunk-QEQFZLYR.js → chunk-RYQLFKCP.js} +20 -10
  21. package/dist/chunk-RYQLFKCP.js.map +1 -0
  22. package/dist/{chunk-QT3SHMLY.js → chunk-UIRBYL4G.js} +43 -12
  23. package/dist/chunk-UIRBYL4G.js.map +1 -0
  24. package/dist/chunk-WJFZJZIM.js +0 -0
  25. package/dist/chunk-WLHJZPFJ.js +845 -0
  26. package/dist/chunk-WLHJZPFJ.js.map +1 -0
  27. package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
  28. package/dist/dist-3KIJ2KQ2.js +1437 -0
  29. package/dist/dist-3KIJ2KQ2.js.map +1 -0
  30. package/dist/{dist-V235KVEX.js → dist-7OUOHQPA.js} +196 -151
  31. package/dist/dist-7OUOHQPA.js.map +1 -0
  32. package/dist/{dist-Z2NEVV55.js → dist-B7TNWGVG.js} +8 -4
  33. package/dist/{dist-CUKBKS3N.js → dist-KYV3LEHG.js} +10 -6
  34. package/dist/{dist-FXQFTT75.js → dist-PHYCFYKH.js} +37 -17
  35. package/dist/dist-PHYCFYKH.js.map +1 -0
  36. package/dist/{dist-2BTJQUJS.js → dist-T5MXBZGP.js} +2 -2
  37. package/dist/{dist-QO4CTLAX.js → dist-Z7KEPQC7.js} +6 -6
  38. package/dist/index.js +2560 -1108
  39. package/dist/index.js.map +1 -1
  40. package/dist/{prepared-state-BUO75YLZ-CDTISC2C.js → prepared-state-BUO75YLZ-RQRFFBJW.js} +2 -2
  41. package/package.json +28 -28
  42. package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
  43. package/runtime/_shared/agentbox-codex-hooks.json +1 -1
  44. package/runtime/_shared/agentbox-dockerd-start +0 -0
  45. package/runtime/_shared/agentbox-open +0 -0
  46. package/runtime/_shared/agentbox-portless-trust +0 -0
  47. package/runtime/_shared/agentbox-vnc-start +0 -0
  48. package/runtime/_shared/ctl.cjs +468 -97
  49. package/runtime/_shared/gh-shim +0 -0
  50. package/runtime/_shared/git-shim +53 -3
  51. package/runtime/_shared/linear-shim +0 -0
  52. package/runtime/_shared/ntn-shim +0 -0
  53. package/runtime/daytona/custom-system-CLAUDE.md +1 -1
  54. package/runtime/digitalocean/agentbox-checkpoint-cleanup +55 -0
  55. package/runtime/digitalocean/agentbox-codex-hooks.json +68 -0
  56. package/runtime/digitalocean/agentbox-dockerd-start +145 -0
  57. package/runtime/digitalocean/agentbox-open +28 -0
  58. package/runtime/digitalocean/agentbox-portless-trust +82 -0
  59. package/runtime/digitalocean/agentbox-setup-skill.md +317 -0
  60. package/runtime/digitalocean/agentbox-vnc-start +102 -0
  61. package/runtime/digitalocean/claude-managed-settings.json +116 -0
  62. package/runtime/digitalocean/ctl.cjs +27852 -0
  63. package/runtime/digitalocean/custom-system-CLAUDE.md +39 -0
  64. package/runtime/digitalocean/gh-shim +344 -0
  65. package/runtime/digitalocean/git-shim +181 -0
  66. package/runtime/digitalocean/linear-shim +181 -0
  67. package/runtime/digitalocean/ntn-shim +95 -0
  68. package/runtime/digitalocean/opencode-agentbox-plugin.js +76 -0
  69. package/runtime/digitalocean/scripts/install-box.sh +462 -0
  70. package/runtime/docker/Dockerfile.box +5 -0
  71. package/runtime/docker/packages/ctl/dist/bin.cjs +468 -97
  72. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
  73. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-codex-hooks.json +1 -1
  74. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
  75. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
  76. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
  77. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +0 -0
  78. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
  79. package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
  80. package/runtime/docker/packages/sandbox-docker/scripts/custom-system-CLAUDE.md +2 -1
  81. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
  82. package/runtime/docker/packages/sandbox-docker/scripts/git-shim +53 -3
  83. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
  84. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
  85. package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
  86. package/runtime/e2b/agentbox-codex-hooks.json +1 -1
  87. package/runtime/e2b/agentbox-dockerd-start +0 -0
  88. package/runtime/e2b/agentbox-open +0 -0
  89. package/runtime/e2b/agentbox-vnc-start +0 -0
  90. package/runtime/e2b/ctl.cjs +468 -97
  91. package/runtime/e2b/custom-system-CLAUDE.md +6 -3
  92. package/runtime/e2b/gh-shim +0 -0
  93. package/runtime/e2b/git-shim +53 -3
  94. package/runtime/e2b/linear-shim +0 -0
  95. package/runtime/e2b/ntn-shim +0 -0
  96. package/runtime/e2b/scripts/build-template.sh +16 -0
  97. package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
  98. package/runtime/hetzner/agentbox-codex-hooks.json +1 -1
  99. package/runtime/hetzner/agentbox-dockerd-start +0 -0
  100. package/runtime/hetzner/agentbox-open +0 -0
  101. package/runtime/hetzner/agentbox-portless-trust +0 -0
  102. package/runtime/hetzner/agentbox-vnc-start +0 -0
  103. package/runtime/hetzner/ctl.cjs +468 -97
  104. package/runtime/hetzner/custom-system-CLAUDE.md +1 -1
  105. package/runtime/hetzner/gh-shim +0 -0
  106. package/runtime/hetzner/git-shim +53 -3
  107. package/runtime/hetzner/linear-shim +0 -0
  108. package/runtime/hetzner/ntn-shim +0 -0
  109. package/runtime/hetzner/scripts/install-box.sh +5 -0
  110. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  111. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  112. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  113. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  114. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  115. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  116. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  117. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  118. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  119. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  120. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  121. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  122. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  123. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +12 -12
  124. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +1 -1
  125. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bqbkd5._.js +1 -1
  126. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +1 -1
  127. package/runtime/hub/apps/hub/.next/server/chunks/_06f2faq._.js +1 -1
  128. package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +8 -8
  129. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_09gdzmo._.js +1 -1
  130. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.js +1 -1
  131. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0tgpglr._.js +1 -1
  132. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_1laion6._.js +1 -1
  133. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +1 -1
  134. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  135. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  136. package/runtime/hub/apps/hub/.next/static/chunks/1c5w3kqosumog.js +1 -0
  137. package/runtime/hub/apps/hub/.next/static/chunks/1o3ot_9-8jgzc.js +1 -0
  138. package/runtime/hub/apps/hub/.next/static/chunks/380qcmusmigzz.js +1 -0
  139. package/runtime/hub/apps/hub/.next/static/chunks/3uq9hf-roasav.js +1 -0
  140. package/runtime/hub/apps/hub/{auth-675P3LQS.js → auth-Q447765C.js} +2 -2
  141. package/runtime/hub/apps/hub/{auth-config-AOBEKRZQ.js → auth-config-SIL635ZD.js} +2 -2
  142. package/runtime/hub/apps/hub/{chunk-H22XP3NY.js → chunk-3VE7AYVK.js} +600 -145
  143. package/runtime/hub/apps/hub/{chunk-EXQCBM5Q.js → chunk-64WEKO34.js} +42 -11
  144. package/runtime/hub/apps/hub/{chunk-56YQBVN2.js → chunk-DZPQB2JZ.js} +1 -1
  145. package/runtime/hub/apps/hub/{chunk-2Z74R6ZT.js → chunk-FGBXEXUV.js} +351 -292
  146. package/runtime/hub/apps/hub/{chunk-AR7CEZ2G.js → chunk-YVELHPNY.js} +218 -17
  147. package/runtime/hub/apps/hub/{dist-LZNRLUYY.js → dist-33ZNVTC6.js} +183 -49
  148. package/runtime/hub/apps/hub/{dist-Q6G66Z57.js → dist-4SXAJBOC.js} +195 -150
  149. package/runtime/hub/apps/hub/{dist-SD4G36EP.js → dist-EPJFN2J3.js} +116 -86
  150. package/runtime/hub/apps/hub/{dist-STQK5XM6.js → dist-GF5EBRNG.js} +1 -1
  151. package/runtime/hub/apps/hub/{dist-LNHEG5P4.js → dist-UJVIROA4.js} +19 -5
  152. package/runtime/hub/apps/hub/dist-XULFTIMT.js +2212 -0
  153. package/runtime/hub/apps/hub/{dist-VV6Z2CQX.js → dist-YM5J25H6.js} +7 -3
  154. package/runtime/hub/apps/hub/{hub-token-2BZFBBW3.js → hub-token-UITZEWVP.js} +2 -2
  155. package/runtime/hub/apps/hub/package.json +1 -0
  156. package/runtime/hub/apps/hub/{prepared-state-BUO75YLZ-CAXQS5Y3.js → prepared-state-BUO75YLZ-O4GZMDRF.js} +1 -1
  157. package/runtime/hub/apps/hub/server.js +38 -19
  158. package/runtime/relay/bin.cjs +275 -59
  159. package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
  160. package/runtime/vercel/agentbox-codex-hooks.json +1 -1
  161. package/runtime/vercel/agentbox-dockerd-start +0 -0
  162. package/runtime/vercel/agentbox-open +0 -0
  163. package/runtime/vercel/agentbox-vnc-start +0 -0
  164. package/runtime/vercel/ctl.cjs +468 -97
  165. package/runtime/vercel/custom-system-CLAUDE.md +3 -2
  166. package/runtime/vercel/gh-shim +0 -0
  167. package/runtime/vercel/git-shim +53 -3
  168. package/runtime/vercel/linear-shim +0 -0
  169. package/runtime/vercel/ntn-shim +0 -0
  170. package/runtime/vercel/scripts/provision.sh +16 -0
  171. package/dist/chunk-GGRZ3GZO.js.map +0 -1
  172. package/dist/chunk-I6ZRWTPR.js.map +0 -1
  173. package/dist/chunk-LA4JMS27.js.map +0 -1
  174. package/dist/chunk-LK2JT2OO.js.map +0 -1
  175. package/dist/chunk-QEQFZLYR.js.map +0 -1
  176. package/dist/chunk-QT3SHMLY.js.map +0 -1
  177. package/dist/chunk-SFA57TGX.js.map +0 -1
  178. package/dist/chunk-W3FQPFP7.js.map +0 -1
  179. package/dist/dist-FXQFTT75.js.map +0 -1
  180. package/dist/dist-V235KVEX.js.map +0 -1
  181. package/runtime/hub/apps/hub/.next/static/chunks/0joh_xsiowfc4.js +0 -1
  182. package/runtime/hub/apps/hub/.next/static/chunks/20hq7-0depjid.js +0 -1
  183. package/runtime/hub/apps/hub/.next/static/chunks/3p86ecqhr_7yy.js +0 -1
  184. package/runtime/hub/apps/hub/.next/static/chunks/3qof5hg87qf5n.js +0 -1
  185. /package/dist/{_cloud-attach-BQRWX3J2.js.map → _cloud-attach-T6GPR6LJ.js.map} +0 -0
  186. /package/dist/{dist-2BTJQUJS.js.map → dist-B7TNWGVG.js.map} +0 -0
  187. /package/dist/{dist-CUKBKS3N.js.map → dist-KYV3LEHG.js.map} +0 -0
  188. /package/dist/{dist-QO4CTLAX.js.map → dist-T5MXBZGP.js.map} +0 -0
  189. /package/dist/{dist-Z2NEVV55.js.map → dist-Z7KEPQC7.js.map} +0 -0
  190. /package/dist/{prepared-state-BUO75YLZ-CDTISC2C.js.map → prepared-state-BUO75YLZ-RQRFFBJW.js.map} +0 -0
  191. /package/runtime/hub/apps/hub/.next/static/{eVq-z4zld_8DGQudbYogV → XtIjHGqvY4mQsOY2-m1Jy}/_buildManifest.js +0 -0
  192. /package/runtime/hub/apps/hub/.next/static/{eVq-z4zld_8DGQudbYogV → XtIjHGqvY4mQsOY2-m1Jy}/_clientMiddlewareManifest.js +0 -0
  193. /package/runtime/hub/apps/hub/.next/static/{eVq-z4zld_8DGQudbYogV → XtIjHGqvY4mQsOY2-m1Jy}/_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)},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(50253),d=a.i(17607),e=a.i(97187),f=a.i(54473),g=a.i(87883),h=a.i(86834);function i({className:a,...c}){return(0,b.jsx)("div",{className:(0,h.cn)("h-px w-full shrink-0 bg-border",a),...c})}var j=a.i(80007),k=a.i(3015),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,j.useStore)(),[d,e]=(0,c.useState)({});return(0,c.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};e(d)}catch{}})(),()=>{a=!0}},[a.providers]),(0,b.jsx)(g.Card,{className:"divide-y divide-border/60 overflow-hidden",children:a.providers.map(a=>(0,b.jsx)(r,{provider:{...a,...d[a.id]}},a.id))})}function r({provider:a}){var d;let g=(0,l.useRouter)(),i=p[a.id]??[],j=new Set(i.filter(a=>!a.optional).map(a=>a.key)),[k,q]=(0,c.useState)({}),[s,t]=(0,c.useState)(()=>a.hasCredentials?Object.fromEntries(i.filter(a=>!a.optional).map(a=>[a.key,!0])):{}),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!a.hasCredentials&&i.length>0),[A,B]=(0,c.useState)(a.jobId??null),[C,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(null),G=async()=>{v(!0),x(null);try{let b={};for(let a of i){if(s[a.key])continue;let c=(k[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([...j].map(a=>[a,!0]))),z(!1),g.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=i.length>0;return(0,b.jsxs)("div",{className:"flex flex-col gap-3 p-4 px-5",children:[(0,b.jsxs)("div",{className:(0,h.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,(d=a).configured?"stale"===d.baseStatus?(0,b.jsx)(f.Badge,{className:"badge-warn gap-1.5 normal-case",title:d.baseStaleReason,children:"stale — re-bake"}):"unprepared"===d.baseStatus?(0,b.jsx)(f.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,b.jsxs)(f.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,b.jsx)("span",{className:"badge-dot"}),"ready"]}):d.hasCredentials?(0,b.jsx)(f.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,b.jsx)(f.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)(e.Icons.refresh,{className:"size-3.5"}),A?"Baking…":C?"Starting…":a.configured?"Re-bake":"Bake image"]})}),J?(0,b.jsx)(e.Icons.chevR,{className:(0,h.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&&i.length>0?(0,b.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border/70 bg-card/50 p-3",children:[i.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]?"••••••••••••":k[a.key]??"",placeholder:a.placeholder,onFocus:()=>{s[a.key]&&(t(b=>({...b,[a.key]:!1})),q(b=>({...b,[a.key]:""})))},onBlur:()=>{j.has(a.key)&&!(k[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),g.refresh()}}):null]})}a.s(["default",0,function(){let{state:a}=(0,j.useStore)(),l=a.github,[m,n]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let a=!0;return fetch("/api/v1/health",{credentials:"same-origin"}).then(a=>a.ok?a.json():null).then(b=>{a&&b?.version&&n(b.version)}).catch(()=>{}),()=>{a=!1}},[]),(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)(k.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)(k.SectionLabel,{children:"GitHub App"}),l.available?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.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)(e.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:[l.appName,l.installed?(0,b.jsxs)(f.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:l.installed?`@${l.account}`:"Not installed"})]})]})}),(0,b.jsx)(k.SectionLabel,{right:(0,b.jsxs)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:[l.repos.length," repos"]}),children:"Authorized repositories"}),(0,b.jsx)(g.Card,{className:"divide-y divide-border/60 overflow-hidden",children:l.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)(e.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)(e.LangDot,{lang:a.lang}),a.lang]}),(0,b.jsxs)("span",{children:["updated ",(0,b.jsx)(d.Ago,{ms:a.pushedAt})]}),(0,b.jsx)(f.Badge,{className:(0,h.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)(g.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)(e.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)(f.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)(i,{}),(0,b.jsxs)("div",{className:"flex items-start gap-3 p-4 px-5 text-[12.5px] text-muted-foreground",children:[(0,b.jsx)(e.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)."})]})]}),(0,b.jsxs)("div",{className:"mt-10 text-center font-mono text-[11px] text-muted-foreground",children:["AgentBox ",m??"…"]})]})}],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(50253),d=a.i(17607),e=a.i(97187),f=a.i(54473),g=a.i(87883),h=a.i(86834);function i({className:a,...c}){return(0,b.jsx)("div",{className:(0,h.cn)("h-px w-full shrink-0 bg-border",a),...c})}var j=a.i(80007),k=a.i(3015),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}],digitalocean:[{key:"token",label:"API token",placeholder:"personal access token (read+write)"}]};function q(){let{state:a}=(0,j.useStore)(),[d,e]=(0,c.useState)({});return(0,c.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};e(d)}catch{}})(),()=>{a=!0}},[a.providers]),(0,b.jsx)(g.Card,{className:"divide-y divide-border/60 overflow-hidden",children:a.providers.map(a=>(0,b.jsx)(r,{provider:{...a,...d[a.id]}},a.id))})}function r({provider:a}){var d;let g=(0,l.useRouter)(),i=p[a.id]??[],j=new Set(i.filter(a=>!a.optional).map(a=>a.key)),[k,q]=(0,c.useState)({}),[s,t]=(0,c.useState)(()=>a.hasCredentials?Object.fromEntries(i.filter(a=>!a.optional).map(a=>[a.key,!0])):{}),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!a.hasCredentials&&i.length>0),[A,B]=(0,c.useState)(a.jobId??null),[C,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(null),G=async()=>{v(!0),x(null);try{let b={};for(let a of i){if(s[a.key])continue;let c=(k[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([...j].map(a=>[a,!0]))),z(!1),g.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=i.length>0;return(0,b.jsxs)("div",{className:"flex flex-col gap-3 p-4 px-5",children:[(0,b.jsxs)("div",{className:(0,h.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,(d=a).configured?"stale"===d.baseStatus?(0,b.jsx)(f.Badge,{className:"badge-warn gap-1.5 normal-case",title:d.baseStaleReason,children:"stale — re-bake"}):"unprepared"===d.baseStatus?(0,b.jsx)(f.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,b.jsxs)(f.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,b.jsx)("span",{className:"badge-dot"}),"ready"]}):d.hasCredentials?(0,b.jsx)(f.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,b.jsx)(f.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)(e.Icons.refresh,{className:"size-3.5"}),A?"Baking…":C?"Starting…":a.configured?"Re-bake":"Bake image"]})}),J?(0,b.jsx)(e.Icons.chevR,{className:(0,h.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&&i.length>0?(0,b.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border/70 bg-card/50 p-3",children:[i.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]?"••••••••••••":k[a.key]??"",placeholder:a.placeholder,onFocus:()=>{s[a.key]&&(t(b=>({...b,[a.key]:!1})),q(b=>({...b,[a.key]:""})))},onBlur:()=>{j.has(a.key)&&!(k[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),g.refresh()}}):null]})}a.s(["default",0,function(){let{state:a}=(0,j.useStore)(),l=a.github,[m,n]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let a=!0;return fetch("/api/v1/health",{credentials:"same-origin"}).then(a=>a.ok?a.json():null).then(b=>{a&&b?.version&&n(b.version)}).catch(()=>{}),()=>{a=!1}},[]),(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)(k.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)(k.SectionLabel,{children:"GitHub App"}),l.available?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.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)(e.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:[l.appName,l.installed?(0,b.jsxs)(f.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:l.installed?`@${l.account}`:"Not installed"})]})]})}),(0,b.jsx)(k.SectionLabel,{right:(0,b.jsxs)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:[l.repos.length," repos"]}),children:"Authorized repositories"}),(0,b.jsx)(g.Card,{className:"divide-y divide-border/60 overflow-hidden",children:l.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)(e.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)(e.LangDot,{lang:a.lang}),a.lang]}),(0,b.jsxs)("span",{children:["updated ",(0,b.jsx)(d.Ago,{ms:a.pushedAt})]}),(0,b.jsx)(f.Badge,{className:(0,h.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)(g.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)(e.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)(f.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)(i,{}),(0,b.jsxs)("div",{className:"flex items-start gap-3 p-4 px-5 text-[12.5px] text-muted-foreground",children:[(0,b.jsx)(e.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)."})]})]}),(0,b.jsxs)("div",{className:"mt-10 text-center font-mono text-[11px] text-muted-foreground",children:["AgentBox ",m??"…"]})]})}],9247)}];
2
2
 
3
3
  //# sourceMappingURL=apps_hub_0b_hsjl._.js.map
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
7
7
  "static/chunks/0cz1d0mv5g_q7.js"
8
8
  ],
9
9
  "lowPriorityFiles": [
10
- "static/eVq-z4zld_8DGQudbYogV/_buildManifest.js",
11
- "static/eVq-z4zld_8DGQudbYogV/_ssgManifest.js",
12
- "static/eVq-z4zld_8DGQudbYogV/_clientMiddlewareManifest.js"
10
+ "static/XtIjHGqvY4mQsOY2-m1Jy/_buildManifest.js",
11
+ "static/XtIjHGqvY4mQsOY2-m1Jy/_ssgManifest.js",
12
+ "static/XtIjHGqvY4mQsOY2-m1Jy/_clientMiddlewareManifest.js"
13
13
  ],
14
14
  "rootMainFiles": [
15
15
  "static/chunks/1y49eldffr2-_.js",
@@ -1 +1 @@
1
- <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/1y49eldffr2-_.js"/><script src="/_next/static/chunks/2w65a9zig6ya7.js" async=""></script><script src="/_next/static/chunks/3x8k7so-uoat8.js" async=""></script><script src="/_next/static/chunks/0ptag81psa0nj.js" async=""></script><script src="/_next/static/chunks/turbopack-2x4_cva4cco3h.js" async=""></script><script src="/_next/static/chunks/2x7nfpuaaba_a.js" async=""></script><script src="/_next/static/chunks/3c49t4evjq8hf.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/1y49eldffr2-_.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[20699,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\"]\n3:I[92242,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\"]\n4:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"ViewportBoundary\"]\na:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"MetadataBoundary\"]\nc:I[17506,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"eVq-z4zld_8DGQudbYogV\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>
1
+ <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/1y49eldffr2-_.js"/><script src="/_next/static/chunks/2w65a9zig6ya7.js" async=""></script><script src="/_next/static/chunks/3x8k7so-uoat8.js" async=""></script><script src="/_next/static/chunks/0ptag81psa0nj.js" async=""></script><script src="/_next/static/chunks/turbopack-2x4_cva4cco3h.js" async=""></script><script src="/_next/static/chunks/2x7nfpuaaba_a.js" async=""></script><script src="/_next/static/chunks/3c49t4evjq8hf.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/1y49eldffr2-_.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[20699,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\"]\n3:I[92242,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\"]\n4:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"ViewportBoundary\"]\na:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"MetadataBoundary\"]\nc:I[17506,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"XtIjHGqvY4mQsOY2-m1Jy\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88451,e=>{"use strict";var t=e.i(1262),r=e.i(45971),s=e.i(54129),n=e.i(44344),a=e.i(69377),o=e.i(9383);let l=(0,o.createServerReference)("60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",o.callServer,void 0,o.findSourceMapURL,"answerApprovalAction");e.s(["ApprovalActions",0,function({id:e}){let o=(0,r.useRouter)(),[i,c]=(0,s.useTransition)(),d=t=>{c(async()=>{let r=await l(e,t);r.ok||window.alert(`Failed: ${r.error}`),o.refresh()})};return(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsxs)(a.Button,{variant:"outline",size:"sm",disabled:i,className:"hover:border-[var(--red-line)] hover:bg-[var(--red-soft)] hover:text-[var(--red)]",onClick:()=>d("n"),children:[(0,t.jsx)(n.Icons.x,{}),"Deny"]}),(0,t.jsxs)(a.Button,{size:"sm",disabled:i,onClick:()=>d("y"),children:[(0,t.jsx)(n.Icons.check,{}),"Approve"]})]})}],88451)},95141,e=>{"use strict";var t=e.i(1262),r=e.i(54129),s=e.i(65232),n=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:a,children:o}){return(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{className:"anim-fade fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-[rgba(20,24,30,.42)] p-6 backdrop-blur-[2px]",onClick:e,children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,s.cn)("anim-pop relative m-auto w-full max-w-[500px] rounded-2xl border border-border bg-card shadow-[0_40px_80px_-30px_rgba(20,24,30,.5)]",a),onClick:e=>e.stopPropagation(),children:[o,(0,t.jsx)("button",{className:"absolute right-4 top-4 grid h-7 w-7 cursor-pointer place-items-center rounded-md border-0 bg-transparent text-[#a4a9b0] transition-colors hover:bg-secondary hover:text-foreground",onClick:e,"aria-label":"Close",children:(0,t.jsx)(n.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("px-5 py-4",e),...r})},"DialogDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("mt-1 font-mono text-xs text-muted-foreground",e),...r})},"DialogFooter",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",e),...r})},"DialogHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",e),...r})},"DialogIcon",0,function({children:e}){return(0,t.jsx)("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-lg border border-[var(--green-line)] bg-accent text-primary [&_svg]:size-[17px]",children:e})},"DialogTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("text-base font-semibold leading-tight tracking-tight",e),...r})}])},86892,30544,e=>{"use strict";var t=e.i(1262),r=e.i(64595);let s={running:{label:"running",badgeClass:"badge-run"},paused:{label:"paused",badgeClass:"badge-pause"},stopped:{label:"stopped",badgeClass:"badge-stop"},creating:{label:"creating",badgeClass:"badge-create"},error:{label:"error",badgeClass:"badge-err"}};e.s(["StatusBadge",0,function({status:e}){let n=s[e]??s.stopped;return(0,t.jsxs)(r.Badge,{className:n.badgeClass,children:[(0,t.jsx)("span",{className:"badge-dot"}),n.label]})}],86892);var n=e.i(45971),a=e.i(54129),o=e.i(65232),l=e.i(69377),i=e.i(44344),c=e.i(9383);let d=(0,c.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",c.callServer,void 0,c.findSourceMapURL,"destroyBoxAction"),u=(0,c.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",c.callServer,void 0,c.findSourceMapURL,"pauseBoxAction"),x=(0,c.createServerReference)("6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb",c.callServer,void 0,c.findSourceMapURL,"renameBoxAction"),m=(0,c.createServerReference)("4071308a0e1675de302803bb969800c52d79f11e13",c.callServer,void 0,c.findSourceMapURL,"resumeBoxAction"),p=(0,c.createServerReference)("40e545c7dd69b4a1d410deb9c94101099961d3af7a",c.callServer,void 0,c.findSourceMapURL,"stopBoxAction");e.s(["BoxActions",0,function({box:e,size:r}){let s=(0,n.useRouter)(),[c,b]=(0,a.useTransition)(),h="running"===e.status,f="paused"===e.status,g="stopped"===e.status,j=e.id.startsWith("job:"),v="lg"===r,N=v?"sm":"icon-sm",S=(t,r,n)=>{t.stopPropagation(),(!n||window.confirm(n))&&b(async()=>{let t=await r(e.id);t.ok||window.alert(`Action failed: ${t.error}`),s.refresh()})};return 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}`),s.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)},49604,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Select",0,function({wrapperClassName:e,className:s,children:n,...a}){return(0,t.jsxs)("span",{className:(0,r.cn)("relative inline-flex",e),children:[(0,t.jsx)("select",{className:(0,r.cn)("h-9 w-full cursor-pointer appearance-none rounded-lg border border-input bg-card py-1 pl-3 pr-9 text-[13px] shadow-sm focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",s),...a,children:n}),(0,t.jsx)("svg",{className:"pointer-events-none absolute right-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:(0,t.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}])},8536,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Card",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...s})},"CardContent",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("p-5 pt-0",e),...s})},"CardDescription",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[12.5px] text-muted-foreground",e),...s})},"CardHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-1 p-5",e),...s})},"CardTitle",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...s})}])},3060,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Input",0,function({className:e,...s}){return(0,t.jsx)("input",{className:(0,r.cn)("flex h-10 w-full rounded-lg border border-input bg-card px-3 py-1 text-sm shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...s})}])},86184,e=>{"use strict";var t=e.i(1262),r=e.i(54129),s=e.i(69377),n=e.i(3060);function a({jobId:e,login:o}){let[l,i]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[u,x]=(0,r.useState)(null),m="exchanging"===o.phase,p=async()=>{let t=l.trim();if(t&&!c){d(!0),x(null);try{let r=await fetch(`/api/v1/jobs/${encodeURIComponent(e)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})});if(!r.ok){let e=await r.json().catch(()=>null);x(e?.error?.message??`request failed (${r.status})`);return}i("")}catch(e){x(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,t.jsx)("p",{className:"text-xs text-amber-100/80",children:"Your saved Claude login is expired. Open the sign-in page, approve access, then paste the code Claude shows you."}),o.url?(0,t.jsx)("a",{href:o.url,target:"_blank",rel:"noreferrer",className:"w-fit rounded-md bg-amber-500/20 px-2.5 py-1 text-xs font-medium text-amber-100 underline decoration-amber-400/50 underline-offset-2 hover:bg-amber-500/30",children:"Open Claude sign-in ↗"}):(0,t.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,t.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,t.jsx)(n.Input,{value:l,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&p()},placeholder:"Paste approval code",disabled:m,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(s.Button,{type:"button",onClick:()=>void p(),disabled:!l.trim()||c||m,children:m?"Verifying…":c?"Submitting…":"Submit"})]}),o.lastError?(0,t.jsx)("p",{className:"text-xs text-amber-300",children:o.lastError}):null,"error"===o.phase&&o.error?(0,t.jsx)("p",{className:"text-xs text-red-400",children:o.error}):null,u?(0,t.jsx)("p",{className:"text-xs text-red-400",children:u}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:s,onDone:n,onStatus:o,onLogin:l}){let[i,c]=(0,r.useState)([]),[d,u]=(0,r.useState)(null),x=(0,r.useRef)(null),m=(0,r.useRef)(n);m.current=n;let p=(0,r.useRef)(o);p.current=o;let b=(0,r.useRef)(l);return b.current=l,(0,r.useEffect)(()=>{p.current?.("streaming");let t=new EventSource(s??`/api/jobs/${encodeURIComponent(e)}/logs`);return t.addEventListener("log",e=>{let t=JSON.parse(e.data);c(e=>[...e,t])}),t.addEventListener("login",e=>{let t=JSON.parse(e.data);u(t),b.current?.(t)}),t.addEventListener("end",e=>{let r=JSON.parse(e.data);p.current?.(r.status),m.current?.(r.status),t.close()}),()=>t.close()},[e,s]),(0,r.useEffect)(()=>{let e=x.current;e&&(e.scrollTop=e.scrollHeight)},[i]),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[d&&"done"!==d.phase?(0,t.jsx)(a,{jobId:e,login:d}):null,(0,t.jsx)("pre",{ref:x,className:"max-h-[440px] min-h-[220px] overflow-auto whitespace-pre rounded-lg bg-[#16181c] p-3 font-mono text-[11.5px] leading-relaxed text-[#d6d9de]",children:0===i.length?"starting…":i.join("\n")})]})}])},33789,1485,e=>{"use strict";var t=e.i(1262),r=e.i(54129);e.s(["Ago",0,function({ms:e}){let[s,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>n(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:s?function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return t+"s ago";let r=Math.floor(t/60);if(r<60)return r+"m ago";let s=Math.floor(r/60);return s<24?s+"h ago":Math.floor(s/24)+"d ago"}(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:r}){return(0,t.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[e,(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),r??null]})}],1485)},9383,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={callServer:function(){return a.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var n in s)Object.defineProperty(r,n,{enumerable:!0,get:s[n]});let a=e.r(57855),o=e.r(61414),l=e.r(97615)},31758,e=>{"use strict";var t=e.i(1262),r=e.i(44344);e.s(["EmptyBox",0,function({children:e}){return(0,t.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-card px-5 py-9 text-center text-[13.5px] text-muted-foreground",children:[(0,t.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,t.jsx)(r.Icons.box,{className:"size-5"})}),e]})}])},23878,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Table",0,function({className:e,...s}){return(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...s})},"TableBody",0,function({className:e,...s}){return(0,t.jsx)("tbody",{className:(0,r.cn)("[&_tr:last-child]:border-0",e),...s})},"TableCell",0,function({className:e,...s}){return(0,t.jsx)("td",{className:(0,r.cn)("px-4 py-3 align-middle",e),...s})},"TableHead",0,function({className:e,...s}){return(0,t.jsx)("th",{className:(0,r.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",e),...s})},"TableHeader",0,function({className:e,...s}){return(0,t.jsx)("thead",{className:(0,r.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",e),...s})},"TableRow",0,function({className:e,...s}){return(0,t.jsx)("tr",{className:(0,r.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",e),...s})}])},22983,93268,66818,e=>{"use strict";var t=e.i(1262),r=e.i(45971),s=e.i(33789),n=e.i(44344),a=e.i(86892),o=e.i(8536),l=e.i(23878),i=e.i(30544);e.s(["BoxTable",0,function({boxes:e}){let c=(0,r.useRouter)();return(0,t.jsx)(o.Card,{className:"overflow-hidden",children:(0,t.jsxs)(l.Table,{children:[(0,t.jsx)(l.TableHeader,{children:(0,t.jsxs)(l.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(l.TableHead,{className:"w-[38%]",children:"Task"}),(0,t.jsx)(l.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,t.jsx)(l.TableHead,{className:"max-md:hidden",children:"Status"}),(0,t.jsx)(l.TableHead,{className:"text-right",children:"Actions"})]})}),(0,t.jsx)(l.TableBody,{children:e.map(e=>(0,t.jsxs)(l.TableRow,{className:"cursor-pointer",onClick:()=>c.push("/boxes/"+e.id),children:[(0,t.jsxs)(l.TableCell,{children:[(0,t.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:e.task}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.id," · ",e.host]})]}),(0,t.jsxs)(l.TableCell,{className:"max-md:hidden",children:[(0,t.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,t.jsx)(n.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.branch})]}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.agent," · ",(0,t.jsx)(s.Ago,{ms:e.lastActivity})]})]}),(0,t.jsx)(l.TableCell,{className:"max-md:hidden",children:(0,t.jsx)(a.StatusBadge,{status:e.status})}),(0,t.jsx)(l.TableCell,{className:"text-right",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(i.BoxActions,{box:e})})]},e.id))})]})})}],22983);var c=e.i(54129),d=e.i(64595),u=e.i(69377),x=e.i(95141),m=e.i(3060),p=e.i(49604),b=e.i(65232);function h({className:e,...r}){return(0,t.jsx)("textarea",{className:(0,b.cn)("flex min-h-[76px] w-full resize-y rounded-lg border border-input bg-card px-3 py-2 text-sm leading-normal shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...r})}var f=e.i(9383);let g=(0,f.createServerReference)("4070192706087364b8c7d220576a6f3e4d3e5c532b",f.callServer,void 0,f.findSourceMapURL,"createBoxAction"),j=(0,f.createServerReference)("40386bdce4d894a318a969412fa1299d2704ccdfb3",f.callServer,void 0,f.findSourceMapURL,"listBranchesAction");var v=e.i(96621),N=e.i(86184);let S=[{id:"docker",label:"Docker (local)",configured:!0}];function y({project:e,projects:s,onClose:a}){let o=(0,r.useRouter)(),{state:l}=(0,v.useStore)(),i=l.providers.length?l.providers:S,[d,f]=(0,c.useTransition)(),[C,B]=(0,c.useState)(e?.id??s[0]?.id??""),[R,I]=(0,c.useState)("claude"),[D,T]=(0,c.useState)("docker"),[A,L]=(0,c.useState)(""),[z,P]=(0,c.useState)(""),[E,U]=(0,c.useState)(""),[M,H]=(0,c.useState)(null),[O,F]=(0,c.useState)(!1),[$,_]=(0,c.useState)(!1),[J,K]=(0,c.useState)(null),[W,q]=(0,c.useState)(null),[V,Y]=(0,c.useState)("streaming"),[G,Q]=(0,c.useState)(null),[X,Z]=(0,c.useState)(null),[ee,et]=(0,c.useState)(!1),[er,es]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/v1/providers?freshness=1",{credentials:"same-origin"});if(!t.ok)return;let r=await t.json();if(e)return;let s={};for(let e of r.providers??[])s[e.id]={baseStatus:e.baseStatus,baseStaleReason:e.baseStaleReason,jobId:e.jobId};es(s)}catch{}})(),()=>{e=!0}},[]);let en=s.find(e=>e.id===C)??e,ea=D??"docker",eo=i.find(e=>e.id===ea),el=er?.[ea],ei=!!el&&(!!el.jobId||"unprepared"===el.baseStatus||"stale"===el.baseStatus);(0,c.useEffect)(()=>{if(!C||W)return;F(en?.needsSetup??!1),T("docker");let e=!1;return H(null),U(en?.currentBranch??""),j(C).then(t=>{if(e||!t.ok){e||t.ok||H([]);return}H(t.branches),t.current&&t.branches.includes(t.current)&&U(t.current)}),()=>{e=!0}},[C,W]);let ec=()=>{K(null);let e=el?.jobId;e?Z(e):f(async()=>{try{let e=await fetch(`/api/v1/providers/${encodeURIComponent(ea)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({})}),t=await e.json().catch(()=>null);if(!e.ok||!t?.jobId)return void K(t?.error?.message??`base image build request failed (${e.status})`);Z(t.jobId)}catch(e){K(e instanceof Error?e.message:String(e))}})},ed=()=>{K(null),f(async()=>{let e=await g({projectId:C,agent:R,provider:D,name:A.trim()||void 0,prompt:"none"===R?void 0:z.trim()||void 0,fromBranch:E.trim()&&E.trim()!==en?.currentBranch?E.trim():void 0,setupWizard:"none"!==R&&O});e.ok?(q(e.jobId),o.refresh()):K(e.error)})};return(0,t.jsxs)(x.Dialog,{onClose:a,className:W||X?"max-w-[900px]":"max-w-[560px]",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogIcon,{children:(0,t.jsx)(n.Icons.box,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x.DialogTitle,{children:!W&&X?"Building base image":"Create box"}),(0,t.jsx)(x.DialogDescription,{children:en?en.name:"Start a box in a project"})]}),W||X?(0,t.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,t.jsx)(w,{status:V,loginPhase:G})}):null]}),(0,t.jsx)(x.DialogBody,{className:"flex flex-col gap-4",children:W?(0,t.jsx)(N.JobLogStream,{jobId:W,onStatus:Y,onDone:()=>o.refresh(),onLogin:e=>Q(e?.phase??null)}):X?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["Building the ",eo?.label??ea," base image — one-time, can take several minutes. The box is created automatically when it finishes."]}),(0,t.jsx)(N.JobLogStream,{jobId:X,onStatus:Y,onDone:e=>{"done"===e?ed():K(`base image build ${e}`)}}),J?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:J}):null]}):(0,t.jsxs)(t.Fragment,{children:[e?null:(0,t.jsx)(k,{label:"Project",children:(0,t.jsxs)(p.Select,{value:C,onChange:e=>B(e.target.value),children:[0===s.length?(0,t.jsx)("option",{value:"",children:"No projects — add one first"}):null,s.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,t.jsx)(k,{label:"Provider",children:(0,t.jsx)(p.Select,{value:D,onChange:e=>T(e.target.value),children:i.map(e=>(0,t.jsxs)("option",{value:e.id,disabled:!e.configured,title:e.reason,children:[e.label,e.configured?"":" — not configured"]},e.id))})}),ei?(0,t.jsx)("p",{className:"-mt-2 font-mono text-xs text-amber-600 dark:text-amber-400",title:el?.baseStaleReason,children:el?.jobId?"A base-image build is already running — the box will be created when it finishes.":el?.baseStatus==="unprepared"?"First use of this provider: the base image will be downloaded or built first (can take 5–10 minutes).":"The base image is out of date and will be rebuilt first (can take 5–10 minutes)."}):null,(0,t.jsx)(k,{label:"Agent",children:(0,t.jsxs)(p.Select,{value:R,onChange:e=>I(e.target.value),children:[(0,t.jsx)("option",{value:"claude",children:"Claude"}),(0,t.jsx)("option",{value:"codex",children:"Codex"}),(0,t.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,t.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,t.jsx)(k,{label:"Name (optional)",children:(0,t.jsx)(m.Input,{value:A,onChange:e=>L(e.target.value),placeholder:"auto"})}),en?.needsSetup&&"none"!==R?(0,t.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",checked:O,onChange:e=>F(e.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"This project has no agentbox.yaml — the agent explores the repo and proposes one on its first turn."})]})]}):null,"none"===R?(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["The box is created and left running with no agent — attach later from a terminal or SSH (",(0,t.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>_(e=>!e),className:"flex cursor-pointer items-center gap-1.5 self-start text-xs font-medium text-secondary-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(n.Icons.chevR,{className:(0,b.cn)("size-3.5 transition-transform",$&&"rotate-90")}),"Advanced"]}),$?(0,t.jsxs)(t.Fragment,{children:[null===M?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsx)(p.Select,{value:"",disabled:!0,children:(0,t.jsx)("option",{value:"",children:"Loading branches…"})})}):M.length>0?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsxs)(p.Select,{value:E,onChange:e=>U(e.target.value),children:[en?.currentBranch&&!M.includes(en.currentBranch)?(0,t.jsxs)("option",{value:"",children:[en.currentBranch," (current)"]}):null,M.map(e=>(0,t.jsxs)("option",{value:e,children:[e,e===en?.currentBranch?" (current)":""]},e))]})}):null,"none"!==R?(0,t.jsx)(k,{label:"Initial prompt (optional)",children:(0,t.jsx)(h,{value:z,onChange:e=>P(e.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),J?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:J}):null]})}),(0,t.jsx)(x.DialogFooter,{children:W||X?(0,t.jsxs)(t.Fragment,{children:["streaming"===V?(0,t.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:W?"The box + agent start in the background — you can close this.":"Keep this open — the box is created when the build finishes."}):null,(0,t.jsx)(u.Button,{onClick:a,children:"Close"})]}):ee?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",title:el?.baseStaleReason,children:["The ",eo?.label??ea," base image is out of date."]}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>et(!1),disabled:d,children:"Cancel"}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>{et(!1),ed()},disabled:d,children:"Use existing image"}),(0,t.jsx)(u.Button,{onClick:()=>{et(!1),ec()},disabled:d,children:"Rebuild & create"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Button,{variant:"outline",onClick:a,disabled:d,children:"Cancel"}),(0,t.jsx)(u.Button,{onClick:()=>{(K(null),C)?ei?"docker"===ea||el?.baseStatus!=="stale"||el.jobId?ec():et(!0):ed():K("pick a project")},disabled:d||!C,children:d?"Starting…":"Create box"})]})})]})}function w({status:e,loginPhase:r}){return"done"===e?(0,t.jsxs)(d.Badge,{className:"badge-run",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===e||"error"===e||"cancelled"===e?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===r?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===r||"starting"===r||"exchanging"===r?(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Working…"]})}function k({label:e,children:r}){return(0,t.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:e}),r]})}e.s(["CreateBoxButton",0,function({project:e,projects:r,variant:s,size:a,className:o}){let[l,i]=(0,c.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.Button,{variant:s,size:a,className:o,onClick:()=>i(!0),children:[(0,t.jsx)(n.Icons.plus,{}),"Create box"]}),l?(0,t.jsx)(y,{project:e,projects:r??(e?[e]:[]),onClose:()=>i(!1)}):null]})}],93268);let C=(0,f.createServerReference)("40c7856bd78dddab224344045df78d51620e411335",f.callServer,void 0,f.findSourceMapURL,"removeProjectAction");e.s(["DeleteProjectButton",0,function({project:e,size:s,className:a,redirectHome:o}){let l=(0,r.useRouter)(),[i,d]=(0,c.useTransition)();return(0,t.jsxs)(u.Button,{variant:"destructive",size:s,className:a,title:"Delete project",disabled:i,onClick:t=>{t.stopPropagation(),t.preventDefault(),window.confirm(`Remove project "${e.name}" from the hub? Its folder and files are NOT deleted — this only unregisters it (and any hub-set project settings). This cannot be undone.`)&&d(async()=>{let t=await C(e.id);t.ok?o?l.push("/"):l.refresh():window.alert(`Delete failed: ${t.error}`)})},children:[(0,t.jsx)(n.Icons.trash,{}),"Delete"]})}],66818)},87340,e=>{"use strict";var t=e.i(1262),r=e.i(51096),s=e.i(44344),n=e.i(96621),a=e.i(88451);function o(){let{state:e,box:o}=(0,n.useStore)();if(0===e.approvals.length)return null;let l=[...e.approvals].sort((e,t)=>e.createdAt-t.createdAt),i=l[0],c=o(i.boxId);return(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-3 rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)] p-4",children:[(0,t.jsx)(s.Icons.shield,{className:"mt-0.5 size-4 flex-none text-[var(--amber)]"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[c?(0,t.jsx)(r.default,{className:"text-[13.5px] font-semibold hover:text-[var(--green-ink)]",href:"/boxes/"+c.id,children:c.task}):(0,t.jsx)("span",{className:"text-[13.5px] font-semibold",children:i.boxId}),(0,t.jsx)("span",{className:"truncate font-mono text-[12.5px] text-secondary-foreground",children:i.command??i.message})]}),i.detail?(0,t.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:i.detail}):null,i.cwd?(0,t.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:i.cwd}):null]}),(0,t.jsxs)("div",{className:"flex flex-none items-center gap-3",children:[l.length>1?(0,t.jsxs)("div",{className:"hidden items-center gap-2 sm:flex",children:[(0,t.jsxs)("span",{className:"font-mono text-[11.5px] text-[var(--amber)]",children:[l.length," pending"]}),(0,t.jsx)(r.default,{className:"font-mono text-[11.5px] text-muted-foreground hover:text-[var(--green-ink)]",href:"/approvals",children:"View all"})]}):null,(0,t.jsx)(a.ApprovalActions,{id:i.id})]})]})}var l=e.i(45971),i=e.i(54129),c=e.i(69377),d=e.i(95141),u=e.i(3060),x=e.i(9383);let m=(0,x.createServerReference)("4087bb6da1f4834ca146bcc8cb7c69295dbeda0bdc",x.callServer,void 0,x.findSourceMapURL,"addProjectAction"),p=(0,x.createServerReference)("40942714d29a270a6816a39cd419b4f09f50fc19b1",x.callServer,void 0,x.findSourceMapURL,"browseDirAction");function b(){let[e,r]=(0,i.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.Button,{onClick:()=>r(!0),children:[(0,t.jsx)(s.Icons.plus,{}),"New project"]}),e?(0,t.jsx)(h,{onClose:()=>r(!1)}):null]})}function h({onClose:e}){let r=(0,l.useRouter)(),[n,a]=(0,i.useTransition)(),[o,x]=(0,i.useState)(""),[b,f]=(0,i.useState)(null),[g,j]=(0,i.useState)([]),[v,N]=(0,i.useState)(!0),[S,y]=(0,i.useState)(null),w=(0,i.useCallback)(async e=>{N(!0),y(null);let t=await p(e);if(!t.ok){y(t.error),N(!1);return}x(t.path),f(t.parent),j(t.entries),N(!1)},[]);return(0,i.useEffect)(()=>{w()},[w]),(0,t.jsxs)(d.Dialog,{onClose:e,children:[(0,t.jsxs)(d.DialogHeader,{children:[(0,t.jsx)(d.DialogIcon,{children:(0,t.jsx)(s.Icons.folder,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.DialogTitle,{children:"Add project"}),(0,t.jsx)(d.DialogDescription,{children:"Pick a folder on this machine"})]})]}),(0,t.jsxs)(d.DialogBody,{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Button,{variant:"outline",className:"flex-none px-2.5",onClick:()=>void w(b??void 0),disabled:!b||v,title:"Up one level","aria-label":"Up one level",children:(0,t.jsx)(s.Icons.arrowUp,{})}),(0,t.jsx)(u.Input,{value:o,onChange:e=>x(e.target.value),placeholder:"/Users/you/Projects/my-app",className:"font-mono text-xs",onKeyDown:e=>{"Enter"===e.key&&w(o)}})]}),(0,t.jsx)("div",{className:"h-56 overflow-y-auto rounded-lg border border-border bg-background",children:v?(0,t.jsx)("div",{className:"px-3 py-2.5 font-mono text-xs text-muted-foreground",children:"Loading…"}):0===g.length?(0,t.jsx)("div",{className:"px-3 py-2.5 font-mono text-xs text-muted-foreground",children:"No subfolders here"}):g.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>void w(e.path),className:"flex w-full cursor-pointer items-center gap-2 border-0 border-b border-border/60 bg-transparent px-3 py-2 text-left text-[13px] transition-colors last:border-b-0 hover:bg-secondary",children:[(0,t.jsx)(s.Icons.folder,{className:"size-4 flex-none text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.name}),e.isProject?(0,t.jsx)("span",{className:"ml-auto flex-none rounded border border-[var(--green-line)] bg-accent px-1.5 py-px font-mono text-[10px] uppercase tracking-wide text-primary",children:"project"}):(0,t.jsx)(s.Icons.chevR,{className:"ml-auto size-3.5 flex-none text-[#a4a9b0]"})]},e.path))}),S?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:S}):null]}),(0,t.jsxs)(d.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:e,disabled:n,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:()=>{y(null);let t=o.trim();t?a(async()=>{let s=await m(t);s.ok?(r.refresh(),e()):y(s.error)}):y("choose a folder")},disabled:n||v,children:n?"Adding…":"Add this folder"})]})]})}var f=e.i(22983),g=e.i(93268),j=e.i(66818),v=e.i(31758),N=e.i(1485);e.s(["default",0,function(){let{state:e,boxesFor:a}=(0,n.useStore)(),l=e.projects.map(e=>({p:e,boxes:a(e.id)})).sort((e,t)=>(e.boxes.length>0?0:1)-(t.boxes.length>0?0:1)),i=e.boxes.filter(e=>"running"===e.status).length;return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,t.jsx)(o,{}),(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Boxes"}),(0,t.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:i})," running across"," ",(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:e.projects.length})," ","project",1===e.projects.length?"":"s"," on this machine."]})]}),(0,t.jsx)("div",{className:"ml-auto flex flex-none gap-2",children:(0,t.jsx)(b,{})})]}),(0,t.jsx)(N.SectionLabel,{children:"Projects"}),0===l.length?(0,t.jsxs)(v.EmptyBox,{children:[(0,t.jsx)("div",{children:"No projects on this machine yet."}),(0,t.jsx)("div",{className:"mt-1.5 font-mono text-xs text-muted-foreground",children:"Add one with “New project”, or run `agentbox create` in a folder."})]}):null,l.map(({p:e,boxes:n})=>(0,t.jsxs)("div",{className:"mb-7",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-1 pb-3",children:[(0,t.jsxs)(r.default,{className:"flex cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-[15px] font-semibold tracking-[-0.01em] text-foreground hover:text-[var(--green-ink)]",href:"/projects/"+e.id,children:[(0,t.jsx)("span",{className:"grid h-[22px] w-[22px] flex-none place-items-center rounded-md border border-[var(--green-line)] bg-accent text-primary",children:(0,t.jsx)(s.Icons.folder,{className:"size-[13px]"})}),e.name]}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.repo}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsxs)("span",{className:"font-mono text-[11.5px] text-[#a4a9b0]",children:[n.length," box",1===n.length?"":"es"]}),(0,t.jsx)(g.CreateBoxButton,{project:e,variant:"outline",size:"sm",className:"font-mono text-xs"}),0===n.length?(0,t.jsx)(j.DeleteProjectButton,{project:e,size:"sm",className:"font-mono text-xs"}):null]}),n.length?(0,t.jsx)(f.BoxTable,{boxes:n}):(0,t.jsx)(v.EmptyBox,{children:(0,t.jsxs)("div",{children:["No boxes in ",(0,t.jsx)("b",{className:"font-semibold text-secondary-foreground",children:e.name})," yet."]})})]},e.id))]})}],87340)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33789,1485,e=>{"use strict";var r=e.i(1262),t=e.i(54129);e.s(["Ago",0,function({ms:e}){let[n,s]=(0,t.useState)(!1);return(0,t.useEffect)(()=>s(!0),[]),(0,r.jsx)("span",{suppressHydrationWarning:!0,children:n?function(e){let r=Math.floor((Date.now()-e)/1e3);if(r<60)return r+"s ago";let t=Math.floor(r/60);if(t<60)return t+"m ago";let n=Math.floor(t/60);return n<24?n+"h ago":Math.floor(n/24)+"d ago"}(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:t}){return(0,r.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,r.jsx)("span",{className:"h-px flex-1 bg-border"}),t??null]})}],1485)},9383,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={callServer:function(){return a.callServer},createServerReference:function(){return o.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var s in n)Object.defineProperty(t,s,{enumerable:!0,get:n[s]});let a=e.r(57855),i=e.r(61414),o=e.r(97615)},31758,e=>{"use strict";var r=e.i(1262),t=e.i(44344);e.s(["EmptyBox",0,function({children:e}){return(0,r.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,r.jsx)("div",{className:"mx-auto mb-3 grid h-10 w-10 place-items-center rounded-lg border border-border text-[#a4a9b0]",children:(0,r.jsx)(t.Icons.box,{className:"size-5"})}),e]})}])},88451,e=>{"use strict";var r=e.i(1262),t=e.i(45971),n=e.i(54129),s=e.i(44344),a=e.i(69377),i=e.i(9383);let o=(0,i.createServerReference)("60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",i.callServer,void 0,i.findSourceMapURL,"answerApprovalAction");e.s(["ApprovalActions",0,function({id:e}){let i=(0,t.useRouter)(),[c,l]=(0,n.useTransition)(),d=r=>{l(async()=>{let t=await o(e,r);t.ok||window.alert(`Failed: ${t.error}`),i.refresh()})};return(0,r.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,r.jsxs)(a.Button,{variant:"outline",size:"sm",disabled:c,className:"hover:border-[var(--red-line)] hover:bg-[var(--red-soft)] hover:text-[var(--red)]",onClick:()=>d("n"),children:[(0,r.jsx)(s.Icons.x,{}),"Deny"]}),(0,r.jsxs)(a.Button,{size:"sm",disabled:c,onClick:()=>d("y"),children:[(0,r.jsx)(s.Icons.check,{}),"Approve"]})]})}],88451)},16200,e=>{"use strict";var r=e.i(1262),t=e.i(65232);e.s(["Label",0,function({className:e,...n}){return(0,r.jsx)("label",{className:(0,t.cn)("mb-2 block text-[13px] font-medium leading-none",e),...n})}])},8536,e=>{"use strict";var r=e.i(1262),t=e.i(65232);e.s(["Card",0,function({className:e,...n}){return(0,r.jsx)("div",{className:(0,t.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...n})},"CardContent",0,function({className:e,...n}){return(0,r.jsx)("div",{className:(0,t.cn)("p-5 pt-0",e),...n})},"CardDescription",0,function({className:e,...n}){return(0,r.jsx)("div",{className:(0,t.cn)("text-[12.5px] text-muted-foreground",e),...n})},"CardHeader",0,function({className:e,...n}){return(0,r.jsx)("div",{className:(0,t.cn)("flex flex-col space-y-1 p-5",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,r.jsx)("div",{className:(0,t.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...n})}])},3060,e=>{"use strict";var r=e.i(1262),t=e.i(65232);e.s(["Input",0,function({className:e,...n}){return(0,r.jsx)("input",{className:(0,t.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),...n})}])},86892,30544,e=>{"use strict";var r=e.i(1262),t=e.i(64595);let n={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=n[e]??n.stopped;return(0,r.jsxs)(t.Badge,{className:s.badgeClass,children:[(0,r.jsx)("span",{className:"badge-dot"}),s.label]})}],86892);var s=e.i(45971),a=e.i(54129),i=e.i(65232),o=e.i(69377),c=e.i(44344),l=e.i(9383);let d=(0,l.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",l.callServer,void 0,l.findSourceMapURL,"destroyBoxAction"),u=(0,l.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",l.callServer,void 0,l.findSourceMapURL,"pauseBoxAction"),x=(0,l.createServerReference)("6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb",l.callServer,void 0,l.findSourceMapURL,"renameBoxAction"),b=(0,l.createServerReference)("4071308a0e1675de302803bb969800c52d79f11e13",l.callServer,void 0,l.findSourceMapURL,"resumeBoxAction"),p=(0,l.createServerReference)("40e545c7dd69b4a1d410deb9c94101099961d3af7a",l.callServer,void 0,l.findSourceMapURL,"stopBoxAction");e.s(["BoxActions",0,function({box:e,size:t}){let n=(0,s.useRouter)(),[l,f]=(0,a.useTransition)(),m="running"===e.status,v="paused"===e.status,g="stopped"===e.status,h=e.id.startsWith("job:"),j="lg"===t,y=j?"sm":"icon-sm",N=(r,t,s)=>{r.stopPropagation(),(!s||window.confirm(s))&&f(async()=>{let r=await t(e.id);r.ok||window.alert(`Action failed: ${r.error}`),n.refresh()})};return h?(0,r.jsx)("div",{className:(0,i.cn)("flex gap-1.5",j?"":"justify-end"),children:(0,r.jsxs)(o.Button,{variant:"destructive",size:y,title:"Dismiss",disabled:l||"error"!==e.status,onClick:r=>N(r,d,`Dismiss failed box ${e.id}? This clears the failed create.`),children:[(0,r.jsx)(c.Icons.trash,{}),j?"Dismiss":null]})}):(0,r.jsxs)("div",{className:(0,i.cn)("flex gap-1.5",j?"":"justify-end"),children:[v?(0,r.jsxs)(o.Button,{variant:j?"default":"outline",size:y,title:"Resume",disabled:l,className:j?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:e=>N(e,b),children:[(0,r.jsx)(c.Icons.play,{}),j?"Resume":null]}):(0,r.jsxs)(o.Button,{variant:"outline",size:y,disabled:l||!m,title:"Pause",className:j?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:e=>N(e,u),children:[(0,r.jsx)(c.Icons.pause,{}),j?"Pause":null]}),(0,r.jsxs)(o.Button,{variant:"outline",size:y,disabled:l||g,title:"Stop",onClick:e=>N(e,p),children:[(0,r.jsx)(c.Icons.stop,{}),j?"Stop":null]}),(0,r.jsxs)(o.Button,{variant:"outline",size:y,disabled:l,title:"Rename",onClick:r=>{r.stopPropagation();let t=window.prompt("Rename box (label only — leave blank to reset)",e.displayName??e.task);null!==t&&f(async()=>{let r=await x(e.id,t.trim());r.ok||window.alert(`Rename failed: ${r.error}`),n.refresh()})},children:[(0,r.jsx)(c.Icons.pencil,{}),j?"Rename":null]}),(0,r.jsxs)(o.Button,{variant:"destructive",size:y,title:"Destroy",disabled:l,onClick:r=>N(r,d,`Destroy box ${e.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,r.jsx)(c.Icons.trash,{}),j?"Destroy":null]})]})}],30544)},95141,e=>{"use strict";var r=e.i(1262),t=e.i(54129),n=e.i(65232),s=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:a,children:i}){return(0,t.useEffect)(()=>{let r=r=>{"Escape"===r.key&&e()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),(0,r.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,r.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,n.cn)("anim-pop relative m-auto w-full max-w-[500px] rounded-2xl border border-border bg-card shadow-[0_40px_80px_-30px_rgba(20,24,30,.5)]",a),onClick:e=>e.stopPropagation(),children:[i,(0,r.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,r.jsx)(s.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:e,...t}){return(0,r.jsx)("div",{className:(0,n.cn)("px-5 py-4",e),...t})},"DialogDescription",0,function({className:e,...t}){return(0,r.jsx)("div",{className:(0,n.cn)("mt-1 font-mono text-xs text-muted-foreground",e),...t})},"DialogFooter",0,function({className:e,...t}){return(0,r.jsx)("div",{className:(0,n.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",e),...t})},"DialogHeader",0,function({className:e,...t}){return(0,r.jsx)("div",{className:(0,n.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",e),...t})},"DialogIcon",0,function({children:e}){return(0,r.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,...t}){return(0,r.jsx)("div",{className:(0,n.cn)("text-base font-semibold leading-tight tracking-tight",e),...t})}])},49604,e=>{"use strict";var r=e.i(1262),t=e.i(65232);e.s(["Select",0,function({wrapperClassName:e,className:n,children:s,...a}){return(0,r.jsxs)("span",{className:(0,t.cn)("relative inline-flex",e),children:[(0,r.jsx)("select",{className:(0,t.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",n),...a,children:s}),(0,r.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,r.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}])},80922,35594,e=>{"use strict";var r=e.i(1262),t=e.i(51096),n=e.i(44344);e.s(["BackLink",0,function({to:e,children:s}){return(0,r.jsxs)(t.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,r.jsx)(n.Icons.arrowL,{className:"size-[13px]"}),s]})}],80922);var s=e.i(65232),a=e.i(8536);e.s(["Stat",0,function({k:e,v:t,mono:n,icon:a}){return(0,r.jsxs)("div",{className:"px-4.5 p-4",children:[(0,r.jsx)("div",{className:"mb-1.5 font-mono text-[10.5px] uppercase tracking-[.06em] text-[#a4a9b0]",children:e}),(0,r.jsxs)("div",{className:(0,s.cn)("flex items-center gap-2 font-semibold tracking-[-0.01em]",n?"font-mono text-sm font-medium":"text-base"),children:[a?(0,r.jsx)(a,{className:"size-[15px] text-muted-foreground"}):null,t]})]})},"StatGrid",0,function({children:e}){return(0,r.jsx)(a.Card,{className:"grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] divide-x divide-border/60 overflow-hidden",children:e})}],35594)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33789,1485,e=>{"use strict";var t=e.i(1262),s=e.i(54129);e.s(["Ago",0,function({ms:e}){let[a,n]=(0,s.useState)(!1);return(0,s.useEffect)(()=>n(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:a?function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return t+"s ago";let s=Math.floor(t/60);if(s<60)return s+"m ago";let a=Math.floor(s/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:s}){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"}),s??null]})}],1485)},8536,e=>{"use strict";var t=e.i(1262),s=e.i(65232);e.s(["Card",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.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,s.cn)("p-5 pt-0",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("text-[12.5px] text-muted-foreground",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("flex flex-col space-y-1 p-5",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...a})}])},3060,e=>{"use strict";var t=e.i(1262),s=e.i(65232);e.s(["Input",0,function({className:e,...a}){return(0,t.jsx)("input",{className:(0,s.cn)("flex h-10 w-full rounded-lg border border-input bg-card px-3 py-1 text-sm shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...a})}])},86184,e=>{"use strict";var t=e.i(1262),s=e.i(54129),a=e.i(69377),n=e.i(3060);function r({jobId:e,login:l}){let[i,o]=(0,s.useState)(""),[d,c]=(0,s.useState)(!1),[x,u]=(0,s.useState)(null),p="exchanging"===l.phase,m=async()=>{let t=i.trim();if(t&&!d){c(!0),u(null);try{let s=await fetch(`/api/v1/jobs/${encodeURIComponent(e)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})});if(!s.ok){let e=await s.json().catch(()=>null);u(e?.error?.message??`request failed (${s.status})`);return}o("")}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!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."}),l.url?(0,t.jsx)("a",{href:l.url,target:"_blank",rel:"noreferrer",className:"w-fit rounded-md bg-amber-500/20 px-2.5 py-1 text-xs font-medium text-amber-100 underline decoration-amber-400/50 underline-offset-2 hover:bg-amber-500/30",children:"Open Claude sign-in ↗"}):(0,t.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,t.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,t.jsx)(n.Input,{value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&m()},placeholder:"Paste approval code",disabled:p,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(a.Button,{type:"button",onClick:()=>void m(),disabled:!i.trim()||d||p,children:p?"Verifying…":d?"Submitting…":"Submit"})]}),l.lastError?(0,t.jsx)("p",{className:"text-xs text-amber-300",children:l.lastError}):null,"error"===l.phase&&l.error?(0,t.jsx)("p",{className:"text-xs text-red-400",children:l.error}):null,x?(0,t.jsx)("p",{className:"text-xs text-red-400",children:x}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:a,onDone:n,onStatus:l,onLogin:i}){let[o,d]=(0,s.useState)([]),[c,x]=(0,s.useState)(null),u=(0,s.useRef)(null),p=(0,s.useRef)(n);p.current=n;let m=(0,s.useRef)(l);m.current=l;let h=(0,s.useRef)(i);return h.current=i,(0,s.useEffect)(()=>{m.current?.("streaming");let t=new EventSource(a??`/api/jobs/${encodeURIComponent(e)}/logs`);return t.addEventListener("log",e=>{let t=JSON.parse(e.data);d(e=>[...e,t])}),t.addEventListener("login",e=>{let t=JSON.parse(e.data);x(t),h.current?.(t)}),t.addEventListener("end",e=>{let s=JSON.parse(e.data);m.current?.(s.status),p.current?.(s.status),t.close()}),()=>t.close()},[e,a]),(0,s.useEffect)(()=>{let e=u.current;e&&(e.scrollTop=e.scrollHeight)},[o]),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[c&&"done"!==c.phase?(0,t.jsx)(r,{jobId:e,login:c}):null,(0,t.jsx)("pre",{ref:u,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===o.length?"starting…":o.join("\n")})]})}])},50557,e=>{"use strict";var t=e.i(1262),s=e.i(54129),a=e.i(33789),n=e.i(44344),r=e.i(64595),l=e.i(8536),i=e.i(65232);function o({className:e,...s}){return(0,t.jsx)("div",{className:(0,i.cn)("h-px w-full shrink-0 bg-border",e),...s})}var d=e.i(96621),c=e.i(1485),x=e.i(45971),u=e.i(69377),p=e.i(3060),m=e.i(86184);let h={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}],digitalocean:[{key:"token",label:"API token",placeholder:"personal access token (read+write)"}]};function f(){let{state:e}=(0,d.useStore)(),[a,n]=(0,s.useState)({});return(0,s.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/v1/providers?freshness=1",{credentials:"same-origin"});if(!t.ok)return;let s=await t.json();if(e)return;let a={};for(let e of s.providers??[])a[e.id]={baseStatus:e.baseStatus,baseStaleReason:e.baseStaleReason};n(a)}catch{}})(),()=>{e=!0}},[e.providers]),(0,t.jsx)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:e.providers.map(e=>(0,t.jsx)(g,{provider:{...e,...a[e.id]}},e.id))})}function g({provider:e}){var a;let l=(0,x.useRouter)(),o=h[e.id]??[],d=new Set(o.filter(e=>!e.optional).map(e=>e.key)),[c,f]=(0,s.useState)({}),[b,j]=(0,s.useState)(()=>e.hasCredentials?Object.fromEntries(o.filter(e=>!e.optional).map(e=>[e.key,!0])):{}),[v,N]=(0,s.useState)(!1),[y,k]=(0,s.useState)(null),[S,w]=(0,s.useState)(!e.hasCredentials&&o.length>0),[C,I]=(0,s.useState)(e.jobId??null),[A,B]=(0,s.useState)(!1),[E,R]=(0,s.useState)(null),O=async()=>{N(!0),k(null);try{let t={};for(let e of o){if(b[e.key])continue;let s=(c[e.key]??"").trim();s&&(t[e.key]=s)}let s=await fetch(`/api/v1/providers/${encodeURIComponent(e.id)}/credentials`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)});if(!s.ok){let e=await s.json().catch(()=>null);k(e?.error?.message??`request failed (${s.status})`);return}f({}),j(Object.fromEntries([...d].map(e=>[e,!0]))),w(!1),l.refresh()}catch(e){k(e instanceof Error?e.message:String(e))}finally{N(!1)}},P=async()=>{B(!0),R(null);try{let t=await fetch(`/api/v1/providers/${encodeURIComponent(e.id)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(e.configured?{force:!0}:{})}),s=await t.json().catch(()=>null);if(!t.ok||!s?.jobId)return void R(s?.error?.message??`request failed (${t.status})`);I(s.jobId)}catch(e){R(e instanceof Error?e.message:String(e))}finally{B(!1)}},z="docker"===e.id||e.hasCredentials,L=o.length>0;return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 px-5",children:[(0,t.jsxs)("div",{className:(0,i.cn)("flex items-center gap-3",L&&"cursor-pointer"),onClick:L?()=>w(e=>!e):void 0,children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[e.label,(a=e).configured?"stale"===a.baseStatus?(0,t.jsx)(r.Badge,{className:"badge-warn gap-1.5 normal-case",title:a.baseStaleReason,children:"stale — re-bake"}):"unprepared"===a.baseStatus?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,t.jsxs)(r.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,t.jsx)("span",{className:"badge-dot"}),"ready"]}):a.hasCredentials?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"needs credentials"})]}),e.reason?(0,t.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:e.reason}):null]}),(0,t.jsx)("div",{className:"flex flex-none items-center gap-2",onClick:e=>e.stopPropagation(),children:(0,t.jsxs)(u.Button,{type:"button",size:"sm",variant:e.configured?"outline":"default",disabled:!z||A||!!C,onClick:()=>void P(),title:z?void 0:"Add credentials first",children:[(0,t.jsx)(n.Icons.refresh,{className:"size-3.5"}),C?"Baking…":A?"Starting…":e.configured?"Re-bake":"Bake image"]})}),L?(0,t.jsx)(n.Icons.chevR,{className:(0,i.cn)("size-4 flex-none text-muted-foreground transition-transform",S&&"rotate-90")}):(0,t.jsx)("span",{className:"size-4 flex-none","aria-hidden":!0})]}),S&&o.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border/70 bg-card/50 p-3",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-[11.5px] font-medium text-muted-foreground",children:[e.label,e.optional?" (optional)":""]}),(0,t.jsx)(p.Input,{type:"password",autoComplete:"off",value:b[e.key]?"••••••••••••":c[e.key]??"",placeholder:e.placeholder,onFocus:()=>{b[e.key]&&(j(t=>({...t,[e.key]:!1})),f(t=>({...t,[e.key]:""})))},onBlur:()=>{d.has(e.key)&&!(c[e.key]??"").trim()&&j(t=>({...t,[e.key]:!0}))},onChange:t=>f(s=>({...s,[e.key]:t.target.value})),className:"font-mono text-xs"})]},e.key)),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)(u.Button,{type:"button",size:"sm",disabled:v,onClick:()=>void O(),children:v?"Saving…":"Save credentials"}),y?(0,t.jsx)("span",{className:"text-xs text-red-400",children:y}):null]})]}):null,E?(0,t.jsx)("div",{className:"text-xs text-red-400",children:E}):null,C?(0,t.jsx)(m.JobLogStream,{jobId:C,endpoint:`/api/v1/jobs/${encodeURIComponent(C)}/logs`,onDone:()=>{I(null),l.refresh()}}):null]})}e.s(["default",0,function(){let{state:e}=(0,d.useStore)(),x=e.github,[u,p]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=!0;return fetch("/api/v1/health",{credentials:"same-origin"}).then(e=>e.ok?e.json():null).then(t=>{e&&t?.version&&p(t.version)}).catch(()=>{}),()=>{e=!1}},[]),(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)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Settings"}),(0,t.jsx)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:"Providers, GitHub access & hub configuration."}),(0,t.jsx)(c.SectionLabel,{right:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:"credentials & base images"}),children:"Sandbox providers"}),(0,t.jsx)(f,{}),(0,t.jsx)(c.SectionLabel,{children:"GitHub App"}),x.available?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Card,{className:"overflow-hidden",children:(0,t.jsxs)("div",{className:"flex items-center gap-4 p-5",children:[(0,t.jsx)("span",{className:"grid h-11 w-11 flex-none place-items-center rounded-xl bg-foreground text-background",children:(0,t.jsx)(n.Icons.github,{className:"size-6"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[14.5px] font-semibold",children:[x.appName,x.installed?(0,t.jsxs)(r.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,t.jsx)("span",{className:"badge-dot"}),"installed"]}):null]}),(0,t.jsx)("div",{className:"mt-0.5 font-mono text-[12.5px] text-muted-foreground",children:x.installed?`@${x.account}`:"Not installed"})]})]})}),(0,t.jsx)(c.SectionLabel,{right:(0,t.jsxs)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:[x.repos.length," repos"]}),children:"Authorized repositories"}),(0,t.jsx)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:x.repos.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3",children:[(0,t.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,t.jsx)(n.Icons.repo,{className:"size-[15px]"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block font-mono text-[13px] font-medium",children:e.full}),(0,t.jsxs)("span",{className:"mt-0.5 flex items-center gap-3 font-mono text-[11.5px] text-muted-foreground",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(n.LangDot,{lang:e.lang}),e.lang]}),(0,t.jsxs)("span",{children:["updated ",(0,t.jsx)(a.Ago,{ms:e.pushedAt})]}),(0,t.jsx)(r.Badge,{className:(0,i.cn)("px-1.5 py-0 text-[10px] uppercase tracking-[.03em]",e.private?"":"border-[var(--green-line)] text-primary"),children:e.private?"private":"public"})]})]})]},e.id))})]}):(0,t.jsxs)(l.Card,{className:"overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 p-5",children:[(0,t.jsx)("span",{className:"grid h-11 w-11 flex-none place-items-center rounded-xl bg-secondary text-muted-foreground",children:(0,t.jsx)(n.Icons.github,{className:"size-6"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[14.5px] font-semibold",children:["GitHub App",(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"not available"})]}),(0,t.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,t.jsx)(o,{}),(0,t.jsxs)("div",{className:"flex items-start gap-3 p-4 px-5 text-[12.5px] text-muted-foreground",children:[(0,t.jsx)(n.Icons.shield,{className:"mt-0.5 size-[15px] flex-none text-primary"}),(0,t.jsx)("span",{children:"Available when the hub runs in a hosted profile (hetzner or vercel)."})]})]}),(0,t.jsxs)("div",{className:"mt-10 text-center font-mono text-[11px] text-muted-foreground",children:["AgentBox ",u??"…"]})]})}],50557)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86892,30544,e=>{"use strict";var t=e.i(1262),r=e.i(64595);let a={running:{label:"running",badgeClass:"badge-run"},paused:{label:"paused",badgeClass:"badge-pause"},stopped:{label:"stopped",badgeClass:"badge-stop"},creating:{label:"creating",badgeClass:"badge-create"},error:{label:"error",badgeClass:"badge-err"}};e.s(["StatusBadge",0,function({status:e}){let 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),i=e.i(69377),l=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"),b=(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,p]=(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))&&p(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)(i.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)(l.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)(i.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)(l.Icons.play,{}),v?"Resume":null]}):(0,t.jsxs)(i.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)(l.Icons.pause,{}),v?"Pause":null]}),(0,t.jsxs)(i.Button,{variant:"outline",size:N,disabled:c||g,title:"Stop",onClick:e=>S(e,b),children:[(0,t.jsx)(l.Icons.stop,{}),v?"Stop":null]}),(0,t.jsxs)(i.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&&p(async()=>{let t=await x(e.id,r.trim());t.ok||window.alert(`Rename failed: ${t.error}`),a.refresh()})},children:[(0,t.jsx)(l.Icons.pencil,{}),v?"Rename":null]}),(0,t.jsxs)(i.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)(l.Icons.trash,{}),v?"Destroy":null]})]})}],30544)},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})}])},49604,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Select",0,function({wrapperClassName:e,className:a,children:s,...n}){return(0,t.jsxs)("span",{className:(0,r.cn)("relative inline-flex",e),children:[(0,t.jsx)("select",{className:(0,r.cn)("h-9 w-full cursor-pointer appearance-none rounded-lg border border-input bg-card py-1 pl-3 pr-9 text-[13px] shadow-sm focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",a),...n,children:s}),(0,t.jsx)("svg",{className:"pointer-events-none absolute right-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:(0,t.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}])},80922,35594,e=>{"use strict";var t=e.i(1262),r=e.i(51096),a=e.i(44344);e.s(["BackLink",0,function({to:e,children: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})}])},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[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[u,x]=(0,r.useState)(null),m="exchanging"===o.phase,b=async()=>{let t=i.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}l("")}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:i,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&b()},placeholder:"Paste approval code",disabled:m,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(a.Button,{type:"button",onClick:()=>void b(),disabled:!i.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:i}){let[l,c]=(0,r.useState)([]),[d,u]=(0,r.useState)(null),x=(0,r.useRef)(null),m=(0,r.useRef)(s);m.current=s;let b=(0,r.useRef)(o);b.current=o;let p=(0,r.useRef)(i);return p.current=i,(0,r.useEffect)(()=>{b.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),p.current?.(t)}),t.addEventListener("end",e=>{let r=JSON.parse(e.data);b.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)},[l]),(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===l.length?"starting…":l.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 i.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),i=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),i=e.i(23878),l=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)(i.Table,{children:[(0,t.jsx)(i.TableHeader,{children:(0,t.jsxs)(i.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(i.TableHead,{className:"w-[38%]",children:"Task"}),(0,t.jsx)(i.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,t.jsx)(i.TableHead,{className:"max-md:hidden",children:"Status"}),(0,t.jsx)(i.TableHead,{className:"text-right",children:"Actions"})]})}),(0,t.jsx)(i.TableBody,{children:e.map(e=>(0,t.jsxs)(i.TableRow,{className:"cursor-pointer",onClick:()=>c.push("/boxes/"+e.id),children:[(0,t.jsxs)(i.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)(i.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)(i.TableCell,{className:"max-md:hidden",children:(0,t.jsx)(n.StatusBadge,{status:e.status})}),(0,t.jsx)(i.TableCell,{className:"text-right",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(l.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),b=e.i(49604),p=e.i(65232);function h({className:e,...r}){return(0,t.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",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:i}=(0,v.useStore)(),l=i.providers.length?i.providers:S,[d,f]=(0,c.useTransition)(),[C,B]=(0,c.useState)(e?.id??a[0]?.id??""),[R,T]=(0,c.useState)("claude"),[I,D]=(0,c.useState)("docker"),[L,A]=(0,c.useState)(""),[P,E]=(0,c.useState)(""),[z,U]=(0,c.useState)(""),[H,M]=(0,c.useState)(null),[O,$]=(0,c.useState)(!1),[F,_]=(0,c.useState)(!1),[J,W]=(0,c.useState)(null),[q,K]=(0,c.useState)(null),[G,V]=(0,c.useState)("streaming"),[Y,Q]=(0,c.useState)(null),[X,Z]=(0,c.useState)(null),[ee,et]=(0,c.useState)(!1),[er,ea]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/v1/providers?freshness=1",{credentials:"same-origin"});if(!t.ok)return;let r=await t.json();if(e)return;let a={};for(let e of r.providers??[])a[e.id]={baseStatus:e.baseStatus,baseStaleReason:e.baseStaleReason,jobId:e.jobId};ea(a)}catch{}})(),()=>{e=!0}},[]);let es=a.find(e=>e.id===C)??e,en=I??"docker",eo=l.find(e=>e.id===en),ei=er?.[en],el=!!ei&&(!!ei.jobId||"unprepared"===ei.baseStatus||"stale"===ei.baseStatus);(0,c.useEffect)(()=>{if(!C||q)return;$(es?.needsSetup??!1),D("docker");let e=!1;return M(null),U(es?.currentBranch??""),j(C).then(t=>{if(e||!t.ok){e||t.ok||M([]);return}M(t.branches),t.current&&t.branches.includes(t.current)&&U(t.current)}),()=>{e=!0}},[C,q]);let ec=()=>{W(null);let e=ei?.jobId;e?Z(e):f(async()=>{try{let e=await fetch(`/api/v1/providers/${encodeURIComponent(en)}/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 W(t?.error?.message??`base image build request failed (${e.status})`);Z(t.jobId)}catch(e){W(e instanceof Error?e.message:String(e))}})},ed=()=>{W(null),f(async()=>{let e=await g({projectId:C,agent:R,provider:I,name:L.trim()||void 0,prompt:"none"===R?void 0:P.trim()||void 0,fromBranch:z.trim()&&z.trim()!==es?.currentBranch?z.trim():void 0,setupWizard:"none"!==R&&O});e.ok?(K(e.jobId),o.refresh()):W(e.error)})};return(0,t.jsxs)(x.Dialog,{onClose:n,className:q||X?"max-w-[900px]":"max-w-[560px]",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogIcon,{children:(0,t.jsx)(s.Icons.box,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x.DialogTitle,{children:!q&&X?"Building base image":"Create box"}),(0,t.jsx)(x.DialogDescription,{children:es?es.name:"Start a box in a project"})]}),q||X?(0,t.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,t.jsx)(w,{status:G,loginPhase:Y})}):null]}),(0,t.jsx)(x.DialogBody,{className:"flex flex-col gap-4",children:q?(0,t.jsx)(N.JobLogStream,{jobId:q,onStatus:V,onDone:()=>o.refresh(),onLogin:e=>Q(e?.phase??null)}):X?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["Building the ",eo?.label??en," base image — one-time, can take several minutes. The box is created automatically when it finishes."]}),(0,t.jsx)(N.JobLogStream,{jobId:X,onStatus:V,onDone:e=>{"done"===e?ed():W(`base image build ${e}`)}}),J?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:J}):null]}):(0,t.jsxs)(t.Fragment,{children:[e?null:(0,t.jsx)(k,{label:"Project",children:(0,t.jsxs)(b.Select,{value:C,onChange:e=>B(e.target.value),children:[0===a.length?(0,t.jsx)("option",{value:"",children:"No projects — add one first"}):null,a.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,t.jsx)(k,{label:"Provider",children:(0,t.jsx)(b.Select,{value:I,onChange:e=>D(e.target.value),children:l.map(e=>(0,t.jsxs)("option",{value:e.id,disabled:!e.configured,title:e.reason,children:[e.label,e.configured?"":" — not configured"]},e.id))})}),el?(0,t.jsx)("p",{className:"-mt-2 font-mono text-xs text-amber-600 dark:text-amber-400",title:ei?.baseStaleReason,children:ei?.jobId?"A base-image build is already running — the box will be created when it finishes.":ei?.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)(b.Select,{value:R,onChange:e=>T(e.target.value),children:[(0,t.jsx)("option",{value:"claude",children:"Claude"}),(0,t.jsx)("option",{value:"codex",children:"Codex"}),(0,t.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,t.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,t.jsx)(k,{label:"Name (optional)",children:(0,t.jsx)(m.Input,{value:L,onChange:e=>A(e.target.value),placeholder:"auto"})}),es?.needsSetup&&"none"!==R?(0,t.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",checked:O,onChange:e=>$(e.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"This project has no agentbox.yaml — the agent explores the repo and proposes one on its first turn."})]})]}):null,"none"===R?(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["The box is created and left running with no agent — attach later from a terminal or SSH (",(0,t.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>_(e=>!e),className:"flex cursor-pointer items-center gap-1.5 self-start text-xs font-medium text-secondary-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(s.Icons.chevR,{className:(0,p.cn)("size-3.5 transition-transform",F&&"rotate-90")}),"Advanced"]}),F?(0,t.jsxs)(t.Fragment,{children:[null===H?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsx)(b.Select,{value:"",disabled:!0,children:(0,t.jsx)("option",{value:"",children:"Loading branches…"})})}):H.length>0?(0,t.jsx)(k,{label:"Base branch",children:(0,t.jsxs)(b.Select,{value:z,onChange:e=>U(e.target.value),children:[es?.currentBranch&&!H.includes(es.currentBranch)?(0,t.jsxs)("option",{value:"",children:[es.currentBranch," (current)"]}):null,H.map(e=>(0,t.jsxs)("option",{value:e,children:[e,e===es?.currentBranch?" (current)":""]},e))]})}):null,"none"!==R?(0,t.jsx)(k,{label:"Initial prompt (optional)",children:(0,t.jsx)(h,{value:P,onChange:e=>E(e.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),J?(0,t.jsx)("div",{className:"font-mono text-xs text-destructive",children:J}):null]})}),(0,t.jsx)(x.DialogFooter,{children:q||X?(0,t.jsxs)(t.Fragment,{children:["streaming"===G?(0,t.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:q?"The box + agent start in the background — you can close this.":"Keep this open — the box is created when the build finishes."}):null,(0,t.jsx)(u.Button,{onClick:n,children:"Close"})]}):ee?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",title:ei?.baseStaleReason,children:["The ",eo?.label??en," base image is out of date."]}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>et(!1),disabled:d,children:"Cancel"}),(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>{et(!1),ed()},disabled:d,children:"Use existing image"}),(0,t.jsx)(u.Button,{onClick:()=>{et(!1),ec()},disabled:d,children:"Rebuild & create"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Button,{variant:"outline",onClick:n,disabled:d,children:"Cancel"}),(0,t.jsx)(u.Button,{onClick:()=>{(W(null),C)?el?"docker"===en||ei?.baseStatus!=="stale"||ei.jobId?ec():et(!0):ed():W("pick a project")},disabled:d||!C,children:d?"Starting…":"Create box"})]})})]})}function w({status:e,loginPhase:r}){return"done"===e?(0,t.jsxs)(d.Badge,{className:"badge-run",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===e||"error"===e||"cancelled"===e?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===r?(0,t.jsxs)(d.Badge,{className:"badge-err",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===r||"starting"===r||"exchanging"===r?(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,t.jsxs)(d.Badge,{className:"badge-create",children:[(0,t.jsx)("span",{className:"badge-dot"}),"Working…"]})}function k({label:e,children:r}){return(0,t.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:e}),r]})}e.s(["CreateBoxButton",0,function({project:e,projects:r,variant:a,size:n,className:o}){let[i,l]=(0,c.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.Button,{variant:a,size:n,className:o,onClick:()=>l(!0),children:[(0,t.jsx)(s.Icons.plus,{}),"Create box"]}),i?(0,t.jsx)(y,{project:e,projects:r??(e?[e]:[]),onClose:()=>l(!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 i=(0,r.useRouter)(),[l,d]=(0,c.useTransition)();return(0,t.jsxs)(u.Button,{variant:"destructive",size:a,className:n,title:"Delete project",disabled:l,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?i.push("/"):i.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),i=e.i(22983),l=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:b}=(0,n.useStore)(),p=m(e);if(!p)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=b(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]"})}),p.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:p.repo})," · ",p.provider]})]}),(0,t.jsxs)("div",{className:"ml-auto flex flex-none gap-2 max-md:ml-0",children:[(0,t.jsx)(l.CreateBoxButton,{project:p}),0===h.length?(0,t.jsx)(c.DeleteProjectButton,{project:p,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:p.provider,mono:!0}),(0,t.jsx)(x.Stat,{k:"Created",v:(0,t.jsx)(a.Ago,{ms:p.createdAt}),mono:!0})]})}),(0,t.jsx)(u.SectionLabel,{children:"Boxes"}),h.length?(0,t.jsx)(i.BoxTable,{boxes:h}):(0,t.jsx)(d.EmptyBox,{children:(0,t.jsx)("div",{children:"No boxes yet."})})]})}])}]);
@@ -3,8 +3,8 @@ import {
3
3
  AUTH_DB_PATH,
4
4
  cookieSecure,
5
5
  hubProfile
6
- } from "./chunk-56YQBVN2.js";
7
- import "./chunk-EXQCBM5Q.js";
6
+ } from "./chunk-DZPQB2JZ.js";
7
+ import "./chunk-64WEKO34.js";
8
8
  import "./chunk-TZFWAJVB.js";
9
9
 
10
10
  // lib/auth.ts
@@ -7,8 +7,8 @@ import {
7
7
  authMode,
8
8
  cookieSecure,
9
9
  hubProfile
10
- } from "./chunk-56YQBVN2.js";
11
- import "./chunk-EXQCBM5Q.js";
10
+ } from "./chunk-DZPQB2JZ.js";
11
+ import "./chunk-64WEKO34.js";
12
12
  import "./chunk-TZFWAJVB.js";
13
13
  export {
14
14
  AUTH_DB_PATH,