@madarco/agentbox 0.22.1 → 0.22.2

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 (122) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/{_cloud-attach-YH2SU75S.js → _cloud-attach-Y5WZ7F53.js} +5 -5
  3. package/dist/{chunk-KBVD2UUQ.js → chunk-3KAWXDQ4.js} +3 -3
  4. package/dist/{chunk-YZXXBHWG.js → chunk-5DZTXHLQ.js} +3 -3
  5. package/dist/{chunk-O2NDZQHN.js → chunk-7HAGPF4X.js} +2 -2
  6. package/dist/{chunk-O67ZESNL.js → chunk-AYNGC4Z5.js} +4 -4
  7. package/dist/{chunk-GGWVTWJM.js → chunk-BMCT3LBE.js} +16 -13
  8. package/dist/chunk-BMCT3LBE.js.map +1 -0
  9. package/dist/{chunk-ALEYDWAO.js → chunk-ES2DDCAC.js} +303 -87
  10. package/dist/chunk-ES2DDCAC.js.map +1 -0
  11. package/dist/{chunk-VBSRJG53.js → chunk-QT3SHMLY.js} +9 -1
  12. package/dist/chunk-QT3SHMLY.js.map +1 -0
  13. package/dist/{chunk-CDEJ2GQK.js → chunk-S4OWE3UD.js} +4 -4
  14. package/dist/{chunk-W2FLHB54.js → chunk-V2NCCC2B.js} +2 -2
  15. package/dist/{dist-QBXEP4VY.js → dist-2BTJQUJS.js} +2 -2
  16. package/dist/{dist-LJHS4PTC.js → dist-AN5NUXA5.js} +6 -6
  17. package/dist/{dist-EJXUKIR7.js → dist-FNAGMTUI.js} +4 -4
  18. package/dist/{dist-YECTRVGD.js → dist-K5GASNBV.js} +6 -6
  19. package/dist/{dist-UR2DB2HT.js → dist-SJRMFVRV.js} +6 -6
  20. package/dist/{dist-QNV4H6NN.js → dist-VOVN64Y2.js} +6 -6
  21. package/dist/index.js +1108 -727
  22. package/dist/index.js.map +1 -1
  23. package/dist/{prepared-state-5FIGV4BE-BMUK63FD.js → prepared-state-5FIGV4BE-WPHOEDA6.js} +2 -2
  24. package/package.json +5 -5
  25. package/runtime/_shared/ctl.cjs +10 -0
  26. package/runtime/docker/packages/ctl/dist/bin.cjs +10 -0
  27. package/runtime/e2b/ctl.cjs +10 -0
  28. package/runtime/hetzner/ctl.cjs +10 -0
  29. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  30. package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +1 -0
  31. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  32. package/runtime/hub/apps/hub/.next/routes-manifest.json +8 -0
  33. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route/app-paths-manifest.json +3 -0
  34. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route/build-manifest.json +9 -0
  35. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route/server-reference-manifest.json +4 -0
  36. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js +9 -0
  37. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.map +5 -0
  38. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -0
  39. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route_client-reference-manifest.js +3 -0
  40. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  41. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/server-reference-manifest.json +12 -0
  42. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  43. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/server-reference-manifest.json +12 -0
  44. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  45. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/server-reference-manifest.json +12 -0
  46. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  47. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  48. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  49. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  50. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  51. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  52. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  53. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  54. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  55. package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +1 -0
  56. package/runtime/hub/apps/hub/.next/server/chunks/0m4a_kysely_dist_095p8vu._.js +1 -1
  57. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_rename_route_actions_0mf3a9p.js +3 -0
  58. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +1 -1
  59. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +1 -1
  60. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0szd4sh._.js +3 -0
  61. package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +14 -14
  62. package/runtime/hub/apps/hub/.next/server/chunks/_0lgs9kd._.js +3 -0
  63. package/runtime/hub/apps/hub/.next/server/chunks/ssr/044u_hub__next-internal_server_app_(dashboard)_projects_[id]_page_actions_15f56np.js +1 -1
  64. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_09gdzmo._.js +1 -1
  65. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ozyjt1._.js +1 -1
  66. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.js +1 -1
  67. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0tgpglr._.js +1 -1
  68. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_1laion6._.js +1 -1
  69. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_boxes_[id]_page_actions_0k7kgn2.js +1 -1
  70. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_page_actions_1t3u0xy.js +1 -1
  71. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_components_1z1p98f._.js +1 -1
  72. package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +1 -0
  73. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  74. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  75. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.js +1 -1
  76. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.json +24 -0
  77. package/runtime/hub/apps/hub/.next/static/chunks/2xc1sm79a6tsb.js +1 -0
  78. package/runtime/hub/apps/hub/.next/static/chunks/332lo0ac7l2wv.js +1 -0
  79. package/runtime/hub/apps/hub/.next/static/chunks/3gdqmzzl34ilu.js +1 -0
  80. package/runtime/hub/apps/hub/.next/static/chunks/44exu5uemf-ev.js +1 -0
  81. package/runtime/hub/apps/hub/{auth-YBXDRLHG.js → auth-675P3LQS.js} +2 -2
  82. package/runtime/hub/apps/hub/{auth-config-LJGI76HI.js → auth-config-AOBEKRZQ.js} +2 -2
  83. package/runtime/hub/apps/hub/{chunk-OBKLTPIR.js → chunk-56YQBVN2.js} +1 -1
  84. package/runtime/hub/apps/hub/{chunk-LJG4CEGS.js → chunk-5XQ3T3W2.js} +274 -84
  85. package/runtime/hub/apps/hub/{chunk-JDA7BPPN.js → chunk-673QOHSR.js} +3 -3
  86. package/runtime/hub/apps/hub/{chunk-V5KGFHCF.js → chunk-7J6ZFTT4.js} +2 -2
  87. package/runtime/hub/apps/hub/{chunk-AKLBSCSZ.js → chunk-EXQCBM5Q.js} +8 -0
  88. package/runtime/hub/apps/hub/{dist-GGM4BUKM.js → dist-EI54M5DP.js} +4 -4
  89. package/runtime/hub/apps/hub/{dist-ELOY2IUE.js → dist-GCALYJN7.js} +3 -3
  90. package/runtime/hub/apps/hub/{dist-FDBOJ74K.js → dist-K7WHNDZB.js} +4 -4
  91. package/runtime/hub/apps/hub/{dist-CM4YAQLI.js → dist-LYTWBTUL.js} +4 -4
  92. package/runtime/hub/apps/hub/{dist-BF54UNHK.js → dist-MOCUH2OC.js} +4 -4
  93. package/runtime/hub/apps/hub/{dist-IENF7YOD.js → dist-STQK5XM6.js} +1 -1
  94. package/runtime/hub/apps/hub/{hub-token-EW32VDIU.js → hub-token-2BZFBBW3.js} +2 -2
  95. package/runtime/hub/apps/hub/{prepared-state-5FIGV4BE-FIXKBF5A.js → prepared-state-5FIGV4BE-D2HJEY2L.js} +1 -1
  96. package/runtime/hub/apps/hub/server.js +57 -16
  97. package/runtime/relay/bin.cjs +10 -0
  98. package/runtime/vercel/ctl.cjs +10 -0
  99. package/dist/chunk-ALEYDWAO.js.map +0 -1
  100. package/dist/chunk-GGWVTWJM.js.map +0 -1
  101. package/dist/chunk-VBSRJG53.js.map +0 -1
  102. package/runtime/hub/apps/hub/.next/static/chunks/0lq354ziiwxxl.js +0 -1
  103. package/runtime/hub/apps/hub/.next/static/chunks/11vmjdy3390ik.js +0 -1
  104. package/runtime/hub/apps/hub/.next/static/chunks/1svigjdfotduh.js +0 -1
  105. package/runtime/hub/apps/hub/.next/static/chunks/2d5e6t-5j4etp.js +0 -1
  106. /package/dist/{_cloud-attach-YH2SU75S.js.map → _cloud-attach-Y5WZ7F53.js.map} +0 -0
  107. /package/dist/{chunk-KBVD2UUQ.js.map → chunk-3KAWXDQ4.js.map} +0 -0
  108. /package/dist/{chunk-YZXXBHWG.js.map → chunk-5DZTXHLQ.js.map} +0 -0
  109. /package/dist/{chunk-O2NDZQHN.js.map → chunk-7HAGPF4X.js.map} +0 -0
  110. /package/dist/{chunk-O67ZESNL.js.map → chunk-AYNGC4Z5.js.map} +0 -0
  111. /package/dist/{chunk-CDEJ2GQK.js.map → chunk-S4OWE3UD.js.map} +0 -0
  112. /package/dist/{chunk-W2FLHB54.js.map → chunk-V2NCCC2B.js.map} +0 -0
  113. /package/dist/{dist-EJXUKIR7.js.map → dist-2BTJQUJS.js.map} +0 -0
  114. /package/dist/{dist-LJHS4PTC.js.map → dist-AN5NUXA5.js.map} +0 -0
  115. /package/dist/{dist-QBXEP4VY.js.map → dist-FNAGMTUI.js.map} +0 -0
  116. /package/dist/{dist-QNV4H6NN.js.map → dist-K5GASNBV.js.map} +0 -0
  117. /package/dist/{dist-UR2DB2HT.js.map → dist-SJRMFVRV.js.map} +0 -0
  118. /package/dist/{dist-YECTRVGD.js.map → dist-VOVN64Y2.js.map} +0 -0
  119. /package/dist/{prepared-state-5FIGV4BE-BMUK63FD.js.map → prepared-state-5FIGV4BE-WPHOEDA6.js.map} +0 -0
  120. /package/runtime/hub/apps/hub/.next/static/{TpPTWVdZDxqrPlONtJcR5 → zT1paOSXMJpAPsZ1dFK2V}/_buildManifest.js +0 -0
  121. /package/runtime/hub/apps/hub/.next/static/{TpPTWVdZDxqrPlONtJcR5 → zT1paOSXMJpAPsZ1dFK2V}/_clientMiddlewareManifest.js +0 -0
  122. /package/runtime/hub/apps/hub/.next/static/{TpPTWVdZDxqrPlONtJcR5 → zT1paOSXMJpAPsZ1dFK2V}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88451,e=>{"use strict";var t=e.i(1262),r=e.i(45971),n=e.i(54129),s=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,n.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)(s.Icons.x,{}),"Deny"]}),(0,t.jsxs)(a.Button,{size:"sm",disabled:i,onClick:()=>d("y"),children:[(0,t.jsx)(s.Icons.check,{}),"Approve"]})]})}],88451)},95141,e=>{"use strict";var t=e.i(1262),r=e.i(54129),n=e.i(65232),s=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,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:[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,n.cn)("px-5 py-4",e),...r})},"DialogDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,n.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,n.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,n.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,n.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 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,t.jsxs)(r.Badge,{className:s.badgeClass,children:[(0,t.jsx)("span",{className:"badge-dot"}),s.label]})}],86892);var s=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"),x=(0,c.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",c.callServer,void 0,c.findSourceMapURL,"pauseBoxAction"),u=(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 n=(0,s.useRouter)(),[c,h]=(0,a.useTransition)(),f="running"===e.status,b="paused"===e.status,g="stopped"===e.status,j="lg"===r,v=j?"sm":"icon-sm",N=(t,r,s)=>{t.stopPropagation(),(!s||window.confirm(s))&&h(async()=>{let t=await r(e.id);t.ok||window.alert(`Action failed: ${t.error}`),n.refresh()})};return(0,t.jsxs)("div",{className:(0,o.cn)("flex gap-1.5",j?"":"justify-end"),children:[b?(0,t.jsxs)(l.Button,{variant:j?"default":"outline",size:v,title:"Resume",disabled:c,className:j?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:e=>N(e,m),children:[(0,t.jsx)(i.Icons.play,{}),j?"Resume":null]}):(0,t.jsxs)(l.Button,{variant:"outline",size:v,disabled:c||!f,title:"Pause",className:j?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:e=>N(e,x),children:[(0,t.jsx)(i.Icons.pause,{}),j?"Pause":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:v,disabled:c||g,title:"Stop",onClick:e=>N(e,p),children:[(0,t.jsx)(i.Icons.stop,{}),j?"Stop":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:v,disabled:c,title:"Rename",onClick:t=>{t.stopPropagation();let r=window.prompt("Rename box (label only — leave blank to reset)",e.displayName??e.task);null!==r&&h(async()=>{let t=await u(e.id,r.trim());t.ok||window.alert(`Rename failed: ${t.error}`),n.refresh()})},children:[(0,t.jsx)(i.Icons.pencil,{}),j?"Rename":null]}),(0,t.jsxs)(l.Button,{variant:"destructive",size:v,title:"Destroy",disabled:c,onClick:t=>N(t,d,`Destroy box ${e.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,t.jsx)(i.Icons.trash,{}),j?"Destroy":null]})]})}],30544)},49604,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Select",0,function({wrapperClassName:e,className:n,children:s,...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",n),...a,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"})})]})}])},8536,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Card",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,r.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...n})},"CardContent",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,r.cn)("p-5 pt-0",e),...n})},"CardDescription",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[12.5px] text-muted-foreground",e),...n})},"CardHeader",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-1 p-5",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,r.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...n})}])},3060,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Input",0,function({className:e,...n}){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),...n})}])},86184,e=>{"use strict";var t=e.i(1262),r=e.i(54129),n=e.i(69377),s=e.i(3060);function a({jobId:e,login:o}){let[l,i]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[x,u]=(0,r.useState)(null),m="exchanging"===o.phase,p=async()=>{let t=l.trim();if(t&&!c){d(!0),u(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);u(e?.error?.message??`request failed (${r.status})`);return}i("")}catch(e){u(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,t.jsx)("p",{className:"text-xs text-amber-100/80",children:"Your saved Claude login is expired. Open the sign-in page, approve access, then paste the code Claude shows you."}),o.url?(0,t.jsx)("a",{href:o.url,target:"_blank",rel:"noreferrer",className:"w-fit rounded-md bg-amber-500/20 px-2.5 py-1 text-xs font-medium text-amber-100 underline decoration-amber-400/50 underline-offset-2 hover:bg-amber-500/30",children:"Open Claude sign-in ↗"}):(0,t.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,t.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,t.jsx)(s.Input,{value:l,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&p()},placeholder:"Paste approval code",disabled:m,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(n.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,x?(0,t.jsx)("p",{className:"text-xs text-red-400",children:x}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:n,onDone:s,onStatus:o,onLogin:l}){let[i,c]=(0,r.useState)([]),[d,x]=(0,r.useState)(null),u=(0,r.useRef)(null),m=(0,r.useRef)(s);m.current=s;let p=(0,r.useRef)(o);p.current=o;let h=(0,r.useRef)(l);return h.current=l,(0,r.useEffect)(()=>{p.current?.("streaming");let t=new EventSource(n??`/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);x(t),h.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,n]),(0,r.useEffect)(()=>{let e=u.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: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===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[n,s]=(0,r.useState)(!1);return(0,r.useEffect)(()=>s(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:n?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 n=Math.floor(r/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: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 n={callServer:function(){return a.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});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,...n}){return(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...n})},"TableBody",0,function({className:e,...n}){return(0,t.jsx)("tbody",{className:(0,r.cn)("[&_tr:last-child]:border-0",e),...n})},"TableCell",0,function({className:e,...n}){return(0,t.jsx)("td",{className:(0,r.cn)("px-4 py-3 align-middle",e),...n})},"TableHead",0,function({className:e,...n}){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),...n})},"TableHeader",0,function({className:e,...n}){return(0,t.jsx)("thead",{className:(0,r.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",e),...n})},"TableRow",0,function({className:e,...n}){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),...n})}])},22983,93268,66818,e=>{"use strict";var t=e.i(1262),r=e.i(45971),n=e.i(33789),s=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)(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)(n.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),x=e.i(69377),u=e.i(95141),m=e.i(3060),p=e.i(49604),h=e.i(65232);function f({className:e,...r}){return(0,t.jsx)("textarea",{className:(0,h.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 b=e.i(9383);let g=(0,b.createServerReference)("4070192706087364b8c7d220576a6f3e4d3e5c532b",b.callServer,void 0,b.findSourceMapURL,"createBoxAction"),j=(0,b.createServerReference)("40386bdce4d894a318a969412fa1299d2704ccdfb3",b.callServer,void 0,b.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:n,onClose:a}){let o=(0,r.useRouter)(),{state:l}=(0,v.useStore)(),i=l.providers.length?l.providers:S,[d,b]=(0,c.useTransition)(),[C,B]=(0,c.useState)(e?.id??n[0]?.id??""),[R,D]=(0,c.useState)("claude"),[T,I]=(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=n.find(e=>e.id===C)??e;return(0,c.useEffect)(()=>{if(!C||W)return;F(X?.needsSetup??!1),I("docker");let e=!1;return H(null),U(X?.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]),(0,t.jsxs)(u.Dialog,{onClose:a,className:W?"max-w-[900px]":"max-w-[560px]",children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogIcon,{children:(0,t.jsx)(s.Icons.box,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.DialogTitle,{children:"Create box"}),(0,t.jsx)(u.DialogDescription,{children:X?X.name:"Start a box in a project"})]}),W?(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)(u.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)}):(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===n.length?(0,t.jsx)("option",{value:"",children:"No projects — add one first"}):null,n.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,t.jsx)(k,{label:"Provider",children:(0,t.jsx)(p.Select,{value:T,onChange:e=>I(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))})}),(0,t.jsx)(k,{label:"Agent",children:(0,t.jsxs)(p.Select,{value:R,onChange:e=>D(e.target.value),children:[(0,t.jsx)("option",{value:"claude",children:"Claude"}),(0,t.jsx)("option",{value:"codex",children:"Codex"}),(0,t.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,t.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,t.jsx)(k,{label:"Name (optional)",children:(0,t.jsx)(m.Input,{value:A,onChange:e=>L(e.target.value),placeholder:"auto"})}),X?.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)(s.Icons.chevR,{className:(0,h.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:[X?.currentBranch&&!M.includes(X.currentBranch)?(0,t.jsxs)("option",{value:"",children:[X.currentBranch," (current)"]}):null,M.map(e=>(0,t.jsxs)("option",{value:e,children:[e,e===X?.currentBranch?" (current)":""]},e))]})}):null,"none"!==R?(0,t.jsx)(k,{label:"Initial prompt (optional)",children:(0,t.jsx)(f,{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)(u.DialogFooter,{children:W?(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:"The box + agent start in the background — you can close this."}):null,(0,t.jsx)(x.Button,{onClick:a,children:"Close"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:a,disabled:d,children:"Cancel"}),(0,t.jsx)(x.Button,{onClick:()=>{(K(null),C)?b(async()=>{let e=await g({projectId:C,agent:R,provider:T,name:A.trim()||void 0,prompt:"none"===R?void 0:z.trim()||void 0,fromBranch:E.trim()&&E.trim()!==X?.currentBranch?E.trim():void 0,setupWizard:"none"!==R&&O});e.ok?(q(e.jobId),o.refresh()):K(e.error)}):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:n,size:a,className:o}){let[l,i]=(0,c.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(x.Button,{variant:n,size:a,className:o,onClick:()=>i(!0),children:[(0,t.jsx)(s.Icons.plus,{}),"Create box"]}),l?(0,t.jsx)(y,{project:e,projects:r??(e?[e]:[]),onClose:()=>i(!1)}):null]})}],93268);let C=(0,b.createServerReference)("40c7856bd78dddab224344045df78d51620e411335",b.callServer,void 0,b.findSourceMapURL,"removeProjectAction");e.s(["DeleteProjectButton",0,function({project:e,size:n,className:a,redirectHome:o}){let l=(0,r.useRouter)(),[i,d]=(0,c.useTransition)();return(0,t.jsxs)(x.Button,{variant:"destructive",size:n,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)(s.Icons.trash,{}),"Delete"]})}],66818)},87340,e=>{"use strict";var t=e.i(1262),r=e.i(51096),n=e.i(44344),s=e.i(96621),a=e.i(88451);function o(){let{state:e,box:o}=(0,s.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)(n.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),x=e.i(3060),u=e.i(9383);let m=(0,u.createServerReference)("4087bb6da1f4834ca146bcc8cb7c69295dbeda0bdc",u.callServer,void 0,u.findSourceMapURL,"addProjectAction"),p=(0,u.createServerReference)("40942714d29a270a6816a39cd419b4f09f50fc19b1",u.callServer,void 0,u.findSourceMapURL,"browseDirAction");function h(){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)(n.Icons.plus,{}),"New project"]}),e?(0,t.jsx)(f,{onClose:()=>r(!1)}):null]})}function f({onClose:e}){let r=(0,l.useRouter)(),[s,a]=(0,i.useTransition)(),[o,u]=(0,i.useState)(""),[h,b]=(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}u(t.path),b(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)(n.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(h??void 0),disabled:!h||v,title:"Up one level","aria-label":"Up one level",children:(0,t.jsx)(n.Icons.arrowUp,{})}),(0,t.jsx)(x.Input,{value:o,onChange:e=>u(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)(n.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)(n.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:s,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:()=>{y(null);let t=o.trim();t?a(async()=>{let n=await m(t);n.ok?(r.refresh(),e()):y(n.error)}):y("choose a folder")},disabled:s||v,children:s?"Adding…":"Add this folder"})]})]})}var b=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,s.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)(h,{})})]}),(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:s})=>(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)(n.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:[s.length," box",1===s.length?"":"es"]}),(0,t.jsx)(g.CreateBoxButton,{project:e,variant:"outline",size:"sm",className:"font-mono text-xs"}),0===s.length?(0,t.jsx)(j.DeleteProjectButton,{project:e,size:"sm",className:"font-mono text-xs"}):null]}),s.length?(0,t.jsx)(b.BoxTable,{boxes:s}):(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)(),[l,c]=(0,n.useTransition)(),d=r=>{c(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:l,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:l,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),l=e.i(44344),c=e.i(9383);let d=(0,c.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",c.callServer,void 0,c.findSourceMapURL,"destroyBoxAction"),x=(0,c.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",c.callServer,void 0,c.findSourceMapURL,"pauseBoxAction"),u=(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:t}){let n=(0,s.useRouter)(),[c,h]=(0,a.useTransition)(),f="running"===e.status,b="paused"===e.status,v="stopped"===e.status,g="lg"===t,j=g?"sm":"icon-sm",N=(r,t,s)=>{r.stopPropagation(),(!s||window.confirm(s))&&h(async()=>{let r=await t(e.id);r.ok||window.alert(`Action failed: ${r.error}`),n.refresh()})};return(0,r.jsxs)("div",{className:(0,i.cn)("flex gap-1.5",g?"":"justify-end"),children:[b?(0,r.jsxs)(o.Button,{variant:g?"default":"outline",size:j,title:"Resume",disabled:c,className:g?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:e=>N(e,m),children:[(0,r.jsx)(l.Icons.play,{}),g?"Resume":null]}):(0,r.jsxs)(o.Button,{variant:"outline",size:j,disabled:c||!f,title:"Pause",className:g?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:e=>N(e,x),children:[(0,r.jsx)(l.Icons.pause,{}),g?"Pause":null]}),(0,r.jsxs)(o.Button,{variant:"outline",size:j,disabled:c||v,title:"Stop",onClick:e=>N(e,p),children:[(0,r.jsx)(l.Icons.stop,{}),g?"Stop":null]}),(0,r.jsxs)(o.Button,{variant:"outline",size:j,disabled:c,title:"Rename",onClick:r=>{r.stopPropagation();let t=window.prompt("Rename box (label only — leave blank to reset)",e.displayName??e.task);null!==t&&h(async()=>{let r=await u(e.id,t.trim());r.ok||window.alert(`Rename failed: ${r.error}`),n.refresh()})},children:[(0,r.jsx)(l.Icons.pencil,{}),g?"Rename":null]}),(0,r.jsxs)(o.Button,{variant:"destructive",size:j,title:"Destroy",disabled:c,onClick:r=>N(r,d,`Destroy box ${e.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,r.jsx)(l.Icons.trash,{}),g?"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)},77084,e=>{"use strict";var r=e.i(1262),t=e.i(45971),n=e.i(33789),s=e.i(44344),a=e.i(86892),i=e.i(65232);function o({className:e,icon:t,title:n,children:s}){return(0,r.jsxs)("div",{className:(0,i.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",e),children:[t?(0,r.jsx)(t,{className:"mt-0.5 size-4 flex-none"}):null,(0,r.jsxs)("div",{className:"min-w-0",children:[n?(0,r.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:n}):null,(0,r.jsx)("div",{className:"text-[12.5px] leading-normal",children:s})]})]})}var l=e.i(8536),c=e.i(96621),d=e.i(88451);function x({boxId:e}){let{state:t}=(0,c.useStore)(),a=t.approvals.filter(r=>r.boxId===e).sort((e,r)=>e.createdAt-r.createdAt);return 0===a.length?null:(0,r.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,r.jsx)(s.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,r.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[a.length," pending approval",1===a.length?"":"s"]}),(0,r.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,r.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:a.map(e=>(0,r.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:e.command??e.message}),e.detail?(0,r.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:e.detail}):null,e.cwd?(0,r.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:e.cwd}):null,(0,r.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,r.jsx)(n.Ago,{ms:e.createdAt})})]}),(0,r.jsx)("div",{className:"flex-none pt-0.5",children:(0,r.jsx)(d.ApprovalActions,{id:e.id})})]},e.id))})]})}var u=e.i(54129),m=e.i(69377);function p({url:e}){let[t,n]=(0,u.useState)(!1),a=(0,u.useRef)(null);(0,u.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]);let i=(0,u.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),n(!0),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)}catch{}},[e]);return(0,r.jsxs)(m.Button,{variant:"outline",size:"sm",onClick:i,children:[t?(0,r.jsx)(s.Icons.check,{}):(0,r.jsx)(s.Icons.copy,{}),t?"Copied":"Copy URL"]})}function h({webUrl:e,vncUrl:t}){return e||t?(0,r.jsx)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,r.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,r.jsx)("div",{className:"text-[13.5px] font-medium",children:e?"Web":"VNC"}),(0,r.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:e??"Remote desktop"})]}),(0,r.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[e?(0,r.jsxs)(m.Button,{variant:"outline",size:"sm",href:e,target:"_blank",rel:"noreferrer",children:[(0,r.jsx)(s.Icons.ext,{}),"Open web"]}):null,e?(0,r.jsx)(p,{url:e}):null,t?(0,r.jsxs)(m.Button,{variant:"outline",size:"sm",href:t,target:"_blank",rel:"noreferrer",children:[(0,r.jsx)(s.Icons.ext,{}),"Open VNC"]}):null]})]})}):null}var f=e.i(80922),b=e.i(30544),v=e.i(51096);function g({k:e,v:t,mono:n,link:s}){return(0,r.jsxs)("div",{className:"grid grid-cols-[156px_1fr] items-baseline gap-4 px-4.5 p-3 max-sm:grid-cols-1 max-sm:gap-1",children:[(0,r.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:e}),(0,r.jsx)("div",{className:(0,i.cn)("min-w-0 text-[13.5px]",n?"font-mono text-[13px]":""),children:s?(0,r.jsx)(v.default,{className:"cursor-pointer text-primary",href:s,children:t}):t})]})}var j=e.i(31758),N=e.i(95141),w=e.i(3060),y=e.i(16200),k=e.i(49604),S=e.i(9383);let C=(0,S.createServerReference)("70fd109611adee18e2a11d04af4332c29e796848e9",S.callServer,void 0,S.findSourceMapURL,"gitBranchAction"),R=(0,S.createServerReference)("600e7ece96e4038f118842cef0ebcf51dadf743c9b",S.callServer,void 0,S.findSourceMapURL,"gitCheckoutAction"),I=(0,S.createServerReference)("605f4904ee0814a4a51c0445aa18e7dfbde590c7e5",S.callServer,void 0,S.findSourceMapURL,"gitPullAction"),B=(0,S.createServerReference)("60675b1179af1a57b7c4bb6e4d893805dd8f7b0b66",S.callServer,void 0,S.findSourceMapURL,"gitPushAction"),D=(0,S.createServerReference)("607692631dd5973ad6071d94f3fee9c7da56a766db",S.callServer,void 0,S.findSourceMapURL,"gitPushHostAction"),A=0;function L({toasts:e,dismiss:t}){return(0,r.jsx)("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex w-[340px] max-w-[calc(100vw-40px)] flex-col gap-2",children:e.map(e=>(0,r.jsxs)("div",{className:"anim-pop pointer-events-auto relative flex items-start gap-3 rounded-xl border border-border bg-card p-3.5 pr-9 shadow-[0_16px_40px_-18px_rgba(20,24,30,.35)]",children:[(0,r.jsx)("span",{className:(0,i.cn)("mt-0.5 grid h-6 w-6 flex-none place-items-center rounded-md border","error"===e.variant?"border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]":"border-[var(--green-line)] bg-accent text-primary"),children:"error"===e.variant?(0,r.jsx)(s.Icons.warn,{className:"size-3.5"}):(0,r.jsx)(s.Icons.check,{className:"size-3.5"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:e.title}),e.detail?(0,r.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:e.detail}):null]}),(0,r.jsx)("button",{className:"absolute right-2.5 top-2.5 grid h-5 w-5 cursor-pointer place-items-center rounded border-0 bg-transparent text-[#a4a9b0] hover:text-foreground",onClick:()=>t(e.id),"aria-label":"Dismiss",children:(0,r.jsx)(s.Icons.x,{className:"size-3"})})]},e.id))})}function z({label:e,desc:t,children:n}){return(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,r.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,r.jsx)("div",{className:"text-[13.5px] font-medium",children:e}),(0,r.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:t})]}),(0,r.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:n})]})}function U({icon:e,disabled:t,onRun:n,children:s}){let[a,i]=(0,u.useState)(!1),o=async()=>{i(!0);try{await n()}finally{i(!1)}};return(0,r.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:t||a,onClick:o,children:[a?(0,r.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,r.jsx)(e,{}),s]})}function P(e,r){let t=(e??"").trim()||(r??"").trim();return t?t.split("\n")[0]:void 0}function T({box:e}){let n=(0,t.useRouter)(),{toasts:a,push:o,dismiss:c}=function(){let[e,r]=(0,u.useState)([]),t=(0,u.useCallback)(e=>r(r=>r.filter(r=>r.id!==e)),[]);return{toasts:e,push:(0,u.useCallback)(e=>{let n=++A;r(r=>[...r,{id:n,...e}]),setTimeout(()=>t(n),4200)},[t]),dismiss:t}}(),[d,x]=(0,u.useState)(null),[p,h]=(0,u.useState)(null),f="running"!==e.status,b=(0,u.useCallback)(async()=>{try{let r=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/git`,{credentials:"same-origin"});x(r.ok?await r.json():null)}catch{x(null)}},[e.id]);(0,u.useEffect)(()=>{b()},[b]);let v=d?.ok&&d.branch?d.branch:e.branch||"—",g=()=>{b(),n.refresh()},j=async(e,r)=>{let t=await r();t.ok?(o({title:e,detail:P(t.stdout,t.stderr)}),g()):o({variant:"error",title:`${e} failed`,detail:t.error})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.Card,{className:(0,i.cn)("divide-y divide-border/60 overflow-hidden",f?"opacity-90":""),children:[f?(0,r.jsxs)("div",{className:"flex items-center gap-2.5 bg-[var(--amber-soft)] px-4.5 p-2.5 text-[12.5px] text-[var(--amber)]",children:[(0,r.jsx)(s.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",e.status," — git operations need a running box."]}):null,(0,r.jsxs)(z,{label:"Sync",desc:`origin ↔ ${v}`,children:[(0,r.jsx)(U,{icon:s.Icons.arrowL,disabled:f,onRun:()=>j("Pulled from origin",()=>I(e.id)),children:"Pull"}),(0,r.jsx)(U,{icon:s.Icons.ext,disabled:f,onRun:()=>j("Pushed to origin",()=>B(e.id)),children:"Push"}),(0,r.jsx)(U,{icon:s.Icons.host,disabled:f,onRun:()=>j("Pushed to host",()=>D(e.id)),children:"Push to host"})]}),(0,r.jsxs)(z,{label:"Branch",desc:`currently on ${v}`,children:[(0,r.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:f,onClick:()=>h("change"),children:[(0,r.jsx)(s.Icons.branch,{}),"Change branch"]}),(0,r.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:f,onClick:()=>h("new"),children:[(0,r.jsx)(s.Icons.plus,{}),"New branch"]})]})]}),"change"===p?(0,r.jsx)(E,{box:e,branch:v,onClose:()=>h(null),onDone:o,onRefresh:g}):null,"new"===p?(0,r.jsx)(F,{box:e,onClose:()=>h(null),onDone:o,onRefresh:g}):null,(0,r.jsx)(L,{toasts:a,dismiss:c})]})}let M="__manual__";function _({boxId:e,value:t,onChange:n,id:s,headLabel:a,currentBranch:i}){let[o,l]=(0,u.useState)(null),[c,d]=(0,u.useState)(i??null),[x,m]=(0,u.useState)(!1);return((0,u.useEffect)(()=>{let r=!1;return(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/branches`,{credentials:"same-origin"}),n=t.ok?await t.json():null;if(r)return;n&&Array.isArray(n.branches)&&n.branches.length>0?(l(n.branches),i||"string"!=typeof n.current||d(n.current)):(l([]),m(!0))}catch{r||(l([]),m(!0))}})(),()=>{r=!0}},[e,i]),null===o)?(0,r.jsx)(k.Select,{id:s,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,r.jsx)("option",{value:"",children:"Loading branches…"})}):x?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.Input,{id:s,className:"font-mono text-[13px]",autoFocus:!0,value:t,onChange:e=>n(e.target.value),placeholder:a?"HEAD":"feature-x"}),o.length>0?(0,r.jsx)("button",{type:"button",onClick:()=>{m(!1),n("")},className:"mt-1.5 cursor-pointer text-xs text-secondary-foreground underline-offset-2 hover:underline",children:"← Back to branch list"}):null]}):(0,r.jsxs)(k.Select,{id:s,value:t,wrapperClassName:"w-full",onChange:e=>{if(e.target.value===M){m(!0),n("");return}n(e.target.value)},children:[a?(0,r.jsx)("option",{value:"",children:a}):(0,r.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,r.jsx)("option",{value:M,children:"Other / type manually…"}),(0,r.jsx)("option",{disabled:!0,children:"────────────"}),o.map(e=>(0,r.jsxs)("option",{value:e,children:[e,e===c?" (current)":""]},e))]})}function E({box:e,branch:t,onClose:n,onDone:a,onRefresh:i}){let[o,l]=(0,u.useState)(""),[c,d]=(0,u.useState)(!1),[x,p]=(0,u.useState)(null),h=o.trim().length>0;return(0,r.jsxs)(N.Dialog,{onClose:n,className:"max-w-[440px]",children:[(0,r.jsxs)(N.DialogHeader,{children:[(0,r.jsx)(N.DialogIcon,{children:(0,r.jsx)(s.Icons.branch,{})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(N.DialogTitle,{children:"Change branch"}),(0,r.jsxs)(N.DialogDescription,{children:[e.id," · currently on ",t]})]})]}),(0,r.jsxs)(N.DialogBody,{children:[(0,r.jsx)(y.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,r.jsx)(_,{boxId:e.id,id:"gb-branch",value:o,onChange:l,currentBranch:t}),(0,r.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"The branch must exist and not be checked out in another worktree."}),x?(0,r.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:x}):null]}),(0,r.jsxs)(N.DialogFooter,{children:[(0,r.jsx)(m.Button,{variant:"outline",onClick:n,disabled:c,children:"Cancel"}),(0,r.jsxs)(m.Button,{onClick:()=>{h&&!c&&(d(!0),p(null),(async()=>{let r=await R(e.id,o.trim());r.ok?(a({title:"Branch changed",detail:P(r.stdout,r.stderr)}),n(),i()):(p(r.error),d(!1))})())},disabled:!h||c,children:[c?(0,r.jsx)("span",{className:"spin"}):(0,r.jsx)(s.Icons.check,{}),c?"Checking out…":"Change branch"]})]})]})}function F({box:e,onClose:t,onDone:n,onRefresh:a}){let[i,o]=(0,u.useState)(""),[l,c]=(0,u.useState)(""),[d,x]=(0,u.useState)(!1),[p,h]=(0,u.useState)(null),f=i.trim().length>0,b=()=>{f&&!d&&(x(!0),h(null),(async()=>{let r=await C(e.id,i.trim(),l.trim()||void 0);r.ok?(n({title:"Branch created",detail:P(r.stdout,r.stderr)}),t(),a()):(h(r.error),x(!1))})())};return(0,r.jsxs)(N.Dialog,{onClose:t,className:"max-w-[440px]",children:[(0,r.jsxs)(N.DialogHeader,{children:[(0,r.jsx)(N.DialogIcon,{children:(0,r.jsx)(s.Icons.branch,{})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(N.DialogTitle,{children:"New branch"}),(0,r.jsxs)(N.DialogDescription,{children:[e.id," · branching in the box workspace"]})]})]}),(0,r.jsxs)(N.DialogBody,{children:[(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)(y.Label,{htmlFor:"nb-name",children:"Name"}),(0,r.jsx)(w.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&b()},placeholder:"my-branch"}),(0,r.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,r.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,r.jsxs)(y.Label,{htmlFor:"nb-from",children:["Base ref ",(0,r.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,r.jsx)(_,{boxId:e.id,id:"nb-from",value:l,onChange:c,headLabel:"Current HEAD (default)"}),(0,r.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),p?(0,r.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:p}):null]}),(0,r.jsxs)(N.DialogFooter,{children:[(0,r.jsx)(m.Button,{variant:"outline",onClick:t,disabled:d,children:"Cancel"}),(0,r.jsxs)(m.Button,{onClick:b,disabled:!f||d,children:[d?(0,r.jsx)("span",{className:"spin"}):(0,r.jsx)(s.Icons.plus,{}),d?"Creating…":"Create branch"]})]})]})}var $=e.i(1485);let H=(0,S.createServerReference)("6096ff4dd5616157cf1da6a977c271641a3ddce491",S.callServer,void 0,S.findSourceMapURL,"restartServiceAction"),O=new Set(["ready","running","done"]),G=new Set(["crashed","unhealthy","backoff","failed"]),K={up:"bg-[var(--green)]",bad:"bg-[var(--red)]",idle:"bg-[var(--amber)]"},W={up:"text-[var(--green-ink)]",bad:"text-[var(--red)]",idle:"text-[var(--amber)]"};function V({svc:e,disabled:t,onRestart:n}){var a;let o=(a=e.state,O.has(a)?"up":G.has(a)?"bad":"idle");return(0,r.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,r.jsx)("span",{className:(0,i.cn)("badge-dot",K[o]),"aria-hidden":!0}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:e.name}),(0,r.jsx)("span",{className:(0,i.cn)("font-mono text-xs",W[o]),children:e.state}),e.restarts>0?(0,r.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",e.restarts]}):null,(0,r.jsx)(m.Button,{variant:"outline",size:"icon-sm",title:`Restart ${e.name}`,disabled:t,onClick:()=>n(e.name),children:(0,r.jsx)(s.Icons.refresh,{})})]})}function q({id:e,running:t}){let[n,a]=(0,u.useState)(null),[i,o]=(0,u.useState)(null),[c,d]=(0,u.useTransition)(),x=(0,u.useCallback)(async()=>{try{let r=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/services`,{credentials:"same-origin"});if(!r.ok)return void o(`status ${String(r.status)}`);a(await r.json()),o(null)}catch(e){o(e instanceof Error?e.message:String(e))}},[e]);(0,u.useEffect)(()=>{if(x(),!t)return;let e=setInterval(()=>void x(),4e3);return()=>clearInterval(e)},[x,t]);let p=r=>{d(async()=>{let t=await H(e,r);t.ok||window.alert(`Restart failed: ${t.error}`),await x()})},h=n?.services??[],f=h.length>0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($.SectionLabel,{right:f?(0,r.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:!t||c,onClick:()=>p(void 0),children:[(0,r.jsx)(s.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,r.jsx)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:n||i?i?(0,r.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",i,")."]}):f?(0,r.jsxs)(r.Fragment,{children:[n?.source==="persisted"?(0,r.jsx)("div",{className:"bg-muted/30 px-4 py-1.5 font-mono text-[11px] text-muted-foreground",children:"persisted snapshot — box not running"}):null,h.map(e=>(0,r.jsx)(V,{svc:e,disabled:!t||c,onRestart:e=>p(e)},e.name))]}):(0,r.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:n?.source==="unavailable"?"No service status (box not running or no snapshot yet).":"No services declared in agentbox.yaml."}):(0,r.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var J=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,t.useParams)(),{box:i,project:d}=(0,c.useStore)(),u=i(e);if(!u)return(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,r.jsx)(f.BackLink,{to:"/",children:"All boxes"}),(0,r.jsx)(j.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let m=d(u.projectId);return(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,r.jsx)(f.BackLink,{to:"/projects/"+u.projectId,children:m?m.name:"Project"}),(0,r.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[u.task,(0,r.jsx)(a.StatusBadge,{status:u.status})]}),(0,r.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,r.jsx)("span",{className:"font-mono text-secondary-foreground",children:u.id})," ·"," ",(0,r.jsx)("span",{className:"font-mono text-secondary-foreground",children:u.repo})," · ",u.host]})]}),(0,r.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,r.jsx)(b.BoxActions,{box:u,size:"lg"})})]}),u.error?(0,r.jsx)(o,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:s.Icons.warn,title:"Box errored",children:(0,r.jsx)("span",{className:"font-mono text-secondary-foreground",children:u.error})}):null,(0,r.jsx)(x,{boxId:u.id}),(0,r.jsx)($.SectionLabel,{children:"Overview"}),(0,r.jsxs)(J.StatGrid,{children:[(0,r.jsx)(J.Stat,{k:"Status",v:(0,r.jsx)(a.StatusBadge,{status:u.status})}),(0,r.jsx)(J.Stat,{k:"Agent CLI",v:u.agent,mono:!0}),(0,r.jsx)(J.Stat,{k:"Commits",v:u.commits??"—",icon:s.Icons.commit}),(0,r.jsx)(J.Stat,{k:"Files touched",v:u.filesTouched??"—",icon:s.Icons.file}),(0,r.jsx)(J.Stat,{k:"Last activity",v:(0,r.jsx)(n.Ago,{ms:u.lastActivity}),mono:!0})]}),u.webUrl||u.vncUrl?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($.SectionLabel,{children:"Access"}),(0,r.jsx)(h,{webUrl:u.webUrl,vncUrl:u.vncUrl})]}):null,(0,r.jsx)($.SectionLabel,{children:"Git operations"}),(0,r.jsx)(T,{box:u}),(0,r.jsx)(q,{id:u.id,running:"running"===u.status}),(0,r.jsx)($.SectionLabel,{children:"Details"}),(0,r.jsxs)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,r.jsx)(g,{k:"Box ID",v:u.id,mono:!0}),(0,r.jsx)(g,{k:"Project",v:m?m.name:"—",link:m?"/projects/"+u.projectId:null}),(0,r.jsx)(g,{k:"Repository",v:u.repo,mono:!0}),(0,r.jsx)(g,{k:"Branch",v:u.branch,mono:!0}),(0,r.jsx)(g,{k:"Host",v:u.host,mono:!0}),(0,r.jsx)(g,{k:"Created",v:new Date(u.createdAt).toLocaleString(),mono:!0})]})]})}],77084)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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 a=n[e]??n.stopped;return(0,r.jsxs)(t.Badge,{className:a.badgeClass,children:[(0,r.jsx)("span",{className:"badge-dot"}),a.label]})}],86892);var a=e.i(45971),s=e.i(54129),o=e.i(65232),l=e.i(69377),i=e.i(44344),c=e.i(9383);let d=(0,c.createServerReference)("40f10bede8a5e7505d5875574f7e6fc4a06e8e2cb7",c.callServer,void 0,c.findSourceMapURL,"destroyBoxAction"),u=(0,c.createServerReference)("40ea16199b5abb2d3c1d4cecdd25aac1e3c41f074c",c.callServer,void 0,c.findSourceMapURL,"pauseBoxAction"),x=(0,c.createServerReference)("6096bb2a65e369cd77e8b1dc6cd900a5f1e67287bb",c.callServer,void 0,c.findSourceMapURL,"renameBoxAction"),m=(0,c.createServerReference)("4071308a0e1675de302803bb969800c52d79f11e13",c.callServer,void 0,c.findSourceMapURL,"resumeBoxAction"),p=(0,c.createServerReference)("40e545c7dd69b4a1d410deb9c94101099961d3af7a",c.callServer,void 0,c.findSourceMapURL,"stopBoxAction");e.s(["BoxActions",0,function({box:e,size:t}){let n=(0,a.useRouter)(),[c,b]=(0,s.useTransition)(),h="running"===e.status,f="paused"===e.status,g="stopped"===e.status,j="lg"===t,v=j?"sm":"icon-sm",N=(r,t,a)=>{r.stopPropagation(),(!a||window.confirm(a))&&b(async()=>{let r=await t(e.id);r.ok||window.alert(`Action failed: ${r.error}`),n.refresh()})};return(0,r.jsxs)("div",{className:(0,o.cn)("flex gap-1.5",j?"":"justify-end"),children:[f?(0,r.jsxs)(l.Button,{variant:j?"default":"outline",size:v,title:"Resume",disabled:c,className:j?"":"hover:border-[var(--green)] hover:bg-accent hover:text-[var(--green-ink)]",onClick:e=>N(e,m),children:[(0,r.jsx)(i.Icons.play,{}),j?"Resume":null]}):(0,r.jsxs)(l.Button,{variant:"outline",size:v,disabled:c||!h,title:"Pause",className:j?"":"hover:border-[var(--amber)] hover:bg-[var(--amber-soft)] hover:text-[var(--amber)]",onClick:e=>N(e,u),children:[(0,r.jsx)(i.Icons.pause,{}),j?"Pause":null]}),(0,r.jsxs)(l.Button,{variant:"outline",size:v,disabled:c||g,title:"Stop",onClick:e=>N(e,p),children:[(0,r.jsx)(i.Icons.stop,{}),j?"Stop":null]}),(0,r.jsxs)(l.Button,{variant:"outline",size:v,disabled:c,title:"Rename",onClick:r=>{r.stopPropagation();let t=window.prompt("Rename box (label only — leave blank to reset)",e.displayName??e.task);null!==t&&b(async()=>{let r=await x(e.id,t.trim());r.ok||window.alert(`Rename failed: ${r.error}`),n.refresh()})},children:[(0,r.jsx)(i.Icons.pencil,{}),j?"Rename":null]}),(0,r.jsxs)(l.Button,{variant:"destructive",size:v,title:"Destroy",disabled:c,onClick:r=>N(r,d,`Destroy box ${e.id}? Its workspace volume is discarded. This cannot be undone.`),children:[(0,r.jsx)(i.Icons.trash,{}),j?"Destroy":null]})]})}],30544)},95141,e=>{"use strict";var r=e.i(1262),t=e.i(54129),n=e.i(65232),a=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:s,children:o}){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)]",s),onClick:e=>e.stopPropagation(),children:[o,(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)(a.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:a,...s}){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),...s,children:a}),(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:a}){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]"}),a]})}],80922);var a=e.i(65232),s=e.i(8536);e.s(["Stat",0,function({k:e,v:t,mono:n,icon:s}){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,a.cn)("flex items-center gap-2 font-semibold tracking-[-0.01em]",n?"font-mono text-sm font-medium":"text-base"),children:[s?(0,r.jsx)(s,{className:"size-[15px] text-muted-foreground"}):null,t]})]})},"StatGrid",0,function({children:e}){return(0,r.jsx)(s.Card,{className:"grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] divide-x divide-border/60 overflow-hidden",children:e})}],35594)},8536,e=>{"use strict";var 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})}])},86184,e=>{"use strict";var r=e.i(1262),t=e.i(54129),n=e.i(69377),a=e.i(3060);function s({jobId:e,login:o}){let[l,i]=(0,t.useState)(""),[c,d]=(0,t.useState)(!1),[u,x]=(0,t.useState)(null),m="exchanging"===o.phase,p=async()=>{let r=l.trim();if(r&&!c){d(!0),x(null);try{let t=await fetch(`/api/v1/jobs/${encodeURIComponent(e)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:r})});if(!t.ok){let e=await t.json().catch(()=>null);x(e?.error?.message??`request failed (${t.status})`);return}i("")}catch(e){x(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,r.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,r.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,r.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,r.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,r.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,r.jsx)(a.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,r.jsx)(n.Button,{type:"button",onClick:()=>void p(),disabled:!l.trim()||c||m,children:m?"Verifying…":c?"Submitting…":"Submit"})]}),o.lastError?(0,r.jsx)("p",{className:"text-xs text-amber-300",children:o.lastError}):null,"error"===o.phase&&o.error?(0,r.jsx)("p",{className:"text-xs text-red-400",children:o.error}):null,u?(0,r.jsx)("p",{className:"text-xs text-red-400",children:u}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:n,onDone:a,onStatus:o,onLogin:l}){let[i,c]=(0,t.useState)([]),[d,u]=(0,t.useState)(null),x=(0,t.useRef)(null),m=(0,t.useRef)(a);m.current=a;let p=(0,t.useRef)(o);p.current=o;let b=(0,t.useRef)(l);return b.current=l,(0,t.useEffect)(()=>{p.current?.("streaming");let r=new EventSource(n??`/api/jobs/${encodeURIComponent(e)}/logs`);return r.addEventListener("log",e=>{let r=JSON.parse(e.data);c(e=>[...e,r])}),r.addEventListener("login",e=>{let r=JSON.parse(e.data);u(r),b.current?.(r)}),r.addEventListener("end",e=>{let t=JSON.parse(e.data);p.current?.(t.status),m.current?.(t.status),r.close()}),()=>r.close()},[e,n]),(0,t.useEffect)(()=>{let e=x.current;e&&(e.scrollTop=e.scrollHeight)},[i]),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[d&&"done"!==d.phase?(0,r.jsx)(s,{jobId:e,login:d}):null,(0,r.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 r=e.i(1262),t=e.i(54129);e.s(["Ago",0,function({ms:e}){let[n,a]=(0,t.useState)(!1);return(0,t.useEffect)(()=>a(!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 s.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let s=e.r(57855),o=e.r(61414),l=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]})}])},23878,e=>{"use strict";var r=e.i(1262),t=e.i(65232);e.s(["Table",0,function({className:e,...n}){return(0,r.jsx)("table",{className:(0,t.cn)("w-full caption-bottom text-sm",e),...n})},"TableBody",0,function({className:e,...n}){return(0,r.jsx)("tbody",{className:(0,t.cn)("[&_tr:last-child]:border-0",e),...n})},"TableCell",0,function({className:e,...n}){return(0,r.jsx)("td",{className:(0,t.cn)("px-4 py-3 align-middle",e),...n})},"TableHead",0,function({className:e,...n}){return(0,r.jsx)("th",{className:(0,t.cn)("h-9 px-4 text-left align-middle font-mono text-[10.5px] font-normal uppercase tracking-[.08em] text-muted-foreground/90",e),...n})},"TableHeader",0,function({className:e,...n}){return(0,r.jsx)("thead",{className:(0,t.cn)("bg-background [&_tr]:border-b [&_tr]:border-border",e),...n})},"TableRow",0,function({className:e,...n}){return(0,r.jsx)("tr",{className:(0,t.cn)("border-b border-border/60 transition-colors hover:bg-[#fcfcfb] data-[state=selected]:bg-accent",e),...n})}])},22983,93268,66818,e=>{"use strict";var r=e.i(1262),t=e.i(45971),n=e.i(33789),a=e.i(44344),s=e.i(86892),o=e.i(8536),l=e.i(23878),i=e.i(30544);e.s(["BoxTable",0,function({boxes:e}){let c=(0,t.useRouter)();return(0,r.jsx)(o.Card,{className:"overflow-hidden",children:(0,r.jsxs)(l.Table,{children:[(0,r.jsx)(l.TableHeader,{children:(0,r.jsxs)(l.TableRow,{className:"hover:bg-transparent",children:[(0,r.jsx)(l.TableHead,{className:"w-[38%]",children:"Task"}),(0,r.jsx)(l.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,r.jsx)(l.TableHead,{className:"max-md:hidden",children:"Status"}),(0,r.jsx)(l.TableHead,{className:"text-right",children:"Actions"})]})}),(0,r.jsx)(l.TableBody,{children:e.map(e=>(0,r.jsxs)(l.TableRow,{className:"cursor-pointer",onClick:()=>c.push("/boxes/"+e.id),children:[(0,r.jsxs)(l.TableCell,{children:[(0,r.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:e.task}),(0,r.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.id," · ",e.host]})]}),(0,r.jsxs)(l.TableCell,{className:"max-md:hidden",children:[(0,r.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,r.jsx)(a.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,r.jsx)("span",{className:"truncate",children:e.branch})]}),(0,r.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[e.agent," · ",(0,r.jsx)(n.Ago,{ms:e.lastActivity})]})]}),(0,r.jsx)(l.TableCell,{className:"max-md:hidden",children:(0,r.jsx)(s.StatusBadge,{status:e.status})}),(0,r.jsx)(l.TableCell,{className:"text-right",onClick:e=>e.stopPropagation(),children:(0,r.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,...t}){return(0,r.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),...t})}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:n,onClose:s}){let o=(0,t.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??n[0]?.id??""),[R,T]=(0,c.useState)("claude"),[D,L]=(0,c.useState)("docker"),[I,A]=(0,c.useState)(""),[P,E]=(0,c.useState)(""),[z,H]=(0,c.useState)(""),[M,U]=(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=n.find(e=>e.id===C)??e;return(0,c.useEffect)(()=>{if(!C||q)return;_(X?.needsSetup??!1),L("docker");let e=!1;return U(null),H(X?.currentBranch??""),j(C).then(r=>{if(e||!r.ok){e||r.ok||U([]);return}U(r.branches),r.current&&r.branches.includes(r.current)&&H(r.current)}),()=>{e=!0}},[C,q]),(0,r.jsxs)(x.Dialog,{onClose:s,className:q?"max-w-[900px]":"max-w-[560px]",children:[(0,r.jsxs)(x.DialogHeader,{children:[(0,r.jsx)(x.DialogIcon,{children:(0,r.jsx)(a.Icons.box,{})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(x.DialogTitle,{children:"Create box"}),(0,r.jsx)(x.DialogDescription,{children:X?X.name:"Start a box in a project"})]}),q?(0,r.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,r.jsx)(w,{status:G,loginPhase:Y})}):null]}),(0,r.jsx)(x.DialogBody,{className:"flex flex-col gap-4",children:q?(0,r.jsx)(N.JobLogStream,{jobId:q,onStatus:V,onDone:()=>o.refresh(),onLogin:e=>Q(e?.phase??null)}):(0,r.jsxs)(r.Fragment,{children:[e?null:(0,r.jsx)(k,{label:"Project",children:(0,r.jsxs)(p.Select,{value:C,onChange:e=>B(e.target.value),children:[0===n.length?(0,r.jsx)("option",{value:"",children:"No projects — add one first"}):null,n.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,r.jsx)(k,{label:"Provider",children:(0,r.jsx)(p.Select,{value:D,onChange:e=>L(e.target.value),children:i.map(e=>(0,r.jsxs)("option",{value:e.id,disabled:!e.configured,title:e.reason,children:[e.label,e.configured?"":" — not configured"]},e.id))})}),(0,r.jsx)(k,{label:"Agent",children:(0,r.jsxs)(p.Select,{value:R,onChange:e=>T(e.target.value),children:[(0,r.jsx)("option",{value:"claude",children:"Claude"}),(0,r.jsx)("option",{value:"codex",children:"Codex"}),(0,r.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,r.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,r.jsx)(k,{label:"Name (optional)",children:(0,r.jsx)(m.Input,{value:I,onChange:e=>A(e.target.value),placeholder:"auto"})}),X?.needsSetup&&"none"!==R?(0,r.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,r.jsx)("input",{type:"checkbox",checked:O,onChange:e=>_(e.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,r.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,r.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,r.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,r.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.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,r.jsx)(a.Icons.chevR,{className:(0,b.cn)("size-3.5 transition-transform",F&&"rotate-90")}),"Advanced"]}),F?(0,r.jsxs)(r.Fragment,{children:[null===M?(0,r.jsx)(k,{label:"Base branch",children:(0,r.jsx)(p.Select,{value:"",disabled:!0,children:(0,r.jsx)("option",{value:"",children:"Loading branches…"})})}):M.length>0?(0,r.jsx)(k,{label:"Base branch",children:(0,r.jsxs)(p.Select,{value:z,onChange:e=>H(e.target.value),children:[X?.currentBranch&&!M.includes(X.currentBranch)?(0,r.jsxs)("option",{value:"",children:[X.currentBranch," (current)"]}):null,M.map(e=>(0,r.jsxs)("option",{value:e,children:[e,e===X?.currentBranch?" (current)":""]},e))]})}):null,"none"!==R?(0,r.jsx)(k,{label:"Initial prompt (optional)",children:(0,r.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,r.jsx)("div",{className:"font-mono text-xs text-destructive",children:J}):null]})}),(0,r.jsx)(x.DialogFooter,{children:q?(0,r.jsxs)(r.Fragment,{children:["streaming"===G?(0,r.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:"The box + agent start in the background — you can close this."}):null,(0,r.jsx)(u.Button,{onClick:s,children:"Close"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Button,{variant:"outline",onClick:s,disabled:d,children:"Cancel"}),(0,r.jsx)(u.Button,{onClick:()=>{(W(null),C)?f(async()=>{let e=await g({projectId:C,agent:R,provider:D,name:I.trim()||void 0,prompt:"none"===R?void 0:P.trim()||void 0,fromBranch:z.trim()&&z.trim()!==X?.currentBranch?z.trim():void 0,setupWizard:"none"!==R&&O});e.ok?(K(e.jobId),o.refresh()):W(e.error)}):W("pick a project")},disabled:d||!C,children:d?"Starting…":"Create box"})]})})]})}function w({status:e,loginPhase:t}){return"done"===e?(0,r.jsxs)(d.Badge,{className:"badge-run",children:[(0,r.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===e||"error"===e||"cancelled"===e?(0,r.jsxs)(d.Badge,{className:"badge-err",children:[(0,r.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===t?(0,r.jsxs)(d.Badge,{className:"badge-err",children:[(0,r.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===t||"starting"===t||"exchanging"===t?(0,r.jsxs)(d.Badge,{className:"badge-create",children:[(0,r.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,r.jsxs)(d.Badge,{className:"badge-create",children:[(0,r.jsx)("span",{className:"badge-dot"}),"Working…"]})}function k({label:e,children:t}){return(0,r.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:e}),t]})}e.s(["CreateBoxButton",0,function({project:e,projects:t,variant:n,size:s,className:o}){let[l,i]=(0,c.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(u.Button,{variant:n,size:s,className:o,onClick:()=>i(!0),children:[(0,r.jsx)(a.Icons.plus,{}),"Create box"]}),l?(0,r.jsx)(y,{project:e,projects:t??(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:n,className:s,redirectHome:o}){let l=(0,t.useRouter)(),[i,d]=(0,c.useTransition)();return(0,r.jsxs)(u.Button,{variant:"destructive",size:n,className:s,title:"Delete project",disabled:i,onClick:r=>{r.stopPropagation(),r.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 r=await C(e.id);r.ok?o?l.push("/"):l.refresh():window.alert(`Delete failed: ${r.error}`)})},children:[(0,r.jsx)(a.Icons.trash,{}),"Delete"]})}],66818)},86691,e=>{"use strict";var r=e.i(1262),t=e.i(45971),n=e.i(33789),a=e.i(44344),s=e.i(96621),o=e.i(80922),l=e.i(22983),i=e.i(93268),c=e.i(66818),d=e.i(31758),u=e.i(1485),x=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,t.useParams)(),{project:m,boxesFor:p}=(0,s.useStore)(),b=m(e);if(!b)return(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,r.jsx)(o.BackLink,{to:"/",children:"Dashboard"}),(0,r.jsx)(d.EmptyBox,{children:"Project not found."})]});let h=p(e),f=h.filter(e=>"running"===e.status).length;return(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,r.jsx)(o.BackLink,{to:"/",children:"All projects"}),(0,r.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("h1",{className:"flex items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[(0,r.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,r.jsx)(a.Icons.folder,{className:"size-[15px]"})}),b.name]}),(0,r.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,r.jsx)("span",{className:"font-mono text-secondary-foreground",children:b.repo})," · ",b.provider]})]}),(0,r.jsxs)("div",{className:"ml-auto flex flex-none gap-2 max-md:ml-0",children:[(0,r.jsx)(i.CreateBoxButton,{project:b}),0===h.length?(0,r.jsx)(c.DeleteProjectButton,{project:b,redirectHome:!0}):null]})]}),(0,r.jsx)("div",{className:"mt-5",children:(0,r.jsxs)(x.StatGrid,{children:[(0,r.jsx)(x.Stat,{k:"Boxes",v:h.length,icon:a.Icons.box}),(0,r.jsx)(x.Stat,{k:"Running",v:f,icon:a.Icons.activity}),(0,r.jsx)(x.Stat,{k:"Provider",v:b.provider,mono:!0}),(0,r.jsx)(x.Stat,{k:"Created",v:(0,r.jsx)(n.Ago,{ms:b.createdAt}),mono:!0})]})}),(0,r.jsx)(u.SectionLabel,{children:"Boxes"}),h.length?(0,r.jsx)(l.BoxTable,{boxes:h}):(0,r.jsx)(d.EmptyBox,{children:(0,r.jsx)("div",{children:"No boxes yet."})})]})}])}]);
@@ -3,8 +3,8 @@ import {
3
3
  AUTH_DB_PATH,
4
4
  cookieSecure,
5
5
  hubProfile
6
- } from "./chunk-OBKLTPIR.js";
7
- import "./chunk-AKLBSCSZ.js";
6
+ } from "./chunk-56YQBVN2.js";
7
+ import "./chunk-EXQCBM5Q.js";
8
8
  import "./chunk-TZFWAJVB.js";
9
9
 
10
10
  // lib/auth.ts
@@ -7,8 +7,8 @@ import {
7
7
  authMode,
8
8
  cookieSecure,
9
9
  hubProfile
10
- } from "./chunk-OBKLTPIR.js";
11
- import "./chunk-AKLBSCSZ.js";
10
+ } from "./chunk-56YQBVN2.js";
11
+ import "./chunk-EXQCBM5Q.js";
12
12
  import "./chunk-TZFWAJVB.js";
13
13
  export {
14
14
  AUTH_DB_PATH,
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __cr } from 'node:module'; import { fileURLToPath as __f } from 'node:url'; import { dirname as __d } from 'node:path'; const require = __cr(import.meta.url); const __filename = __f(import.meta.url); const __dirname = __d(__filename);
2
2
  import {
3
3
  STATE_DIR
4
- } from "./chunk-AKLBSCSZ.js";
4
+ } from "./chunk-EXQCBM5Q.js";
5
5
 
6
6
  // lib/auth-config.ts
7
7
  import { join } from "node:path";