@anvia/studio 0.7.13 → 0.7.14

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 (25) hide show
  1. package/dist/ui/assets/{evals-page-eIWZ_vsI.js → evals-page-w-gdHmQ3.js} +2 -2
  2. package/dist/ui/assets/{evals-page-eIWZ_vsI.js.map → evals-page-w-gdHmQ3.js.map} +1 -1
  3. package/dist/ui/assets/{index-CC5mjRie.js → index-BImv2lI7.js} +17 -17
  4. package/dist/ui/assets/index-BImv2lI7.js.map +1 -0
  5. package/dist/ui/assets/{knowledge-page-C6WkzIFh.js → knowledge-page-Diqg4sSt.js} +2 -2
  6. package/dist/ui/assets/{knowledge-page-C6WkzIFh.js.map → knowledge-page-Diqg4sSt.js.map} +1 -1
  7. package/dist/ui/assets/{mcps-page-BJ4m_GoP.js → mcps-page-XTpTg88A.js} +2 -2
  8. package/dist/ui/assets/{mcps-page-BJ4m_GoP.js.map → mcps-page-XTpTg88A.js.map} +1 -1
  9. package/dist/ui/assets/{memory-page-BuerJ-04.js → memory-page-DXesSt0M.js} +2 -2
  10. package/dist/ui/assets/{memory-page-BuerJ-04.js.map → memory-page-DXesSt0M.js.map} +1 -1
  11. package/dist/ui/assets/{pipelines-page-Dx0uB0Dm.js → pipelines-page-Bk0Qm7db.js} +2 -2
  12. package/dist/ui/assets/{pipelines-page-Dx0uB0Dm.js.map → pipelines-page-Bk0Qm7db.js.map} +1 -1
  13. package/dist/ui/assets/{sessions-page-UdXui_Zk.js → sessions-page-CmDz8RxM.js} +2 -2
  14. package/dist/ui/assets/{sessions-page-UdXui_Zk.js.map → sessions-page-CmDz8RxM.js.map} +1 -1
  15. package/dist/ui/assets/{status-page-DC5pVW4o.js → status-page-oWsYfXZZ.js} +2 -2
  16. package/dist/ui/assets/{status-page-DC5pVW4o.js.map → status-page-oWsYfXZZ.js.map} +1 -1
  17. package/dist/ui/assets/{tools-page-ByKfOqk3.js → tools-page-C-ht7C6S.js} +2 -2
  18. package/dist/ui/assets/{tools-page-ByKfOqk3.js.map → tools-page-C-ht7C6S.js.map} +1 -1
  19. package/dist/ui/assets/{trace-browser-Dk7nD7KO.js → trace-browser-DaE4vnXd.js} +2 -2
  20. package/dist/ui/assets/{trace-browser-Dk7nD7KO.js.map → trace-browser-DaE4vnXd.js.map} +1 -1
  21. package/dist/ui/assets/{transcript-item-DbtXMj-E.js → transcript-item-BqGgawoe.js} +2 -2
  22. package/dist/ui/assets/{transcript-item-DbtXMj-E.js.map → transcript-item-BqGgawoe.js.map} +1 -1
  23. package/dist/ui/index.html +1 -1
  24. package/package.json +4 -4
  25. package/dist/ui/assets/index-CC5mjRie.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{i as e,r as t,s as n,t as r}from"./utils-BN2yP0LH.js";import{o as i,t as a}from"./format-C9HPGfkW.js";import{A as o,B as s,C as c,D as l,F as u,M as d,N as f,P as p,S as m,T as h,_ as g,b as _,c as v,g as y,h as b,k as ee,o as x,v as S,w as C,y as w}from"./index-CC5mjRie.js";var T=[[`path`,{d:`M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.5 16.5L9.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M14.5 16.5L14.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],E=n(e(),1),D=t(),O=`Dialog`,[k,te]=ee(O),[A,j]=k(O),M=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=E.useRef(null),c=E.useRef(null),[l,u]=g({prop:r,defaultProp:i??!1,onChange:a,caller:O});return(0,D.jsx)(A,{scope:t,triggerRef:s,contentRef:c,contentId:_(),titleId:_(),descriptionId:_(),open:l,onOpenChange:u,onOpenToggle:E.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};M.displayName=O;var N=`DialogTrigger`,ne=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=j(N,n),a=u(t,i.triggerRef);return(0,D.jsx)(l.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Q(i.open),...r,ref:a,onClick:o(e.onClick,i.onOpenToggle)})});ne.displayName=N;var P=`DialogPortal`,[F,I]=k(P,{forceMount:void 0}),L=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=j(P,t);return(0,D.jsx)(F,{scope:t,forceMount:n,children:E.Children.map(r,e=>(0,D.jsx)(S,{present:n||a.open,children:(0,D.jsx)(w,{asChild:!0,container:i,children:e})}))})};L.displayName=P;var R=`DialogOverlay`,z=E.forwardRef((e,t)=>{let n=I(R,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=j(R,e.__scopeDialog);return a.modal?(0,D.jsx)(S,{present:r||a.open,children:(0,D.jsx)(V,{...i,ref:t})}):null});z.displayName=R;var B=p(`DialogOverlay.RemoveScroll`),V=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=j(R,n),a=u(t,h());return(0,D.jsx)(b,{as:B,allowPinchZoom:!0,shards:[i.contentRef],children:(0,D.jsx)(l.div,{"data-state":Q(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),H=`DialogContent`,U=E.forwardRef((e,t)=>{let n=I(H,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=j(H,e.__scopeDialog);return(0,D.jsx)(S,{present:r||a.open,children:a.modal?(0,D.jsx)(W,{...i,ref:t}):(0,D.jsx)(G,{...i,ref:t})})});U.displayName=H;var W=E.forwardRef((e,t)=>{let n=j(H,e.__scopeDialog),r=E.useRef(null),i=u(t,n.contentRef,r);return E.useEffect(()=>{let e=r.current;if(e)return y(e)},[]),(0,D.jsx)(K,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:o(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:o(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:o(e.onFocusOutside,e=>e.preventDefault())})}),G=E.forwardRef((e,t)=>{let n=j(H,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return(0,D.jsx)(K,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),K=E.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=j(H,n);return c(),(0,D.jsx)(D.Fragment,{children:(0,D.jsx)(m,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,D.jsx)(C,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Q(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),q=`DialogTitle`,J=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=j(q,n);return(0,D.jsx)(l.h2,{id:i.titleId,...r,ref:t})});J.displayName=q;var Y=`DialogDescription`,X=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=j(Y,n);return(0,D.jsx)(l.p,{id:i.descriptionId,...r,ref:t})});X.displayName=Y;var Z=`DialogClose`,re=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=j(Z,n);return(0,D.jsx)(l.button,{type:`button`,...r,ref:t,onClick:o(e.onClick,()=>i.onOpenChange(!1))})});re.displayName=Z;function Q(e){return e?`open`:`closed`}var ie=M;function ae({className:e,children:t,...n}){return(0,D.jsxs)(L,{children:[(0,D.jsx)(z,{className:`fixed inset-0 z-50 bg-background/80 backdrop-blur-sm`}),(0,D.jsx)(U,{className:r(`fixed left-1/2 top-1/2 z-50 grid w-[min(420px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover p-5 text-popover-foreground shadow-2xl shadow-black/40`,e),...n,children:t})]})}function oe({className:e,...t}){return(0,D.jsx)(`div`,{className:r(`grid gap-1.5`,e),...t})}function se({className:e,...t}){return(0,D.jsx)(`div`,{className:r(`flex justify-end gap-2`,e),...t})}function ce({className:e,...t}){return(0,D.jsx)(J,{className:r(`text-base font-bold`,e),...t})}function le({className:e,...t}){return(0,D.jsx)(X,{className:r(`text-sm leading-6 text-muted-foreground`,e),...t})}function $(e){return e.sessionsEnabled?(0,D.jsx)(x,{className:`overflow-auto pb-6 pr-6`,"aria-label":`Sessions`,children:(0,D.jsxs)(v,{className:`min-w-225 rounded-xl p-2`,children:[(0,D.jsxs)(`div`,{className:`sticky top-0 z-10 grid min-h-11 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px_72px] items-center gap-4 rounded-lg border border-border/60 bg-card/95 px-4 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground backdrop-blur`,children:[(0,D.jsx)(`span`,{children:`Session`}),(0,D.jsx)(`span`,{children:`Agent`}),(0,D.jsx)(`span`,{children:`Messages`}),(0,D.jsx)(`span`,{children:`Updated`}),(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})]}),e.sessionLoadState===`loading`&&e.sessions.length===0?(0,D.jsx)(`div`,{className:`px-5 py-4 text-sm font-medium text-muted-foreground`,children:`Loading sessions`}):null,e.sessionLoadState===`idle`&&e.sessions.length===0?(0,D.jsx)(`div`,{className:`px-5 py-4 text-sm font-medium text-muted-foreground`,children:`No sessions`}):null,e.sessions.map(t=>(0,D.jsxs)(`div`,{className:r(`mt-1 grid min-h-14 w-full min-w-0 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px_72px] items-center gap-4 rounded-lg border border-transparent px-4 text-left text-muted-foreground transition duration-200 hover:border-border/70 hover:bg-accent/80 hover:text-accent-foreground`,t.id===e.selectedSessionId&&`border-border/80 bg-muted/45 text-foreground`),children:[(0,D.jsxs)(f,{className:`col-span-4 grid h-full min-h-14 min-w-0 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px] items-center justify-start gap-4 border-0 bg-transparent p-0 text-left text-inherit shadow-none hover:bg-transparent hover:text-inherit`,type:`button`,variant:`ghost`,onClick:()=>e.onOpenSession(t.id),children:[(0,D.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,D.jsx)(`strong`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:t.title??`Untitled chat`}),(0,D.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-muted-foreground`,children:t.id})]}),(0,D.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium`,children:a(e.agents,t.agentId)}),(0,D.jsxs)(`span`,{className:`text-xs font-medium tabular-nums text-muted-foreground`,children:[t.messageCount,` messages`]}),(0,D.jsx)(`time`,{className:`text-xs font-medium text-muted-foreground`,children:i(t.updatedAt)})]}),(0,D.jsxs)(`span`,{className:`flex items-center justify-end gap-1`,children:[(0,D.jsx)(f,{"aria-label":`View tracing for ${t.title??`Untitled chat`}`,className:`h-7 min-h-7 w-7 border-0 bg-transparent p-0 text-muted-foreground opacity-80 hover:bg-transparent hover:text-foreground hover:opacity-100 [&_svg]:h-3.5 [&_svg]:w-3.5`,size:`icon`,type:`button`,variant:`ghost`,onClick:n=>{n.stopPropagation(),e.onViewSessionTracing(t.id)},children:(0,D.jsx)(d,{icon:s,"aria-hidden":`true`})}),(0,D.jsx)(f,{"aria-label":`Delete ${t.title??`Untitled chat`}`,className:`h-7 min-h-7 w-7 border-0 bg-transparent p-0 text-muted-foreground opacity-80 hover:bg-transparent hover:text-destructive hover:opacity-100 [&_svg]:h-3.5 [&_svg]:w-3.5`,size:`icon`,type:`button`,variant:`ghost`,onClick:n=>{n.stopPropagation(),e.onDeleteSession(t)},children:(0,D.jsx)(d,{icon:T,"aria-hidden":`true`})})]})]},t.id))]})}):(0,D.jsx)(`div`,{className:`w-full rounded-lg border border-dashed border-border p-8 text-sm font-medium text-muted-foreground`,children:`Sessions are disabled`})}function ue(e){let t=e.session?.title??`Untitled chat`;return(0,D.jsx)(ie,{open:e.session!==void 0,onOpenChange:e.onOpenChange,children:(0,D.jsxs)(ae,{children:[(0,D.jsxs)(oe,{children:[(0,D.jsx)(ce,{children:`Delete session`}),(0,D.jsxs)(le,{children:[`Delete "`,t,`" and its traces. This cannot be undone.`]})]}),(0,D.jsxs)(se,{children:[(0,D.jsx)(f,{type:`button`,variant:`ghost`,onClick:()=>e.onOpenChange(!1),children:`Cancel`}),(0,D.jsx)(f,{type:`button`,variant:`destructive`,onClick:()=>{e.session!==void 0&&e.onConfirm(e.session)},children:`Delete`})]})]})})}export{ue as DeleteSessionDialog,$ as SessionsPage};
2
- //# sourceMappingURL=sessions-page-UdXui_Zk.js.map
1
+ import{i as e,r as t,s as n,t as r}from"./utils-BN2yP0LH.js";import{o as i,t as a}from"./format-C9HPGfkW.js";import{A as o,B as s,C as c,D as l,F as u,M as d,N as f,P as p,S as m,T as h,_ as g,b as _,c as v,g as y,h as b,k as ee,o as x,v as S,w as C,y as w}from"./index-BImv2lI7.js";var T=[[`path`,{d:`M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.5 16.5L9.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M14.5 16.5L14.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],E=n(e(),1),D=t(),O=`Dialog`,[k,te]=ee(O),[A,j]=k(O),M=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=E.useRef(null),c=E.useRef(null),[l,u]=g({prop:r,defaultProp:i??!1,onChange:a,caller:O});return(0,D.jsx)(A,{scope:t,triggerRef:s,contentRef:c,contentId:_(),titleId:_(),descriptionId:_(),open:l,onOpenChange:u,onOpenToggle:E.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};M.displayName=O;var N=`DialogTrigger`,ne=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=j(N,n),a=u(t,i.triggerRef);return(0,D.jsx)(l.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Q(i.open),...r,ref:a,onClick:o(e.onClick,i.onOpenToggle)})});ne.displayName=N;var P=`DialogPortal`,[F,I]=k(P,{forceMount:void 0}),L=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=j(P,t);return(0,D.jsx)(F,{scope:t,forceMount:n,children:E.Children.map(r,e=>(0,D.jsx)(S,{present:n||a.open,children:(0,D.jsx)(w,{asChild:!0,container:i,children:e})}))})};L.displayName=P;var R=`DialogOverlay`,z=E.forwardRef((e,t)=>{let n=I(R,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=j(R,e.__scopeDialog);return a.modal?(0,D.jsx)(S,{present:r||a.open,children:(0,D.jsx)(V,{...i,ref:t})}):null});z.displayName=R;var B=p(`DialogOverlay.RemoveScroll`),V=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=j(R,n),a=u(t,h());return(0,D.jsx)(b,{as:B,allowPinchZoom:!0,shards:[i.contentRef],children:(0,D.jsx)(l.div,{"data-state":Q(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),H=`DialogContent`,U=E.forwardRef((e,t)=>{let n=I(H,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=j(H,e.__scopeDialog);return(0,D.jsx)(S,{present:r||a.open,children:a.modal?(0,D.jsx)(W,{...i,ref:t}):(0,D.jsx)(G,{...i,ref:t})})});U.displayName=H;var W=E.forwardRef((e,t)=>{let n=j(H,e.__scopeDialog),r=E.useRef(null),i=u(t,n.contentRef,r);return E.useEffect(()=>{let e=r.current;if(e)return y(e)},[]),(0,D.jsx)(K,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:o(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:o(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:o(e.onFocusOutside,e=>e.preventDefault())})}),G=E.forwardRef((e,t)=>{let n=j(H,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return(0,D.jsx)(K,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),K=E.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=j(H,n);return c(),(0,D.jsx)(D.Fragment,{children:(0,D.jsx)(m,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,D.jsx)(C,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Q(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),q=`DialogTitle`,J=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=j(q,n);return(0,D.jsx)(l.h2,{id:i.titleId,...r,ref:t})});J.displayName=q;var Y=`DialogDescription`,X=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=j(Y,n);return(0,D.jsx)(l.p,{id:i.descriptionId,...r,ref:t})});X.displayName=Y;var Z=`DialogClose`,re=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=j(Z,n);return(0,D.jsx)(l.button,{type:`button`,...r,ref:t,onClick:o(e.onClick,()=>i.onOpenChange(!1))})});re.displayName=Z;function Q(e){return e?`open`:`closed`}var ie=M;function ae({className:e,children:t,...n}){return(0,D.jsxs)(L,{children:[(0,D.jsx)(z,{className:`fixed inset-0 z-50 bg-background/80 backdrop-blur-sm`}),(0,D.jsx)(U,{className:r(`fixed left-1/2 top-1/2 z-50 grid w-[min(420px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover p-5 text-popover-foreground shadow-2xl shadow-black/40`,e),...n,children:t})]})}function oe({className:e,...t}){return(0,D.jsx)(`div`,{className:r(`grid gap-1.5`,e),...t})}function se({className:e,...t}){return(0,D.jsx)(`div`,{className:r(`flex justify-end gap-2`,e),...t})}function ce({className:e,...t}){return(0,D.jsx)(J,{className:r(`text-base font-bold`,e),...t})}function le({className:e,...t}){return(0,D.jsx)(X,{className:r(`text-sm leading-6 text-muted-foreground`,e),...t})}function $(e){return e.sessionsEnabled?(0,D.jsx)(x,{className:`overflow-auto pb-6 pr-6`,"aria-label":`Sessions`,children:(0,D.jsxs)(v,{className:`min-w-225 rounded-xl p-2`,children:[(0,D.jsxs)(`div`,{className:`sticky top-0 z-10 grid min-h-11 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px_72px] items-center gap-4 rounded-lg border border-border/60 bg-card/95 px-4 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground backdrop-blur`,children:[(0,D.jsx)(`span`,{children:`Session`}),(0,D.jsx)(`span`,{children:`Agent`}),(0,D.jsx)(`span`,{children:`Messages`}),(0,D.jsx)(`span`,{children:`Updated`}),(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})]}),e.sessionLoadState===`loading`&&e.sessions.length===0?(0,D.jsx)(`div`,{className:`px-5 py-4 text-sm font-medium text-muted-foreground`,children:`Loading sessions`}):null,e.sessionLoadState===`idle`&&e.sessions.length===0?(0,D.jsx)(`div`,{className:`px-5 py-4 text-sm font-medium text-muted-foreground`,children:`No sessions`}):null,e.sessions.map(t=>(0,D.jsxs)(`div`,{className:r(`mt-1 grid min-h-14 w-full min-w-0 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px_72px] items-center gap-4 rounded-lg border border-transparent px-4 text-left text-muted-foreground transition duration-200 hover:border-border/70 hover:bg-accent/80 hover:text-accent-foreground`,t.id===e.selectedSessionId&&`border-border/80 bg-muted/45 text-foreground`),children:[(0,D.jsxs)(f,{className:`col-span-4 grid h-full min-h-14 min-w-0 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px] items-center justify-start gap-4 border-0 bg-transparent p-0 text-left text-inherit shadow-none hover:bg-transparent hover:text-inherit`,type:`button`,variant:`ghost`,onClick:()=>e.onOpenSession(t.id),children:[(0,D.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,D.jsx)(`strong`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:t.title??`Untitled chat`}),(0,D.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-muted-foreground`,children:t.id})]}),(0,D.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium`,children:a(e.agents,t.agentId)}),(0,D.jsxs)(`span`,{className:`text-xs font-medium tabular-nums text-muted-foreground`,children:[t.messageCount,` messages`]}),(0,D.jsx)(`time`,{className:`text-xs font-medium text-muted-foreground`,children:i(t.updatedAt)})]}),(0,D.jsxs)(`span`,{className:`flex items-center justify-end gap-1`,children:[(0,D.jsx)(f,{"aria-label":`View tracing for ${t.title??`Untitled chat`}`,className:`h-7 min-h-7 w-7 border-0 bg-transparent p-0 text-muted-foreground opacity-80 hover:bg-transparent hover:text-foreground hover:opacity-100 [&_svg]:h-3.5 [&_svg]:w-3.5`,size:`icon`,type:`button`,variant:`ghost`,onClick:n=>{n.stopPropagation(),e.onViewSessionTracing(t.id)},children:(0,D.jsx)(d,{icon:s,"aria-hidden":`true`})}),(0,D.jsx)(f,{"aria-label":`Delete ${t.title??`Untitled chat`}`,className:`h-7 min-h-7 w-7 border-0 bg-transparent p-0 text-muted-foreground opacity-80 hover:bg-transparent hover:text-destructive hover:opacity-100 [&_svg]:h-3.5 [&_svg]:w-3.5`,size:`icon`,type:`button`,variant:`ghost`,onClick:n=>{n.stopPropagation(),e.onDeleteSession(t)},children:(0,D.jsx)(d,{icon:T,"aria-hidden":`true`})})]})]},t.id))]})}):(0,D.jsx)(`div`,{className:`w-full rounded-lg border border-dashed border-border p-8 text-sm font-medium text-muted-foreground`,children:`Sessions are disabled`})}function ue(e){let t=e.session?.title??`Untitled chat`;return(0,D.jsx)(ie,{open:e.session!==void 0,onOpenChange:e.onOpenChange,children:(0,D.jsxs)(ae,{children:[(0,D.jsxs)(oe,{children:[(0,D.jsx)(ce,{children:`Delete session`}),(0,D.jsxs)(le,{children:[`Delete "`,t,`" and its traces. This cannot be undone.`]})]}),(0,D.jsxs)(se,{children:[(0,D.jsx)(f,{type:`button`,variant:`ghost`,onClick:()=>e.onOpenChange(!1),children:`Cancel`}),(0,D.jsx)(f,{type:`button`,variant:`destructive`,onClick:()=>{e.session!==void 0&&e.onConfirm(e.session)},children:`Delete`})]})]})})}export{ue as DeleteSessionDialog,$ as SessionsPage};
2
+ //# sourceMappingURL=sessions-page-CmDz8RxM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sessions-page-UdXui_Zk.js","names":["Dialog","PortalPrimitive","RemoveScroll","DialogContent","Fragment","DialogTitle","DialogDescription"],"sources":["../../../../../node_modules/.pnpm/@hugeicons+core-free-icons@4.2.2/node_modules/@hugeicons/core-free-icons/dist/esm/Delete02Icon.js","../../../../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.17_@types+react-dom@19.2.3_@types+react@19.2.14__@types+reac_02115fea7d1b017428075e9497896153/node_modules/@radix-ui/react-dialog/dist/index.mjs","../../../src/ui/app/components/ui/dialog.tsx","../../../src/ui/app/modules/sessions/sessions-page.tsx"],"sourcesContent":["const Delete02Icon = [\n [\"path\", { d: \"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeWidth: \"1.5\", key: \"0\" }],\n [\"path\", { d: \"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeWidth: \"1.5\", key: \"1\" }],\n [\"path\", { d: \"M9.5 16.5L9.5 10.5\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeWidth: \"1.5\", key: \"2\" }],\n [\"path\", { d: \"M14.5 16.5L14.5 10.5\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeWidth: \"1.5\", key: \"3\" }]\n];\n\nexport { Delete02Icon as default };\n//# sourceMappingURL=Delete02Icon.js.map\n","\"use client\";\n\n// src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer, useDismissableLayerSurface } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar Slot = createSlot(\"DialogOverlay.RemoveScroll\");\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n const registerDismissableSurface = useDismissableLayerSurface();\n const composedRefs = useComposedRefs(forwardedRef, registerDismissableSurface);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: composedRefs,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: context.open,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n useFocusGuards();\n return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: forwardedRef,\n deferPointerDownOutside: true,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ) });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nvar WarningProvider = (props) => {\n return props.children;\n};\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nexport {\n DialogClose as Close,\n DialogContent as Content,\n DialogDescription as Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogOverlay as Overlay,\n DialogPortal as Portal,\n Dialog as Root,\n DialogTitle as Title,\n DialogTrigger as Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n","import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport type * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport const Dialog = DialogPrimitive.Root;\nexport const DialogTrigger = DialogPrimitive.Trigger;\nexport const DialogClose = DialogPrimitive.Close;\n\nexport function DialogContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content>) {\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm\" />\n <DialogPrimitive.Content\n className={cn(\n \"fixed left-1/2 top-1/2 z-50 grid w-[min(420px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover p-5 text-popover-foreground shadow-2xl shadow-black/40\",\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\nexport function DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"grid gap-1.5\", className)} {...props} />;\n}\n\nexport function DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"flex justify-end gap-2\", className)} {...props} />;\n}\n\nexport function DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return <DialogPrimitive.Title className={cn(\"text-base font-bold\", className)} {...props} />;\n}\n\nexport function DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-sm leading-6 text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n","import { Activity01Icon, Delete02Icon } from \"@hugeicons/core-free-icons\";\nimport type { StudioConfig, StudioSessionSummary } from \"../../../../types\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../../components/ui/dialog\";\nimport { StudioIcon } from \"../../components/ui/icon\";\nimport { StudioPageShell, StudioSurface } from \"../../components/ui/studio\";\nimport { cn } from \"../../lib/utils\";\nimport { agentLabel, formatRelativeTime } from \"../shared/format\";\nimport type { SessionLoadState } from \"../shared/types\";\n\nexport function SessionsPage(props: {\n agents: StudioConfig[\"agents\"];\n sessions: StudioSessionSummary[];\n sessionsEnabled: boolean;\n sessionLoadState: SessionLoadState;\n selectedSessionId: string;\n onOpenSession: (sessionId: string) => void;\n onViewSessionTracing: (sessionId: string) => void;\n onDeleteSession: (session: StudioSessionSummary) => void;\n}) {\n if (!props.sessionsEnabled) {\n return (\n <div className=\"w-full rounded-lg border border-dashed border-border p-8 text-sm font-medium text-muted-foreground\">\n Sessions are disabled\n </div>\n );\n }\n\n return (\n <StudioPageShell className=\"overflow-auto pb-6 pr-6\" aria-label=\"Sessions\">\n <StudioSurface className=\"min-w-225 rounded-xl p-2\">\n <div className=\"sticky top-0 z-10 grid min-h-11 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px_72px] items-center gap-4 rounded-lg border border-border/60 bg-card/95 px-4 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground backdrop-blur\">\n <span>Session</span>\n <span>Agent</span>\n <span>Messages</span>\n <span>Updated</span>\n <span className=\"sr-only\">Actions</span>\n </div>\n {props.sessionLoadState === \"loading\" && props.sessions.length === 0 ? (\n <div className=\"px-5 py-4 text-sm font-medium text-muted-foreground\">\n Loading sessions\n </div>\n ) : null}\n {props.sessionLoadState === \"idle\" && props.sessions.length === 0 ? (\n <div className=\"px-5 py-4 text-sm font-medium text-muted-foreground\">No sessions</div>\n ) : null}\n {props.sessions.map((session) => (\n <div\n className={cn(\n \"mt-1 grid min-h-14 w-full min-w-0 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px_72px] items-center gap-4 rounded-lg border border-transparent px-4 text-left text-muted-foreground transition duration-200 hover:border-border/70 hover:bg-accent/80 hover:text-accent-foreground\",\n session.id === props.selectedSessionId &&\n \"border-border/80 bg-muted/45 text-foreground\",\n )}\n key={session.id}\n >\n <Button\n className=\"col-span-4 grid h-full min-h-14 min-w-0 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px] items-center justify-start gap-4 border-0 bg-transparent p-0 text-left text-inherit shadow-none hover:bg-transparent hover:text-inherit\"\n type=\"button\"\n variant=\"ghost\"\n onClick={() => props.onOpenSession(session.id)}\n >\n <span className=\"grid min-w-0 gap-0.5\">\n <strong className=\"min-w-0 truncate text-sm font-medium text-foreground\">\n {session.title ?? \"Untitled chat\"}\n </strong>\n <span className=\"min-w-0 truncate text-xs font-medium text-muted-foreground\">\n {session.id}\n </span>\n </span>\n <span className=\"min-w-0 truncate text-xs font-medium\">\n {agentLabel(props.agents, session.agentId)}\n </span>\n <span className=\"text-xs font-medium tabular-nums text-muted-foreground\">\n {session.messageCount} messages\n </span>\n <time className=\"text-xs font-medium text-muted-foreground\">\n {formatRelativeTime(session.updatedAt)}\n </time>\n </Button>\n <span className=\"flex items-center justify-end gap-1\">\n <Button\n aria-label={`View tracing for ${session.title ?? \"Untitled chat\"}`}\n className=\"h-7 min-h-7 w-7 border-0 bg-transparent p-0 text-muted-foreground opacity-80 hover:bg-transparent hover:text-foreground hover:opacity-100 [&_svg]:h-3.5 [&_svg]:w-3.5\"\n size=\"icon\"\n type=\"button\"\n variant=\"ghost\"\n onClick={(event) => {\n event.stopPropagation();\n props.onViewSessionTracing(session.id);\n }}\n >\n <StudioIcon icon={Activity01Icon} aria-hidden=\"true\" />\n </Button>\n <Button\n aria-label={`Delete ${session.title ?? \"Untitled chat\"}`}\n className=\"h-7 min-h-7 w-7 border-0 bg-transparent p-0 text-muted-foreground opacity-80 hover:bg-transparent hover:text-destructive hover:opacity-100 [&_svg]:h-3.5 [&_svg]:w-3.5\"\n size=\"icon\"\n type=\"button\"\n variant=\"ghost\"\n onClick={(event) => {\n event.stopPropagation();\n props.onDeleteSession(session);\n }}\n >\n <StudioIcon icon={Delete02Icon} aria-hidden=\"true\" />\n </Button>\n </span>\n </div>\n ))}\n </StudioSurface>\n </StudioPageShell>\n );\n}\n\nexport function DeleteSessionDialog(props: {\n session: StudioSessionSummary | undefined;\n onOpenChange: (open: boolean) => void;\n onConfirm: (session: StudioSessionSummary) => void;\n}) {\n const title = props.session?.title ?? \"Untitled chat\";\n\n return (\n <Dialog open={props.session !== undefined} onOpenChange={props.onOpenChange}>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Delete session</DialogTitle>\n <DialogDescription>\n Delete \"{title}\" and its traces. This cannot be undone.\n </DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <Button type=\"button\" variant=\"ghost\" onClick={() => props.onOpenChange(false)}>\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n onClick={() => {\n if (props.session !== undefined) {\n props.onConfirm(props.session);\n }\n }}\n >\n Delete\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n"],"x_google_ignoreList":[0,1],"mappings":"2RAAA,IAAM,EAAe,CACnB,CAAC,OAAQ,CAAE,EAAG,qSAAsS,OAAQ,eAAgB,cAAe,QAAS,YAAa,MAAO,IAAK,IAAK,CAAC,CACnY,CAAC,OAAQ,CAAE,EAAG,8SAA+S,OAAQ,eAAgB,cAAe,QAAS,YAAa,MAAO,IAAK,IAAK,CAAC,CAC5Y,CAAC,OAAQ,CAAE,EAAG,qBAAsB,OAAQ,eAAgB,cAAe,QAAS,YAAa,MAAO,IAAK,IAAK,CAAC,CACnH,CAAC,OAAQ,CAAE,EAAG,uBAAwB,OAAQ,eAAgB,cAAe,QAAS,YAAa,MAAO,IAAK,IAAK,CAAC,CACtH,kBCcG,EAAc,SACd,CAAC,EAAqB,IAAqB,GAAmB,EAAY,CAC1E,CAAC,EAAgB,GAAoB,EAAoB,EAAY,CACrEA,EAAU,GAAU,CACtB,GAAM,CACJ,gBACA,WACA,KAAM,EACN,cACA,eACA,QAAQ,IACN,EACE,EAAA,EAAmB,OAAO,KAAK,CAC/B,EAAA,EAAmB,OAAO,KAAK,CAC/B,CAAC,EAAM,GAAW,EAAqB,CAC3C,KAAM,EACN,YAAa,GAAe,GAC5B,SAAU,EACV,OAAQ,EACT,CAAC,CACF,OAAuB,EAAA,EAAA,KACrB,EACA,CACE,MAAO,EACP,aACA,aACA,UAAW,GAAO,CAClB,QAAS,GAAO,CAChB,cAAe,GAAO,CACtB,OACA,aAAc,EACd,aAAA,EAAoB,gBAAkB,EAAS,GAAa,CAAC,EAAS,CAAE,CAAC,EAAQ,CAAC,CAClF,QACA,WACD,CACF,EAEH,EAAO,YAAc,EACrB,IAAI,EAAe,gBACf,GAAA,EAAsB,YACvB,EAAO,IAAiB,CACvB,GAAM,CAAE,gB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KAAC,EAAD,CACE,aAAY,UAAU,EAAQ,OAAS,kBACvC,UAAU,yKACV,KAAK,OACL,KAAK,SACL,QAAQ,QACR,QAAU,GAAU,CAClB,EAAM,iBAAiB,CACvB,EAAM,gBAAgB,EAAQ,YAGhC,EAAA,EAAA,KAAC,EAAD,CAAY,KAAM,EAAc,cAAY,OAAS,CAAA,CAC9C,CAAA,CACJ,GACH,EAtDC,EAAQ,GAsDT,CACN,CACY,GACA,CAAA,EAxFhB,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,8GAAqG,wBAE9G,CAAA,CA0FZ,SAAgB,GAAoB,EAIjC,CACD,IAAM,EAAQ,EAAM,SAAS,OAAS,gBAEtC,OACE,EAAA,EAAA,KAAC,GAAD,CAAQ,KAAM,EAAM,UAAY,IAAA,GAAW,aAAc,EAAM,uBAC7D,EAAA,EAAA,MAAC,GAAD,CAAA,SAAA,EACE,EAAA,EAAA,MAAC,GAAD,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,GAAD,CAAA,SAAa,iBAA4B,CAAA,EACzC,EAAA,EAAA,MAAC,GAAD,CAAA,SAAA,CAAmB,WACR,EAAM,2CACG,CAAA,CAAA,CACP,CAAA,CAAA,EACf,EAAA,EAAA,MAAC,GAAD,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,EAAD,CAAQ,KAAK,SAAS,QAAQ,QAAQ,YAAe,EAAM,aAAa,GAAM,UAAE,SAEvE,CAAA,EACT,EAAA,EAAA,KAAC,EAAD,CACE,KAAK,SACL,QAAQ,cACR,YAAe,CACT,EAAM,UAAY,IAAA,IACpB,EAAM,UAAU,EAAM,QAAQ,WAGnC,SAEQ,CAAA,CACI,CAAA,CAAA,CACD,CAAA,CAAA,CACT,CAAA"}
1
+ {"version":3,"file":"sessions-page-CmDz8RxM.js","names":["Dialog","PortalPrimitive","RemoveScroll","DialogContent","Fragment","DialogTitle","DialogDescription"],"sources":["../../../../../node_modules/.pnpm/@hugeicons+core-free-icons@4.2.2/node_modules/@hugeicons/core-free-icons/dist/esm/Delete02Icon.js","../../../../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.17_@types+react-dom@19.2.3_@types+react@19.2.14__@types+reac_02115fea7d1b017428075e9497896153/node_modules/@radix-ui/react-dialog/dist/index.mjs","../../../src/ui/app/components/ui/dialog.tsx","../../../src/ui/app/modules/sessions/sessions-page.tsx"],"sourcesContent":["const Delete02Icon = [\n [\"path\", { d: \"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeWidth: \"1.5\", key: \"0\" }],\n [\"path\", { d: \"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeWidth: \"1.5\", key: \"1\" }],\n [\"path\", { d: \"M9.5 16.5L9.5 10.5\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeWidth: \"1.5\", key: \"2\" }],\n [\"path\", { d: \"M14.5 16.5L14.5 10.5\", stroke: \"currentColor\", strokeLinecap: \"round\", strokeWidth: \"1.5\", key: \"3\" }]\n];\n\nexport { Delete02Icon as default };\n//# sourceMappingURL=Delete02Icon.js.map\n","\"use client\";\n\n// src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer, useDismissableLayerSurface } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar Slot = createSlot(\"DialogOverlay.RemoveScroll\");\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n const registerDismissableSurface = useDismissableLayerSurface();\n const composedRefs = useComposedRefs(forwardedRef, registerDismissableSurface);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: composedRefs,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: context.open,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n useFocusGuards();\n return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: forwardedRef,\n deferPointerDownOutside: true,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ) });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nvar WarningProvider = (props) => {\n return props.children;\n};\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nexport {\n DialogClose as Close,\n DialogContent as Content,\n DialogDescription as Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogOverlay as Overlay,\n DialogPortal as Portal,\n Dialog as Root,\n DialogTitle as Title,\n DialogTrigger as Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n","import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport type * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport const Dialog = DialogPrimitive.Root;\nexport const DialogTrigger = DialogPrimitive.Trigger;\nexport const DialogClose = DialogPrimitive.Close;\n\nexport function DialogContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content>) {\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm\" />\n <DialogPrimitive.Content\n className={cn(\n \"fixed left-1/2 top-1/2 z-50 grid w-[min(420px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover p-5 text-popover-foreground shadow-2xl shadow-black/40\",\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\nexport function DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"grid gap-1.5\", className)} {...props} />;\n}\n\nexport function DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"flex justify-end gap-2\", className)} {...props} />;\n}\n\nexport function DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return <DialogPrimitive.Title className={cn(\"text-base font-bold\", className)} {...props} />;\n}\n\nexport function DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-sm leading-6 text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n","import { Activity01Icon, Delete02Icon } from \"@hugeicons/core-free-icons\";\nimport type { StudioConfig, StudioSessionSummary } from \"../../../../types\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../../components/ui/dialog\";\nimport { StudioIcon } from \"../../components/ui/icon\";\nimport { StudioPageShell, StudioSurface } from \"../../components/ui/studio\";\nimport { cn } from \"../../lib/utils\";\nimport { agentLabel, formatRelativeTime } from \"../shared/format\";\nimport type { SessionLoadState } from \"../shared/types\";\n\nexport function SessionsPage(props: {\n agents: StudioConfig[\"agents\"];\n sessions: StudioSessionSummary[];\n sessionsEnabled: boolean;\n sessionLoadState: SessionLoadState;\n selectedSessionId: string;\n onOpenSession: (sessionId: string) => void;\n onViewSessionTracing: (sessionId: string) => void;\n onDeleteSession: (session: StudioSessionSummary) => void;\n}) {\n if (!props.sessionsEnabled) {\n return (\n <div className=\"w-full rounded-lg border border-dashed border-border p-8 text-sm font-medium text-muted-foreground\">\n Sessions are disabled\n </div>\n );\n }\n\n return (\n <StudioPageShell className=\"overflow-auto pb-6 pr-6\" aria-label=\"Sessions\">\n <StudioSurface className=\"min-w-225 rounded-xl p-2\">\n <div className=\"sticky top-0 z-10 grid min-h-11 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px_72px] items-center gap-4 rounded-lg border border-border/60 bg-card/95 px-4 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground backdrop-blur\">\n <span>Session</span>\n <span>Agent</span>\n <span>Messages</span>\n <span>Updated</span>\n <span className=\"sr-only\">Actions</span>\n </div>\n {props.sessionLoadState === \"loading\" && props.sessions.length === 0 ? (\n <div className=\"px-5 py-4 text-sm font-medium text-muted-foreground\">\n Loading sessions\n </div>\n ) : null}\n {props.sessionLoadState === \"idle\" && props.sessions.length === 0 ? (\n <div className=\"px-5 py-4 text-sm font-medium text-muted-foreground\">No sessions</div>\n ) : null}\n {props.sessions.map((session) => (\n <div\n className={cn(\n \"mt-1 grid min-h-14 w-full min-w-0 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px_72px] items-center gap-4 rounded-lg border border-transparent px-4 text-left text-muted-foreground transition duration-200 hover:border-border/70 hover:bg-accent/80 hover:text-accent-foreground\",\n session.id === props.selectedSessionId &&\n \"border-border/80 bg-muted/45 text-foreground\",\n )}\n key={session.id}\n >\n <Button\n className=\"col-span-4 grid h-full min-h-14 min-w-0 grid-cols-[minmax(220px,1.3fr)_180px_120px_120px] items-center justify-start gap-4 border-0 bg-transparent p-0 text-left text-inherit shadow-none hover:bg-transparent hover:text-inherit\"\n type=\"button\"\n variant=\"ghost\"\n onClick={() => props.onOpenSession(session.id)}\n >\n <span className=\"grid min-w-0 gap-0.5\">\n <strong className=\"min-w-0 truncate text-sm font-medium text-foreground\">\n {session.title ?? \"Untitled chat\"}\n </strong>\n <span className=\"min-w-0 truncate text-xs font-medium text-muted-foreground\">\n {session.id}\n </span>\n </span>\n <span className=\"min-w-0 truncate text-xs font-medium\">\n {agentLabel(props.agents, session.agentId)}\n </span>\n <span className=\"text-xs font-medium tabular-nums text-muted-foreground\">\n {session.messageCount} messages\n </span>\n <time className=\"text-xs font-medium text-muted-foreground\">\n {formatRelativeTime(session.updatedAt)}\n </time>\n </Button>\n <span className=\"flex items-center justify-end gap-1\">\n <Button\n aria-label={`View tracing for ${session.title ?? \"Untitled chat\"}`}\n className=\"h-7 min-h-7 w-7 border-0 bg-transparent p-0 text-muted-foreground opacity-80 hover:bg-transparent hover:text-foreground hover:opacity-100 [&_svg]:h-3.5 [&_svg]:w-3.5\"\n size=\"icon\"\n type=\"button\"\n variant=\"ghost\"\n onClick={(event) => {\n event.stopPropagation();\n props.onViewSessionTracing(session.id);\n }}\n >\n <StudioIcon icon={Activity01Icon} aria-hidden=\"true\" />\n </Button>\n <Button\n aria-label={`Delete ${session.title ?? \"Untitled chat\"}`}\n className=\"h-7 min-h-7 w-7 border-0 bg-transparent p-0 text-muted-foreground opacity-80 hover:bg-transparent hover:text-destructive hover:opacity-100 [&_svg]:h-3.5 [&_svg]:w-3.5\"\n size=\"icon\"\n type=\"button\"\n variant=\"ghost\"\n onClick={(event) => {\n event.stopPropagation();\n props.onDeleteSession(session);\n }}\n >\n <StudioIcon icon={Delete02Icon} aria-hidden=\"true\" />\n </Button>\n </span>\n </div>\n ))}\n </StudioSurface>\n </StudioPageShell>\n );\n}\n\nexport function DeleteSessionDialog(props: {\n session: StudioSessionSummary | undefined;\n onOpenChange: (open: boolean) => void;\n onConfirm: (session: StudioSessionSummary) => void;\n}) {\n const title = props.session?.title ?? \"Untitled chat\";\n\n return (\n <Dialog open={props.session !== undefined} onOpenChange={props.onOpenChange}>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Delete session</DialogTitle>\n <DialogDescription>\n Delete \"{title}\" and its traces. This cannot be undone.\n </DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <Button type=\"button\" variant=\"ghost\" onClick={() => props.onOpenChange(false)}>\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n onClick={() => {\n if (props.session !== undefined) {\n props.onConfirm(props.session);\n }\n }}\n >\n Delete\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n"],"x_google_ignoreList":[0,1],"mappings":"2RAAA,IAAM,EAAe,CACnB,CAAC,OAAQ,CAAE,EAAG,qSAAsS,OAAQ,eAAgB,cAAe,QAAS,YAAa,MAAO,IAAK,IAAK,CAAC,CACnY,CAAC,OAAQ,CAAE,EAAG,8SAA+S,OAAQ,eAAgB,cAAe,QAAS,YAAa,MAAO,IAAK,IAAK,CAAC,CAC5Y,CAAC,OAAQ,CAAE,EAAG,qBAAsB,OAAQ,eAAgB,cAAe,QAAS,YAAa,MAAO,IAAK,IAAK,CAAC,CACnH,CAAC,OAAQ,CAAE,EAAG,uBAAwB,OAAQ,eAAgB,cAAe,QAAS,YAAa,MAAO,IAAK,IAAK,CAAC,CACtH,kBCcG,EAAc,SACd,CAAC,EAAqB,IAAqB,GAAmB,EAAY,CAC1E,CAAC,EAAgB,GAAoB,EAAoB,EAAY,CACrEA,EAAU,GAAU,CACtB,GAAM,CACJ,gBACA,WACA,KAAM,EACN,cACA,eACA,QAAQ,IACN,EACE,EAAA,EAAmB,OAAO,KAAK,CAC/B,EAAA,EAAmB,OAAO,KAAK,CAC/B,CAAC,EAAM,GAAW,EAAqB,CAC3C,KAAM,EACN,YAAa,GAAe,GAC5B,SAAU,EACV,OAAQ,EACT,CAAC,CACF,OAAuB,EAAA,EAAA,KACrB,EACA,CACE,MAAO,EACP,aACA,aACA,UAAW,GAAO,CAClB,QAAS,GAAO,CAChB,cAAe,GAAO,CACtB,OACA,aAAc,EACd,aAAA,EAAoB,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AA,CACT,CAAA"}
@@ -1,2 +1,2 @@
1
- import{i as e,r as t,s as n}from"./utils-BN2yP0LH.js";import{N as r}from"./index-CC5mjRie.js";import{t as i}from"./badge-BH7gz3tB.js";import{t as a}from"./renderers-CIC1VVRv.js";var o=n(e(),1),s=t();function c(e){let[t,n]=(0,o.useState)(),[c,p]=(0,o.useState)(!1),[m,h]=(0,o.useState)(``),g=(0,o.useCallback)(async()=>{if(!e.enabled){n(void 0);return}p(!0),h(``);try{let e=await fetch(`/status`);if(!e.ok)throw Error(`Status failed with HTTP ${e.status}`);n(await e.json())}catch(e){h(e instanceof Error?e.message:String(e)),n(void 0)}finally{p(!1)}},[e.enabled]);return(0,o.useEffect)(()=>{g()},[g]),(0,s.jsxs)(`section`,{className:`grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55`,"aria-label":`Status`,children:[(0,s.jsx)(`header`,{className:`bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur`,children:(0,s.jsxs)(`div`,{className:`grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1`,children:[(0,s.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,s.jsx)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.24em] text-foreground`,children:`Operations`}),(0,s.jsx)(`h1`,{className:`m-0 text-2xl font-semibold leading-none tracking-tight text-foreground`,children:`Status`}),(0,s.jsx)(`p`,{className:`m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground`,children:`Runtime health, storage adapters, feature capabilities, and current record counts.`})]}),(0,s.jsx)(r,{className:`h-9 min-h-9 rounded-lg px-3 text-xs`,type:`button`,variant:`secondary`,disabled:c,onClick:()=>void g(),children:`Refresh`})]})}),(0,s.jsx)(`div`,{className:`min-h-0 overflow-auto pb-6 pl-0 pr-6`,children:e.enabled?c&&t===void 0?(0,s.jsx)(f,{title:`Loading status`,text:`Reading runtime status.`}):m.length>0?(0,s.jsx)(f,{title:`Status error`,text:m}):t===void 0?null:(0,s.jsxs)(`div`,{className:`grid gap-4`,children:[(0,s.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-4`,children:[(0,s.jsx)(l,{label:`Agents`,value:t.counts.agents}),(0,s.jsx)(l,{label:`Pipelines`,value:t.counts.pipelines}),(0,s.jsx)(l,{label:`Sessions`,value:t.counts.sessions??`-`}),(0,s.jsx)(l,{label:`Traces`,value:t.counts.traces??`-`})]}),(0,s.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(0,0.85fr)_minmax(0,1.15fr)]`,children:[(0,s.jsxs)(`section`,{className:`grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5`,children:[(0,s.jsx)(d,{children:`runtime`}),(0,s.jsx)(u,{label:`id`,value:t.runner.id}),(0,s.jsx)(u,{label:`name`,value:t.runner.name??`-`}),(0,s.jsx)(u,{label:`version`,value:t.runner.version??`-`}),(0,s.jsx)(u,{label:`generated`,value:t.generatedAt})]}),(0,s.jsxs)(`section`,{className:`grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5`,children:[(0,s.jsx)(d,{children:`storage`}),(0,s.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[Object.entries(t.storage).map(([e,t])=>(0,s.jsx)(u,{label:e,value:t??`-`},e)),Object.entries(t.storage).length===0?(0,s.jsx)(`div`,{className:`rounded-lg border border-dashed border-border/80 bg-background/45 px-3 py-2 text-sm text-muted-foreground`,children:`No storage adapters reported.`}):null]})]})]}),(0,s.jsxs)(`section`,{className:`grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5`,children:[(0,s.jsx)(d,{children:`capabilities`}),(0,s.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:Object.entries(t.capabilities).map(([e,t])=>(0,s.jsx)(i,{className:t?.enabled?`border-border/80 bg-muted/45 text-foreground`:`border-border/80 bg-muted/55 text-muted-foreground`,children:e},e))})]}),(0,s.jsxs)(`section`,{className:`grid min-w-0 overflow-hidden rounded-xl border border-border/80 bg-card/45`,children:[(0,s.jsx)(`div`,{className:`flex min-h-10 items-center justify-between gap-3 border-b border-border/80 bg-muted/20 px-4`,children:(0,s.jsx)(d,{children:`raw summary`})}),(0,s.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,s.jsx)(`pre`,{className:`m-0 min-w-max p-4 text-xs leading-5 text-foreground`,children:(0,s.jsx)(`code`,{children:(0,s.jsx)(a,{text:JSON.stringify(t,null,2)})})})})]})]}):(0,s.jsx)(f,{title:`Status unavailable`,text:`This Studio runtime did not expose status.`})})]})}function l(e){return(0,s.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/80 bg-card/45 p-5`,children:[(0,s.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:e.label}),(0,s.jsx)(`span`,{className:` text-3xl font-semibold tracking-tight text-foreground`,children:e.value})]})}function u(e){return(0,s.jsxs)(`div`,{className:`grid min-w-0 gap-1 rounded-lg bg-background/45 px-3 py-2 text-sm`,children:[(0,s.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:e.label}),(0,s.jsx)(`span`,{className:`min-w-0 truncate text-xs text-foreground`,title:String(e.value),children:e.value})]})}function d(e){return(0,s.jsx)(`h2`,{className:`m-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:e.children})}function f(e){return(0,s.jsx)(`div`,{className:`grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center`,children:(0,s.jsxs)(`div`,{className:`grid max-w-md gap-2`,children:[(0,s.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:e.title}),(0,s.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:e.text})]})})}export{c as StatusPage};
2
- //# sourceMappingURL=status-page-DC5pVW4o.js.map
1
+ import{i as e,r as t,s as n}from"./utils-BN2yP0LH.js";import{N as r}from"./index-BImv2lI7.js";import{t as i}from"./badge-BH7gz3tB.js";import{t as a}from"./renderers-CIC1VVRv.js";var o=n(e(),1),s=t();function c(e){let[t,n]=(0,o.useState)(),[c,p]=(0,o.useState)(!1),[m,h]=(0,o.useState)(``),g=(0,o.useCallback)(async()=>{if(!e.enabled){n(void 0);return}p(!0),h(``);try{let e=await fetch(`/status`);if(!e.ok)throw Error(`Status failed with HTTP ${e.status}`);n(await e.json())}catch(e){h(e instanceof Error?e.message:String(e)),n(void 0)}finally{p(!1)}},[e.enabled]);return(0,o.useEffect)(()=>{g()},[g]),(0,s.jsxs)(`section`,{className:`grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55`,"aria-label":`Status`,children:[(0,s.jsx)(`header`,{className:`bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur`,children:(0,s.jsxs)(`div`,{className:`grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1`,children:[(0,s.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,s.jsx)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.24em] text-foreground`,children:`Operations`}),(0,s.jsx)(`h1`,{className:`m-0 text-2xl font-semibold leading-none tracking-tight text-foreground`,children:`Status`}),(0,s.jsx)(`p`,{className:`m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground`,children:`Runtime health, storage adapters, feature capabilities, and current record counts.`})]}),(0,s.jsx)(r,{className:`h-9 min-h-9 rounded-lg px-3 text-xs`,type:`button`,variant:`secondary`,disabled:c,onClick:()=>void g(),children:`Refresh`})]})}),(0,s.jsx)(`div`,{className:`min-h-0 overflow-auto pb-6 pl-0 pr-6`,children:e.enabled?c&&t===void 0?(0,s.jsx)(f,{title:`Loading status`,text:`Reading runtime status.`}):m.length>0?(0,s.jsx)(f,{title:`Status error`,text:m}):t===void 0?null:(0,s.jsxs)(`div`,{className:`grid gap-4`,children:[(0,s.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-4`,children:[(0,s.jsx)(l,{label:`Agents`,value:t.counts.agents}),(0,s.jsx)(l,{label:`Pipelines`,value:t.counts.pipelines}),(0,s.jsx)(l,{label:`Sessions`,value:t.counts.sessions??`-`}),(0,s.jsx)(l,{label:`Traces`,value:t.counts.traces??`-`})]}),(0,s.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(0,0.85fr)_minmax(0,1.15fr)]`,children:[(0,s.jsxs)(`section`,{className:`grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5`,children:[(0,s.jsx)(d,{children:`runtime`}),(0,s.jsx)(u,{label:`id`,value:t.runner.id}),(0,s.jsx)(u,{label:`name`,value:t.runner.name??`-`}),(0,s.jsx)(u,{label:`version`,value:t.runner.version??`-`}),(0,s.jsx)(u,{label:`generated`,value:t.generatedAt})]}),(0,s.jsxs)(`section`,{className:`grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5`,children:[(0,s.jsx)(d,{children:`storage`}),(0,s.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[Object.entries(t.storage).map(([e,t])=>(0,s.jsx)(u,{label:e,value:t??`-`},e)),Object.entries(t.storage).length===0?(0,s.jsx)(`div`,{className:`rounded-lg border border-dashed border-border/80 bg-background/45 px-3 py-2 text-sm text-muted-foreground`,children:`No storage adapters reported.`}):null]})]})]}),(0,s.jsxs)(`section`,{className:`grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5`,children:[(0,s.jsx)(d,{children:`capabilities`}),(0,s.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:Object.entries(t.capabilities).map(([e,t])=>(0,s.jsx)(i,{className:t?.enabled?`border-border/80 bg-muted/45 text-foreground`:`border-border/80 bg-muted/55 text-muted-foreground`,children:e},e))})]}),(0,s.jsxs)(`section`,{className:`grid min-w-0 overflow-hidden rounded-xl border border-border/80 bg-card/45`,children:[(0,s.jsx)(`div`,{className:`flex min-h-10 items-center justify-between gap-3 border-b border-border/80 bg-muted/20 px-4`,children:(0,s.jsx)(d,{children:`raw summary`})}),(0,s.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,s.jsx)(`pre`,{className:`m-0 min-w-max p-4 text-xs leading-5 text-foreground`,children:(0,s.jsx)(`code`,{children:(0,s.jsx)(a,{text:JSON.stringify(t,null,2)})})})})]})]}):(0,s.jsx)(f,{title:`Status unavailable`,text:`This Studio runtime did not expose status.`})})]})}function l(e){return(0,s.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/80 bg-card/45 p-5`,children:[(0,s.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:e.label}),(0,s.jsx)(`span`,{className:` text-3xl font-semibold tracking-tight text-foreground`,children:e.value})]})}function u(e){return(0,s.jsxs)(`div`,{className:`grid min-w-0 gap-1 rounded-lg bg-background/45 px-3 py-2 text-sm`,children:[(0,s.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:e.label}),(0,s.jsx)(`span`,{className:`min-w-0 truncate text-xs text-foreground`,title:String(e.value),children:e.value})]})}function d(e){return(0,s.jsx)(`h2`,{className:`m-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:e.children})}function f(e){return(0,s.jsx)(`div`,{className:`grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center`,children:(0,s.jsxs)(`div`,{className:`grid max-w-md gap-2`,children:[(0,s.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:e.title}),(0,s.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:e.text})]})})}export{c as StatusPage};
2
+ //# sourceMappingURL=status-page-oWsYfXZZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"status-page-DC5pVW4o.js","names":[],"sources":["../../../src/ui/app/modules/status/status-page.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from \"react\";\nimport type { StudioStatusSummary } from \"../../../../types\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { JsonSyntax } from \"../shared/renderers\";\n\nexport function StatusPage(props: { enabled: boolean }) {\n const [summary, setSummary] = useState<StudioStatusSummary | undefined>();\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState(\"\");\n\n const loadStatus = useCallback(async () => {\n if (!props.enabled) {\n setSummary(undefined);\n return;\n }\n setLoading(true);\n setError(\"\");\n try {\n const response = await fetch(\"/status\");\n if (!response.ok) {\n throw new Error(`Status failed with HTTP ${response.status}`);\n }\n setSummary((await response.json()) as StudioStatusSummary);\n } catch (loadError) {\n setError(loadError instanceof Error ? loadError.message : String(loadError));\n setSummary(undefined);\n } finally {\n setLoading(false);\n }\n }, [props.enabled]);\n\n useEffect(() => {\n void loadStatus();\n }, [loadStatus]);\n\n return (\n <section\n className=\"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55\"\n aria-label=\"Status\"\n >\n <header className=\"bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur\">\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1\">\n <div className=\"grid min-w-0 gap-2\">\n <div className=\" text-xs font-semibold uppercase tracking-[0.24em] text-foreground\">\n Operations\n </div>\n <h1 className=\"m-0 text-2xl font-semibold leading-none tracking-tight text-foreground\">\n Status\n </h1>\n <p className=\"m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground\">\n Runtime health, storage adapters, feature capabilities, and current record counts.\n </p>\n </div>\n <Button\n className=\"h-9 min-h-9 rounded-lg px-3 text-xs\"\n type=\"button\"\n variant=\"secondary\"\n disabled={loading}\n onClick={() => void loadStatus()}\n >\n Refresh\n </Button>\n </div>\n </header>\n\n <div className=\"min-h-0 overflow-auto pb-6 pl-0 pr-6\">\n {!props.enabled ? (\n <EmptyState\n title=\"Status unavailable\"\n text=\"This Studio runtime did not expose status.\"\n />\n ) : loading && summary === undefined ? (\n <EmptyState title=\"Loading status\" text=\"Reading runtime status.\" />\n ) : error.length > 0 ? (\n <EmptyState title=\"Status error\" text={error} />\n ) : summary === undefined ? null : (\n <div className=\"grid gap-4\">\n <div className=\"grid gap-4 lg:grid-cols-4\">\n <Metric label=\"Agents\" value={summary.counts.agents} />\n <Metric label=\"Pipelines\" value={summary.counts.pipelines} />\n <Metric label=\"Sessions\" value={summary.counts.sessions ?? \"-\"} />\n <Metric label=\"Traces\" value={summary.counts.traces ?? \"-\"} />\n </div>\n <div className=\"grid gap-4 xl:grid-cols-[minmax(0,0.85fr)_minmax(0,1.15fr)]\">\n <section className=\"grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5\">\n <SectionLabel>runtime</SectionLabel>\n <KeyValue label=\"id\" value={summary.runner.id} />\n <KeyValue label=\"name\" value={summary.runner.name ?? \"-\"} />\n <KeyValue label=\"version\" value={summary.runner.version ?? \"-\"} />\n <KeyValue label=\"generated\" value={summary.generatedAt} />\n </section>\n <section className=\"grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5\">\n <SectionLabel>storage</SectionLabel>\n <div className=\"grid gap-2 sm:grid-cols-2\">\n {Object.entries(summary.storage).map(([key, value]) => (\n <KeyValue key={key} label={key} value={value ?? \"-\"} />\n ))}\n {Object.entries(summary.storage).length === 0 ? (\n <div className=\"rounded-lg border border-dashed border-border/80 bg-background/45 px-3 py-2 text-sm text-muted-foreground\">\n No storage adapters reported.\n </div>\n ) : null}\n </div>\n </section>\n </div>\n <section className=\"grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5\">\n <SectionLabel>capabilities</SectionLabel>\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n {Object.entries(summary.capabilities).map(([name, capability]) => (\n <Badge\n className={\n capability?.enabled\n ? \"border-border/80 bg-muted/45 text-foreground\"\n : \"border-border/80 bg-muted/55 text-muted-foreground\"\n }\n key={name}\n >\n {name}\n </Badge>\n ))}\n </div>\n </section>\n <section className=\"grid min-w-0 overflow-hidden rounded-xl border border-border/80 bg-card/45\">\n <div className=\"flex min-h-10 items-center justify-between gap-3 border-b border-border/80 bg-muted/20 px-4\">\n <SectionLabel>raw summary</SectionLabel>\n </div>\n <div className=\"min-w-0 overflow-x-auto\">\n <pre className=\"m-0 min-w-max p-4 text-xs leading-5 text-foreground\">\n <code>\n <JsonSyntax text={JSON.stringify(summary, null, 2)} />\n </code>\n </pre>\n </div>\n </section>\n </div>\n )}\n </div>\n </section>\n );\n}\n\nfunction Metric(props: { label: string; value: string | number }) {\n return (\n <div className=\"grid gap-2 rounded-xl border border-border/80 bg-card/45 p-5\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n {props.label}\n </span>\n <span className=\" text-3xl font-semibold tracking-tight text-foreground\">{props.value}</span>\n </div>\n );\n}\n\nfunction KeyValue(props: { label: string; value: string | number }) {\n return (\n <div className=\"grid min-w-0 gap-1 rounded-lg bg-background/45 px-3 py-2 text-sm\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground\">\n {props.label}\n </span>\n <span className=\"min-w-0 truncate text-xs text-foreground\" title={String(props.value)}>\n {props.value}\n </span>\n </div>\n );\n}\n\nfunction SectionLabel(props: { children: string }) {\n return (\n <h2 className=\"m-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n {props.children}\n </h2>\n );\n}\n\nfunction EmptyState(props: { title: string; text: string }) {\n return (\n <div className=\"grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center\">\n <div className=\"grid max-w-md gap-2\">\n <h2 className=\"m-0 text-base font-semibold text-foreground\">{props.title}</h2>\n <p className=\"m-0 text-sm leading-6 text-muted-foreground\">{props.text}</p>\n </div>\n </div>\n );\n}\n"],"mappings":"uMAMA,SAAgB,EAAW,EAA6B,CACtD,GAAM,CAAC,EAAS,IAAA,EAAA,EAAA,WAAyD,CACnE,CAAC,EAAS,IAAA,EAAA,EAAA,UAAuB,GAAM,CACvC,CAAC,EAAO,IAAA,EAAA,EAAA,UAAqB,GAAG,CAEhC,GAAA,EAA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,4EAAf,EACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,oFACb,EAAM,MACF,CAAA,EACP,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,2CAA2C,MAAO,OAAO,EAAM,MAAM,UAClF,EAAM,MACF,CAAA,CACH,GAIV,SAAS,EAAa,EAA6B,CACjD,OACE,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,sFACX,EAAM,SACJ,CAAA,CAIT,SAAS,EAAW,EAAwC,CAC1D,OACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,0HACb,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,+BAAf,EACE,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,uDAA+C,EAAM,MAAW,CAAA,EAC9E,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,uDAA+C,EAAM,KAAS,CAAA,CACvE,GACF,CAAA"}
1
+ {"version":3,"file":"status-page-oWsYfXZZ.js","names":[],"sources":["../../../src/ui/app/modules/status/status-page.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from \"react\";\nimport type { StudioStatusSummary } from \"../../../../types\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { JsonSyntax } from \"../shared/renderers\";\n\nexport function StatusPage(props: { enabled: boolean }) {\n const [summary, setSummary] = useState<StudioStatusSummary | undefined>();\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState(\"\");\n\n const loadStatus = useCallback(async () => {\n if (!props.enabled) {\n setSummary(undefined);\n return;\n }\n setLoading(true);\n setError(\"\");\n try {\n const response = await fetch(\"/status\");\n if (!response.ok) {\n throw new Error(`Status failed with HTTP ${response.status}`);\n }\n setSummary((await response.json()) as StudioStatusSummary);\n } catch (loadError) {\n setError(loadError instanceof Error ? loadError.message : String(loadError));\n setSummary(undefined);\n } finally {\n setLoading(false);\n }\n }, [props.enabled]);\n\n useEffect(() => {\n void loadStatus();\n }, [loadStatus]);\n\n return (\n <section\n className=\"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55\"\n aria-label=\"Status\"\n >\n <header className=\"bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur\">\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1\">\n <div className=\"grid min-w-0 gap-2\">\n <div className=\" text-xs font-semibold uppercase tracking-[0.24em] text-foreground\">\n Operations\n </div>\n <h1 className=\"m-0 text-2xl font-semibold leading-none tracking-tight text-foreground\">\n Status\n </h1>\n <p className=\"m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground\">\n Runtime health, storage adapters, feature capabilities, and current record counts.\n </p>\n </div>\n <Button\n className=\"h-9 min-h-9 rounded-lg px-3 text-xs\"\n type=\"button\"\n variant=\"secondary\"\n disabled={loading}\n onClick={() => void loadStatus()}\n >\n Refresh\n </Button>\n </div>\n </header>\n\n <div className=\"min-h-0 overflow-auto pb-6 pl-0 pr-6\">\n {!props.enabled ? (\n <EmptyState\n title=\"Status unavailable\"\n text=\"This Studio runtime did not expose status.\"\n />\n ) : loading && summary === undefined ? (\n <EmptyState title=\"Loading status\" text=\"Reading runtime status.\" />\n ) : error.length > 0 ? (\n <EmptyState title=\"Status error\" text={error} />\n ) : summary === undefined ? null : (\n <div className=\"grid gap-4\">\n <div className=\"grid gap-4 lg:grid-cols-4\">\n <Metric label=\"Agents\" value={summary.counts.agents} />\n <Metric label=\"Pipelines\" value={summary.counts.pipelines} />\n <Metric label=\"Sessions\" value={summary.counts.sessions ?? \"-\"} />\n <Metric label=\"Traces\" value={summary.counts.traces ?? \"-\"} />\n </div>\n <div className=\"grid gap-4 xl:grid-cols-[minmax(0,0.85fr)_minmax(0,1.15fr)]\">\n <section className=\"grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5\">\n <SectionLabel>runtime</SectionLabel>\n <KeyValue label=\"id\" value={summary.runner.id} />\n <KeyValue label=\"name\" value={summary.runner.name ?? \"-\"} />\n <KeyValue label=\"version\" value={summary.runner.version ?? \"-\"} />\n <KeyValue label=\"generated\" value={summary.generatedAt} />\n </section>\n <section className=\"grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5\">\n <SectionLabel>storage</SectionLabel>\n <div className=\"grid gap-2 sm:grid-cols-2\">\n {Object.entries(summary.storage).map(([key, value]) => (\n <KeyValue key={key} label={key} value={value ?? \"-\"} />\n ))}\n {Object.entries(summary.storage).length === 0 ? (\n <div className=\"rounded-lg border border-dashed border-border/80 bg-background/45 px-3 py-2 text-sm text-muted-foreground\">\n No storage adapters reported.\n </div>\n ) : null}\n </div>\n </section>\n </div>\n <section className=\"grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5\">\n <SectionLabel>capabilities</SectionLabel>\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n {Object.entries(summary.capabilities).map(([name, capability]) => (\n <Badge\n className={\n capability?.enabled\n ? \"border-border/80 bg-muted/45 text-foreground\"\n : \"border-border/80 bg-muted/55 text-muted-foreground\"\n }\n key={name}\n >\n {name}\n </Badge>\n ))}\n </div>\n </section>\n <section className=\"grid min-w-0 overflow-hidden rounded-xl border border-border/80 bg-card/45\">\n <div className=\"flex min-h-10 items-center justify-between gap-3 border-b border-border/80 bg-muted/20 px-4\">\n <SectionLabel>raw summary</SectionLabel>\n </div>\n <div className=\"min-w-0 overflow-x-auto\">\n <pre className=\"m-0 min-w-max p-4 text-xs leading-5 text-foreground\">\n <code>\n <JsonSyntax text={JSON.stringify(summary, null, 2)} />\n </code>\n </pre>\n </div>\n </section>\n </div>\n )}\n </div>\n </section>\n );\n}\n\nfunction Metric(props: { label: string; value: string | number }) {\n return (\n <div className=\"grid gap-2 rounded-xl border border-border/80 bg-card/45 p-5\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n {props.label}\n </span>\n <span className=\" text-3xl font-semibold tracking-tight text-foreground\">{props.value}</span>\n </div>\n );\n}\n\nfunction KeyValue(props: { label: string; value: string | number }) {\n return (\n <div className=\"grid min-w-0 gap-1 rounded-lg bg-background/45 px-3 py-2 text-sm\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground\">\n {props.label}\n </span>\n <span className=\"min-w-0 truncate text-xs text-foreground\" title={String(props.value)}>\n {props.value}\n </span>\n </div>\n );\n}\n\nfunction SectionLabel(props: { children: string }) {\n return (\n <h2 className=\"m-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n {props.children}\n </h2>\n );\n}\n\nfunction EmptyState(props: { title: string; text: string }) {\n return (\n <div className=\"grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center\">\n <div className=\"grid max-w-md gap-2\">\n <h2 className=\"m-0 text-base font-semibold text-foreground\">{props.title}</h2>\n <p className=\"m-0 text-sm leading-6 text-muted-foreground\">{props.text}</p>\n </div>\n </div>\n );\n}\n"],"mappings":"uMAMA,SAAgB,EAAW,EAA6B,CACtD,GAAM,CAAC,EAAS,IAAA,EAAA,EAAA,WAAyD,CACnE,CAAC,EAAS,IAAA,EAAA,EAAA,UAAuB,GAAM,CACvC,CAAC,EAAO,IAAA,EAAA,EAAA,UAAqB,GAAG,CAEhC,GAAA,EAAA,EAAA,aAAyB,SAAY,CACzC,GAAI,CAAC,EAAM,QAAS,CAClB,EAAW,IAAA,GAAU,CACrB,OAEF,EAAW,GAAK,CAChB,EAAS,GAAG,CACZ,GAAI,CACF,IAAM,EAAW,MAAM,MAAM,UAAU,CACvC,GAAI,CAAC,EAAS,GACZ,MAAU,MAAM,2BAA2B,EAAS,SAAS,CAE/D,EAAY,MAAM,EAAS,MAAM,CAAyB,OACnD,EAAW,CAClB,EAAS,aAAqB,MAAQ,EAAU,QAAU,OAAO,EAAU,CAAC,CAC5E,EAAW,IAAA,GAAU,QACb,CACR,EAAW,GAAM,GAElB,CAAC,EAAM,QAAQ,CAAC,CAMnB,OAJA,EAAA,EAAA,eAAgB,CACT,GAAY,EAChB,CAAC,EAAW,CAAC,EAGd,EAAA,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AAG,UAAU,uDAA+C,EAAM,KAAS,CAAA,CACvE,GACF,CAAA"}
@@ -1,2 +1,2 @@
1
- import{i as e,r as t,s as n,t as r}from"./utils-BN2yP0LH.js";import{N as i,d as a,f as o,m as s,p as c,r as l,u}from"./index-CC5mjRie.js";import{t as d}from"./badge-BH7gz3tB.js";import{t as f}from"./renderers-CIC1VVRv.js";var p=n(e(),1),m=t();function h(e){let t=e.agents.find(t=>t.id===e.selectedAgentId)??e.agents[0],n=e.summary?.tools??[],[r,f]=(0,p.useState)(``),[h,b]=(0,p.useState)(`{}`),[S,w]=(0,p.useState)(`idle`),[T,E]=(0,p.useState)(),[D,O]=(0,p.useState)(``),k=(0,p.useMemo)(()=>n.find(e=>e.name===r)??n[0],[r,n]);(0,p.useEffect)(()=>{if(n.length===0){f(``);return}n.some(e=>e.name===r)||f(n[0]?.name??``)},[r,n]);async function A(){if(t===void 0||k===void 0)return;let e;try{e=JSON.parse(h)}catch(e){O(e instanceof Error?e.message:String(e)),E(void 0);return}w(`running`),O(``),E(void 0);try{let n=await fetch(`/agents/${encodeURIComponent(t.id)}/tools/${encodeURIComponent(k.name)}/runs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({args:e})}),r=await n.json();E(r),(!n.ok||r.status===`error`)&&O(C(r.error??r))}catch(e){O(e instanceof Error?e.message:String(e))}finally{w(`idle`)}}return(0,m.jsxs)(`section`,{className:`grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55`,"aria-label":`Tools`,children:[(0,m.jsx)(`header`,{className:`bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur`,children:(0,m.jsxs)(`div`,{className:`grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1`,children:[(0,m.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,m.jsx)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.24em] text-foreground`,children:`Agent capabilities`}),(0,m.jsx)(`h1`,{className:`m-0 text-2xl font-semibold leading-none tracking-tight text-foreground`,children:`Tools`}),(0,m.jsx)(`p`,{className:`m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground`,children:`Tool definitions registered on Studio agents, including approval policy and input schema.`})]}),e.agents.length>1?(0,m.jsxs)(u,{value:t?.id??``,onValueChange:e.onSelectAgent,children:[(0,m.jsx)(c,{className:`h-9 min-h-9 w-64 rounded-lg border-border bg-card/80 text-xs max-md:w-full`,children:(0,m.jsx)(s,{placeholder:`Agent`})}),(0,m.jsx)(a,{align:`end`,children:e.agents.map(e=>(0,m.jsx)(o,{value:e.id,children:e.name??e.id},e.id))})]}):null]})}),(0,m.jsx)(`div`,{className:`min-h-0 overflow-auto pb-6 pl-0 pr-6`,children:(0,m.jsx)(`div`,{className:`grid w-full gap-4`,children:e.enabled?e.loading?(0,m.jsx)(v,{title:`Loading tools`,message:`Reading registered tool metadata.`}):n.length===0?(0,m.jsx)(v,{title:`No tools`,message:`The selected agent has no registered tools.`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`section`,{className:`grid gap-4 rounded-xl border border-border/80 bg-card/55 p-4 shadow-sm xl:grid-cols-[minmax(300px,0.7fr)_minmax(0,1fr)]`,children:[(0,m.jsxs)(`div`,{className:`grid content-start gap-3`,children:[(0,m.jsxs)(`div`,{className:`grid gap-1`,children:[(0,m.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:`Run tool`}),(0,m.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:`Invoke a registered tool directly with JSON arguments and inspect the raw result.`})]}),(0,m.jsxs)(u,{value:k?.name??``,onValueChange:f,children:[(0,m.jsx)(c,{className:`h-9 min-h-9 rounded-lg border-border bg-background/80 text-xs`,children:(0,m.jsx)(s,{placeholder:`Tool`})}),(0,m.jsx)(a,{children:n.map(e=>(0,m.jsx)(o,{value:e.name,children:e.name},`${e.source}:${e.name}`))})]}),k===void 0?null:(0,m.jsxs)(`div`,{className:`grid gap-2 rounded-lg bg-background/45 p-3`,children:[(0,m.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:`selected definition`}),(0,m.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:k.description}),(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:[(0,m.jsx)(d,{className:y(k.source),children:k.source}),(0,m.jsxs)(d,{className:`border-border/80 bg-muted/55 text-muted-foreground`,children:[x(k.parameters),` fields`]})]})]})]}),(0,m.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,m.jsx)(l,{className:`min-h-40 resize-y rounded-lg border-border bg-background/70 p-3 text-xs leading-5`,value:h,spellCheck:!1,onChange:e=>b(e.target.value)}),(0,m.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,m.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:`Arguments must be valid JSON.`}),(0,m.jsx)(i,{className:`h-9 min-h-9 rounded-lg px-4 text-xs`,type:`button`,disabled:S===`running`||k===void 0,onClick:()=>void A(),children:S===`running`?`Running`:`Run`})]}),D.length>0?(0,m.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs leading-5 text-destructive`,children:D}):null,T===void 0?null:(0,m.jsx)(_,{value:T,title:`Result`})]})]}),(0,m.jsxs)(`div`,{className:`grid gap-1 overflow-hidden rounded-xl border border-border/80 bg-card/55 p-2 shadow-sm`,children:[(0,m.jsxs)(`div`,{className:`grid min-h-10 grid-cols-[minmax(260px,0.75fr)_minmax(0,1fr)] items-center rounded-lg border border-border/60 bg-muted/20 px-4 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground max-lg:hidden`,children:[(0,m.jsx)(`span`,{children:`Definition`}),(0,m.jsx)(`span`,{children:`Parameter schema`})]}),n.map(e=>(0,m.jsx)(g,{tool:e},`${e.source}:${e.name}`))]})]}):(0,m.jsx)(v,{title:`Tools unavailable`,message:`No registered Studio agent exposes static or dynamic tools.`})})})]})}function g(e){let t=x(e.tool.parameters);return(0,m.jsxs)(`article`,{className:`grid grid-cols-[minmax(300px,0.75fr)_minmax(0,1fr)] gap-2 rounded-lg border border-transparent bg-background/25 p-2 transition duration-200 hover:border-border/70 hover:bg-background/35 max-lg:grid-cols-1`,children:[(0,m.jsxs)(`div`,{className:`grid content-start gap-4 rounded-lg bg-card/25 p-3`,children:[(0,m.jsxs)(`div`,{className:`grid gap-1`,children:[(0,m.jsx)(`h2`,{className:`m-0 truncate text-sm font-semibold text-foreground`,children:e.tool.name}),(0,m.jsx)(`span`,{className:`truncate text-xs font-medium text-muted-foreground`,children:e.tool.agentId})]}),(0,m.jsx)(`p`,{className:`m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground`,children:e.tool.description}),(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:[(0,m.jsx)(d,{className:y(e.tool.source),children:e.tool.source}),(0,m.jsxs)(d,{className:r(e.tool.approval.required?`border-border/80 bg-muted/45 text-foreground`:`border-border/80 bg-muted/55 text-muted-foreground`),children:[`approval `,e.tool.approval.required?`required`:`none`]}),(0,m.jsxs)(d,{className:`border-border/80 bg-transparent text-muted-foreground`,children:[t,` `,t===1?`field`:`fields`]})]}),e.tool.approval.reason===void 0?null:(0,m.jsx)(`p`,{className:`m-0 rounded-lg bg-muted/45 px-3 py-2 text-xs leading-5 text-muted-foreground`,children:e.tool.approval.reason})]}),(0,m.jsx)(_,{value:e.tool.parameters,title:`JSON schema`})]})}function _(e){return(0,m.jsxs)(`section`,{className:`grid min-w-0 content-start overflow-hidden rounded-lg bg-background/45`,children:[(0,m.jsxs)(`div`,{className:`flex min-h-9 items-center justify-between gap-3 bg-muted/20 px-4`,children:[(0,m.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:e.title}),(0,m.jsx)(`span`,{className:` text-xs text-muted-foreground`,children:b(e.value)})]}),(0,m.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,m.jsx)(`pre`,{className:`m-0 max-h-96 min-w-max p-4 text-xs leading-5 text-foreground`,children:(0,m.jsx)(`code`,{children:(0,m.jsx)(f,{text:S(e.value)})})})})]})}function v(e){return(0,m.jsx)(`div`,{className:`grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center`,children:(0,m.jsxs)(`div`,{className:`grid max-w-md gap-2`,children:[(0,m.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:e.title}),(0,m.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:e.message})]})})}function y(e){return e===`dynamic`?`border-border/80 bg-muted/45 text-foreground`:`border-border/80 bg-muted/55 text-muted-foreground`}function b(e){if(typeof e!=`object`||!e||Array.isArray(e))return`value`;let t=e.type;return typeof t==`string`?t:`object`}function x(e){if(typeof e!=`object`||!e||Array.isArray(e))return 0;let t=e.properties;return typeof t==`object`&&t&&!Array.isArray(t)?Object.keys(t).length:0}function S(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function C(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}export{h as ToolsPage};
2
- //# sourceMappingURL=tools-page-ByKfOqk3.js.map
1
+ import{i as e,r as t,s as n,t as r}from"./utils-BN2yP0LH.js";import{N as i,d as a,f as o,m as s,p as c,r as l,u}from"./index-BImv2lI7.js";import{t as d}from"./badge-BH7gz3tB.js";import{t as f}from"./renderers-CIC1VVRv.js";var p=n(e(),1),m=t();function h(e){let t=e.agents.find(t=>t.id===e.selectedAgentId)??e.agents[0],n=e.summary?.tools??[],[r,f]=(0,p.useState)(``),[h,b]=(0,p.useState)(`{}`),[S,w]=(0,p.useState)(`idle`),[T,E]=(0,p.useState)(),[D,O]=(0,p.useState)(``),k=(0,p.useMemo)(()=>n.find(e=>e.name===r)??n[0],[r,n]);(0,p.useEffect)(()=>{if(n.length===0){f(``);return}n.some(e=>e.name===r)||f(n[0]?.name??``)},[r,n]);async function A(){if(t===void 0||k===void 0)return;let e;try{e=JSON.parse(h)}catch(e){O(e instanceof Error?e.message:String(e)),E(void 0);return}w(`running`),O(``),E(void 0);try{let n=await fetch(`/agents/${encodeURIComponent(t.id)}/tools/${encodeURIComponent(k.name)}/runs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({args:e})}),r=await n.json();E(r),(!n.ok||r.status===`error`)&&O(C(r.error??r))}catch(e){O(e instanceof Error?e.message:String(e))}finally{w(`idle`)}}return(0,m.jsxs)(`section`,{className:`grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55`,"aria-label":`Tools`,children:[(0,m.jsx)(`header`,{className:`bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur`,children:(0,m.jsxs)(`div`,{className:`grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1`,children:[(0,m.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,m.jsx)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.24em] text-foreground`,children:`Agent capabilities`}),(0,m.jsx)(`h1`,{className:`m-0 text-2xl font-semibold leading-none tracking-tight text-foreground`,children:`Tools`}),(0,m.jsx)(`p`,{className:`m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground`,children:`Tool definitions registered on Studio agents, including approval policy and input schema.`})]}),e.agents.length>1?(0,m.jsxs)(u,{value:t?.id??``,onValueChange:e.onSelectAgent,children:[(0,m.jsx)(c,{className:`h-9 min-h-9 w-64 rounded-lg border-border bg-card/80 text-xs max-md:w-full`,children:(0,m.jsx)(s,{placeholder:`Agent`})}),(0,m.jsx)(a,{align:`end`,children:e.agents.map(e=>(0,m.jsx)(o,{value:e.id,children:e.name??e.id},e.id))})]}):null]})}),(0,m.jsx)(`div`,{className:`min-h-0 overflow-auto pb-6 pl-0 pr-6`,children:(0,m.jsx)(`div`,{className:`grid w-full gap-4`,children:e.enabled?e.loading?(0,m.jsx)(v,{title:`Loading tools`,message:`Reading registered tool metadata.`}):n.length===0?(0,m.jsx)(v,{title:`No tools`,message:`The selected agent has no registered tools.`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`section`,{className:`grid gap-4 rounded-xl border border-border/80 bg-card/55 p-4 shadow-sm xl:grid-cols-[minmax(300px,0.7fr)_minmax(0,1fr)]`,children:[(0,m.jsxs)(`div`,{className:`grid content-start gap-3`,children:[(0,m.jsxs)(`div`,{className:`grid gap-1`,children:[(0,m.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:`Run tool`}),(0,m.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:`Invoke a registered tool directly with JSON arguments and inspect the raw result.`})]}),(0,m.jsxs)(u,{value:k?.name??``,onValueChange:f,children:[(0,m.jsx)(c,{className:`h-9 min-h-9 rounded-lg border-border bg-background/80 text-xs`,children:(0,m.jsx)(s,{placeholder:`Tool`})}),(0,m.jsx)(a,{children:n.map(e=>(0,m.jsx)(o,{value:e.name,children:e.name},`${e.source}:${e.name}`))})]}),k===void 0?null:(0,m.jsxs)(`div`,{className:`grid gap-2 rounded-lg bg-background/45 p-3`,children:[(0,m.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:`selected definition`}),(0,m.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:k.description}),(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:[(0,m.jsx)(d,{className:y(k.source),children:k.source}),(0,m.jsxs)(d,{className:`border-border/80 bg-muted/55 text-muted-foreground`,children:[x(k.parameters),` fields`]})]})]})]}),(0,m.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,m.jsx)(l,{className:`min-h-40 resize-y rounded-lg border-border bg-background/70 p-3 text-xs leading-5`,value:h,spellCheck:!1,onChange:e=>b(e.target.value)}),(0,m.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,m.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:`Arguments must be valid JSON.`}),(0,m.jsx)(i,{className:`h-9 min-h-9 rounded-lg px-4 text-xs`,type:`button`,disabled:S===`running`||k===void 0,onClick:()=>void A(),children:S===`running`?`Running`:`Run`})]}),D.length>0?(0,m.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs leading-5 text-destructive`,children:D}):null,T===void 0?null:(0,m.jsx)(_,{value:T,title:`Result`})]})]}),(0,m.jsxs)(`div`,{className:`grid gap-1 overflow-hidden rounded-xl border border-border/80 bg-card/55 p-2 shadow-sm`,children:[(0,m.jsxs)(`div`,{className:`grid min-h-10 grid-cols-[minmax(260px,0.75fr)_minmax(0,1fr)] items-center rounded-lg border border-border/60 bg-muted/20 px-4 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground max-lg:hidden`,children:[(0,m.jsx)(`span`,{children:`Definition`}),(0,m.jsx)(`span`,{children:`Parameter schema`})]}),n.map(e=>(0,m.jsx)(g,{tool:e},`${e.source}:${e.name}`))]})]}):(0,m.jsx)(v,{title:`Tools unavailable`,message:`No registered Studio agent exposes static or dynamic tools.`})})})]})}function g(e){let t=x(e.tool.parameters);return(0,m.jsxs)(`article`,{className:`grid grid-cols-[minmax(300px,0.75fr)_minmax(0,1fr)] gap-2 rounded-lg border border-transparent bg-background/25 p-2 transition duration-200 hover:border-border/70 hover:bg-background/35 max-lg:grid-cols-1`,children:[(0,m.jsxs)(`div`,{className:`grid content-start gap-4 rounded-lg bg-card/25 p-3`,children:[(0,m.jsxs)(`div`,{className:`grid gap-1`,children:[(0,m.jsx)(`h2`,{className:`m-0 truncate text-sm font-semibold text-foreground`,children:e.tool.name}),(0,m.jsx)(`span`,{className:`truncate text-xs font-medium text-muted-foreground`,children:e.tool.agentId})]}),(0,m.jsx)(`p`,{className:`m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground`,children:e.tool.description}),(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:[(0,m.jsx)(d,{className:y(e.tool.source),children:e.tool.source}),(0,m.jsxs)(d,{className:r(e.tool.approval.required?`border-border/80 bg-muted/45 text-foreground`:`border-border/80 bg-muted/55 text-muted-foreground`),children:[`approval `,e.tool.approval.required?`required`:`none`]}),(0,m.jsxs)(d,{className:`border-border/80 bg-transparent text-muted-foreground`,children:[t,` `,t===1?`field`:`fields`]})]}),e.tool.approval.reason===void 0?null:(0,m.jsx)(`p`,{className:`m-0 rounded-lg bg-muted/45 px-3 py-2 text-xs leading-5 text-muted-foreground`,children:e.tool.approval.reason})]}),(0,m.jsx)(_,{value:e.tool.parameters,title:`JSON schema`})]})}function _(e){return(0,m.jsxs)(`section`,{className:`grid min-w-0 content-start overflow-hidden rounded-lg bg-background/45`,children:[(0,m.jsxs)(`div`,{className:`flex min-h-9 items-center justify-between gap-3 bg-muted/20 px-4`,children:[(0,m.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:e.title}),(0,m.jsx)(`span`,{className:` text-xs text-muted-foreground`,children:b(e.value)})]}),(0,m.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,m.jsx)(`pre`,{className:`m-0 max-h-96 min-w-max p-4 text-xs leading-5 text-foreground`,children:(0,m.jsx)(`code`,{children:(0,m.jsx)(f,{text:S(e.value)})})})})]})}function v(e){return(0,m.jsx)(`div`,{className:`grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center`,children:(0,m.jsxs)(`div`,{className:`grid max-w-md gap-2`,children:[(0,m.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:e.title}),(0,m.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:e.message})]})})}function y(e){return e===`dynamic`?`border-border/80 bg-muted/45 text-foreground`:`border-border/80 bg-muted/55 text-muted-foreground`}function b(e){if(typeof e!=`object`||!e||Array.isArray(e))return`value`;let t=e.type;return typeof t==`string`?t:`object`}function x(e){if(typeof e!=`object`||!e||Array.isArray(e))return 0;let t=e.properties;return typeof t==`object`&&t&&!Array.isArray(t)?Object.keys(t).length:0}function S(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function C(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}export{h as ToolsPage};
2
+ //# sourceMappingURL=tools-page-C-ht7C6S.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools-page-ByKfOqk3.js","names":[],"sources":["../../../src/ui/app/modules/tools/tools-page.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport type {\n StudioAgentToolMetadata,\n StudioAgentToolsSummary,\n StudioConfig,\n StudioToolRunResponse,\n} from \"../../../../types\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../components/ui/select\";\nimport { Textarea } from \"../../components/ui/textarea\";\nimport { cn } from \"../../lib/utils\";\nimport { JsonSyntax } from \"../shared/renderers\";\n\nexport function ToolsPage(props: {\n agents: StudioConfig[\"agents\"];\n selectedAgentId: string;\n summary: StudioAgentToolsSummary | undefined;\n enabled: boolean;\n loading: boolean;\n onSelectAgent: (agentId: string) => void;\n}) {\n const selectedAgent =\n props.agents.find((agent) => agent.id === props.selectedAgentId) ?? props.agents[0];\n const tools = props.summary?.tools ?? [];\n const [selectedToolName, setSelectedToolName] = useState(\"\");\n const [argsText, setArgsText] = useState(\"{}\");\n const [runState, setRunState] = useState<\"idle\" | \"running\">(\"idle\");\n const [runResponse, setRunResponse] = useState<StudioToolRunResponse | undefined>();\n const [runError, setRunError] = useState(\"\");\n const selectedTool = useMemo(\n () => tools.find((tool) => tool.name === selectedToolName) ?? tools[0],\n [selectedToolName, tools],\n );\n\n useEffect(() => {\n if (tools.length === 0) {\n setSelectedToolName(\"\");\n return;\n }\n if (!tools.some((tool) => tool.name === selectedToolName)) {\n setSelectedToolName(tools[0]?.name ?? \"\");\n }\n }, [selectedToolName, tools]);\n\n async function runSelectedTool() {\n if (selectedAgent === undefined || selectedTool === undefined) {\n return;\n }\n let args: unknown;\n try {\n args = JSON.parse(argsText);\n } catch (parseError) {\n setRunError(parseError instanceof Error ? parseError.message : String(parseError));\n setRunResponse(undefined);\n return;\n }\n\n setRunState(\"running\");\n setRunError(\"\");\n setRunResponse(undefined);\n try {\n const response = await fetch(\n `/agents/${encodeURIComponent(selectedAgent.id)}/tools/${encodeURIComponent(\n selectedTool.name,\n )}/runs`,\n {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: JSON.stringify({ args }),\n },\n );\n const body = (await response.json()) as StudioToolRunResponse;\n setRunResponse(body);\n if (!response.ok || body.status === \"error\") {\n setRunError(formatJson(body.error ?? body));\n }\n } catch (error) {\n setRunError(error instanceof Error ? error.message : String(error));\n } finally {\n setRunState(\"idle\");\n }\n }\n\n return (\n <section\n className=\"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55\"\n aria-label=\"Tools\"\n >\n <header className=\"bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur\">\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1\">\n <div className=\"grid min-w-0 gap-2\">\n <div className=\" text-xs font-semibold uppercase tracking-[0.24em] text-foreground\">\n Agent capabilities\n </div>\n <h1 className=\"m-0 text-2xl font-semibold leading-none tracking-tight text-foreground\">\n Tools\n </h1>\n <p className=\"m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground\">\n Tool definitions registered on Studio agents, including approval policy and input\n schema.\n </p>\n </div>\n {props.agents.length > 1 ? (\n <Select value={selectedAgent?.id ?? \"\"} onValueChange={props.onSelectAgent}>\n <SelectTrigger className=\"h-9 min-h-9 w-64 rounded-lg border-border bg-card/80 text-xs max-md:w-full\">\n <SelectValue placeholder=\"Agent\" />\n </SelectTrigger>\n <SelectContent align=\"end\">\n {props.agents.map((agent) => (\n <SelectItem value={agent.id} key={agent.id}>\n {agent.name ?? agent.id}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : null}\n </div>\n </header>\n\n <div className=\"min-h-0 overflow-auto pb-6 pl-0 pr-6\">\n <div className=\"grid w-full gap-4\">\n {!props.enabled ? (\n <EmptyState\n title=\"Tools unavailable\"\n message=\"No registered Studio agent exposes static or dynamic tools.\"\n />\n ) : props.loading ? (\n <EmptyState title=\"Loading tools\" message=\"Reading registered tool metadata.\" />\n ) : tools.length === 0 ? (\n <EmptyState title=\"No tools\" message=\"The selected agent has no registered tools.\" />\n ) : (\n <>\n <section className=\"grid gap-4 rounded-xl border border-border/80 bg-card/55 p-4 shadow-sm xl:grid-cols-[minmax(300px,0.7fr)_minmax(0,1fr)]\">\n <div className=\"grid content-start gap-3\">\n <div className=\"grid gap-1\">\n <h2 className=\"m-0 text-base font-semibold text-foreground\">Run tool</h2>\n <p className=\"m-0 text-sm leading-6 text-muted-foreground\">\n Invoke a registered tool directly with JSON arguments and inspect the raw\n result.\n </p>\n </div>\n <Select value={selectedTool?.name ?? \"\"} onValueChange={setSelectedToolName}>\n <SelectTrigger className=\"h-9 min-h-9 rounded-lg border-border bg-background/80 text-xs\">\n <SelectValue placeholder=\"Tool\" />\n </SelectTrigger>\n <SelectContent>\n {tools.map((tool) => (\n <SelectItem value={tool.name} key={`${tool.source}:${tool.name}`}>\n {tool.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {selectedTool === undefined ? null : (\n <div className=\"grid gap-2 rounded-lg bg-background/45 p-3\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground\">\n selected definition\n </span>\n <p className=\"m-0 text-sm leading-6 text-muted-foreground\">\n {selectedTool.description}\n </p>\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n <Badge className={sourceBadgeClass(selectedTool.source)}>\n {selectedTool.source}\n </Badge>\n <Badge className=\"border-border/80 bg-muted/55 text-muted-foreground\">\n {schemaPropertyCount(selectedTool.parameters)} fields\n </Badge>\n </div>\n </div>\n )}\n </div>\n <div className=\"grid min-w-0 gap-3\">\n <Textarea\n className=\"min-h-40 resize-y rounded-lg border-border bg-background/70 p-3 text-xs leading-5\"\n value={argsText}\n spellCheck={false}\n onChange={(event) => setArgsText(event.target.value)}\n />\n <div className=\"flex min-w-0 items-center justify-between gap-3\">\n <span className=\"min-w-0 truncate text-xs text-muted-foreground\">\n Arguments must be valid JSON.\n </span>\n <Button\n className=\"h-9 min-h-9 rounded-lg px-4 text-xs\"\n type=\"button\"\n disabled={runState === \"running\" || selectedTool === undefined}\n onClick={() => void runSelectedTool()}\n >\n {runState === \"running\" ? \"Running\" : \"Run\"}\n </Button>\n </div>\n {runError.length > 0 ? (\n <div className=\"rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs leading-5 text-destructive\">\n {runError}\n </div>\n ) : null}\n {runResponse === undefined ? null : (\n <SchemaBlock value={runResponse} title=\"Result\" />\n )}\n </div>\n </section>\n\n <div className=\"grid gap-1 overflow-hidden rounded-xl border border-border/80 bg-card/55 p-2 shadow-sm\">\n <div className=\"grid min-h-10 grid-cols-[minmax(260px,0.75fr)_minmax(0,1fr)] items-center rounded-lg border border-border/60 bg-muted/20 px-4 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground max-lg:hidden\">\n <span>Definition</span>\n <span>Parameter schema</span>\n </div>\n {tools.map((tool) => (\n <ToolDefinitionRow tool={tool} key={`${tool.source}:${tool.name}`} />\n ))}\n </div>\n </>\n )}\n </div>\n </div>\n </section>\n );\n}\n\nfunction ToolDefinitionRow(props: { tool: StudioAgentToolMetadata }) {\n const propertyCount = schemaPropertyCount(props.tool.parameters);\n return (\n <article className=\"grid grid-cols-[minmax(300px,0.75fr)_minmax(0,1fr)] gap-2 rounded-lg border border-transparent bg-background/25 p-2 transition duration-200 hover:border-border/70 hover:bg-background/35 max-lg:grid-cols-1\">\n <div className=\"grid content-start gap-4 rounded-lg bg-card/25 p-3\">\n <div className=\"grid gap-1\">\n <h2 className=\"m-0 truncate text-sm font-semibold text-foreground\">{props.tool.name}</h2>\n <span className=\"truncate text-xs font-medium text-muted-foreground\">\n {props.tool.agentId}\n </span>\n </div>\n <p className=\"m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground\">\n {props.tool.description}\n </p>\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n <Badge className={sourceBadgeClass(props.tool.source)}>{props.tool.source}</Badge>\n <Badge\n className={cn(\n props.tool.approval.required\n ? \"border-border/80 bg-muted/45 text-foreground\"\n : \"border-border/80 bg-muted/55 text-muted-foreground\",\n )}\n >\n approval {props.tool.approval.required ? \"required\" : \"none\"}\n </Badge>\n <Badge className=\"border-border/80 bg-transparent text-muted-foreground\">\n {propertyCount} {propertyCount === 1 ? \"field\" : \"fields\"}\n </Badge>\n </div>\n {props.tool.approval.reason === undefined ? null : (\n <p className=\"m-0 rounded-lg bg-muted/45 px-3 py-2 text-xs leading-5 text-muted-foreground\">\n {props.tool.approval.reason}\n </p>\n )}\n </div>\n <SchemaBlock value={props.tool.parameters} title=\"JSON schema\" />\n </article>\n );\n}\n\nfunction SchemaBlock(props: { value: unknown; title: string }) {\n return (\n <section className=\"grid min-w-0 content-start overflow-hidden rounded-lg bg-background/45\">\n <div className=\"flex min-h-9 items-center justify-between gap-3 bg-muted/20 px-4\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n {props.title}\n </span>\n <span className=\" text-xs text-muted-foreground\">{schemaType(props.value)}</span>\n </div>\n <div className=\"min-w-0 overflow-x-auto\">\n <pre className=\"m-0 max-h-96 min-w-max p-4 text-xs leading-5 text-foreground\">\n <code>\n <JsonSyntax text={formatSchema(props.value)} />\n </code>\n </pre>\n </div>\n </section>\n );\n}\n\nfunction EmptyState(props: { title: string; message: string }) {\n return (\n <div className=\"grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center\">\n <div className=\"grid max-w-md gap-2\">\n <h2 className=\"m-0 text-base font-semibold text-foreground\">{props.title}</h2>\n <p className=\"m-0 text-sm leading-6 text-muted-foreground\">{props.message}</p>\n </div>\n </div>\n );\n}\n\nfunction sourceBadgeClass(source: \"static\" | \"dynamic\"): string {\n return source === \"dynamic\"\n ? \"border-border/80 bg-muted/45 text-foreground\"\n : \"border-border/80 bg-muted/55 text-muted-foreground\";\n}\n\nfunction schemaType(value: unknown): string {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return \"value\";\n }\n const type = (value as { type?: unknown }).type;\n return typeof type === \"string\" ? type : \"object\";\n}\n\nfunction schemaPropertyCount(value: unknown): number {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return 0;\n }\n const properties = (value as { properties?: unknown }).properties;\n return typeof properties === \"object\" && properties !== null && !Array.isArray(properties)\n ? Object.keys(properties).length\n : 0;\n}\n\nfunction formatSchema(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n\nfunction formatJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n"],"mappings":"mPAoBA,SAAgB,EAAU,EAOvB,CACD,IAAM,EACJ,EAAM,OAAO,KAAM,GAAU,EAAM,KAAO,EAAM,gBAAgB,EAAI,EAAM,OAAO,GAC7E,EAAQ,EAAM,SAAS,OAAS,EAAE,CAClC,CAAC,EAAkB,IAAA,EAAA,EAAA,UAAgC,GAAG,CACtD,CAAC,EAAU,IAAA,EAAA,EAAA,UAAwB,KAAK,CACxC,CAAC,EAAU,IAAA,EAAA,EAAA,UAA4C,OAAO,CAC9D,CAAC,EAAa,IAAA,EAAA,EAAA,WAA+D,CAC7E,CAAC,EAAU,IAAA,EAAA,EAAA,UAAwB,GAAG,CACtC,GAAA,EAAA,EAAA,aACE,EAAM,KAAM,GAAS,EAAK,OAAS,EAAiB,EAAI,EAAM,GACpE,CAAC,EAAkB,EAAM,CAC1B,EAED,EAAA,EAAA,eAAgB,CACd,GAAI,EAAM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,EAAO,SAG3C,SAAS,EAAoB,EAAwB,CACnD,GAAI,OAAO,GAAU,WAAY,GAAkB,MAAM,QAAQ,EAAM,CACrE,MAAO,GAET,IAAM,EAAc,EAAmC,WACvD,OAAO,OAAO,GAAe,UAAY,GAAuB,CAAC,MAAM,QAAQ,EAAW,CACtF,OAAO,KAAK,EAAW,CAAC,OACxB,EAGN,SAAS,EAAa,EAAwB,CAC5C,GAAI,CACF,OAAO,KAAK,UAAU,EAAO,KAAM,EAAE,MAC/B,CACN,OAAO,OAAO,EAAM,EAIxB,SAAS,EAAW,EAAwB,CAC1C,GAAI,CACF,OAAO,KAAK,UAAU,EAAO,KAAM,EAAE,MAC/B,CACN,OAAO,OAAO,EAAM"}
1
+ {"version":3,"file":"tools-page-C-ht7C6S.js","names":[],"sources":["../../../src/ui/app/modules/tools/tools-page.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport type {\n StudioAgentToolMetadata,\n StudioAgentToolsSummary,\n StudioConfig,\n StudioToolRunResponse,\n} from \"../../../../types\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../components/ui/select\";\nimport { Textarea } from \"../../components/ui/textarea\";\nimport { cn } from \"../../lib/utils\";\nimport { JsonSyntax } from \"../shared/renderers\";\n\nexport function ToolsPage(props: {\n agents: StudioConfig[\"agents\"];\n selectedAgentId: string;\n summary: StudioAgentToolsSummary | undefined;\n enabled: boolean;\n loading: boolean;\n onSelectAgent: (agentId: string) => void;\n}) {\n const selectedAgent =\n props.agents.find((agent) => agent.id === props.selectedAgentId) ?? props.agents[0];\n const tools = props.summary?.tools ?? [];\n const [selectedToolName, setSelectedToolName] = useState(\"\");\n const [argsText, setArgsText] = useState(\"{}\");\n const [runState, setRunState] = useState<\"idle\" | \"running\">(\"idle\");\n const [runResponse, setRunResponse] = useState<StudioToolRunResponse | undefined>();\n const [runError, setRunError] = useState(\"\");\n const selectedTool = useMemo(\n () => tools.find((tool) => tool.name === selectedToolName) ?? tools[0],\n [selectedToolName, tools],\n );\n\n useEffect(() => {\n if (tools.length === 0) {\n setSelectedToolName(\"\");\n return;\n }\n if (!tools.some((tool) => tool.name === selectedToolName)) {\n setSelectedToolName(tools[0]?.name ?? \"\");\n }\n }, [selectedToolName, tools]);\n\n async function runSelectedTool() {\n if (selectedAgent === undefined || selectedTool === undefined) {\n return;\n }\n let args: unknown;\n try {\n args = JSON.parse(argsText);\n } catch (parseError) {\n setRunError(parseError instanceof Error ? parseError.message : String(parseError));\n setRunResponse(undefined);\n return;\n }\n\n setRunState(\"running\");\n setRunError(\"\");\n setRunResponse(undefined);\n try {\n const response = await fetch(\n `/agents/${encodeURIComponent(selectedAgent.id)}/tools/${encodeURIComponent(\n selectedTool.name,\n )}/runs`,\n {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: JSON.stringify({ args }),\n },\n );\n const body = (await response.json()) as StudioToolRunResponse;\n setRunResponse(body);\n if (!response.ok || body.status === \"error\") {\n setRunError(formatJson(body.error ?? body));\n }\n } catch (error) {\n setRunError(error instanceof Error ? error.message : String(error));\n } finally {\n setRunState(\"idle\");\n }\n }\n\n return (\n <section\n className=\"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55\"\n aria-label=\"Tools\"\n >\n <header className=\"bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur\">\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1\">\n <div className=\"grid min-w-0 gap-2\">\n <div className=\" text-xs font-semibold uppercase tracking-[0.24em] text-foreground\">\n Agent capabilities\n </div>\n <h1 className=\"m-0 text-2xl font-semibold leading-none tracking-tight text-foreground\">\n Tools\n </h1>\n <p className=\"m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground\">\n Tool definitions registered on Studio agents, including approval policy and input\n schema.\n </p>\n </div>\n {props.agents.length > 1 ? (\n <Select value={selectedAgent?.id ?? \"\"} onValueChange={props.onSelectAgent}>\n <SelectTrigger className=\"h-9 min-h-9 w-64 rounded-lg border-border bg-card/80 text-xs max-md:w-full\">\n <SelectValue placeholder=\"Agent\" />\n </SelectTrigger>\n <SelectContent align=\"end\">\n {props.agents.map((agent) => (\n <SelectItem value={agent.id} key={agent.id}>\n {agent.name ?? agent.id}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : null}\n </div>\n </header>\n\n <div className=\"min-h-0 overflow-auto pb-6 pl-0 pr-6\">\n <div className=\"grid w-full gap-4\">\n {!props.enabled ? (\n <EmptyState\n title=\"Tools unavailable\"\n message=\"No registered Studio agent exposes static or dynamic tools.\"\n />\n ) : props.loading ? (\n <EmptyState title=\"Loading tools\" message=\"Reading registered tool metadata.\" />\n ) : tools.length === 0 ? (\n <EmptyState title=\"No tools\" message=\"The selected agent has no registered tools.\" />\n ) : (\n <>\n <section className=\"grid gap-4 rounded-xl border border-border/80 bg-card/55 p-4 shadow-sm xl:grid-cols-[minmax(300px,0.7fr)_minmax(0,1fr)]\">\n <div className=\"grid content-start gap-3\">\n <div className=\"grid gap-1\">\n <h2 className=\"m-0 text-base font-semibold text-foreground\">Run tool</h2>\n <p className=\"m-0 text-sm leading-6 text-muted-foreground\">\n Invoke a registered tool directly with JSON arguments and inspect the raw\n result.\n </p>\n </div>\n <Select value={selectedTool?.name ?? \"\"} onValueChange={setSelectedToolName}>\n <SelectTrigger className=\"h-9 min-h-9 rounded-lg border-border bg-background/80 text-xs\">\n <SelectValue placeholder=\"Tool\" />\n </SelectTrigger>\n <SelectContent>\n {tools.map((tool) => (\n <SelectItem value={tool.name} key={`${tool.source}:${tool.name}`}>\n {tool.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {selectedTool === undefined ? null : (\n <div className=\"grid gap-2 rounded-lg bg-background/45 p-3\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground\">\n selected definition\n </span>\n <p className=\"m-0 text-sm leading-6 text-muted-foreground\">\n {selectedTool.description}\n </p>\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n <Badge className={sourceBadgeClass(selectedTool.source)}>\n {selectedTool.source}\n </Badge>\n <Badge className=\"border-border/80 bg-muted/55 text-muted-foreground\">\n {schemaPropertyCount(selectedTool.parameters)} fields\n </Badge>\n </div>\n </div>\n )}\n </div>\n <div className=\"grid min-w-0 gap-3\">\n <Textarea\n className=\"min-h-40 resize-y rounded-lg border-border bg-background/70 p-3 text-xs leading-5\"\n value={argsText}\n spellCheck={false}\n onChange={(event) => setArgsText(event.target.value)}\n />\n <div className=\"flex min-w-0 items-center justify-between gap-3\">\n <span className=\"min-w-0 truncate text-xs text-muted-foreground\">\n Arguments must be valid JSON.\n </span>\n <Button\n className=\"h-9 min-h-9 rounded-lg px-4 text-xs\"\n type=\"button\"\n disabled={runState === \"running\" || selectedTool === undefined}\n onClick={() => void runSelectedTool()}\n >\n {runState === \"running\" ? \"Running\" : \"Run\"}\n </Button>\n </div>\n {runError.length > 0 ? (\n <div className=\"rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs leading-5 text-destructive\">\n {runError}\n </div>\n ) : null}\n {runResponse === undefined ? null : (\n <SchemaBlock value={runResponse} title=\"Result\" />\n )}\n </div>\n </section>\n\n <div className=\"grid gap-1 overflow-hidden rounded-xl border border-border/80 bg-card/55 p-2 shadow-sm\">\n <div className=\"grid min-h-10 grid-cols-[minmax(260px,0.75fr)_minmax(0,1fr)] items-center rounded-lg border border-border/60 bg-muted/20 px-4 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground max-lg:hidden\">\n <span>Definition</span>\n <span>Parameter schema</span>\n </div>\n {tools.map((tool) => (\n <ToolDefinitionRow tool={tool} key={`${tool.source}:${tool.name}`} />\n ))}\n </div>\n </>\n )}\n </div>\n </div>\n </section>\n );\n}\n\nfunction ToolDefinitionRow(props: { tool: StudioAgentToolMetadata }) {\n const propertyCount = schemaPropertyCount(props.tool.parameters);\n return (\n <article className=\"grid grid-cols-[minmax(300px,0.75fr)_minmax(0,1fr)] gap-2 rounded-lg border border-transparent bg-background/25 p-2 transition duration-200 hover:border-border/70 hover:bg-background/35 max-lg:grid-cols-1\">\n <div className=\"grid content-start gap-4 rounded-lg bg-card/25 p-3\">\n <div className=\"grid gap-1\">\n <h2 className=\"m-0 truncate text-sm font-semibold text-foreground\">{props.tool.name}</h2>\n <span className=\"truncate text-xs font-medium text-muted-foreground\">\n {props.tool.agentId}\n </span>\n </div>\n <p className=\"m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground\">\n {props.tool.description}\n </p>\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n <Badge className={sourceBadgeClass(props.tool.source)}>{props.tool.source}</Badge>\n <Badge\n className={cn(\n props.tool.approval.required\n ? \"border-border/80 bg-muted/45 text-foreground\"\n : \"border-border/80 bg-muted/55 text-muted-foreground\",\n )}\n >\n approval {props.tool.approval.required ? \"required\" : \"none\"}\n </Badge>\n <Badge className=\"border-border/80 bg-transparent text-muted-foreground\">\n {propertyCount} {propertyCount === 1 ? \"field\" : \"fields\"}\n </Badge>\n </div>\n {props.tool.approval.reason === undefined ? null : (\n <p className=\"m-0 rounded-lg bg-muted/45 px-3 py-2 text-xs leading-5 text-muted-foreground\">\n {props.tool.approval.reason}\n </p>\n )}\n </div>\n <SchemaBlock value={props.tool.parameters} title=\"JSON schema\" />\n </article>\n );\n}\n\nfunction SchemaBlock(props: { value: unknown; title: string }) {\n return (\n <section className=\"grid min-w-0 content-start overflow-hidden rounded-lg bg-background/45\">\n <div className=\"flex min-h-9 items-center justify-between gap-3 bg-muted/20 px-4\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n {props.title}\n </span>\n <span className=\" text-xs text-muted-foreground\">{schemaType(props.value)}</span>\n </div>\n <div className=\"min-w-0 overflow-x-auto\">\n <pre className=\"m-0 max-h-96 min-w-max p-4 text-xs leading-5 text-foreground\">\n <code>\n <JsonSyntax text={formatSchema(props.value)} />\n </code>\n </pre>\n </div>\n </section>\n );\n}\n\nfunction EmptyState(props: { title: string; message: string }) {\n return (\n <div className=\"grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center\">\n <div className=\"grid max-w-md gap-2\">\n <h2 className=\"m-0 text-base font-semibold text-foreground\">{props.title}</h2>\n <p className=\"m-0 text-sm leading-6 text-muted-foreground\">{props.message}</p>\n </div>\n </div>\n );\n}\n\nfunction sourceBadgeClass(source: \"static\" | \"dynamic\"): string {\n return source === \"dynamic\"\n ? \"border-border/80 bg-muted/45 text-foreground\"\n : \"border-border/80 bg-muted/55 text-muted-foreground\";\n}\n\nfunction schemaType(value: unknown): string {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return \"value\";\n }\n const type = (value as { type?: unknown }).type;\n return typeof type === \"string\" ? type : \"object\";\n}\n\nfunction schemaPropertyCount(value: unknown): number {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return 0;\n }\n const properties = (value as { properties?: unknown }).properties;\n return typeof properties === \"object\" && properties !== null && !Array.isArray(properties)\n ? Object.keys(properties).length\n : 0;\n}\n\nfunction formatSchema(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n\nfunction formatJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n"],"mappings":"mPAoBA,SAAgB,EAAU,EAOvB,CACD,IAAM,EACJ,EAAM,OAAO,KAAM,GAAU,EAAM,KAAO,EAAM,gBAAgB,EAAI,EAAM,OAAO,GAC7E,EAAQ,EAAM,SAAS,OAAS,EAAE,CAClC,CAAC,EAAkB,IAAA,EAAA,EAAA,UAAgC,GAAG,CACtD,CAAC,EAAU,IAAA,EAAA,EAAA,UAAwB,KAAK,CACxC,CAAC,EAAU,IAAA,EAAA,EAAA,UAA4C,OAAO,CAC9D,CAAC,EAAa,IAAA,EA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ACF,CAAA,CAIV,SAAS,EAAiB,EAAsC,CAC9D,OAAO,IAAW,UACd,+CACA,qDAGN,SAAS,EAAW,EAAwB,CAC1C,GAAI,OAAO,GAAU,WAAY,GAAkB,MAAM,QAAQ,EAAM,CACrE,MAAO,QAET,IAAM,EAAQ,EAA6B,KAC3C,OAAO,OAAO,GAAS,SAAW,EAAO,SAG3C,SAAS,EAAoB,EAAwB,CACnD,GAAI,OAAO,GAAU,WAAY,GAAkB,MAAM,QAAQ,EAAM,CACrE,MAAO,GAET,IAAM,EAAc,EAAmC,WACvD,OAAO,OAAO,GAAe,UAAY,GAAuB,CAAC,MAAM,QAAQ,EAAW,CACtF,OAAO,KAAK,EAAW,CAAC,OACxB,EAGN,SAAS,EAAa,EAAwB,CAC5C,GAAI,CACF,OAAO,KAAK,UAAU,EAAO,KAAM,EAAE,MAC/B,CACN,OAAO,OAAO,EAAM,EAIxB,SAAS,EAAW,EAAwB,CAC1C,GAAI,CACF,OAAO,KAAK,UAAU,EAAO,KAAM,EAAE,MAC/B,CACN,OAAO,OAAO,EAAM"}
@@ -1,4 +1,4 @@
1
- import{i as e,r as t,s as n,t as r}from"./utils-BN2yP0LH.js";import{a as i,c as a,l as o,m as s,p as c,r as l,s as u,u as d}from"./format-C9HPGfkW.js";import{t as f}from"./PathIcon-DX1w_Nk9.js";import{A as p,D as m,E as h,F as g,I as _,L as v,M as y,N as b,O as x,R as S,V as C,j as w,k as T,v as E,x as D,z as O}from"./index-CC5mjRie.js";import{t as k}from"./badge-BH7gz3tB.js";var ee=[[`path`,{d:`M5.5 12.002H19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M10.9999 18.002C10.9999 18.002 4.99998 13.583 4.99997 12.0019C4.99996 10.4208 11 6.00195 11 6.00195`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],te=[[`path`,{d:`M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ne=[[`path`,{d:`M11 6H15.5C17.9853 6 20 8.01472 20 10.5C20 12.9853 17.9853 15 15.5 15H4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6.99998 12C6.99998 12 4.00001 14.2095 4 15C3.99999 15.7906 7 18 7 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],re=[[`path`,{d:`M4 12C4 8.22876 4 6.34315 5.17157 5.17157C6.34315 4 8.22876 4 12 4C15.7712 4 17.6569 4 18.8284 5.17157C20 6.34315 20 8.22876 20 12C20 15.7712 20 17.6569 18.8284 18.8284C17.6569 20 15.7712 20 12 20C8.22876 20 6.34315 20 5.17157 18.8284C4 17.6569 4 15.7712 4 12Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 2V4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M14.5 2V4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M9.5 20V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M14.5 20V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M13 9L9 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M15 13L13 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M22 14.5L20 14.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`7`}],[`path`,{d:`M4 9.5L2 9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`8`}],[`path`,{d:`M4 14.5L2 14.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`9`}],[`path`,{d:`M22 9.5L20 9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`10`}]],ie=[[`path`,{d:`M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5 7L5 17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`circle`,{cx:`5`,cy:`5`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`3`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`4`}]],ae=[[`path`,{d:`M15.5 12C15.5 13.933 13.933 15.5 12 15.5C10.067 15.5 8.5 13.933 8.5 12C8.5 10.067 10.067 8.5 12 8.5C13.933 8.5 15.5 10.067 15.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M21.011 14.0965C21.5329 13.9558 21.7939 13.8854 21.8969 13.7508C22 13.6163 22 13.3998 22 12.9669V11.0332C22 10.6003 22 10.3838 21.8969 10.2493C21.7938 10.1147 21.5329 10.0443 21.011 9.90358C19.0606 9.37759 17.8399 7.33851 18.3433 5.40087C18.4817 4.86799 18.5509 4.60156 18.4848 4.44529C18.4187 4.28902 18.2291 4.18134 17.8497 3.96596L16.125 2.98673C15.7528 2.77539 15.5667 2.66972 15.3997 2.69222C15.2326 2.71472 15.0442 2.90273 14.6672 3.27873C13.208 4.73448 10.7936 4.73442 9.33434 3.27864C8.95743 2.90263 8.76898 2.71463 8.60193 2.69212C8.43489 2.66962 8.24877 2.77529 7.87653 2.98663L6.15184 3.96587C5.77253 4.18123 5.58287 4.28891 5.51678 4.44515C5.45068 4.6014 5.51987 4.86787 5.65825 5.4008C6.16137 7.3385 4.93972 9.37763 2.98902 9.9036C2.46712 10.0443 2.20617 10.1147 2.10308 10.2492C2 10.3838 2 10.6003 2 11.0332V12.9669C2 13.3998 2 13.6163 2.10308 13.7508C2.20615 13.8854 2.46711 13.9558 2.98902 14.0965C4.9394 14.6225 6.16008 16.6616 5.65672 18.5992C5.51829 19.1321 5.44907 19.3985 5.51516 19.5548C5.58126 19.7111 5.77092 19.8188 6.15025 20.0341L7.87495 21.0134C8.24721 21.2247 8.43334 21.3304 8.6004 21.3079C8.76746 21.2854 8.95588 21.0973 9.33271 20.7213C10.7927 19.2644 13.2088 19.2643 14.6689 20.7212C15.0457 21.0973 15.2341 21.2853 15.4012 21.3078C15.5682 21.3303 15.7544 21.2246 16.1266 21.0133L17.8513 20.034C18.2307 19.8187 18.4204 19.711 18.4864 19.5547C18.5525 19.3984 18.4833 19.132 18.3448 18.5991C17.8412 16.6616 19.0609 14.6226 21.011 14.0965Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],A=n(e(),1),j=t();function oe(e){try{return JSON.stringify(e,null,2)??`undefined`}catch{return String(e)}}function se(e){return(0,j.jsx)(`div`,{className:`overflow-x-auto rounded-lg bg-card/85 px-4 py-4 text-sm leading-6 text-foreground`,children:(0,j.jsx)(ue,{depth:0,path:`$`,value:e.value})})}var ce=16,le=20;function ue(e){return pe(e.value)?(0,j.jsx)(de,{arrayIndex:e.arrayIndex,depth:e.depth,path:e.path,propertyKey:e.propertyKey,trailingComma:e.trailingComma,value:e.value}):(0,j.jsxs)(`div`,{className:`min-w-max whitespace-pre`,style:{paddingLeft:`${M(e.depth)}px`},children:[(0,j.jsx)(N,{arrayIndex:e.arrayIndex,propertyKey:e.propertyKey}),(0,j.jsx)(fe,{value:e.value}),e.trailingComma?(0,j.jsx)(`span`,{className:`text-foreground`,children:`,`}):null]})}function de(e){let[t,n]=(0,A.useState)(e.depth===0),r=Array.isArray(e.value)?e.value:void 0,i=r===void 0?Object.entries(e.value):r.map((e,t)=>[String(t),e]),a=r===void 0?`{`:`[`,o=r===void 0?`}`:`]`,s=r===void 0?`{…}`:`[…]`;return i.length===0?(0,j.jsxs)(`div`,{className:`min-w-max whitespace-pre`,style:{paddingLeft:`${M(e.depth)}px`},children:[(0,j.jsx)(N,{arrayIndex:e.arrayIndex,propertyKey:e.propertyKey}),(0,j.jsxs)(`span`,{className:`text-foreground`,children:[a,o,e.trailingComma?`,`:``]})]}):(0,j.jsxs)(`div`,{className:`grid min-w-max`,children:[(0,j.jsxs)(`button`,{"aria-expanded":t,className:`grid min-w-max grid-cols-[16px_auto] items-center gap-1 rounded-lg py-0.5 pr-2 text-left transition duration-200 hover:bg-accent/45 hover:text-accent-foreground`,onClick:()=>n(e=>!e),style:{paddingLeft:`${e.depth*ce}px`},type:`button`,children:[(0,j.jsx)(`span`,{className:`grid h-4 w-4 place-items-center text-muted-foreground [&_svg]:h-3 [&_svg]:w-3`,children:t?(0,j.jsx)(y,{icon:O,"aria-hidden":`true`}):(0,j.jsx)(y,{icon:te,"aria-hidden":`true`})}),(0,j.jsxs)(`span`,{className:`whitespace-pre`,children:[(0,j.jsx)(N,{arrayIndex:e.arrayIndex,propertyKey:e.propertyKey}),t?(0,j.jsx)(`span`,{className:`text-foreground`,children:a}):(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:s}),!t&&e.trailingComma?(0,j.jsx)(`span`,{className:`text-foreground`,children:`,`}):null]})]}),t?(0,j.jsxs)(j.Fragment,{children:[i.map(([t,n],a)=>(0,j.jsx)(ue,{arrayIndex:r===void 0?void 0:Number(t),depth:e.depth+1,path:`${e.path}.${t}`,propertyKey:r===void 0?t:void 0,trailingComma:a<i.length-1,value:n},`${e.path}.${t}`)),(0,j.jsxs)(`div`,{className:`min-w-max whitespace-pre text-foreground`,style:{paddingLeft:`${M(e.depth)}px`},children:[o,e.trailingComma?`,`:``]})]}):null]})}function M(e){return e*ce+le}function N(e){return e.propertyKey===void 0?e.arrayIndex===void 0?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[`[`,e.arrayIndex,`]`]}),(0,j.jsx)(`span`,{className:`text-foreground`,children:` `})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:JSON.stringify(e.propertyKey)}),(0,j.jsx)(`span`,{className:`text-foreground`,children:`: `})]})}function fe(e){return typeof e.value==`string`?(0,j.jsx)(`span`,{className:`text-foreground`,children:JSON.stringify(e.value)}):typeof e.value==`number`?(0,j.jsx)(`span`,{className:`text-foreground`,children:String(e.value)}):typeof e.value==`boolean`?(0,j.jsx)(`span`,{className:`text-chart-4`,children:String(e.value)}):e.value===null?(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`null`}):e.value===void 0?(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`undefined`}):(0,j.jsx)(`span`,{className:`text-foreground`,children:oe(e.value)})}function pe(e){return Array.isArray(e)||s(e)}function me(e){return e.label===`Message Id`}function he(e){let t=`h-3.5 w-3.5 shrink-0`;switch(e.label){case`System prompt`:return(0,j.jsx)(y,{icon:ae,"aria-hidden":`true`,className:t});case`Prompt`:return(0,j.jsx)(y,{icon:S,"aria-hidden":`true`,className:t});case`Output`:case`Assistant output`:return(0,j.jsx)(y,{icon:ne,"aria-hidden":`true`,className:t});default:return null}}function ge(e,t){if(e===`Output`){let e=_e(t);if(e.length>0)return e}let n=P(t,e);if(n.length>0)return n;if(!s(t))return[{label:e,text:xe(t)}];let r=[];for(let[e,n]of Object.entries(t)){let t=P(n,e);if(t.length>0){r.push(...t);continue}r.push({label:I(e),text:xe(n)})}return r.length>0?r:[{label:e,text:`Empty object`}]}function _e(e){if(!s(e))return[];let t=[],n=P(e.choice,`choice`);return t.push(...n),typeof e.messageId==`string`&&e.messageId.length>0&&t.push({label:`Message Id`,text:e.messageId}),t}function P(e,t){if(typeof e==`string`&&t===void 0)return[{label:`Value`,text:e}];if(Array.isArray(e))return t===`chatHistory`?ve(e):t===`history`?ye(e):e.map((e,n)=>({label:F(e,n,t),text:C(e)||u(e)})).filter(e=>e.text.length>0);if(!s(e))return[];let n=Array.isArray(e.chatHistory)?e.chatHistory:void 0;if(n!==void 0){let t=be(e);return t.push(...P(n,`chatHistory`)),t}if(Array.isArray(e.prompt))return P(e.prompt,`prompt`);let r=[];r.push(...be(e));let i=Array.isArray(e.history)?e.history:[];i.length>0&&r.push(...P(i,`history`));let a=C(e.prompt);return a.length>0&&r.push({label:i.length>0?`Current prompt`:`Prompt`,text:a}),r}function ve(e){let t=e.map((e,t)=>({label:F(e,t,`chatHistory`),text:C(e)||u(e)})).filter(e=>e.text.length>0),n=t.at(-1),r=t.slice(0,-1),i=[];return r.length>0&&i.push({label:`Conversation history (${r.length})`,text:r.map((e,t)=>`${t+1}. ${e.label}\n${e.text}`).join(`
1
+ import{i as e,r as t,s as n,t as r}from"./utils-BN2yP0LH.js";import{a as i,c as a,l as o,m as s,p as c,r as l,s as u,u as d}from"./format-C9HPGfkW.js";import{t as f}from"./PathIcon-DX1w_Nk9.js";import{A as p,D as m,E as h,F as g,I as _,L as v,M as y,N as b,O as x,R as S,V as C,j as w,k as T,v as E,x as D,z as O}from"./index-BImv2lI7.js";import{t as k}from"./badge-BH7gz3tB.js";var ee=[[`path`,{d:`M5.5 12.002H19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M10.9999 18.002C10.9999 18.002 4.99998 13.583 4.99997 12.0019C4.99996 10.4208 11 6.00195 11 6.00195`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],te=[[`path`,{d:`M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ne=[[`path`,{d:`M11 6H15.5C17.9853 6 20 8.01472 20 10.5C20 12.9853 17.9853 15 15.5 15H4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6.99998 12C6.99998 12 4.00001 14.2095 4 15C3.99999 15.7906 7 18 7 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],re=[[`path`,{d:`M4 12C4 8.22876 4 6.34315 5.17157 5.17157C6.34315 4 8.22876 4 12 4C15.7712 4 17.6569 4 18.8284 5.17157C20 6.34315 20 8.22876 20 12C20 15.7712 20 17.6569 18.8284 18.8284C17.6569 20 15.7712 20 12 20C8.22876 20 6.34315 20 5.17157 18.8284C4 17.6569 4 15.7712 4 12Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 2V4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M14.5 2V4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M9.5 20V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M14.5 20V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M13 9L9 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M15 13L13 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M22 14.5L20 14.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`7`}],[`path`,{d:`M4 9.5L2 9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`8`}],[`path`,{d:`M4 14.5L2 14.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`9`}],[`path`,{d:`M22 9.5L20 9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`10`}]],ie=[[`path`,{d:`M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5 7L5 17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`circle`,{cx:`5`,cy:`5`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`3`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`4`}]],ae=[[`path`,{d:`M15.5 12C15.5 13.933 13.933 15.5 12 15.5C10.067 15.5 8.5 13.933 8.5 12C8.5 10.067 10.067 8.5 12 8.5C13.933 8.5 15.5 10.067 15.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M21.011 14.0965C21.5329 13.9558 21.7939 13.8854 21.8969 13.7508C22 13.6163 22 13.3998 22 12.9669V11.0332C22 10.6003 22 10.3838 21.8969 10.2493C21.7938 10.1147 21.5329 10.0443 21.011 9.90358C19.0606 9.37759 17.8399 7.33851 18.3433 5.40087C18.4817 4.86799 18.5509 4.60156 18.4848 4.44529C18.4187 4.28902 18.2291 4.18134 17.8497 3.96596L16.125 2.98673C15.7528 2.77539 15.5667 2.66972 15.3997 2.69222C15.2326 2.71472 15.0442 2.90273 14.6672 3.27873C13.208 4.73448 10.7936 4.73442 9.33434 3.27864C8.95743 2.90263 8.76898 2.71463 8.60193 2.69212C8.43489 2.66962 8.24877 2.77529 7.87653 2.98663L6.15184 3.96587C5.77253 4.18123 5.58287 4.28891 5.51678 4.44515C5.45068 4.6014 5.51987 4.86787 5.65825 5.4008C6.16137 7.3385 4.93972 9.37763 2.98902 9.9036C2.46712 10.0443 2.20617 10.1147 2.10308 10.2492C2 10.3838 2 10.6003 2 11.0332V12.9669C2 13.3998 2 13.6163 2.10308 13.7508C2.20615 13.8854 2.46711 13.9558 2.98902 14.0965C4.9394 14.6225 6.16008 16.6616 5.65672 18.5992C5.51829 19.1321 5.44907 19.3985 5.51516 19.5548C5.58126 19.7111 5.77092 19.8188 6.15025 20.0341L7.87495 21.0134C8.24721 21.2247 8.43334 21.3304 8.6004 21.3079C8.76746 21.2854 8.95588 21.0973 9.33271 20.7213C10.7927 19.2644 13.2088 19.2643 14.6689 20.7212C15.0457 21.0973 15.2341 21.2853 15.4012 21.3078C15.5682 21.3303 15.7544 21.2246 16.1266 21.0133L17.8513 20.034C18.2307 19.8187 18.4204 19.711 18.4864 19.5547C18.5525 19.3984 18.4833 19.132 18.3448 18.5991C17.8412 16.6616 19.0609 14.6226 21.011 14.0965Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],A=n(e(),1),j=t();function oe(e){try{return JSON.stringify(e,null,2)??`undefined`}catch{return String(e)}}function se(e){return(0,j.jsx)(`div`,{className:`overflow-x-auto rounded-lg bg-card/85 px-4 py-4 text-sm leading-6 text-foreground`,children:(0,j.jsx)(ue,{depth:0,path:`$`,value:e.value})})}var ce=16,le=20;function ue(e){return pe(e.value)?(0,j.jsx)(de,{arrayIndex:e.arrayIndex,depth:e.depth,path:e.path,propertyKey:e.propertyKey,trailingComma:e.trailingComma,value:e.value}):(0,j.jsxs)(`div`,{className:`min-w-max whitespace-pre`,style:{paddingLeft:`${M(e.depth)}px`},children:[(0,j.jsx)(N,{arrayIndex:e.arrayIndex,propertyKey:e.propertyKey}),(0,j.jsx)(fe,{value:e.value}),e.trailingComma?(0,j.jsx)(`span`,{className:`text-foreground`,children:`,`}):null]})}function de(e){let[t,n]=(0,A.useState)(e.depth===0),r=Array.isArray(e.value)?e.value:void 0,i=r===void 0?Object.entries(e.value):r.map((e,t)=>[String(t),e]),a=r===void 0?`{`:`[`,o=r===void 0?`}`:`]`,s=r===void 0?`{…}`:`[…]`;return i.length===0?(0,j.jsxs)(`div`,{className:`min-w-max whitespace-pre`,style:{paddingLeft:`${M(e.depth)}px`},children:[(0,j.jsx)(N,{arrayIndex:e.arrayIndex,propertyKey:e.propertyKey}),(0,j.jsxs)(`span`,{className:`text-foreground`,children:[a,o,e.trailingComma?`,`:``]})]}):(0,j.jsxs)(`div`,{className:`grid min-w-max`,children:[(0,j.jsxs)(`button`,{"aria-expanded":t,className:`grid min-w-max grid-cols-[16px_auto] items-center gap-1 rounded-lg py-0.5 pr-2 text-left transition duration-200 hover:bg-accent/45 hover:text-accent-foreground`,onClick:()=>n(e=>!e),style:{paddingLeft:`${e.depth*ce}px`},type:`button`,children:[(0,j.jsx)(`span`,{className:`grid h-4 w-4 place-items-center text-muted-foreground [&_svg]:h-3 [&_svg]:w-3`,children:t?(0,j.jsx)(y,{icon:O,"aria-hidden":`true`}):(0,j.jsx)(y,{icon:te,"aria-hidden":`true`})}),(0,j.jsxs)(`span`,{className:`whitespace-pre`,children:[(0,j.jsx)(N,{arrayIndex:e.arrayIndex,propertyKey:e.propertyKey}),t?(0,j.jsx)(`span`,{className:`text-foreground`,children:a}):(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:s}),!t&&e.trailingComma?(0,j.jsx)(`span`,{className:`text-foreground`,children:`,`}):null]})]}),t?(0,j.jsxs)(j.Fragment,{children:[i.map(([t,n],a)=>(0,j.jsx)(ue,{arrayIndex:r===void 0?void 0:Number(t),depth:e.depth+1,path:`${e.path}.${t}`,propertyKey:r===void 0?t:void 0,trailingComma:a<i.length-1,value:n},`${e.path}.${t}`)),(0,j.jsxs)(`div`,{className:`min-w-max whitespace-pre text-foreground`,style:{paddingLeft:`${M(e.depth)}px`},children:[o,e.trailingComma?`,`:``]})]}):null]})}function M(e){return e*ce+le}function N(e){return e.propertyKey===void 0?e.arrayIndex===void 0?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[`[`,e.arrayIndex,`]`]}),(0,j.jsx)(`span`,{className:`text-foreground`,children:` `})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:JSON.stringify(e.propertyKey)}),(0,j.jsx)(`span`,{className:`text-foreground`,children:`: `})]})}function fe(e){return typeof e.value==`string`?(0,j.jsx)(`span`,{className:`text-foreground`,children:JSON.stringify(e.value)}):typeof e.value==`number`?(0,j.jsx)(`span`,{className:`text-foreground`,children:String(e.value)}):typeof e.value==`boolean`?(0,j.jsx)(`span`,{className:`text-chart-4`,children:String(e.value)}):e.value===null?(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`null`}):e.value===void 0?(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`undefined`}):(0,j.jsx)(`span`,{className:`text-foreground`,children:oe(e.value)})}function pe(e){return Array.isArray(e)||s(e)}function me(e){return e.label===`Message Id`}function he(e){let t=`h-3.5 w-3.5 shrink-0`;switch(e.label){case`System prompt`:return(0,j.jsx)(y,{icon:ae,"aria-hidden":`true`,className:t});case`Prompt`:return(0,j.jsx)(y,{icon:S,"aria-hidden":`true`,className:t});case`Output`:case`Assistant output`:return(0,j.jsx)(y,{icon:ne,"aria-hidden":`true`,className:t});default:return null}}function ge(e,t){if(e===`Output`){let e=_e(t);if(e.length>0)return e}let n=P(t,e);if(n.length>0)return n;if(!s(t))return[{label:e,text:xe(t)}];let r=[];for(let[e,n]of Object.entries(t)){let t=P(n,e);if(t.length>0){r.push(...t);continue}r.push({label:I(e),text:xe(n)})}return r.length>0?r:[{label:e,text:`Empty object`}]}function _e(e){if(!s(e))return[];let t=[],n=P(e.choice,`choice`);return t.push(...n),typeof e.messageId==`string`&&e.messageId.length>0&&t.push({label:`Message Id`,text:e.messageId}),t}function P(e,t){if(typeof e==`string`&&t===void 0)return[{label:`Value`,text:e}];if(Array.isArray(e))return t===`chatHistory`?ve(e):t===`history`?ye(e):e.map((e,n)=>({label:F(e,n,t),text:C(e)||u(e)})).filter(e=>e.text.length>0);if(!s(e))return[];let n=Array.isArray(e.chatHistory)?e.chatHistory:void 0;if(n!==void 0){let t=be(e);return t.push(...P(n,`chatHistory`)),t}if(Array.isArray(e.prompt))return P(e.prompt,`prompt`);let r=[];r.push(...be(e));let i=Array.isArray(e.history)?e.history:[];i.length>0&&r.push(...P(i,`history`));let a=C(e.prompt);return a.length>0&&r.push({label:i.length>0?`Current prompt`:`Prompt`,text:a}),r}function ve(e){let t=e.map((e,t)=>({label:F(e,t,`chatHistory`),text:C(e)||u(e)})).filter(e=>e.text.length>0),n=t.at(-1),r=t.slice(0,-1),i=[];return r.length>0&&i.push({label:`Conversation history (${r.length})`,text:r.map((e,t)=>`${t+1}. ${e.label}\n${e.text}`).join(`
2
2
 
3
3
  `)}),n!==void 0&&i.push({label:r.length>0?`Current prompt`:`Prompt`,text:n.text}),i}function ye(e){let t=e.map((e,t)=>({label:F(e,t,`history`),text:C(e)||u(e)})).filter(e=>e.text.length>0);return t.length===0?[]:[{label:`Conversation history (${t.length})`,text:t.map((e,t)=>`${t+1}. ${e.label}\n${e.text}`).join(`
4
4
 
@@ -7,4 +7,4 @@ import{i as e,r as t,s as n,t as r}from"./utils-BN2yP0LH.js";import{a as i,c as
7
7
  `).flatMap(e=>{let[t,...n]=e.split(`
8
8
  `),r=/^(\d+)\.\s+(.+)$/.exec(t??``);return r===null?[]:[{index:r[1]??``,role:r[2]??`Message`,text:n.join(`
9
9
  `)}]}):[]}export{bt as TraceBrowser};
10
- //# sourceMappingURL=trace-browser-Dk7nD7KO.js.map
10
+ //# sourceMappingURL=trace-browser-DaE4vnXd.js.map