@agents-shire/cli-win32-x64 1.0.3 → 1.0.5
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/package.json +1 -1
- package/shire.exe +0 -0
- package/frontend/chunk-0bse45gk.js +0 -2
- package/frontend/chunk-0kgchkzc.js +0 -2
- package/frontend/chunk-0sevb013.js +0 -2
- package/frontend/chunk-1dh4a5cx.js +0 -2
- package/frontend/chunk-1s0wttpq.js +0 -2
- package/frontend/chunk-22exkank.js +0 -2
- package/frontend/chunk-2e1s65yj.js +0 -2
- package/frontend/chunk-3nr0jqvn.js +0 -1
- package/frontend/chunk-4w7jtd73.js +0 -1
- package/frontend/chunk-54cwnag0.js +0 -2
- package/frontend/chunk-88e95fy7.js +0 -1
- package/frontend/chunk-a192rsyd.js +0 -2
- package/frontend/chunk-acmptvxv.js +0 -2
- package/frontend/chunk-bhn3xax8.js +0 -30
- package/frontend/chunk-crwk8d1a.js +0 -1
- package/frontend/chunk-dcv8hszn.js +0 -2
- package/frontend/chunk-fhmact7z.js +0 -2
- package/frontend/chunk-g1t3cgxq.js +0 -2
- package/frontend/chunk-gx71yw3f.js +0 -12
- package/frontend/chunk-jt8zx64v.js +0 -2
- package/frontend/chunk-k1p6pt0y.js +0 -2
- package/frontend/chunk-n7r5yhva.js +0 -2
- package/frontend/chunk-qf8bwpw7.js +0 -1
- package/frontend/chunk-qsqdrxhf.js +0 -28
- package/frontend/chunk-r19vjw47.js +0 -2
- package/frontend/chunk-sc5hwhz8.js +0 -42
- package/frontend/chunk-sqjb0n8w.js +0 -3
- package/frontend/chunk-t3xdmmp4.js +0 -1
- package/frontend/chunk-zagd9kjc.js +0 -2
- package/frontend/index.html +0 -16
- package/frontend/main.js +0 -214
package/package.json
CHANGED
package/shire.exe
CHANGED
|
Binary file
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Aa as e,Ea as d,Qa as t,Va as o}from"/chunk-bhn3xax8.js";var r=e(d(),1);var n=e(t(),1),p=r.forwardRef(({className:i,type:l,...s},a)=>{return n.jsxDEV("input",{type:l,className:o("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",i),ref:a,...s},void 0,!1,void 0,this)});p.displayName="Input";
|
|
2
|
-
export{p as ka};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{la as H,na as R,pa as F,qa as _,sa as m,ta as I,ua as l,va as v}from"/chunk-n7r5yhva.js";import{Aa as C,Ea as t,Na as e,Sa as E}from"/chunk-bhn3xax8.js";var z=C(t(),1);var D=C(e(),1),x="rovingFocusGroup.onEntryFocus",qq={bubbles:!1,cancelable:!0},j="RovingFocusGroup",[S,u,zq]=m(j),[Jq,Uq]=R(j,[zq]),[Qq,Wq]=Jq(j),d=z.forwardRef((q,W)=>{return D.jsx(S.Provider,{scope:q.__scopeRovingFocusGroup,children:D.jsx(S.Slot,{scope:q.__scopeRovingFocusGroup,children:D.jsx(Xq,{...q,ref:W})})})});d.displayName=j;var Xq=z.forwardRef((q,W)=>{let{__scopeRovingFocusGroup:Z,orientation:J,loop:k=!1,dir:G,currentTabStopId:h,defaultCurrentTabStopId:O,onCurrentTabStopIdChange:N,onEntryFocus:Y,preventScrollOnEntryFocus:$=!1,...w}=q,A=z.useRef(null),M=E(W,A),U=I(G),[P,Q]=F({prop:h,defaultProp:O??null,onChange:N,caller:j}),[V,g]=z.useState(!1),K=l(Y),B=u(Z),T=z.useRef(!1),[c,f]=z.useState(0);return z.useEffect(()=>{let X=A.current;if(X)return X.addEventListener(x,K),()=>X.removeEventListener(x,K)},[K]),D.jsx(Qq,{scope:Z,orientation:J,dir:U,loop:k,currentTabStopId:P,onItemFocus:z.useCallback((X)=>Q(X),[Q]),onItemShiftTab:z.useCallback(()=>g(!0),[]),onFocusableItemAdd:z.useCallback(()=>f((X)=>X+1),[]),onFocusableItemRemove:z.useCallback(()=>f((X)=>X-1),[]),children:D.jsx(_.div,{tabIndex:V||c===0?-1:0,"data-orientation":J,...w,ref:M,style:{outline:"none",...q.style},onMouseDown:H(q.onMouseDown,()=>{T.current=!0}),onFocus:H(q.onFocus,(X)=>{let s=!T.current;if(X.target===X.currentTarget&&s&&!V){let b=new CustomEvent(x,qq);if(X.currentTarget.dispatchEvent(b),!b.defaultPrevented){let y=B().filter((L)=>L.focusable),r=y.find((L)=>L.active),n=y.find((L)=>L.id===P),o=[r,n,...y].filter(Boolean).map((L)=>L.ref.current);i(o,$)}}T.current=!1}),onBlur:H(q.onBlur,()=>g(!1))})})}),p="RovingFocusGroupItem",a=z.forwardRef((q,W)=>{let{__scopeRovingFocusGroup:Z,focusable:J=!0,active:k=!1,tabStopId:G,children:h,...O}=q,N=v(),Y=G||N,$=Wq(p,Z),w=$.currentTabStopId===Y,A=u(Z),{onFocusableItemAdd:M,onFocusableItemRemove:U,currentTabStopId:P}=$;return z.useEffect(()=>{if(J)return M(),()=>U()},[J,M,U]),D.jsx(S.ItemSlot,{scope:Z,id:Y,focusable:J,active:k,children:D.jsx(_.span,{tabIndex:w?0:-1,"data-orientation":$.orientation,...O,ref:W,onMouseDown:H(q.onMouseDown,(Q)=>{if(!J)Q.preventDefault();else $.onItemFocus(Y)}),onFocus:H(q.onFocus,()=>$.onItemFocus(Y)),onKeyDown:H(q.onKeyDown,(Q)=>{if(Q.key==="Tab"&&Q.shiftKey){$.onItemShiftTab();return}if(Q.target!==Q.currentTarget)return;let V=Kq(Q,$.orientation,$.dir);if(V!==void 0){if(Q.metaKey||Q.ctrlKey||Q.altKey||Q.shiftKey)return;Q.preventDefault();let K=A().filter((B)=>B.focusable).map((B)=>B.ref.current);if(V==="last")K.reverse();else if(V==="prev"||V==="next"){if(V==="prev")K.reverse();let B=K.indexOf(Q.currentTarget);K=$.loop?Vq(K,B+1):K.slice(B+1)}setTimeout(()=>i(K))}}),children:typeof h==="function"?h({isCurrentTabStop:w,hasTabStop:P!=null}):h})})});a.displayName=p;var Zq={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $q(q,W){if(W!=="rtl")return q;return q==="ArrowLeft"?"ArrowRight":q==="ArrowRight"?"ArrowLeft":q}function Kq(q,W,Z){let J=$q(q.key,Z);if(W==="vertical"&&["ArrowLeft","ArrowRight"].includes(J))return;if(W==="horizontal"&&["ArrowUp","ArrowDown"].includes(J))return;return Zq[J]}function i(q,W=!1){let Z=document.activeElement;for(let J of q){if(J===Z)return;if(J.focus({preventScroll:W}),document.activeElement!==Z)return}}function Vq(q,W){return q.map((Z,J)=>q[(W+J)%q.length])}var Pq=d,kq=a;
|
|
2
|
-
export{Uq as u,Pq as v,kq as w};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Aa as r,Cb as a,Ea as c,Ia as u,Qa as n}from"/chunk-bhn3xax8.js";var o=r(c(),1);var e=r(n(),1),i=o.createContext(null);function d(){let t=o.useContext(i);if(!t)throw Error("useProjectLayout must be used within a ProjectLayoutProvider");return t}function s({value:t}){return e.jsxDEV(i.Provider,{value:t,children:e.jsxDEV(o.Suspense,{fallback:e.jsxDEV("div",{className:"flex items-center justify-center flex-1",children:e.jsxDEV(a,{size:"lg",className:"text-muted-foreground"},void 0,!1,void 0,this)},void 0,!1,void 0,this),children:e.jsxDEV(u,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}
|
|
2
|
-
export{d as a,s as b};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Aa as b,Ea as m,Fa as Y,Na as R,Qa as B,Ta as V,Ua as F,Va as G}from"/chunk-bhn3xax8.js";var H=b(m(),1);var k=b(m(),1);var o=b(m(),1),Z=b(Y(),1);var L=b(R(),1),_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=_.reduce((y,a)=>{let l=V(`Primitive.${a}`),f=o.forwardRef((J,K)=>{let{asChild:Q,...T}=J,X=Q?l:a;if(typeof window<"u")window[Symbol.for("radix-ui")]=!0;return L.jsx(X,{...T,ref:K})});return f.displayName=`Primitive.${a}`,{...y,[a]:f}},{});var q=b(R(),1),$="Label",z=k.forwardRef((y,a)=>{return q.jsx(W.label,{...y,ref:a,onMouseDown:(l)=>{if(l.target.closest("button, input, select, textarea"))return;if(y.onMouseDown?.(l),!l.defaultPrevented&&l.detail>1)l.preventDefault()}})});z.displayName=$;var P=z;var I=b(B(),1),A=F("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),N=H.forwardRef(({className:y,...a},l)=>I.jsxDEV(P,{ref:l,className:G(A(),y),...a},void 0,!1,void 0,this));N.displayName=P.displayName;
|
|
2
|
-
export{N as K};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Aa as b,Ea as c,Qa as T,Va as o}from"/chunk-bhn3xax8.js";var r=b(c(),1);var l=b(T(),1),m=r.forwardRef(({className:e,...t},a)=>l.jsxDEV("div",{className:"relative w-full overflow-auto",children:l.jsxDEV("table",{ref:a,className:o("w-full caption-bottom text-sm",e),...t},void 0,!1,void 0,this)},void 0,!1,void 0,this));m.displayName="Table";var d=r.forwardRef(({className:e,...t},a)=>l.jsxDEV("thead",{ref:a,className:o("[&_tr]:border-b",e),...t},void 0,!1,void 0,this));d.displayName="TableHeader";var n=r.forwardRef(({className:e,...t},a)=>l.jsxDEV("tbody",{ref:a,className:o("[&_tr:last-child]:border-0",e),...t},void 0,!1,void 0,this));n.displayName="TableBody";var s=r.forwardRef(({className:e,...t},a)=>l.jsxDEV("tfoot",{ref:a,className:o("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t},void 0,!1,void 0,this));s.displayName="TableFooter";var i=r.forwardRef(({className:e,...t},a)=>l.jsxDEV("tr",{ref:a,className:o("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t},void 0,!1,void 0,this));i.displayName="TableRow";var f=r.forwardRef(({className:e,...t},a)=>l.jsxDEV("th",{ref:a,className:o("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t},void 0,!1,void 0,this));f.displayName="TableHead";var R=r.forwardRef(({className:e,...t},a)=>l.jsxDEV("td",{ref:a,className:o("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t},void 0,!1,void 0,this));R.displayName="TableCell";var H=r.forwardRef(({className:e,...t},a)=>l.jsxDEV("caption",{ref:a,className:o("mt-4 text-sm text-muted-foreground",e),...t},void 0,!1,void 0,this));H.displayName="TableCaption";
|
|
2
|
-
export{m as L,d as M,n as N,i as O,f as P,R as Q};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Aa as r,Qa as o,Xa as i,Ya as n}from"/chunk-bhn3xax8.js";var t=r(o(),1);function s({message:a="Something went wrong",onRetry:e}){return t.jsxDEV("div",{role:"alert",className:"flex flex-col items-center justify-center py-12 gap-3 text-center",children:[t.jsxDEV(n,{className:"h-8 w-8 text-destructive"},void 0,!1,void 0,this),t.jsxDEV("p",{className:"text-sm text-muted-foreground",children:a},void 0,!1,void 0,this),e&&t.jsxDEV(i,{variant:"outline",size:"sm",onClick:e,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
|
|
2
|
-
export{s as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as x,h as E}from"/chunk-54cwnag0.js";import{k as T,l as B,m as I,n as y,o as j}from"/chunk-dcv8hszn.js";import"/chunk-0kgchkzc.js";import"/chunk-jt8zx64v.js";import{I as M}from"/chunk-acmptvxv.js";import{R as V}from"/chunk-2e1s65yj.js";import{$ as U,S as D,T as F,U as L,V as S,W as z,X as H,Y as O,Z as $,_ as J,aa as X,ba as Y,ca as W,da as Z}from"/chunk-gx71yw3f.js";import"/chunk-sc5hwhz8.js";import{ka as G}from"/chunk-0bse45gk.js";import"/chunk-n7r5yhva.js";import{xa as d}from"/chunk-zagd9kjc.js";import{za as C}from"/chunk-0sevb013.js";import{Aa as s,Db as R,Ea as ce,Eb as q,Hb as K,Ib as Q,Jb as _,Oa as N,Qa as u,Wa as P,Xa as n,_a as k}from"/chunk-bhn3xax8.js";var a=s(ce(),1);var e=s(u(),1);function de(m){switch(m){case"running":return"default";case"starting":return"secondary";case"error":return"destructive";default:return"secondary"}}var ue=/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/;function h(){let m=N(),{data:p=[],isLoading:te,isError:oe,error:ae,refetch:re}=q(),ne=K(),g=Q(),ie=_();M("projects:lobby",()=>{m.invalidateQueries({queryKey:["projects"]})});let[le,i]=a.useState(!1),[r,v]=a.useState(""),[c,f]=a.useState(null),[w,b]=a.useState(null);a.useEffect(()=>{b(null)},[p]);let l=ue.test(r),A=()=>{if(!l)return;ne.mutate(r),v(""),i(!1)},se=()=>{if(!c)return;g.mutate(c.id),f(null)};if(te)return e.jsxDEV(d,{children:e.jsxDEV(R,{},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(oe)return e.jsxDEV(d,{children:e.jsxDEV(V,{message:ae?.message||"Failed to load projects",onRetry:()=>re()},void 0,!1,void 0,this)},void 0,!1,void 0,this);return e.jsxDEV(d,{children:[e.jsxDEV("div",{className:"space-y-6",children:[e.jsxDEV("div",{className:"flex items-center justify-between",children:[e.jsxDEV("h1",{className:"text-2xl font-bold",children:"Projects"},void 0,!1,void 0,this),e.jsxDEV(n,{onClick:()=>i(!0),children:"+ New Project"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p.length===0?e.jsxDEV("div",{className:"text-center py-16 max-w-md mx-auto",children:[e.jsxDEV("h2",{className:"text-lg font-semibold mb-2",children:"No projects yet"},void 0,!1,void 0,this),e.jsxDEV("p",{className:"text-muted-foreground mb-6",children:"Each project gets its own isolated VM with a team of AI agents that can collaborate on tasks together."},void 0,!1,void 0,this),e.jsxDEV(n,{onClick:()=>i(!0),children:"Create Your First Project"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):e.jsxDEV("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:p.map((t)=>e.jsxDEV(x,{role:"button",tabIndex:0,className:"cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>C(`/projects/${t.name}`),onKeyDown:(o)=>{if(o.key==="Enter"||o.key===" ")o.preventDefault(),C(`/projects/${t.name}`)},children:e.jsxDEV(E,{className:"pt-6",children:e.jsxDEV("div",{className:"flex items-center justify-between",children:[e.jsxDEV("h3",{className:"font-semibold text-lg",children:t.name},void 0,!1,void 0,this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV(j,{variant:de(t.status),children:t.status},void 0,!1,void 0,this),e.jsxDEV(T,{children:[e.jsxDEV(B,{asChild:!0,children:e.jsxDEV(n,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":`${t.name} actions`,onClick:(o)=>o.stopPropagation(),children:e.jsxDEV(k,{className:"h-4 w-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.jsxDEV(I,{align:"end",children:[t.status==="error"&&e.jsxDEV(y,{disabled:w===t.id,onClick:()=>{b(t.id),ie.mutate(t.id)},children:w===t.id?"Restarting...":"Restart"},void 0,!1,void 0,this),e.jsxDEV(y,{className:"text-destructive focus:text-destructive",onClick:(o)=>{o.stopPropagation(),f(t)},children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},t.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV(J,{open:le,onOpenChange:i,children:e.jsxDEV(U,{children:[e.jsxDEV(X,{children:[e.jsxDEV(W,{children:"New Project"},void 0,!1,void 0,this),e.jsxDEV(Z,{children:"Create a new project with its own isolated VM."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV("div",{className:"py-4 space-y-2",children:[e.jsxDEV(G,{placeholder:"my-project",value:r,onChange:(t)=>v(t.target.value.toLowerCase()),onKeyDown:(t)=>{if(t.key==="Enter")A()},autoFocus:!0,"aria-describedby":r&&!l?"project-name-error":void 0,"aria-invalid":r!==""&&!l},void 0,!1,void 0,this),r&&!l&&e.jsxDEV("p",{id:"project-name-error",className:"text-sm text-destructive",children:"Use lowercase letters, numbers, and hyphens only. Must start and end with a letter or number."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV(Y,{children:[e.jsxDEV(n,{variant:"outline",onClick:()=>i(!1),children:"Cancel"},void 0,!1,void 0,this),e.jsxDEV(n,{onClick:A,disabled:!l,children:"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),e.jsxDEV(D,{open:!!c,onOpenChange:(t)=>!t&&f(null),children:e.jsxDEV(F,{children:[e.jsxDEV(L,{children:[e.jsxDEV(z,{children:"Delete Project"},void 0,!1,void 0,this),e.jsxDEV(H,{children:["Are you sure you want to delete “",c?.name,"”? This will destroy the VM and all its data. This action cannot be undone."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV(S,{children:[e.jsxDEV($,{children:"Cancel"},void 0,!1,void 0,this),e.jsxDEV(O,{className:P({variant:"destructive"}),onClick:se,disabled:g.isPending,children:g.isPending?"Deleting...":"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var ee=s(u(),1);function me(){return ee.jsxDEV(h,{},void 0,!1,void 0,this)}export{me as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Y}from"/chunk-k1p6pt0y.js";import{d as w,h as y}from"/chunk-54cwnag0.js";import{i as b,j as D}from"/chunk-r19vjw47.js";import{k as _,l as $,m as U,n as q,o as d}from"/chunk-dcv8hszn.js";import"/chunk-0kgchkzc.js";import"/chunk-fhmact7z.js";import"/chunk-jt8zx64v.js";import"/chunk-a192rsyd.js";import"/chunk-1s0wttpq.js";import{S as p,T as u,U as A,V as f,W as v,X as N,Y as C,Z as h}from"/chunk-gx71yw3f.js";import"/chunk-sc5hwhz8.js";import"/chunk-0bse45gk.js";import"/chunk-n7r5yhva.js";import{xa as Z}from"/chunk-zagd9kjc.js";import{za as T}from"/chunk-0sevb013.js";import{Aa as l,Cb as I,Db as z,Ea as re,Gb as G,Ha as k,Lb as J,Mb as K,Ob as Q,Pb as W,Qa as m,Qb as X,Wa as O,Xa as o,_a as F,bb as L,sb as H}from"/chunk-bhn3xax8.js";var s=l(re(),1);var e=l(m(),1),le=(i)=>i==="active"||i==="starting"||i==="bootstrapping";function P(){let{agentName:i}=k(),{projectId:a,projectName:j}=G(),{data:E=[]}=J(a),r=E.find((B)=>B.name===i)?.id,{data:M}=K(a,r),n=X(a??""),g=W(a??""),V=Q(a??""),[ee,c]=s.useState(!1),[te,R]=s.useState(!1),[ae,S]=s.useState(!1);if(!a||!r||!M)return e.jsxDEV(z,{},void 0,!1,void 0,this);let t=M,ne=(B,oe)=>{let{id:me,...ie}=oe;V.mutate({id:t.id,...ie}),c(!1)};return e.jsxDEV(Z,{children:[e.jsxDEV("div",{className:"space-y-6",children:[e.jsxDEV("div",{className:"flex items-center justify-between",children:[e.jsxDEV("div",{className:"flex items-center gap-3",children:[e.jsxDEV(o,{variant:"ghost",size:"icon","aria-label":"Back",onClick:()=>T(`/projects/${j}/agents/${t.name}`),children:e.jsxDEV(L,{className:"h-5 w-5"},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.jsxDEV("h1",{className:"text-2xl font-bold",children:t.name},void 0,!1,void 0,this),e.jsxDEV(d,{variant:b(t.status),children:t.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV(o,{variant:"outline",onClick:()=>c(!0),children:[e.jsxDEV(H,{className:"h-4 w-4 mr-1"},void 0,!1,void 0,this),"Edit"]},void 0,!0,void 0,this),le(t.status)?e.jsxDEV(o,{variant:"outline",onClick:()=>S(!0),children:"Restart Agent"},void 0,!1,void 0,this):e.jsxDEV(o,{onClick:()=>n.mutate(r),disabled:n.isPending,children:[n.isPending&&e.jsxDEV(I,{size:"sm",className:"mr-1"},void 0,!1,void 0,this),"Start Agent"]},void 0,!0,void 0,this),e.jsxDEV(_,{children:[e.jsxDEV($,{asChild:!0,children:e.jsxDEV(o,{variant:"ghost",size:"icon","aria-label":"More actions",children:e.jsxDEV(F,{className:"h-4 w-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.jsxDEV(U,{align:"end",children:e.jsxDEV(q,{className:"text-destructive focus:text-destructive",onClick:()=>R(!0),children:"Delete Agent"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV("div",{className:"space-y-6",children:[e.jsxDEV(w,{children:e.jsxDEV(y,{className:"pt-6",children:e.jsxDEV("dl",{className:"divide-y divide-border",children:[e.jsxDEV("div",{className:"py-3 grid grid-cols-3 gap-4",children:[e.jsxDEV("dt",{className:"text-sm font-medium text-muted-foreground",children:"Name"},void 0,!1,void 0,this),e.jsxDEV("dd",{className:"text-sm col-span-2",children:t.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.description&&e.jsxDEV("div",{className:"py-3 grid grid-cols-3 gap-4",children:[e.jsxDEV("dt",{className:"text-sm font-medium text-muted-foreground",children:"Description"},void 0,!1,void 0,this),e.jsxDEV("dd",{className:"text-sm col-span-2",children:t.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV("div",{className:"py-3 grid grid-cols-3 gap-4",children:[e.jsxDEV("dt",{className:"text-sm font-medium text-muted-foreground",children:"Model"},void 0,!1,void 0,this),e.jsxDEV("dd",{className:"text-sm col-span-2",children:t.model||"Not set"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.harness&&e.jsxDEV("div",{className:"py-3 grid grid-cols-3 gap-4",children:[e.jsxDEV("dt",{className:"text-sm font-medium text-muted-foreground",children:"Harness"},void 0,!1,void 0,this),e.jsxDEV("dd",{className:"text-sm col-span-2",children:e.jsxDEV(d,{variant:"outline",children:D(t.harness)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV("div",{className:"py-3 grid grid-cols-3 gap-4",children:[e.jsxDEV("dt",{className:"text-sm font-medium text-muted-foreground",children:"Status"},void 0,!1,void 0,this),e.jsxDEV("dd",{className:"text-sm col-span-2",children:e.jsxDEV(d,{variant:b(t.status),children:t.status},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.jsxDEV(w,{children:e.jsxDEV(y,{className:"pt-6",children:[e.jsxDEV("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"System Prompt"},void 0,!1,void 0,this),e.jsxDEV("pre",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:t.systemPrompt||"Not set"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV(Y,{open:ee,title:"Edit Agent",agent:t,onSave:ne,onClose:()=>c(!1)},void 0,!1,void 0,this),e.jsxDEV(p,{open:ae,onOpenChange:S,children:e.jsxDEV(u,{children:[e.jsxDEV(A,{children:[e.jsxDEV(v,{children:"Restart Agent"},void 0,!1,void 0,this),e.jsxDEV(N,{children:"This will stop the current runner and restart the agent. The VM will be preserved."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV(f,{children:[e.jsxDEV(h,{children:"Cancel"},void 0,!1,void 0,this),e.jsxDEV(C,{onClick:()=>n.mutate(r),disabled:n.isPending,children:n.isPending?"Restarting...":"Restart"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),e.jsxDEV(p,{open:te,onOpenChange:R,children:e.jsxDEV(u,{children:[e.jsxDEV(A,{children:[e.jsxDEV(v,{children:"Delete Agent"},void 0,!1,void 0,this),e.jsxDEV(N,{children:"This will stop the agent and permanently remove its workspace directory. This cannot be undone."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.jsxDEV(f,{children:[e.jsxDEV(h,{children:"Cancel"},void 0,!1,void 0,this),e.jsxDEV(C,{className:O({variant:"destructive"}),onClick:()=>g.mutate(r),disabled:g.isPending,children:g.isPending?"Deleting...":"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var x=l(m(),1);function de(){return x.jsxDEV(P,{},void 0,!1,void 0,this)}export{de as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Aa as o,Ea as l,Qa as c,Va as r}from"/chunk-bhn3xax8.js";var d=o(l(),1);var i=o(c(),1),n=d.forwardRef(({className:e,...t},a)=>i.jsxDEV("div",{ref:a,className:r("rounded-xl border bg-card text-card-foreground shadow",e),...t},void 0,!1,void 0,this));n.displayName="Card";var m=d.forwardRef(({className:e,...t},a)=>i.jsxDEV("div",{ref:a,className:r("flex flex-col space-y-1.5 p-6",e),...t},void 0,!1,void 0,this));m.displayName="CardHeader";var s=d.forwardRef(({className:e,...t},a)=>i.jsxDEV("div",{ref:a,className:r("font-semibold leading-none tracking-tight",e),...t},void 0,!1,void 0,this));s.displayName="CardTitle";var f=d.forwardRef(({className:e,...t},a)=>i.jsxDEV("div",{ref:a,className:r("text-sm text-muted-foreground",e),...t},void 0,!1,void 0,this));f.displayName="CardDescription";var H=d.forwardRef(({className:e,...t},a)=>i.jsxDEV("div",{ref:a,className:r("p-6 pt-0",e),...t},void 0,!1,void 0,this));H.displayName="CardContent";var T=d.forwardRef(({className:e,...t},a)=>i.jsxDEV("div",{ref:a,className:r("flex items-center p-6 pt-0",e),...t},void 0,!1,void 0,this));T.displayName="CardFooter";
|
|
2
|
-
export{n as d,m as e,s as f,f as g,H as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as fN}from"/chunk-1dh4a5cx.js";import{i as JN}from"/chunk-r19vjw47.js";import{k as oN,l as zN,m as UN,n as BN,o as l}from"/chunk-dcv8hszn.js";import{p as S}from"/chunk-qsqdrxhf.js";import"/chunk-0kgchkzc.js";import"/chunk-jt8zx64v.js";import{H as hN}from"/chunk-a192rsyd.js";import{I as qN}from"/chunk-acmptvxv.js";import{R as yN}from"/chunk-2e1s65yj.js";import"/chunk-sc5hwhz8.js";import"/chunk-n7r5yhva.js";import{Aa as X,Ab as $N,Bb as kN,Cb as V,Ea as s,Gb as r,Ha as PN,Lb as uN,Oa as x,Qa as k,Qb as QN,Rb as D,Sb as XN,Tb as _N,Ub as LN,Vb as GN,Xa as Y,Za as bN,gb as KN,hb as WN,jb as e,nb as i,ob as HN,rb as YN,wb as ZN,zb as ON}from"/chunk-bhn3xax8.js";var y=X(s(),1),E=X(s(),1);var $=X(k(),1);function t({agent:W,onMenuToggle:v}){let{projectId:b}=r(),G=GN(b??"");return $.jsxDEV("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[v&&$.jsxDEV(Y,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":"Open menu",onClick:v,children:$.jsxDEV(i,{className:"h-5 w-5"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("h2",{className:"text-lg font-semibold",children:W.name},void 0,!1,void 0,this),$.jsxDEV(l,{variant:JN(W.status),children:W.status},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ml-auto",children:$.jsxDEV(oN,{children:[$.jsxDEV(zN,{asChild:!0,children:$.jsxDEV(Y,{variant:"ghost",size:"icon","aria-label":"Agent options",children:$.jsxDEV(bN,{className:"h-4 w-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(UN,{align:"end",children:$.jsxDEV(BN,{onClick:()=>G.mutate(W.id),children:[$.jsxDEV(WN,{className:"h-4 w-4 mr-2"},void 0,!1,void 0,this),"Clear Session"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var o=X(s(),1);var N=X(k(),1),RN=52428800;function CN(W){if(W<1024)return`${W} B`;if(W<1048576)return`${(W/1024).toFixed(1)} KB`;return`${(W/1048576).toFixed(1)} MB`}var lN=o.memo(function({attachments:v,projectName:b,agentId:G}){if(!v.length)return null;return N.jsxDEV("div",{className:"flex flex-wrap gap-2 mt-2",children:v.map((J)=>{let K=`/api/projects/${b}/agents/${G}/attachments/${J.id}/${J.filename}`;return J.content_type.startsWith("image/")?N.jsxDEV("a",{href:K,target:"_blank",rel:"noopener noreferrer",className:"block rounded-md border border-border overflow-hidden hover:opacity-90 transition-opacity",children:N.jsxDEV("img",{src:K,alt:J.filename,loading:"lazy",className:"max-w-48 max-h-32 object-cover"},void 0,!1,void 0,this)},J.id,!1,void 0,this):N.jsxDEV("a",{href:K,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-2 rounded-md border border-border hover:bg-muted/50 text-sm",children:[N.jsxDEV(e,{className:"h-4 w-4 shrink-0 text-muted-foreground"},void 0,!1,void 0,this),N.jsxDEV("span",{className:"truncate max-w-40",children:J.filename},void 0,!1,void 0,this),N.jsxDEV("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:["(",CN(J.size),")"]},void 0,!0,void 0,this),N.jsxDEV(KN,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"},void 0,!1,void 0,this)]},J.id,!0,void 0,this)})},void 0,!1,void 0,this)}),SN=o.memo(function({msg:v}){let[b,G]=o.useState(!1),J=v.input?JSON.stringify(v.input,null,2):"",K=v.output!=null;return N.jsxDEV("div",{className:"max-w-[80%] rounded-lg border border-border text-sm w-fit",children:[N.jsxDEV("button",{type:"button",onClick:()=>G(!b),"aria-expanded":b,className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50 rounded-lg",children:[N.jsxDEV("span",{className:"text-muted-foreground",children:b?"▼":"▶"},void 0,!1,void 0,this),N.jsxDEV(l,{variant:"outline",className:"font-mono text-xs",children:v.tool},void 0,!1,void 0,this),K?N.jsxDEV(l,{variant:v.isError?"destructive":"secondary",className:"text-xs",children:v.isError?"error":"done"},void 0,!1,void 0,this):N.jsxDEV("span",{className:"text-xs text-muted-foreground animate-pulse",children:"running..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&N.jsxDEV("div",{className:"border-t border-border px-3 py-2 space-y-2",children:[J&&N.jsxDEV("div",{children:[N.jsxDEV("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Input"},void 0,!1,void 0,this),N.jsxDEV("pre",{className:"whitespace-pre-wrap font-mono text-xs bg-muted/50 rounded p-2 max-h-40 overflow-y-auto",children:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K&&N.jsxDEV("div",{children:[N.jsxDEV("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Output"},void 0,!1,void 0,this),N.jsxDEV("pre",{className:"whitespace-pre-wrap font-mono text-xs bg-muted/50 rounded p-2 max-h-40 overflow-y-auto",children:v.output},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}),dN=o.memo(function({msg:v}){let[b,G]=o.useState(!1);return N.jsxDEV("div",{className:"max-w-[80%] rounded-lg border border-border text-sm w-fit",children:[N.jsxDEV("button",{type:"button",onClick:()=>G(!b),"aria-expanded":b,className:"flex w-full items-center gap-2 px-3 py-1.5 text-left hover:bg-muted/50 rounded-lg italic",children:[N.jsxDEV("span",{className:"text-muted-foreground",children:b?"▼":"▶"},void 0,!1,void 0,this),N.jsxDEV("span",{className:"text-muted-foreground",children:["Message from ",v.fromAgent]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),b&&N.jsxDEV("div",{className:"border-t border-border px-3 py-2",children:N.jsxDEV(S,{children:v.text??""},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}),mN=o.memo(function({msg:v}){let[b,G]=o.useState(!1);return N.jsxDEV("div",{className:"max-w-[80%] rounded-lg border border-border text-sm w-fit",children:[N.jsxDEV(Y,{variant:"ghost",onClick:()=>G(!b),"aria-expanded":b,className:"flex w-full items-center gap-2 px-3 py-1.5 text-left italic h-auto justify-start",children:[N.jsxDEV("span",{className:"text-muted-foreground",children:b?"▼":"▶"},void 0,!1,void 0,this),N.jsxDEV("span",{className:"text-muted-foreground",children:"System notification"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&N.jsxDEV("div",{className:"border-t border-border px-3 py-2",children:N.jsxDEV(S,{children:v.text??""},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)});function IN(W){return W.map((v)=>{let{content:b}=v;return{id:v.id,role:v.role,ts:v.createdAt,text:b.text,tool:b.tool,tool_use_id:b.tool_use_id,input:b.input,output:b.output,isError:b.isError,fromAgent:b.fromAgent,attachments:b.attachments}})}function NN({agent:W,streamingText:v}){let{projectId:b,projectName:G}=r(),J=x(),K=()=>J.setQueryData(["agents",b],(w)=>w?.map((U)=>U.id===W.id?{...U,busy:!0}:U)),{data:_,isLoading:P,fetchNextPage:d,hasNextPage:a,isFetchingNextPage:j}=D(b,W.id),M=XN(b??""),q=_N(b??""),B=QN(b??""),h=o.useMemo(()=>{if(!_)return[];let w=[..._.pages].reverse().flatMap((U)=>U.messages);return IN(w)},[_]),T=a??!1,u=j,[L,m]=o.useState(""),[C,f]=o.useState(""),[H,O]=o.useState([]),F=o.useRef(null),A=o.useRef(null),p=o.useRef(null),I=o.useRef(null),n=o.useRef(0),g=o.useRef(0),c=o.useRef(!1);o.useEffect(()=>{f(""),c.current=!1,n.current=0,g.current=0},[W.id]),o.useEffect(()=>{f(v??"")},[v]),o.useEffect(()=>{let w=n.current,U=I.current;if(U&&h.length>0){if(!c.current)c.current=!0,p.current?.scrollIntoView();else if(h.length>w){let Z=g.current;if(Z>0&&U.scrollHeight>Z&&U.scrollTop<50)U.scrollTop=U.scrollHeight-Z;else p.current?.scrollIntoView({behavior:"smooth"})}}n.current=h.length},[h]),o.useEffect(()=>{if(C&&c.current)p.current?.scrollIntoView()},[C]),o.useEffect(()=>{if(W.busy&&c.current)p.current?.scrollIntoView({behavior:"smooth"})},[W.busy]),o.useEffect(()=>{let w=I.current;if(w)g.current=w.scrollHeight});let MN=o.useCallback(()=>{let w=I.current;if(!w||!T||u)return;if(w.scrollTop===0&&h.length>0)d()},[T,u,d,h.length]),TN=o.useCallback((w)=>{let U=w.target.files;if(!U)return;Array.from(U).forEach((Z)=>{if(Z.size>RN)return;let R=new FileReader;R.onload=()=>{let pN=R.result;O((cN)=>[...cN,{name:Z.name,size:Z.size,base64:pN,content_type:Z.type||"application/octet-stream"}])},R.readAsDataURL(Z)}),w.target.value=""},[]),FN=o.useCallback((w)=>{O((U)=>U.filter((Z,R)=>R!==w))},[]),vN=()=>{let w=L.trim();if(!w&&H.length===0)return;let U=H.length>0?H.map((Z)=>({name:Z.name,content:Z.base64,content_type:Z.content_type})):void 0;if(K(),M.mutate({agentId:W.id,text:w||"",attachments:U}),m(""),O([]),A.current)A.current.style.height="auto"},AN=h.length>0||C.length>0;return N.jsxDEV("div",{className:"flex flex-col h-full",children:[N.jsxDEV("div",{ref:I,onScroll:MN,className:"flex-1 overflow-y-auto p-4 space-y-3",children:[u&&N.jsxDEV("div",{className:"flex justify-center py-2",children:N.jsxDEV("span",{className:"text-xs text-muted-foreground animate-pulse",children:"Loading older messages..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),P&&N.jsxDEV("div",{className:"flex items-center justify-center h-full",children:N.jsxDEV(V,{size:"md",className:"text-muted-foreground"},void 0,!1,void 0,this)},void 0,!1,void 0,this),!P&&!AN&&N.jsxDEV("div",{className:"flex flex-col items-center justify-center h-full gap-4 max-w-sm mx-auto text-center",children:[N.jsxDEV("p",{className:"text-sm text-muted-foreground",children:"Send a message to start working with this agent."},void 0,!1,void 0,this),W.status==="active"&&N.jsxDEV("div",{className:"flex flex-wrap justify-center gap-2",children:["What can you help me with?","What tools do you have?"].map((w)=>N.jsxDEV(Y,{variant:"outline",size:"sm",className:"rounded-full",onClick:()=>{K(),M.mutate({agentId:W.id,text:w})},children:w},w,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h.map((w,U)=>w.role==="tool_use"?N.jsxDEV(SN,{msg:w},w.id??`msg-${U}`,!1,void 0,this):w.role==="inter_agent"?N.jsxDEV(dN,{msg:w},w.id??`msg-${U}`,!1,void 0,this):w.role==="system"?N.jsxDEV(mN,{msg:w},w.id??`msg-${U}`,!1,void 0,this):N.jsxDEV("div",{className:`flex ${w.role==="user"?"justify-end":"justify-start"}`,children:N.jsxDEV("div",{className:`px-3 py-1.5 rounded-lg text-sm w-fit max-w-[80%] ${w.role==="user"?"bg-primary/10 text-foreground":"bg-muted"}`,children:[w.text?N.jsxDEV(S,{children:w.text},void 0,!1,void 0,this):null,w.attachments&&w.attachments.length>0&&N.jsxDEV(lN,{attachments:w.attachments,projectName:G,agentId:W.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},w.id??`msg-${U}`,!1,void 0,this)),C&&N.jsxDEV("div",{className:"flex justify-start",children:N.jsxDEV("div",{className:"px-3 py-1.5 rounded-lg text-sm w-fit max-w-[80%] bg-muted",children:N.jsxDEV(S,{children:C},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),W.busy&&!C&&N.jsxDEV("div",{className:"flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground",role:"status","aria-live":"polite",children:[N.jsxDEV("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-status-active animate-pulse","aria-hidden":"true"},void 0,!1,void 0,this),"Thinking..."]},void 0,!0,void 0,this),N.jsxDEV("div",{ref:p},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.status==="active"?N.jsxDEV("div",{className:"border-t border-border p-4",children:[N.jsxDEV("input",{ref:F,type:"file",multiple:!0,className:"hidden",onChange:TN},void 0,!1,void 0,this),H.length>0&&N.jsxDEV("div",{className:"flex flex-wrap gap-2 mb-2",children:H.map((w,U)=>N.jsxDEV("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md border border-border bg-muted/50 text-xs",children:[N.jsxDEV(e,{className:"h-3 w-3 text-muted-foreground"},void 0,!1,void 0,this),N.jsxDEV("span",{className:"truncate max-w-32",children:w.name},void 0,!1,void 0,this),N.jsxDEV("span",{className:"text-muted-foreground",children:["(",CN(w.size),")"]},void 0,!0,void 0,this),N.jsxDEV("button",{type:"button",onClick:()=>FN(U),className:"text-muted-foreground hover:text-foreground",children:N.jsxDEV($N,{className:"h-3 w-3"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},`${w.name}-${U}`,!0,void 0,this))},void 0,!1,void 0,this),N.jsxDEV("div",{className:"flex gap-2 items-end",children:[N.jsxDEV(Y,{variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>F.current?.click(),"aria-label":"Attach file",children:N.jsxDEV(YN,{className:"h-4 w-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this),N.jsxDEV(hN,{ref:A,value:L,onChange:(w)=>{m(w.target.value),w.target.style.height="auto",w.target.style.height=Math.min(w.target.scrollHeight,150)+"px"},placeholder:"Type a message...",rows:1,className:"min-h-0 resize-none",onKeyDown:(w)=>{if(w.key==="Enter"&&!w.shiftKey)w.preventDefault(),vN()}},void 0,!1,void 0,this),W.busy?N.jsxDEV(Y,{variant:"destructive",size:"icon",onClick:()=>q.mutate(W.id),"aria-label":"Stop",children:N.jsxDEV(ZN,{className:"h-4 w-4 fill-current"},void 0,!1,void 0,this)},void 0,!1,void 0,this):N.jsxDEV(Y,{onClick:vN,disabled:M.isPending,children:"Send"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):W.status==="idle"?N.jsxDEV("div",{className:"border-t border-border p-4",children:N.jsxDEV("div",{className:"flex items-center justify-between gap-3",children:[N.jsxDEV("p",{className:"text-sm text-muted-foreground",children:"Agent is idle. It will restart automatically when the VM wakes up."},void 0,!1,void 0,this),N.jsxDEV(Y,{variant:"outline",size:"sm",onClick:()=>B.mutate(W.id),disabled:B.isPending,children:B.isPending?"Restarting...":"Restart"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var z=X(k(),1);function wN({onNewAgent:W,onBrowseCatalog:v,onMenuToggle:b,hasAgents:G}){return z.jsxDEV("div",{className:"flex flex-col h-full",children:[b&&z.jsxDEV("div",{className:"px-4 py-3 border-b border-border md:hidden",children:z.jsxDEV(Y,{variant:"ghost",size:"icon","aria-label":"Open menu",onClick:b,children:z.jsxDEV(i,{className:"h-5 w-5"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV("div",{className:"flex flex-col items-center justify-center flex-1 p-8 max-w-lg mx-auto",children:[z.jsxDEV("h1",{className:"text-2xl font-bold mb-2",children:"Shire"},void 0,!1,void 0,this),G?z.jsxDEV(z.Fragment,{children:[z.jsxDEV("p",{className:"text-muted-foreground text-center mb-6",children:"Select an agent from the sidebar to start chatting."},void 0,!1,void 0,this),z.jsxDEV(Y,{onClick:W,children:"+ New Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):z.jsxDEV(z.Fragment,{children:[z.jsxDEV("p",{className:"text-muted-foreground text-center mb-8",children:"Create AI agents that work together. Each agent runs in its own sandbox and can collaborate with others through messaging."},void 0,!1,void 0,this),z.jsxDEV("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 w-full mb-8",children:[z.jsxDEV("div",{className:"flex flex-col items-center text-center gap-2 p-3",children:[z.jsxDEV("div",{className:"rounded-full bg-primary/10 p-2.5",children:z.jsxDEV(HN,{className:"h-5 w-5 text-primary"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-sm text-muted-foreground",children:"Chat with agents directly"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"flex flex-col items-center text-center gap-2 p-3",children:[z.jsxDEV("div",{className:"rounded-full bg-primary/10 p-2.5",children:z.jsxDEV(ON,{className:"h-5 w-5 text-primary"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-sm text-muted-foreground",children:"Agents collaborate autonomously"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"flex flex-col items-center text-center gap-2 p-3",children:[z.jsxDEV("div",{className:"rounded-full bg-primary/10 p-2.5",children:z.jsxDEV(kN,{className:"h-5 w-5 text-primary"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-sm text-muted-foreground",children:"Isolated VMs per project"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"flex flex-col sm:flex-row gap-3",children:[v&&z.jsxDEV(Y,{variant:"outline",onClick:v,children:"Browse Catalog"},void 0,!1,void 0,this),z.jsxDEV(Y,{onClick:W,children:"+ New Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Q=X(k(),1);function iN(W,v,b,G){W.setQueryData(["agents",v],(J)=>J?.map((K)=>K.id===b?{...K,...G}:K))}function rN(){let{agentName:W}=PN(),{projectId:v,sidebarOpen:b,setSidebarOpen:G,onNewAgent:J,onBrowseCatalog:K}=fN(),_=x(),{data:P=[],isLoading:d,isError:a,error:j,refetch:M}=uN(v),q=W?P.find((O)=>O.name===W):P[0],B=q?.id,{data:h}=D(v,B),T=LN(v??""),[u,L]=E.useState(""),m=E.useCallback((O)=>{switch(O.type){case"text_delta":{let{delta:F}=O.payload;if(F)L((A)=>A+F);break}case"text":case"turn_complete":{if(L(""),B)_.invalidateQueries({queryKey:["messages",v,B]});break}case"tool_use":case"tool_result":case"inter_agent_message":case"attachment":case"error":case"system_message":{if(B)_.invalidateQueries({queryKey:["messages",v,B]});break}}},[v,B,_]);qN(v&&B?`project:${v}:agent:${B}`:null,m);let C=y.useRef(B);if(C.current!==B){if(C.current=B,u!=="")L("")}let f=h?.pages?.[0]?.messages?.at(-1)?.id,H=y.useRef(T);if(y.useEffect(()=>{H.current=T}),y.useEffect(()=>{if(!v||!B||!f)return;H.current.mutate({agentId:B,messageId:f}),iN(_,v,B,{unreadCount:0})},[v,B,f,_]),q)return Q.jsxDEV(Q.Fragment,{children:[Q.jsxDEV(t,{agent:q,onMenuToggle:()=>G(!b)},void 0,!1,void 0,this),Q.jsxDEV("div",{className:"flex-1 min-h-0",children:Q.jsxDEV(NN,{agent:q,streamingText:u},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(d)return Q.jsxDEV("div",{className:"flex items-center justify-center flex-1",children:Q.jsxDEV(V,{size:"lg",className:"text-muted-foreground"},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(a)return Q.jsxDEV("div",{className:"flex items-center justify-center flex-1",children:Q.jsxDEV(yN,{message:j?.message||"Failed to load agents",onRetry:()=>M()},void 0,!1,void 0,this)},void 0,!1,void 0,this);return Q.jsxDEV(wN,{onNewAgent:J,onBrowseCatalog:K,onMenuToggle:()=>G(!b),hasAgents:P.length>0},void 0,!1,void 0,this)}export{rN as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Aa as e,Ea as d,Qa as r,Va as t}from"/chunk-bhn3xax8.js";var a=e(d(),1);var o=e(r(),1),l=a.forwardRef(({className:n,...s},i)=>{return o.jsxDEV("textarea",{className:t("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:i,...s},void 0,!1,void 0,this)});l.displayName="Textarea";
|
|
2
|
-
export{l as H};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Aa as P,Ea as Q}from"/chunk-bhn3xax8.js";var z=P(Q(),1),F=1000,U=30000;class G{ws=null;handlers=new Map;pendingSubscriptions=new Set;reconnectTimer=null;url;retryMs=F;_connectionState="disconnected";stateListeners=new Set;intentionalClose=!1;constructor(){let j=window.location.protocol==="https:"?"wss:":"ws:";this.url=`${j}//${window.location.host}/ws`}get connectionState(){return this._connectionState}setConnectionState(j){if(this._connectionState===j)return;this._connectionState=j;for(let m of this.stateListeners)m()}onStateChange(j){return this.stateListeners.add(j),()=>{this.stateListeners.delete(j)}}connect(){if(this.ws?.readyState===WebSocket.OPEN)return;this.setConnectionState("connecting"),this.ws=new WebSocket(this.url),this.ws.onopen=()=>{this.retryMs=F,this.setConnectionState("connected");for(let j of this.handlers.keys())this.send({type:"subscribe",topic:j});for(let j of this.pendingSubscriptions)this.send({type:"subscribe",topic:j}),this.pendingSubscriptions.delete(j)},this.ws.onmessage=(j)=>{let m;try{m=JSON.parse(j.data)}catch{return}let q=this.handlers.get(m.topic);if(q)for(let D of q)D(m)},this.ws.onclose=()=>{if(this.intentionalClose){this.intentionalClose=!1;return}this.setConnectionState("disconnected"),this.reconnectTimer=setTimeout(()=>this.connect(),this.retryMs),this.retryMs=Math.min(this.retryMs*2,U)}}subscribe(j,m){let q=this.handlers.get(j);if(!q)if(q=new Set,this.handlers.set(j,q),this.ws?.readyState===WebSocket.OPEN)this.send({type:"subscribe",topic:j});else this.pendingSubscriptions.add(j);return q.add(m),()=>{if(q.delete(m),q.size===0){if(this.handlers.delete(j),this.ws?.readyState===WebSocket.OPEN)this.send({type:"unsubscribe",topic:j})}}}send(j){if(this.ws?.readyState===WebSocket.OPEN)this.ws.send(JSON.stringify(j))}disconnect(){if(this.reconnectTimer)clearTimeout(this.reconnectTimer);this.intentionalClose=!0,this.ws?.close(),this.ws=null,this.setConnectionState("disconnected")}}var B=null;function J(){if(!B)B=new G,B.connect();return B}function Z(j,m){let q=z.useRef(m);z.useEffect(()=>{q.current=m}),z.useEffect(()=>{if(!j)return;return J().subscribe(j,(O)=>{q.current(O)})},[j])}function $(){let j=J();return z.useSyncExternalStore((m)=>j.onStateChange(m),()=>j.connectionState)}
|
|
2
|
-
export{Z as I,$ as J};
|