@madarco/agentbox 0.23.2 → 0.23.3

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 (119) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{_cloud-attach-LP5CIO7S.js → _cloud-attach-BQRWX3J2.js} +3 -3
  3. package/dist/chunk-G3H2L3O2.js +0 -0
  4. package/dist/chunk-GGRZ3GZO.js +0 -0
  5. package/dist/{chunk-C47ZA42C.js → chunk-I6ZRWTPR.js} +25 -3
  6. package/dist/chunk-I6ZRWTPR.js.map +1 -0
  7. package/dist/{chunk-AGSLJ3NE.js → chunk-LA4JMS27.js} +10 -2
  8. package/dist/{chunk-AGSLJ3NE.js.map → chunk-LA4JMS27.js.map} +1 -1
  9. package/dist/chunk-LK2JT2OO.js +0 -0
  10. package/dist/chunk-LSQXT5WZ.js +0 -0
  11. package/dist/{chunk-J3GSZ33V.js → chunk-QEQFZLYR.js} +7 -7
  12. package/dist/chunk-QT3SHMLY.js +0 -0
  13. package/dist/{chunk-7D7K4UXW.js → chunk-SFA57TGX.js} +3 -3
  14. package/dist/{chunk-TZLNJBIM.js → chunk-W3FQPFP7.js} +2 -2
  15. package/dist/chunk-WJFZJZIM.js +0 -0
  16. package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
  17. package/dist/dist-2BTJQUJS.js +0 -0
  18. package/dist/{dist-VMR6UEP2.js → dist-CUKBKS3N.js} +4 -4
  19. package/dist/{dist-HENU2IVK.js → dist-FXQFTT75.js} +3 -3
  20. package/dist/{dist-UIOWLT3C.js → dist-QO4CTLAX.js} +4 -4
  21. package/dist/{dist-OTSXYV6X.js → dist-V235KVEX.js} +3 -3
  22. package/dist/{dist-NUZ2RMOP.js → dist-Z2NEVV55.js} +4 -2
  23. package/dist/index.js +19 -36
  24. package/dist/index.js.map +1 -1
  25. package/dist/prepared-state-BUO75YLZ-CDTISC2C.js +0 -0
  26. package/package.json +28 -27
  27. package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
  28. package/runtime/_shared/agentbox-dockerd-start +0 -0
  29. package/runtime/_shared/agentbox-open +0 -0
  30. package/runtime/_shared/agentbox-portless-trust +0 -0
  31. package/runtime/_shared/agentbox-vnc-start +0 -0
  32. package/runtime/_shared/ctl.cjs +0 -0
  33. package/runtime/_shared/gh-shim +0 -0
  34. package/runtime/_shared/git-shim +0 -0
  35. package/runtime/_shared/linear-shim +0 -0
  36. package/runtime/_shared/ntn-shim +0 -0
  37. package/runtime/docker/packages/ctl/dist/bin.cjs +0 -0
  38. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
  39. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
  40. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
  41. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
  42. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +0 -0
  43. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
  44. package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
  45. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
  46. package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
  47. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
  48. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
  49. package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
  50. package/runtime/e2b/agentbox-dockerd-start +0 -0
  51. package/runtime/e2b/agentbox-open +0 -0
  52. package/runtime/e2b/agentbox-vnc-start +0 -0
  53. package/runtime/e2b/ctl.cjs +0 -0
  54. package/runtime/e2b/gh-shim +0 -0
  55. package/runtime/e2b/git-shim +0 -0
  56. package/runtime/e2b/linear-shim +0 -0
  57. package/runtime/e2b/ntn-shim +0 -0
  58. package/runtime/e2b/scripts/build-template.sh +0 -0
  59. package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
  60. package/runtime/hetzner/agentbox-dockerd-start +0 -0
  61. package/runtime/hetzner/agentbox-open +0 -0
  62. package/runtime/hetzner/agentbox-portless-trust +0 -0
  63. package/runtime/hetzner/agentbox-vnc-start +0 -0
  64. package/runtime/hetzner/ctl.cjs +0 -0
  65. package/runtime/hetzner/gh-shim +0 -0
  66. package/runtime/hetzner/git-shim +0 -0
  67. package/runtime/hetzner/linear-shim +0 -0
  68. package/runtime/hetzner/ntn-shim +0 -0
  69. package/runtime/hetzner/scripts/install-box.sh +0 -0
  70. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  71. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  72. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  73. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  74. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  75. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  76. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  77. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  78. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  79. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  80. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +1 -1
  81. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bqbkd5._.js +2 -2
  82. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +2 -2
  83. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
  84. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  85. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  86. package/runtime/hub/apps/hub/.next/static/chunks/{1py5tlz57h7ra.js → 44o5lj23__y1m.js} +1 -1
  87. package/runtime/hub/apps/hub/{chunk-TS3DHXYG.js → chunk-2Z74R6ZT.js} +9 -1
  88. package/runtime/hub/apps/hub/{chunk-5C7T5LX3.js → chunk-AR7CEZ2G.js} +24 -2
  89. package/runtime/hub/apps/hub/{dist-3ILQQGCH.js → dist-LNHEG5P4.js} +2 -2
  90. package/runtime/hub/apps/hub/{dist-CJHZ37LW.js → dist-LZNRLUYY.js} +2 -2
  91. package/runtime/hub/apps/hub/{dist-PKOFN4OD.js → dist-Q6G66Z57.js} +2 -2
  92. package/runtime/hub/apps/hub/{dist-WRKJHF6W.js → dist-SD4G36EP.js} +2 -2
  93. package/runtime/hub/apps/hub/{dist-6R5YPL5S.js → dist-VV6Z2CQX.js} +3 -1
  94. package/runtime/hub/apps/hub/server.js +22 -9
  95. package/runtime/relay/bin.cjs +0 -0
  96. package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
  97. package/runtime/vercel/agentbox-dockerd-start +0 -0
  98. package/runtime/vercel/agentbox-open +0 -0
  99. package/runtime/vercel/agentbox-vnc-start +0 -0
  100. package/runtime/vercel/ctl.cjs +0 -0
  101. package/runtime/vercel/gh-shim +0 -0
  102. package/runtime/vercel/git-shim +0 -0
  103. package/runtime/vercel/linear-shim +0 -0
  104. package/runtime/vercel/ntn-shim +0 -0
  105. package/runtime/vercel/scripts/provision.sh +0 -0
  106. package/LICENSE +0 -21
  107. package/dist/chunk-C47ZA42C.js.map +0 -1
  108. /package/dist/{_cloud-attach-LP5CIO7S.js.map → _cloud-attach-BQRWX3J2.js.map} +0 -0
  109. /package/dist/{chunk-J3GSZ33V.js.map → chunk-QEQFZLYR.js.map} +0 -0
  110. /package/dist/{chunk-7D7K4UXW.js.map → chunk-SFA57TGX.js.map} +0 -0
  111. /package/dist/{chunk-TZLNJBIM.js.map → chunk-W3FQPFP7.js.map} +0 -0
  112. /package/dist/{dist-NUZ2RMOP.js.map → dist-CUKBKS3N.js.map} +0 -0
  113. /package/dist/{dist-HENU2IVK.js.map → dist-FXQFTT75.js.map} +0 -0
  114. /package/dist/{dist-UIOWLT3C.js.map → dist-QO4CTLAX.js.map} +0 -0
  115. /package/dist/{dist-OTSXYV6X.js.map → dist-V235KVEX.js.map} +0 -0
  116. /package/dist/{dist-VMR6UEP2.js.map → dist-Z2NEVV55.js.map} +0 -0
  117. /package/runtime/hub/apps/hub/.next/static/{W7Oc_BUsChvL4rrhfKZRY → 12hWAUQ9O9G3VS4vxKuav}/_buildManifest.js +0 -0
  118. /package/runtime/hub/apps/hub/.next/static/{W7Oc_BUsChvL4rrhfKZRY → 12hWAUQ9O9G3VS4vxKuav}/_clientMiddlewareManifest.js +0 -0
  119. /package/runtime/hub/apps/hub/.next/static/{W7Oc_BUsChvL4rrhfKZRY → 12hWAUQ9O9G3VS4vxKuav}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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 i.findSourceMapURL}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(57855),i=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]})}])},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),i=e.i(9383);let l=(0,i.createServerReference)("60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",i.callServer,void 0,i.findSourceMapURL,"answerApprovalAction");e.s(["ApprovalActions",0,function({id:e}){let i=(0,r.useRouter)(),[o,c]=(0,n.useTransition)(),d=t=>{c(async()=>{let r=await l(e,t);r.ok||window.alert(`Failed: ${r.error}`),i.refresh()})};return(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsxs)(a.Button,{variant:"outline",size:"sm",disabled:o,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:o,onClick:()=>d("y"),children:[(0,t.jsx)(s.Icons.check,{}),"Approve"]})]})}],88451)},16200,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Label",0,function({className:e,...n}){return(0,t.jsx)("label",{className:(0,r.cn)("mb-2 block text-[13px] font-medium leading-none",e),...n})}])},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})}])},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),i=e.i(65232),l=e.i(69377),o=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,v="stopped"===e.status,g="lg"===r,j=g?"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,i.cn)("flex gap-1.5",g?"":"justify-end"),children:[b?(0,t.jsxs)(l.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,t.jsx)(o.Icons.play,{}),g?"Resume":null]}):(0,t.jsxs)(l.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,t.jsx)(o.Icons.pause,{}),g?"Pause":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:j,disabled:c||v,title:"Stop",onClick:e=>N(e,p),children:[(0,t.jsx)(o.Icons.stop,{}),g?"Stop":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:j,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)(o.Icons.pencil,{}),g?"Rename":null]}),(0,t.jsxs)(l.Button,{variant:"destructive",size:j,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)(o.Icons.trash,{}),g?"Destroy":null]})]})}],30544)},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:i}){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:[i,(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})}])},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"})})]})}])},80922,35594,e=>{"use strict";var t=e.i(1262),r=e.i(51096),n=e.i(44344);e.s(["BackLink",0,function({to:e,children:s}){return(0,t.jsxs)(r.default,{className:"mb-3.5 inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-mono text-xs text-muted-foreground hover:text-primary",href:e,children:[(0,t.jsx)(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:r,mono:n,icon:a}){return(0,t.jsxs)("div",{className:"px-4.5 p-4",children:[(0,t.jsx)("div",{className:"mb-1.5 font-mono text-[10.5px] uppercase tracking-[.06em] text-[#a4a9b0]",children:e}),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-center gap-2 font-semibold tracking-[-0.01em]",n?"font-mono text-sm font-medium":"text-base"),children:[a?(0,t.jsx)(a,{className:"size-[15px] text-muted-foreground"}):null,r]})]})},"StatGrid",0,function({children:e}){return(0,t.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 t=e.i(1262),r=e.i(45971),n=e.i(33789),s=e.i(44344),a=e.i(86892),i=e.i(65232);function l({className:e,icon:r,title:n,children:s}){return(0,t.jsxs)("div",{className:(0,i.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",e),children:[r?(0,t.jsx)(r,{className:"mt-0.5 size-4 flex-none"}):null,(0,t.jsxs)("div",{className:"min-w-0",children:[n?(0,t.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:n}):null,(0,t.jsx)("div",{className:"text-[12.5px] leading-normal",children:s})]})]})}var o=e.i(8536),c=e.i(96621),d=e.i(88451);function x({boxId:e}){let{state:r}=(0,c.useStore)(),a=r.approvals.filter(t=>t.boxId===e).sort((e,t)=>e.createdAt-t.createdAt);return 0===a.length?null:(0,t.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,t.jsx)(s.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,t.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[a.length," pending approval",1===a.length?"":"s"]}),(0,t.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,t.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:a.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:e.command??e.message}),e.detail?(0,t.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:e.detail}):null,e.cwd?(0,t.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:e.cwd}):null,(0,t.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,t.jsx)(n.Ago,{ms:e.createdAt})})]}),(0,t.jsx)("div",{className:"flex-none pt-0.5",children:(0,t.jsx)(d.ApprovalActions,{id:e.id})})]},e.id))})]})}var u=e.i(54129),m=e.i(69377),p=e.i(1485);let h=[{app:"claude",label:"Claude",icon:"claude"},{app:"codex",label:"Codex",icon:"codex"},{app:"vscode",label:"VS Code",icon:"ext"},{app:"cmux",label:"cmux",icon:"terminal"},{app:"herdr",label:"Herdr",icon:"terminal"},{app:"iterm2",label:"iTerm2",icon:"terminal"},{app:"finder",label:"Finder",icon:"folder"}];function f({url:e}){let[r,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,t.jsxs)(m.Button,{variant:"outline",size:"sm",onClick:i,children:[r?(0,t.jsx)(s.Icons.check,{}):(0,t.jsx)(s.Icons.copy,{}),r?"Copied":"Copy URL"]})}function b({box:e}){let{webUrl:r,vncUrl:n}=e,{eligible:a,pending:i,launch:l}=function(e){let[t,r]=(0,u.useState)(null),[n,s]=(0,u.useState)(null);(0,u.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/v1/open-targets",{credentials:"same-origin"});e&&r(t.ok?await t.json():null)}catch{e&&r(null)}})(),()=>{e=!1}},[]);let a=(0,u.useCallback)(async t=>{s(t);try{let r=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/open`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({app:t})});if(!r.ok){let e=await r.json().catch(()=>null);window.alert(`Open in ${t} failed: ${e?.error?.message??`HTTP ${r.status}`}`)}}catch(e){window.alert(`Open in ${t} failed: ${e instanceof Error?e.message:String(e)}`)}finally{s(null)}},[e.id]),i=t?.supported?t.targets:null;return{eligible:i?h.filter(({app:t})=>{let r=i[t];return r.available&&(!r.providers||r.providers.includes(e.provider))}):[],pending:n,launch:a}}(e);return r||n||0!==a.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.SectionLabel,{children:"Access"}),(0,t.jsxs)(o.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[r||n?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,t.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,t.jsx)("div",{className:"text-[13.5px] font-medium",children:r?"Web":"VNC"}),(0,t.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:r??"Remote desktop"})]}),(0,t.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[r?(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",href:r,target:"_blank",rel:"noreferrer",children:[(0,t.jsx)(s.Icons.ext,{}),"Open web"]}):null,r?(0,t.jsx)(f,{url:r}):null,n?(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",href:n,target:"_blank",rel:"noreferrer",children:[(0,t.jsx)(s.Icons.ext,{}),"Open VNC"]}):null]})]}):null,a.length>0?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,t.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,t.jsx)("div",{className:"text-[13.5px] font-medium",children:"Apps"}),(0,t.jsx)("div",{className:"mt-0.5 text-[11.5px] text-muted-foreground",children:"Open the box project from the host"})]}),(0,t.jsx)("div",{className:"flex flex-none flex-wrap justify-end gap-1.5",children:a.map(({app:e,label:r,icon:n})=>{let a=s.Icons[n];return(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:null!==i,onClick:()=>void l(e),children:[(0,t.jsx)(a,{}),r]},e)})})]}):null]})]}):null}var v=e.i(80922),g=e.i(30544),j=e.i(51096);function N({k:e,v:r,mono:n,link:s}){return(0,t.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,t.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:e}),(0,t.jsx)("div",{className:(0,i.cn)("min-w-0 text-[13.5px]",n?"font-mono text-[13px]":""),children:s?(0,t.jsx)(j.default,{className:"cursor-pointer text-primary",href:s,children:r}):r})]})}var w=e.i(31758),y=e.i(95141),S=e.i(3060),k=e.i(16200),C=e.i(49604),I=e.i(9383);let R=(0,I.createServerReference)("70fd109611adee18e2a11d04af4332c29e796848e9",I.callServer,void 0,I.findSourceMapURL,"gitBranchAction"),B=(0,I.createServerReference)("600e7ece96e4038f118842cef0ebcf51dadf743c9b",I.callServer,void 0,I.findSourceMapURL,"gitCheckoutAction"),D=(0,I.createServerReference)("605f4904ee0814a4a51c0445aa18e7dfbde590c7e5",I.callServer,void 0,I.findSourceMapURL,"gitPullAction"),A=(0,I.createServerReference)("60675b1179af1a57b7c4bb6e4d893805dd8f7b0b66",I.callServer,void 0,I.findSourceMapURL,"gitPushAction"),L=(0,I.createServerReference)("607692631dd5973ad6071d94f3fee9c7da56a766db",I.callServer,void 0,I.findSourceMapURL,"gitPushHostAction"),z=0;function T({toasts:e,dismiss:r}){return(0,t.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,t.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,t.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,t.jsx)(s.Icons.warn,{className:"size-3.5"}):(0,t.jsx)(s.Icons.check,{className:"size-3.5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:e.title}),e.detail?(0,t.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:e.detail}):null]}),(0,t.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:()=>r(e.id),"aria-label":"Dismiss",children:(0,t.jsx)(s.Icons.x,{className:"size-3"})})]},e.id))})}function P({label:e,desc:r,children:n}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,t.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,t.jsx)("div",{className:"text-[13.5px] font-medium",children:e}),(0,t.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:r})]}),(0,t.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:n})]})}function U({icon:e,disabled:r,onRun:n,children:s}){let[a,i]=(0,u.useState)(!1),l=async()=>{i(!0);try{await n()}finally{i(!1)}};return(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:r||a,onClick:l,children:[a?(0,t.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,t.jsx)(e,{}),s]})}function M(e,t){let r=(e??"").trim()||(t??"").trim();return r?r.split("\n")[0]:void 0}function $({box:e}){let n=(0,r.useRouter)(),{toasts:a,push:l,dismiss:c}=function(){let[e,t]=(0,u.useState)([]),r=(0,u.useCallback)(e=>t(t=>t.filter(t=>t.id!==e)),[]);return{toasts:e,push:(0,u.useCallback)(e=>{let n=++z;t(t=>[...t,{id:n,...e}]),setTimeout(()=>r(n),4200)},[r]),dismiss:r}}(),[d,x]=(0,u.useState)(null),[p,h]=(0,u.useState)(null),f="running"!==e.status,b=(0,u.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/git`,{credentials:"same-origin"});x(t.ok?await t.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,t)=>{let r=await t();r.ok?(l({title:e,detail:M(r.stdout,r.stderr)}),g()):l({variant:"error",title:`${e} failed`,detail:r.error})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Card,{className:(0,i.cn)("divide-y divide-border/60 overflow-hidden",f?"opacity-90":""),children:[f?(0,t.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,t.jsx)(s.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",e.status," — git operations need a running box."]}):null,(0,t.jsxs)(P,{label:"Sync",desc:`origin ↔ ${v}`,children:[(0,t.jsx)(U,{icon:s.Icons.arrowL,disabled:f,onRun:()=>j("Pulled from origin",()=>D(e.id)),children:"Pull"}),(0,t.jsx)(U,{icon:s.Icons.ext,disabled:f,onRun:()=>j("Pushed to origin",()=>A(e.id)),children:"Push"}),(0,t.jsx)(U,{icon:s.Icons.host,disabled:f,onRun:()=>j("Pushed to host",()=>L(e.id)),children:"Push to host"})]}),(0,t.jsxs)(P,{label:"Branch",desc:`currently on ${v}`,children:[(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:f,onClick:()=>h("change"),children:[(0,t.jsx)(s.Icons.branch,{}),"Change branch"]}),(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:f,onClick:()=>h("new"),children:[(0,t.jsx)(s.Icons.plus,{}),"New branch"]})]})]}),"change"===p?(0,t.jsx)(F,{box:e,branch:v,onClose:()=>h(null),onDone:l,onRefresh:g}):null,"new"===p?(0,t.jsx)(O,{box:e,onClose:()=>h(null),onDone:l,onRefresh:g}):null,(0,t.jsx)(T,{toasts:a,dismiss:c})]})}let E="__manual__";function _({boxId:e,value:r,onChange:n,id:s,headLabel:a,currentBranch:i}){let[l,o]=(0,u.useState)(null),[c,d]=(0,u.useState)(i??null),[x,m]=(0,u.useState)(!1);return((0,u.useEffect)(()=>{let t=!1;return(async()=>{try{let r=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/branches`,{credentials:"same-origin"}),n=r.ok?await r.json():null;if(t)return;n&&Array.isArray(n.branches)&&n.branches.length>0?(o(n.branches),i||"string"!=typeof n.current||d(n.current)):(o([]),m(!0))}catch{t||(o([]),m(!0))}})(),()=>{t=!0}},[e,i]),null===l)?(0,t.jsx)(C.Select,{id:s,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,t.jsx)("option",{value:"",children:"Loading branches…"})}):x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.Input,{id:s,className:"font-mono text-[13px]",autoFocus:!0,value:r,onChange:e=>n(e.target.value),placeholder:a?"HEAD":"feature-x"}),l.length>0?(0,t.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,t.jsxs)(C.Select,{id:s,value:r,wrapperClassName:"w-full",onChange:e=>{if(e.target.value===E){m(!0),n("");return}n(e.target.value)},children:[a?(0,t.jsx)("option",{value:"",children:a}):(0,t.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,t.jsx)("option",{value:E,children:"Other / type manually…"}),(0,t.jsx)("option",{disabled:!0,children:"────────────"}),l.map(e=>(0,t.jsxs)("option",{value:e,children:[e,e===c?" (current)":""]},e))]})}function F({box:e,branch:r,onClose:n,onDone:a,onRefresh:i}){let[l,o]=(0,u.useState)(""),[c,d]=(0,u.useState)(!1),[x,p]=(0,u.useState)(null),h=l.trim().length>0;return(0,t.jsxs)(y.Dialog,{onClose:n,className:"max-w-[440px]",children:[(0,t.jsxs)(y.DialogHeader,{children:[(0,t.jsx)(y.DialogIcon,{children:(0,t.jsx)(s.Icons.branch,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.DialogTitle,{children:"Change branch"}),(0,t.jsxs)(y.DialogDescription,{children:[e.id," · currently on ",r]})]})]}),(0,t.jsxs)(y.DialogBody,{children:[(0,t.jsx)(k.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,t.jsx)(_,{boxId:e.id,id:"gb-branch",value:l,onChange:o,currentBranch:r}),(0,t.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,t.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:x}):null]}),(0,t.jsxs)(y.DialogFooter,{children:[(0,t.jsx)(m.Button,{variant:"outline",onClick:n,disabled:c,children:"Cancel"}),(0,t.jsxs)(m.Button,{onClick:()=>{h&&!c&&(d(!0),p(null),(async()=>{let t=await B(e.id,l.trim());t.ok?(a({title:"Branch changed",detail:M(t.stdout,t.stderr)}),n(),i()):(p(t.error),d(!1))})())},disabled:!h||c,children:[c?(0,t.jsx)("span",{className:"spin"}):(0,t.jsx)(s.Icons.check,{}),c?"Checking out…":"Change branch"]})]})]})}function O({box:e,onClose:r,onDone:n,onRefresh:a}){let[i,l]=(0,u.useState)(""),[o,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 t=await R(e.id,i.trim(),o.trim()||void 0);t.ok?(n({title:"Branch created",detail:M(t.stdout,t.stderr)}),r(),a()):(h(t.error),x(!1))})())};return(0,t.jsxs)(y.Dialog,{onClose:r,className:"max-w-[440px]",children:[(0,t.jsxs)(y.DialogHeader,{children:[(0,t.jsx)(y.DialogIcon,{children:(0,t.jsx)(s.Icons.branch,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.DialogTitle,{children:"New branch"}),(0,t.jsxs)(y.DialogDescription,{children:[e.id," · branching in the box workspace"]})]})]}),(0,t.jsxs)(y.DialogBody,{children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(k.Label,{htmlFor:"nb-name",children:"Name"}),(0,t.jsx)(S.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:i,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&b()},placeholder:"my-branch"}),(0,t.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,t.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,t.jsxs)(k.Label,{htmlFor:"nb-from",children:["Base ref ",(0,t.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,t.jsx)(_,{boxId:e.id,id:"nb-from",value:o,onChange:c,headLabel:"Current HEAD (default)"}),(0,t.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),p?(0,t.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:p}):null]}),(0,t.jsxs)(y.DialogFooter,{children:[(0,t.jsx)(m.Button,{variant:"outline",onClick:r,disabled:d,children:"Cancel"}),(0,t.jsxs)(m.Button,{onClick:b,disabled:!f||d,children:[d?(0,t.jsx)("span",{className:"spin"}):(0,t.jsx)(s.Icons.plus,{}),d?"Creating…":"Create branch"]})]})]})}let H=(0,I.createServerReference)("6096ff4dd5616157cf1da6a977c271641a3ddce491",I.callServer,void 0,I.findSourceMapURL,"restartServiceAction"),G=new Set(["ready","running","done"]),K=new Set(["crashed","unhealthy","backoff","failed"]),V={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 J({svc:e,disabled:r,onRestart:n}){var a;let l=(a=e.state,G.has(a)?"up":K.has(a)?"bad":"idle");return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,t.jsx)("span",{className:(0,i.cn)("badge-dot",V[l]),"aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:e.name}),(0,t.jsx)("span",{className:(0,i.cn)("font-mono text-xs",W[l]),children:e.state}),e.restarts>0?(0,t.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",e.restarts]}):null,(0,t.jsx)(m.Button,{variant:"outline",size:"icon-sm",title:`Restart ${e.name}`,disabled:r,onClick:()=>n(e.name),children:(0,t.jsx)(s.Icons.refresh,{})})]})}function q({id:e,running:r}){let[n,a]=(0,u.useState)(null),[i,l]=(0,u.useState)(null),[c,d]=(0,u.useTransition)(),x=(0,u.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/services`,{credentials:"same-origin"});if(!t.ok)return void l(`status ${String(t.status)}`);a(await t.json()),l(null)}catch(e){l(e instanceof Error?e.message:String(e))}},[e]);(0,u.useEffect)(()=>{if(x(),!r)return;let e=setInterval(()=>void x(),4e3);return()=>clearInterval(e)},[x,r]);let h=t=>{d(async()=>{let r=await H(e,t);r.ok||window.alert(`Restart failed: ${r.error}`),await x()})},f=n?.services??[],b=f.length>0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.SectionLabel,{right:b?(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:!r||c,onClick:()=>h(void 0),children:[(0,t.jsx)(s.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,t.jsx)(o.Card,{className:"divide-y divide-border/60 overflow-hidden",children:n||i?i?(0,t.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",i,")."]}):b?(0,t.jsxs)(t.Fragment,{children:[n?.source==="persisted"?(0,t.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,f.map(e=>(0,t.jsx)(J,{svc:e,disabled:!r||c,onRestart:e=>h(e)},e.name))]}):(0,t.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,t.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var Q=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,r.useParams)(),{box:i,project:d}=(0,c.useStore)(),u=i(e);if(!u)return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,t.jsx)(v.BackLink,{to:"/",children:"All boxes"}),(0,t.jsx)(w.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let m=d(u.projectId);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)(v.BackLink,{to:"/projects/"+u.projectId,children:m?m.name:"Project"}),(0,t.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[u.task,(0,t.jsx)(a.StatusBadge,{status:u.status})]}),(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:u.id})," ·"," ",(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:u.repo})," · ",u.host]})]}),(0,t.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,t.jsx)(g.BoxActions,{box:u,size:"lg"})})]}),u.error?(0,t.jsx)(l,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:s.Icons.warn,title:"Box errored",children:(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:u.error})}):null,(0,t.jsx)(x,{boxId:u.id}),(0,t.jsx)(p.SectionLabel,{children:"Overview"}),(0,t.jsxs)(Q.StatGrid,{children:[(0,t.jsx)(Q.Stat,{k:"Status",v:(0,t.jsx)(a.StatusBadge,{status:u.status})}),(0,t.jsx)(Q.Stat,{k:"Agent CLI",v:u.agent,mono:!0}),(0,t.jsx)(Q.Stat,{k:"Commits",v:u.commits??"—",icon:s.Icons.commit}),(0,t.jsx)(Q.Stat,{k:"Files touched",v:u.filesTouched??"—",icon:s.Icons.file}),(0,t.jsx)(Q.Stat,{k:"Last activity",v:(0,t.jsx)(n.Ago,{ms:u.lastActivity}),mono:!0})]}),(0,t.jsx)(b,{box:u}),(0,t.jsx)(p.SectionLabel,{children:"Git operations"}),(0,t.jsx)($,{box:u}),(0,t.jsx)(q,{id:u.id,running:"running"===u.status}),(0,t.jsx)(p.SectionLabel,{children:"Details"}),(0,t.jsxs)(o.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,t.jsx)(N,{k:"Box ID",v:u.id,mono:!0}),(0,t.jsx)(N,{k:"Project",v:m?m.name:"—",link:m?"/projects/"+u.projectId:null}),(0,t.jsx)(N,{k:"Repository",v:u.repo,mono:!0}),(0,t.jsx)(N,{k:"Branch",v:u.branch,mono:!0}),(0,t.jsx)(N,{k:"Host",v:u.host,mono:!0}),(0,t.jsx)(N,{k:"Created",v:new Date(u.createdAt).toLocaleString(),mono:!0})]})]})}],77084)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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 i.findSourceMapURL}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(57855),i=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]})}])},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),i=e.i(9383);let l=(0,i.createServerReference)("60ff5520393ac26282f15f58e0b073a0c45b3ba7e5",i.callServer,void 0,i.findSourceMapURL,"answerApprovalAction");e.s(["ApprovalActions",0,function({id:e}){let i=(0,r.useRouter)(),[o,c]=(0,n.useTransition)(),d=t=>{c(async()=>{let r=await l(e,t);r.ok||window.alert(`Failed: ${r.error}`),i.refresh()})};return(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsxs)(a.Button,{variant:"outline",size:"sm",disabled:o,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:o,onClick:()=>d("y"),children:[(0,t.jsx)(s.Icons.check,{}),"Approve"]})]})}],88451)},16200,e=>{"use strict";var t=e.i(1262),r=e.i(65232);e.s(["Label",0,function({className:e,...n}){return(0,t.jsx)("label",{className:(0,r.cn)("mb-2 block text-[13px] font-medium leading-none",e),...n})}])},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})}])},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),i=e.i(65232),l=e.i(69377),o=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,v="stopped"===e.status,g="lg"===r,j=g?"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,i.cn)("flex gap-1.5",g?"":"justify-end"),children:[b?(0,t.jsxs)(l.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,t.jsx)(o.Icons.play,{}),g?"Resume":null]}):(0,t.jsxs)(l.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,t.jsx)(o.Icons.pause,{}),g?"Pause":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:j,disabled:c||v,title:"Stop",onClick:e=>N(e,p),children:[(0,t.jsx)(o.Icons.stop,{}),g?"Stop":null]}),(0,t.jsxs)(l.Button,{variant:"outline",size:j,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)(o.Icons.pencil,{}),g?"Rename":null]}),(0,t.jsxs)(l.Button,{variant:"destructive",size:j,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)(o.Icons.trash,{}),g?"Destroy":null]})]})}],30544)},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:i}){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:[i,(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})}])},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"})})]})}])},80922,35594,e=>{"use strict";var t=e.i(1262),r=e.i(51096),n=e.i(44344);e.s(["BackLink",0,function({to:e,children:s}){return(0,t.jsxs)(r.default,{className:"mb-3.5 inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-mono text-xs text-muted-foreground hover:text-primary",href:e,children:[(0,t.jsx)(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:r,mono:n,icon:a}){return(0,t.jsxs)("div",{className:"px-4.5 p-4",children:[(0,t.jsx)("div",{className:"mb-1.5 font-mono text-[10.5px] uppercase tracking-[.06em] text-[#a4a9b0]",children:e}),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-center gap-2 font-semibold tracking-[-0.01em]",n?"font-mono text-sm font-medium":"text-base"),children:[a?(0,t.jsx)(a,{className:"size-[15px] text-muted-foreground"}):null,r]})]})},"StatGrid",0,function({children:e}){return(0,t.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 t=e.i(1262),r=e.i(45971),n=e.i(33789),s=e.i(44344),a=e.i(86892),i=e.i(65232);function l({className:e,icon:r,title:n,children:s}){return(0,t.jsxs)("div",{className:(0,i.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",e),children:[r?(0,t.jsx)(r,{className:"mt-0.5 size-4 flex-none"}):null,(0,t.jsxs)("div",{className:"min-w-0",children:[n?(0,t.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:n}):null,(0,t.jsx)("div",{className:"text-[12.5px] leading-normal",children:s})]})]})}var o=e.i(8536),c=e.i(96621),d=e.i(88451);function x({boxId:e}){let{state:r}=(0,c.useStore)(),a=r.approvals.filter(t=>t.boxId===e).sort((e,t)=>e.createdAt-t.createdAt);return 0===a.length?null:(0,t.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,t.jsx)(s.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,t.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[a.length," pending approval",1===a.length?"":"s"]}),(0,t.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,t.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:a.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:e.command??e.message}),e.detail?(0,t.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:e.detail}):null,e.cwd?(0,t.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:e.cwd}):null,(0,t.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,t.jsx)(n.Ago,{ms:e.createdAt})})]}),(0,t.jsx)("div",{className:"flex-none pt-0.5",children:(0,t.jsx)(d.ApprovalActions,{id:e.id})})]},e.id))})]})}var u=e.i(54129),m=e.i(69377),p=e.i(1485);let h=[{app:"claude",label:"Claude",icon:"claude"},{app:"codex",label:"Codex",icon:"codex"},{app:"vscode",label:"VS Code",icon:"ext"},{app:"cmux",label:"cmux",icon:"terminal"},{app:"herdr",label:"Herdr",icon:"terminal"},{app:"iterm2",label:"iTerm2",icon:"terminal"},{app:"finder",label:"Finder",icon:"folder"}];function f({url:e}){let[r,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,t.jsxs)(m.Button,{variant:"outline",size:"sm",onClick:i,children:[r?(0,t.jsx)(s.Icons.check,{}):(0,t.jsx)(s.Icons.copy,{}),r?"Copied":"Copy URL"]})}function b({box:e}){let{webUrl:r,vncUrl:n}=e,{eligible:a,pending:i,launch:l}=function(e){let[t,r]=(0,u.useState)(null),[n,s]=(0,u.useState)(null);(0,u.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/v1/open-targets",{credentials:"same-origin"});e&&r(t.ok?await t.json():null)}catch{e&&r(null)}})(),()=>{e=!1}},[]);let a=(0,u.useCallback)(async t=>{s(t);try{let r=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/open`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({app:t})});if(!r.ok){let e=await r.json().catch(()=>null);window.alert(`Open in ${t} failed: ${e?.error?.message??`HTTP ${r.status}`}`)}}catch(e){window.alert(`Open in ${t} failed: ${e instanceof Error?e.message:String(e)}`)}finally{s(null)}},[e.id]),i=t?.supported?t.targets:null;return{eligible:i?h.filter(({app:t})=>{let r=i[t];return r.available&&(!r.providers||r.providers.includes(e.provider))}):[],pending:n,launch:a}}(e);return r||n||0!==a.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.SectionLabel,{children:"Access"}),(0,t.jsxs)(o.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[r||n?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,t.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,t.jsx)("div",{className:"text-[13.5px] font-medium",children:r?"Web":"VNC"}),(0,t.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:r??"Remote desktop"})]}),(0,t.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[r?(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",href:r,target:"_blank",rel:"noreferrer",children:[(0,t.jsx)(s.Icons.ext,{}),"Open web"]}):null,r?(0,t.jsx)(f,{url:r}):null,n?(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",href:n,target:"_blank",rel:"noreferrer",onClick:()=>{fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/screen`,{method:"POST",credentials:"same-origin"}).catch(()=>{})},children:[(0,t.jsx)(s.Icons.ext,{}),"Open VNC"]}):null]})]}):null,a.length>0?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,t.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,t.jsx)("div",{className:"text-[13.5px] font-medium",children:"Apps"}),(0,t.jsx)("div",{className:"mt-0.5 text-[11.5px] text-muted-foreground",children:"Open the box project from the host"})]}),(0,t.jsx)("div",{className:"flex flex-none flex-wrap justify-end gap-1.5",children:a.map(({app:e,label:r,icon:n})=>{let a=s.Icons[n];return(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:null!==i,onClick:()=>void l(e),children:[(0,t.jsx)(a,{}),r]},e)})})]}):null]})]}):null}var v=e.i(80922),g=e.i(30544),j=e.i(51096);function N({k:e,v:r,mono:n,link:s}){return(0,t.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,t.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:e}),(0,t.jsx)("div",{className:(0,i.cn)("min-w-0 text-[13.5px]",n?"font-mono text-[13px]":""),children:s?(0,t.jsx)(j.default,{className:"cursor-pointer text-primary",href:s,children:r}):r})]})}var w=e.i(31758),y=e.i(95141),S=e.i(3060),k=e.i(16200),C=e.i(49604),I=e.i(9383);let R=(0,I.createServerReference)("70fd109611adee18e2a11d04af4332c29e796848e9",I.callServer,void 0,I.findSourceMapURL,"gitBranchAction"),B=(0,I.createServerReference)("600e7ece96e4038f118842cef0ebcf51dadf743c9b",I.callServer,void 0,I.findSourceMapURL,"gitCheckoutAction"),D=(0,I.createServerReference)("605f4904ee0814a4a51c0445aa18e7dfbde590c7e5",I.callServer,void 0,I.findSourceMapURL,"gitPullAction"),A=(0,I.createServerReference)("60675b1179af1a57b7c4bb6e4d893805dd8f7b0b66",I.callServer,void 0,I.findSourceMapURL,"gitPushAction"),L=(0,I.createServerReference)("607692631dd5973ad6071d94f3fee9c7da56a766db",I.callServer,void 0,I.findSourceMapURL,"gitPushHostAction"),z=0;function T({toasts:e,dismiss:r}){return(0,t.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,t.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,t.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,t.jsx)(s.Icons.warn,{className:"size-3.5"}):(0,t.jsx)(s.Icons.check,{className:"size-3.5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:e.title}),e.detail?(0,t.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:e.detail}):null]}),(0,t.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:()=>r(e.id),"aria-label":"Dismiss",children:(0,t.jsx)(s.Icons.x,{className:"size-3"})})]},e.id))})}function P({label:e,desc:r,children:n}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,t.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,t.jsx)("div",{className:"text-[13.5px] font-medium",children:e}),(0,t.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:r})]}),(0,t.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:n})]})}function U({icon:e,disabled:r,onRun:n,children:s}){let[a,i]=(0,u.useState)(!1),l=async()=>{i(!0);try{await n()}finally{i(!1)}};return(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:r||a,onClick:l,children:[a?(0,t.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,t.jsx)(e,{}),s]})}function $(e,t){let r=(e??"").trim()||(t??"").trim();return r?r.split("\n")[0]:void 0}function M({box:e}){let n=(0,r.useRouter)(),{toasts:a,push:l,dismiss:c}=function(){let[e,t]=(0,u.useState)([]),r=(0,u.useCallback)(e=>t(t=>t.filter(t=>t.id!==e)),[]);return{toasts:e,push:(0,u.useCallback)(e=>{let n=++z;t(t=>[...t,{id:n,...e}]),setTimeout(()=>r(n),4200)},[r]),dismiss:r}}(),[d,x]=(0,u.useState)(null),[p,h]=(0,u.useState)(null),f="running"!==e.status,b=(0,u.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/git`,{credentials:"same-origin"});x(t.ok?await t.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,t)=>{let r=await t();r.ok?(l({title:e,detail:$(r.stdout,r.stderr)}),g()):l({variant:"error",title:`${e} failed`,detail:r.error})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Card,{className:(0,i.cn)("divide-y divide-border/60 overflow-hidden",f?"opacity-90":""),children:[f?(0,t.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,t.jsx)(s.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",e.status," — git operations need a running box."]}):null,(0,t.jsxs)(P,{label:"Sync",desc:`origin ↔ ${v}`,children:[(0,t.jsx)(U,{icon:s.Icons.arrowL,disabled:f,onRun:()=>j("Pulled from origin",()=>D(e.id)),children:"Pull"}),(0,t.jsx)(U,{icon:s.Icons.ext,disabled:f,onRun:()=>j("Pushed to origin",()=>A(e.id)),children:"Push"}),(0,t.jsx)(U,{icon:s.Icons.host,disabled:f,onRun:()=>j("Pushed to host",()=>L(e.id)),children:"Push to host"})]}),(0,t.jsxs)(P,{label:"Branch",desc:`currently on ${v}`,children:[(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:f,onClick:()=>h("change"),children:[(0,t.jsx)(s.Icons.branch,{}),"Change branch"]}),(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:f,onClick:()=>h("new"),children:[(0,t.jsx)(s.Icons.plus,{}),"New branch"]})]})]}),"change"===p?(0,t.jsx)(F,{box:e,branch:v,onClose:()=>h(null),onDone:l,onRefresh:g}):null,"new"===p?(0,t.jsx)(O,{box:e,onClose:()=>h(null),onDone:l,onRefresh:g}):null,(0,t.jsx)(T,{toasts:a,dismiss:c})]})}let E="__manual__";function _({boxId:e,value:r,onChange:n,id:s,headLabel:a,currentBranch:i}){let[l,o]=(0,u.useState)(null),[c,d]=(0,u.useState)(i??null),[x,m]=(0,u.useState)(!1);return((0,u.useEffect)(()=>{let t=!1;return(async()=>{try{let r=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/branches`,{credentials:"same-origin"}),n=r.ok?await r.json():null;if(t)return;n&&Array.isArray(n.branches)&&n.branches.length>0?(o(n.branches),i||"string"!=typeof n.current||d(n.current)):(o([]),m(!0))}catch{t||(o([]),m(!0))}})(),()=>{t=!0}},[e,i]),null===l)?(0,t.jsx)(C.Select,{id:s,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,t.jsx)("option",{value:"",children:"Loading branches…"})}):x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.Input,{id:s,className:"font-mono text-[13px]",autoFocus:!0,value:r,onChange:e=>n(e.target.value),placeholder:a?"HEAD":"feature-x"}),l.length>0?(0,t.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,t.jsxs)(C.Select,{id:s,value:r,wrapperClassName:"w-full",onChange:e=>{if(e.target.value===E){m(!0),n("");return}n(e.target.value)},children:[a?(0,t.jsx)("option",{value:"",children:a}):(0,t.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,t.jsx)("option",{value:E,children:"Other / type manually…"}),(0,t.jsx)("option",{disabled:!0,children:"────────────"}),l.map(e=>(0,t.jsxs)("option",{value:e,children:[e,e===c?" (current)":""]},e))]})}function F({box:e,branch:r,onClose:n,onDone:a,onRefresh:i}){let[l,o]=(0,u.useState)(""),[c,d]=(0,u.useState)(!1),[x,p]=(0,u.useState)(null),h=l.trim().length>0;return(0,t.jsxs)(y.Dialog,{onClose:n,className:"max-w-[440px]",children:[(0,t.jsxs)(y.DialogHeader,{children:[(0,t.jsx)(y.DialogIcon,{children:(0,t.jsx)(s.Icons.branch,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.DialogTitle,{children:"Change branch"}),(0,t.jsxs)(y.DialogDescription,{children:[e.id," · currently on ",r]})]})]}),(0,t.jsxs)(y.DialogBody,{children:[(0,t.jsx)(k.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,t.jsx)(_,{boxId:e.id,id:"gb-branch",value:l,onChange:o,currentBranch:r}),(0,t.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,t.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:x}):null]}),(0,t.jsxs)(y.DialogFooter,{children:[(0,t.jsx)(m.Button,{variant:"outline",onClick:n,disabled:c,children:"Cancel"}),(0,t.jsxs)(m.Button,{onClick:()=>{h&&!c&&(d(!0),p(null),(async()=>{let t=await B(e.id,l.trim());t.ok?(a({title:"Branch changed",detail:$(t.stdout,t.stderr)}),n(),i()):(p(t.error),d(!1))})())},disabled:!h||c,children:[c?(0,t.jsx)("span",{className:"spin"}):(0,t.jsx)(s.Icons.check,{}),c?"Checking out…":"Change branch"]})]})]})}function O({box:e,onClose:r,onDone:n,onRefresh:a}){let[i,l]=(0,u.useState)(""),[o,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 t=await R(e.id,i.trim(),o.trim()||void 0);t.ok?(n({title:"Branch created",detail:$(t.stdout,t.stderr)}),r(),a()):(h(t.error),x(!1))})())};return(0,t.jsxs)(y.Dialog,{onClose:r,className:"max-w-[440px]",children:[(0,t.jsxs)(y.DialogHeader,{children:[(0,t.jsx)(y.DialogIcon,{children:(0,t.jsx)(s.Icons.branch,{})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.DialogTitle,{children:"New branch"}),(0,t.jsxs)(y.DialogDescription,{children:[e.id," · branching in the box workspace"]})]})]}),(0,t.jsxs)(y.DialogBody,{children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(k.Label,{htmlFor:"nb-name",children:"Name"}),(0,t.jsx)(S.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:i,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&b()},placeholder:"my-branch"}),(0,t.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,t.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,t.jsxs)(k.Label,{htmlFor:"nb-from",children:["Base ref ",(0,t.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,t.jsx)(_,{boxId:e.id,id:"nb-from",value:o,onChange:c,headLabel:"Current HEAD (default)"}),(0,t.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),p?(0,t.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:p}):null]}),(0,t.jsxs)(y.DialogFooter,{children:[(0,t.jsx)(m.Button,{variant:"outline",onClick:r,disabled:d,children:"Cancel"}),(0,t.jsxs)(m.Button,{onClick:b,disabled:!f||d,children:[d?(0,t.jsx)("span",{className:"spin"}):(0,t.jsx)(s.Icons.plus,{}),d?"Creating…":"Create branch"]})]})]})}let H=(0,I.createServerReference)("6096ff4dd5616157cf1da6a977c271641a3ddce491",I.callServer,void 0,I.findSourceMapURL,"restartServiceAction"),G=new Set(["ready","running","done"]),K=new Set(["crashed","unhealthy","backoff","failed"]),V={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 J({svc:e,disabled:r,onRestart:n}){var a;let l=(a=e.state,G.has(a)?"up":K.has(a)?"bad":"idle");return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,t.jsx)("span",{className:(0,i.cn)("badge-dot",V[l]),"aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:e.name}),(0,t.jsx)("span",{className:(0,i.cn)("font-mono text-xs",W[l]),children:e.state}),e.restarts>0?(0,t.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",e.restarts]}):null,(0,t.jsx)(m.Button,{variant:"outline",size:"icon-sm",title:`Restart ${e.name}`,disabled:r,onClick:()=>n(e.name),children:(0,t.jsx)(s.Icons.refresh,{})})]})}function q({id:e,running:r}){let[n,a]=(0,u.useState)(null),[i,l]=(0,u.useState)(null),[c,d]=(0,u.useTransition)(),x=(0,u.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/services`,{credentials:"same-origin"});if(!t.ok)return void l(`status ${String(t.status)}`);a(await t.json()),l(null)}catch(e){l(e instanceof Error?e.message:String(e))}},[e]);(0,u.useEffect)(()=>{if(x(),!r)return;let e=setInterval(()=>void x(),4e3);return()=>clearInterval(e)},[x,r]);let h=t=>{d(async()=>{let r=await H(e,t);r.ok||window.alert(`Restart failed: ${r.error}`),await x()})},f=n?.services??[],b=f.length>0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.SectionLabel,{right:b?(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",disabled:!r||c,onClick:()=>h(void 0),children:[(0,t.jsx)(s.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,t.jsx)(o.Card,{className:"divide-y divide-border/60 overflow-hidden",children:n||i?i?(0,t.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",i,")."]}):b?(0,t.jsxs)(t.Fragment,{children:[n?.source==="persisted"?(0,t.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,f.map(e=>(0,t.jsx)(J,{svc:e,disabled:!r||c,onRestart:e=>h(e)},e.name))]}):(0,t.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,t.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var Q=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,r.useParams)(),{box:i,project:d}=(0,c.useStore)(),u=i(e);if(!u)return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,t.jsx)(v.BackLink,{to:"/",children:"All boxes"}),(0,t.jsx)(w.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let m=d(u.projectId);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)(v.BackLink,{to:"/projects/"+u.projectId,children:m?m.name:"Project"}),(0,t.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[u.task,(0,t.jsx)(a.StatusBadge,{status:u.status})]}),(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:u.id})," ·"," ",(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:u.repo})," · ",u.host]})]}),(0,t.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,t.jsx)(g.BoxActions,{box:u,size:"lg"})})]}),u.error?(0,t.jsx)(l,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:s.Icons.warn,title:"Box errored",children:(0,t.jsx)("span",{className:"font-mono text-secondary-foreground",children:u.error})}):null,(0,t.jsx)(x,{boxId:u.id}),(0,t.jsx)(p.SectionLabel,{children:"Overview"}),(0,t.jsxs)(Q.StatGrid,{children:[(0,t.jsx)(Q.Stat,{k:"Status",v:(0,t.jsx)(a.StatusBadge,{status:u.status})}),(0,t.jsx)(Q.Stat,{k:"Agent CLI",v:u.agent,mono:!0}),(0,t.jsx)(Q.Stat,{k:"Commits",v:u.commits??"—",icon:s.Icons.commit}),(0,t.jsx)(Q.Stat,{k:"Files touched",v:u.filesTouched??"—",icon:s.Icons.file}),(0,t.jsx)(Q.Stat,{k:"Last activity",v:(0,t.jsx)(n.Ago,{ms:u.lastActivity}),mono:!0})]}),(0,t.jsx)(b,{box:u}),(0,t.jsx)(p.SectionLabel,{children:"Git operations"}),(0,t.jsx)(M,{box:u}),(0,t.jsx)(q,{id:u.id,running:"running"===u.status}),(0,t.jsx)(p.SectionLabel,{children:"Details"}),(0,t.jsxs)(o.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,t.jsx)(N,{k:"Box ID",v:u.id,mono:!0}),(0,t.jsx)(N,{k:"Project",v:m?m.name:"—",link:m?"/projects/"+u.projectId:null}),(0,t.jsx)(N,{k:"Repository",v:u.repo,mono:!0}),(0,t.jsx)(N,{k:"Branch",v:u.branch,mono:!0}),(0,t.jsx)(N,{k:"Host",v:u.host,mono:!0}),(0,t.jsx)(N,{k:"Created",v:new Date(u.createdAt).toLocaleString(),mono:!0})]})]})}],77084)}]);
@@ -12564,6 +12564,13 @@ async function ensureBoxBrowser(container, timeoutMs = 8e3, targetUrl = "about:b
12564
12564
  reason: `agent-browser open failed: ${open.stderr || open.stdout || `exit ${String(open.exitCode)}`}`
12565
12565
  };
12566
12566
  }
