@madarco/agentbox 0.23.3 → 0.23.4
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.
- package/CHANGELOG.md +20 -0
- package/dist/index.js +27 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
- package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/{09xn_next_dist_0iwlo01._.js → 09xn_next_dist_1uccfbf._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0vdzfiw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/{[root-of-the-server]__0cpdgd0._.js → [root-of-the-server]__1bd_5o3._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
- package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/000a1sa7te1h8.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/20hq7-0depjid.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3dfjrxx-dy644.css +3 -0
- package/runtime/hub/apps/hub/package.json +1 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1bq2f8q._.js +0 -3
- package/runtime/hub/apps/hub/.next/static/chunks/3rm29i8e-lb25.css +0 -3
- package/runtime/hub/apps/hub/.next/static/chunks/44o5lj23__y1m.js +0 -1
- /package/runtime/hub/apps/hub/.next/static/{12hWAUQ9O9G3VS4vxKuav → eVq-z4zld_8DGQudbYogV}/_buildManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{12hWAUQ9O9G3VS4vxKuav → eVq-z4zld_8DGQudbYogV}/_clientMiddlewareManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{12hWAUQ9O9G3VS4vxKuav → eVq-z4zld_8DGQudbYogV}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
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)}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|