12567
+ async function ensureBoxBrowserShowingApp(box) {
12568
+ const persisted = await readBoxStatus(box);
12569
+ const exposePort = persisted?.services.find((s) => s.expose)?.expose?.port;
12570
+ const target = exposePort !== void 0 ? box.portlessUrl ?? `http://localhost:${String(exposePort)}` : "about:blank";
12571
+ const res = await ensureBoxBrowser(box.container, void 0, target);
12572
+ return { ...res, target };
12573
+ }
12567
12574
 
12568
12575
  export {
12569
12576
  DEFAULT_RELAY_PORT,
@@ -12795,5 +12802,6 @@ export {
12795
12802
  stopHub,
12796
12803
  getHubStatus,
12797
12804
  browserSessionActive,
12798
- ensureBoxBrowser
12805
+ ensureBoxBrowser,
12806
+ ensureBoxBrowserShowingApp
12799
12807
  };
@@ -19,9 +19,10 @@ import {
19
19
  portlessAlias,
20
20
  portlessGetUrl,
21
21
  portlessUnalias,
22
+ readBoxStatus,
22
23
  registerBoxWithRelay,
23
24
  syncClaudeCredentials
24
- } from "./chunk-TS3DHXYG.js";
25
+ } from "./chunk-2Z74R6ZT.js";
25
26
  import {
26
27
  BOX_DYNAMIC_SYNC_MANIFEST,
27
28
  BOX_HOME,
@@ -2792,6 +2793,26 @@ function defaultCommand(kind, opts) {
2792
2793
  function shellSingle(s) {
2793
2794
  return "'" + s.replace(/'/g, "'\\''") + "'";
2794
2795
  }
2796
+ async function openWebAppOnVncScreen(box, provider) {
2797
+ const persisted = await readBoxStatus(box);
2798
+ const hasWebService = persisted?.services.some((s) => s.expose) ?? false;
2799
+ if (!hasWebService) return { opened: false, reason: "no web service" };
2800
+ try {
2801
+ const target = await provider.resolveUrl(box, { kind: "web" });
2802
+ const br = await provider.exec(
2803
+ box,
2804
+ ["bash", "-lc", `agent-browser open --headed ${quoteShellArg(target)}`],
2805
+ { user: "vscode" }
2806
+ );
2807
+ if (br.exitCode === 0) return { opened: true, target };
2808
+ return {
2809
+ opened: false,
2810
+ reason: br.stderr.trim() || br.stdout.trim() || `exit ${String(br.exitCode)}`
2811
+ };
2812
+ } catch (err) {
2813
+ return { opened: false, reason: err instanceof Error ? err.message : String(err) };
2814
+ }
2815
+ }
2795
2816
 
2796
2817
  export {
2797
2818
  listCloudCheckpoints,
@@ -2802,5 +2823,6 @@ export {
2802
2823
  removeCloudCheckpointDir,
2803
2824
  createCloudProvider,
2804
2825
  hostTermForCloud,
2805
- renderInnerCommand
2826
+ renderInnerCommand,
2827
+ openWebAppOnVncScreen
2806
2828
  };
@@ -21,8 +21,8 @@ import {
21
21
  renderInnerCommand,
22
22
  resolveCloudCheckpoint,
23
23
  writeCloudCheckpointManifest
24
- } from "./chunk-5C7T5LX3.js";
25
- import "./chunk-TS3DHXYG.js";
24
+ } from "./chunk-AR7CEZ2G.js";
25
+ import "./chunk-2Z74R6ZT.js";
26
26
  import "./chunk-3LAHFDJF.js";
27
27
  import {
28
28
  UserFacingError,
@@ -12,11 +12,11 @@ import {
12
12
  } from "./chunk-OF242BLD.js";
13
13
  import {
14
14
  createCloudProvider
15
- } from "./chunk-5C7T5LX3.js";
15
+ } from "./chunk-AR7CEZ2G.js";
16
16
  import {
17
17
  detectPortless,
18
18
  portlessDoctorRow
19
- } from "./chunk-TS3DHXYG.js";
19
+ } from "./chunk-2Z74R6ZT.js";
20
20
  import "./chunk-3LAHFDJF.js";
21
21
  import {
22
22
  UserFacingError,
@@ -18,8 +18,8 @@ import {
18
18
  renderInnerCommand,
19
19
  resolveCloudCheckpoint,
20
20
  writeCloudCheckpointManifest
21
- } from "./chunk-5C7T5LX3.js";
22
- import "./chunk-TS3DHXYG.js";
21
+ } from "./chunk-AR7CEZ2G.js";
22
+ import "./chunk-2Z74R6ZT.js";
23
23
  import "./chunk-3LAHFDJF.js";
24
24
  import {
25
25
  UserFacingError,
@@ -13,8 +13,8 @@ import {
13
13
  } from "./chunk-OF242BLD.js";
14
14
  import {
15
15
  createCloudProvider
16
- } from "./chunk-5C7T5LX3.js";
17
- import "./chunk-TS3DHXYG.js";
16
+ } from "./chunk-AR7CEZ2G.js";
17
+ import "./chunk-2Z74R6ZT.js";
18
18
  import "./chunk-3LAHFDJF.js";
19
19
  import {
20
20
  DOCKER_CONTEXT_FILE_MAP,
@@ -96,6 +96,7 @@ import {
96
96
  ensureAgentboxTasksFile,
97
97
  ensureAgentsVolume,
98
98
  ensureBoxBrowser,
99
+ ensureBoxBrowserShowingApp,
99
100
  ensureClaudeVolume,
100
101
  ensureCodexInstalled,
101
102
  ensureCodexVolume,
@@ -222,7 +223,7 @@ import {
222
223
  vscodeServerVolumeName,
223
224
  waitForTmuxPaneContent,
224
225
  warmUpClaudeCredentials
225
- } from "./chunk-TS3DHXYG.js";
226
+ } from "./chunk-2Z74R6ZT.js";
226
227
  import "./chunk-3LAHFDJF.js";
227
228
  import {
228
229
  AmbiguousBoxError,
@@ -393,6 +394,7 @@ export {
393
394
  ensureAgentboxTasksFile,
394
395
  ensureAgentsVolume,
395
396
  ensureBoxBrowser,
397
+ ensureBoxBrowserShowingApp,
396
398
  ensureClaudeVolume,
397
399
  ensureCodexInstalled,
398
400
  ensureCodexVolume,
@@ -4,11 +4,13 @@ import {
4
4
  } from "./chunk-56YQBVN2.js";
5
5
  import {
6
6
  baseFreshnessFromFingerprints,
7
- currentCloudBaseFingerprint
8
- } from "./chunk-5C7T5LX3.js";
7
+ currentCloudBaseFingerprint,
8
+ openWebAppOnVncScreen
9
+ } from "./chunk-AR7CEZ2G.js";
9
10
  import {
10
11
  enqueuePrepareJob,
11
12
  enqueueQueueJob,
13
+ ensureBoxBrowserShowingApp,
12
14
  hashRpcParams,
13
15
  isValidBoxStatus,
14
16
  listBoxes,
@@ -17,7 +19,7 @@ import {
17
19
  readJob,
18
20
  startRelayDaemon,
19
21
  writeQueueLoginCode
20
- } from "./chunk-TS3DHXYG.js";
22
+ } from "./chunk-2Z74R6ZT.js";
21
23
  import "./chunk-3LAHFDJF.js";
22
24
  import {
23
25
  BOX_WORKSPACE,
@@ -67,11 +69,11 @@ import { promisify } from "node:util";
67
69
  var execFileAsync = promisify(execFile);
68
70
  var DISPLAY_NAME_MAX = 60;
69
71
  var IMPORTERS = {
70
- docker: () => import("./dist-6R5YPL5S.js"),
71
- daytona: () => import("./dist-WRKJHF6W.js"),
72
- hetzner: () => import("./dist-CJHZ37LW.js"),
73
- vercel: () => import("./dist-3ILQQGCH.js"),
74
- e2b: () => import("./dist-PKOFN4OD.js")
72
+ docker: () => import("./dist-VV6Z2CQX.js"),
73
+ daytona: () => import("./dist-SD4G36EP.js"),
74
+ hetzner: () => import("./dist-LZNRLUYY.js"),
75
+ vercel: () => import("./dist-LNHEG5P4.js"),
76
+ e2b: () => import("./dist-Q6G66Z57.js")
75
77
  };
76
78
  var prepareEnqueueChain = /* @__PURE__ */ new Map();
77
79
  async function providerForBox(box) {
@@ -337,7 +339,7 @@ var freshnessCache = /* @__PURE__ */ new Map();
337
339
  async function providerBaseFreshness(id, claudeInstall) {
338
340
  if (id === "docker") {
339
341
  try {
340
- const { evaluateDockerBaseFreshness } = await import("./dist-6R5YPL5S.js");
342
+ const { evaluateDockerBaseFreshness } = await import("./dist-VV6Z2CQX.js");
341
343
  return await evaluateDockerBaseFreshness({ claudeInstall });
342
344
  } catch {
343
345
  return { state: "unknown" };
@@ -662,6 +664,17 @@ function createHubBackend(handle) {
662
664
  await hubWriteSshConfig(box, provider);
663
665
  }),
664
666
  stop: (id) => runLifecycle(id, (box, provider) => provider.stop(box)),
667
+ screen: (id) => runLifecycle(id, async (box, provider) => {
668
+ if ((box.provider ?? "docker") === "docker") {
669
+ const br = await ensureBoxBrowserShowingApp(box);
670
+ if (!br.up) console.warn(`[hub] screen ${box.name}: in-box browser failed: ${br.reason ?? "unknown"}`);
671
+ } else {
672
+ const br = await openWebAppOnVncScreen(box, provider);
673
+ if (!br.opened && br.reason && br.reason !== "no web service") {
674
+ console.warn(`[hub] screen ${box.name}: in-box browser failed: ${br.reason}`);
675
+ }
676
+ }
677
+ }),
665
678
  destroy: (id) => runLifecycle(id, async (box, provider) => {
666
679
  await provider.destroy(box);
667
680
  await syncAgentboxSshConfig().catch(() => {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 AgentBox contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.