@anvia/studio 0.8.1 → 1.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +31 -19
  2. package/dist/index.d.ts +37 -60
  3. package/dist/index.js +1000 -724
  4. package/dist/index.js.map +1 -1
  5. package/dist/ui/assets/{ArrowClockwise.es-CSN-gjxO.js → ArrowClockwise.es-DMJj7Hv0.js} +2 -2
  6. package/dist/ui/assets/{ArrowClockwise.es-CSN-gjxO.js.map → ArrowClockwise.es-DMJj7Hv0.js.map} +1 -1
  7. package/dist/ui/assets/{agents-page-CkNSbqAj.js → agents-page-CbQpO3Tg.js} +2 -2
  8. package/dist/ui/assets/agents-page-CbQpO3Tg.js.map +1 -0
  9. package/dist/ui/assets/{badge-RJJoRC4P.js → badge-BIWy1K8W.js} +1 -1
  10. package/dist/ui/assets/{badge-RJJoRC4P.js.map → badge-BIWy1K8W.js.map} +1 -1
  11. package/dist/ui/assets/index-DizotQot.js +119 -0
  12. package/dist/ui/assets/index-DizotQot.js.map +1 -0
  13. package/dist/ui/assets/{input-BOUv3rgO.js → input-BTHDDFpv.js} +1 -1
  14. package/dist/ui/assets/{input-BOUv3rgO.js.map → input-BTHDDFpv.js.map} +1 -1
  15. package/dist/ui/assets/{knowledge-page-Cot_uYcE.js → knowledge-page-C8zg8uTL.js} +2 -2
  16. package/dist/ui/assets/{knowledge-page-Cot_uYcE.js.map → knowledge-page-C8zg8uTL.js.map} +1 -1
  17. package/dist/ui/assets/{mcps-page-BSO6ork4.js → mcps-page-gNYeqSPB.js} +2 -2
  18. package/dist/ui/assets/{mcps-page-BSO6ork4.js.map → mcps-page-gNYeqSPB.js.map} +1 -1
  19. package/dist/ui/assets/{memory-page-CG84G--r.js → memory-page-BLrfOqyU.js} +4 -4
  20. package/dist/ui/assets/memory-page-BLrfOqyU.js.map +1 -0
  21. package/dist/ui/assets/pipelines-page-hTEhFZGg.js +8 -0
  22. package/dist/ui/assets/pipelines-page-hTEhFZGg.js.map +1 -0
  23. package/dist/ui/assets/{renderers-B8gvjR2u.js → renderers-DC_-TD_X.js} +3 -3
  24. package/dist/ui/assets/{renderers-B8gvjR2u.js.map → renderers-DC_-TD_X.js.map} +1 -1
  25. package/dist/ui/assets/{sandboxes-page-D910dyFO.js → sandboxes-page-DtPnuza7.js} +2 -2
  26. package/dist/ui/assets/{sandboxes-page-D910dyFO.js.map → sandboxes-page-DtPnuza7.js.map} +1 -1
  27. package/dist/ui/assets/{sessions-page-CSN2vSKZ.js → sessions-page-DBzoP7MV.js} +2 -2
  28. package/dist/ui/assets/{sessions-page-CSN2vSKZ.js.map → sessions-page-DBzoP7MV.js.map} +1 -1
  29. package/dist/ui/assets/{status-page-CgRNt0wi.js → status-page-Bf1lq444.js} +2 -2
  30. package/dist/ui/assets/{status-page-CgRNt0wi.js.map → status-page-Bf1lq444.js.map} +1 -1
  31. package/dist/ui/assets/tool-runner-BbUlfPEO.js +2 -0
  32. package/dist/ui/assets/{tool-runner-BZN-PZJU.js.map → tool-runner-BbUlfPEO.js.map} +1 -1
  33. package/dist/ui/assets/{tools-page-DRv7aklU.js → tools-page-BgUz-79v.js} +2 -2
  34. package/dist/ui/assets/{tools-page-DRv7aklU.js.map → tools-page-BgUz-79v.js.map} +1 -1
  35. package/dist/ui/assets/trace-browser-qfYPcdR2.js +10 -0
  36. package/dist/ui/assets/trace-browser-qfYPcdR2.js.map +1 -0
  37. package/dist/ui/assets/{transcript-item-ZNkQEaCw.js → transcript-item-HFuuqmKM.js} +3 -3
  38. package/dist/ui/assets/{transcript-item-ZNkQEaCw.js.map → transcript-item-HFuuqmKM.js.map} +1 -1
  39. package/dist/ui/index.html +1 -2
  40. package/package.json +12 -11
  41. package/dist/ui/assets/agents-page-CkNSbqAj.js.map +0 -1
  42. package/dist/ui/assets/chunk-ADH7NNCS-DM6fsnDI.js +0 -2
  43. package/dist/ui/assets/chunk-ADH7NNCS-DM6fsnDI.js.map +0 -1
  44. package/dist/ui/assets/index-Bh7RLPBw.js +0 -56
  45. package/dist/ui/assets/index-Bh7RLPBw.js.map +0 -1
  46. package/dist/ui/assets/memory-page-CG84G--r.js.map +0 -1
  47. package/dist/ui/assets/pipelines-page-Hbf5ffUH.js +0 -8
  48. package/dist/ui/assets/pipelines-page-Hbf5ffUH.js.map +0 -1
  49. package/dist/ui/assets/tool-runner-BZN-PZJU.js +0 -2
  50. package/dist/ui/assets/trace-browser-B07coNNE.js +0 -10
  51. package/dist/ui/assets/trace-browser-B07coNNE.js.map +0 -1
@@ -1,3 +1,3 @@
1
- import{i as e,r as t,s as n,t as r}from"./utils-C9GMruoG.js";import{B as i,F as a,H as o,J as s,L as c,S as l,W as u,t as d}from"./index-Bh7RLPBw.js";import{t as f}from"./badge-RJJoRC4P.js";import{i as p,r as m}from"./renderers-B8gvjR2u.js";var h=n(e(),1),g=new Map([[`bold`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M224,196h-4V40a12,12,0,0,0-12-12H152a12,12,0,0,0-12,12V76H96A12,12,0,0,0,84,88v36H48a12,12,0,0,0-12,12v60H32a12,12,0,0,0,0,24H224a12,12,0,0,0,0-24ZM164,52h32V196H164Zm-56,48h32v96H108ZM60,148H84v48H60Z`}))],[`duotone`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M208,40V208H152V40Z`,opacity:`0.2`}),h.createElement(`path`,{d:`M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z`}))],[`fill`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M232,208a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16h8V136a8,8,0,0,1,8-8H72a8,8,0,0,1,8,8v64H96V88a8,8,0,0,1,8-8h32a8,8,0,0,1,8,8V200h16V40a8,8,0,0,1,8-8h40a8,8,0,0,1,8,8V200h8A8,8,0,0,1,232,208Z`}))],[`light`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M224,202H214V40a6,6,0,0,0-6-6H152a6,6,0,0,0-6,6V82H96a6,6,0,0,0-6,6v42H48a6,6,0,0,0-6,6v66H32a6,6,0,0,0,0,12H224a6,6,0,0,0,0-12ZM158,46h44V202H158ZM102,94h44V202H102ZM54,142H90v60H54Z`}))],[`regular`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z`}))],[`thin`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M224,204H212V40a4,4,0,0,0-4-4H152a4,4,0,0,0-4,4V84H96a4,4,0,0,0-4,4v44H48a4,4,0,0,0-4,4v68H32a4,4,0,0,0,0,8H224a4,4,0,0,0,0-8ZM156,44h48V204H156ZM100,92h48V204H100ZM52,140H92v64H52Z`}))]]),_=new Map([[`bold`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z`}))],[`duotone`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),h.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`fill`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`light`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z`}))],[`regular`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`thin`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z`}))]]),v=new Map([[`bold`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M200,164a36.07,36.07,0,0,0-33.94,24H72a28,28,0,0,1,0-56h96a44,44,0,0,0,0-88H72a12,12,0,0,0,0,24h96a20,20,0,0,1,0,40H72a52,52,0,0,0,0,104h94.06A36,36,0,1,0,200,164Zm0,48a12,12,0,1,1,12-12A12,12,0,0,1,200,212Z`}))],[`duotone`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M224,200a24,24,0,1,1-24-24A24,24,0,0,1,224,200Z`,opacity:`0.2`}),h.createElement(`path`,{d:`M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z`}))],[`fill`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M228,200a28,28,0,0,1-54.83,8H72a48,48,0,0,1,0-96h96a24,24,0,0,0,0-48H72a8,8,0,0,1,0-16h96a40,40,0,0,1,0,80H72a32,32,0,0,0,0,64H173.17A28,28,0,0,1,228,200Z`}))],[`light`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M200,170a30.05,30.05,0,0,0-29.4,24H72a34,34,0,0,1,0-68h96a38,38,0,0,0,0-76H72a6,6,0,0,0,0,12h96a26,26,0,0,1,0,52H72a46,46,0,0,0,0,92h98.6A30,30,0,1,0,200,170Zm0,48a18,18,0,1,1,18-18A18,18,0,0,1,200,218Z`}))],[`regular`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z`}))],[`thin`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M200,172a28,28,0,0,0-27.71,24H72a36,36,0,0,1,0-72h96a36,36,0,0,0,0-72H72a4,4,0,0,0,0,8h96a28,28,0,0,1,0,56H72a44,44,0,0,0,0,88H172.29A28,28,0,1,0,200,172Zm0,48a20,20,0,1,1,20-20A20,20,0,0,1,200,220Z`}))]]),y=h.forwardRef((e,t)=>h.createElement(u,{ref:t,...e,weights:g}));y.displayName=`ChartBarIcon`;var b=y,x=h.forwardRef((e,t)=>h.createElement(u,{ref:t,...e,weights:_}));x.displayName=`CopyIcon`;var S=x,C=h.forwardRef((e,t)=>h.createElement(u,{ref:t,...e,weights:v}));C.displayName=`PathIcon`;var w=C,T=t();function E(e){return e.durationMs===void 0?null:(0,T.jsx)(`span`,{"aria-live":`off`,className:r(`inline-flex items-center gap-1.5 text-xs font-medium tabular-nums text-muted-foreground`,e.className),children:D(e.durationMs)})}function D(e){let t=Math.floor((Number.isFinite(e)?Math.max(0,e):0)/1e3),n=Math.floor(t/60),r=t%60;return`Finished - ${n===0?`${r}s`:`${n}m ${r}s`}`}var O=(0,h.memo)(function(e){let t=e.displayText??(`text`in e.entry?e.entry.text:``);if(e.entry.kind===`reasoning`)return(0,T.jsxs)(`article`,{className:`max-w-205 justify-self-start text-muted-foreground`,"data-entry-id":String(e.entry.entryId),children:[(0,T.jsx)(`div`,{className:`mb-1 text-xs font-semibold uppercase text-muted-foreground`,children:`Reasoning`}),(0,T.jsx)(m,{live:e.live,size:`base`,text:t})]});if(e.entry.kind===`tool`)return(0,T.jsx)(B,{entry:e.entry,decidingApprovals:e.decidingApprovals,answeringQuestions:e.answeringQuestions,onApprovalDecision:e.onApprovalDecision,onQuestionAnswer:e.onQuestionAnswer});let n=e.entry.role===`assistant`?e.entry.traceId:void 0,i=e.entry.role===`assistant`&&z(t),a=e.entry.role===`assistant`&&`tone`in e.entry&&e.entry.tone===`error`,o=e.entry.role===`assistant`&&`tone`in e.entry&&e.entry.tone===`pending`,s=e.entry.role===`assistant`&&!o&&e.entry.text.trim().length>0,c=e.entry.durationMs??e.metrics?.durationMs,l=s||c!==void 0;return e.entry.role===`user`?(0,T.jsxs)(`article`,{className:`grid w-fit max-w-[min(64ch,82%)] justify-items-end justify-self-end self-start text-foreground`,"data-entry-id":String(e.entry.entryId),children:[e.entry.text.trim().length===0?null:(0,T.jsx)(`div`,{className:`rounded-2xl bg-muted px-4 py-2.5`,children:(0,T.jsx)(m,{size:`base`,text:e.entry.text})}),e.entry.attachments===void 0?null:(0,T.jsx)(R,{attachments:e.entry.attachments})]}):(0,T.jsxs)(`article`,{className:r(`self-start`,i?`w-full max-w-full`:`max-w-[min(82ch,100%)]`,e.entry.role===`assistant`&&r(`justify-self-start text-foreground`,a&&`text-destructive`)),"data-entry-id":String(e.entry.entryId),children:[o?(0,T.jsx)(L,{}):null,t.trim().length===0?null:(0,T.jsx)(m,{live:e.live,size:`base`,text:t}),l?(0,T.jsx)(k,{metrics:e.metrics,showActions:s,text:e.entry.text,traceId:n,durationMs:c,onOpenTrace:e.onOpenTrace}):null]})});function k(e){let[t,n]=(0,h.useState)(!1),r=e.traceId;async function o(){if(!(typeof navigator>`u`||navigator.clipboard===void 0))try{await navigator.clipboard.writeText(e.text),n(!0),window.setTimeout(()=>n(!1),1200)}catch{n(!1)}}return(0,T.jsxs)(`div`,{className:`mt-3 flex min-w-0 items-center gap-1.5`,children:[e.showActions?(0,T.jsx)(a,{"aria-label":t?`Response copied`:`Copy response`,className:`h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground`,title:t?`Copied`:`Copy response`,type:`button`,variant:`ghost`,onClick:()=>void o(),children:(0,T.jsx)(l,{icon:t?i:S,"aria-hidden":`true`})}):null,e.showActions?(0,T.jsxs)(`div`,{className:`group relative`,children:[(0,T.jsx)(a,{"aria-label":`Response metrics`,className:`h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground`,title:P(e.metrics),type:`button`,variant:`ghost`,children:(0,T.jsx)(l,{icon:b,"aria-hidden":`true`})}),(0,T.jsx)(`div`,{className:`pointer-events-none absolute left-0 top-full z-30 mt-2 hidden w-64 rounded-lg border border-border/90 bg-popover p-3 text-popover-foreground shadow-xl shadow-black/25 group-focus-within:grid group-hover:grid`,role:`tooltip`,children:(0,T.jsx)(A,{metrics:e.metrics})})]}):null,!e.showActions||r===void 0?null:(0,T.jsx)(a,{"aria-label":`Open trace ${r}`,className:`h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground`,title:`Open trace ${r}`,type:`button`,variant:`ghost`,onClick:()=>e.onOpenTrace(r),children:(0,T.jsx)(l,{icon:w,"aria-hidden":`true`})}),(0,T.jsx)(E,{className:e.showActions?`ml-1.5`:void 0,durationMs:e.durationMs})]})}function A(e){let t=M(e.metrics);return(0,T.jsxs)(`div`,{className:`grid min-w-0 gap-2 text-xs leading-5`,children:[(0,T.jsx)(`div`,{className:`font-semibold text-foreground`,children:`Response metrics`}),(0,T.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,T.jsx)(j,{label:`Cost`,value:`Unavailable`}),t.length===0?(0,T.jsx)(`div`,{className:`text-muted-foreground`,children:`No usage metrics yet`}):t.map(e=>(0,T.jsx)(j,{label:e.label,value:e.value},e.label))]})]})}function j(e){return(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,T.jsx)(`span`,{className:`shrink-0 font-medium tabular-nums text-foreground`,children:e.value})]})}function M(e){let t=[],n=e?.usage;return n?.totalTokens!==void 0&&t.push({label:`Total`,value:`${F(n.totalTokens)} tokens`}),n?.inputTokens!==void 0&&t.push({label:`Input`,value:F(n.inputTokens)}),n?.outputTokens!==void 0&&t.push({label:`Output`,value:F(n.outputTokens)}),N(t,`Cached`,n,`cachedInputTokens`),N(t,`Cache create`,n,`cacheCreationInputTokens`),e?.durationMs!==void 0&&t.push({label:`Duration`,value:I(e.durationMs)}),t}function N(e,t,n,r){let i=n?.[r];i!==void 0&&i>0&&e.push({label:t,value:F(i)})}function P(e){let t=M(e);return t.length===0?`Cost unavailable. No usage metrics yet.`:[`Cost unavailable`,...t.map(e=>`${e.label}: ${e.value}`)].join(`. `)}function F(e){return e.toLocaleString()}function I(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function L(){return(0,T.jsxs)(`div`,{"aria-label":`Assistant is thinking`,"aria-live":`polite`,className:`inline-flex min-h-8 items-center gap-2 py-1 text-muted-foreground`,role:`status`,children:[(0,T.jsx)(`span`,{className:`text-base font-medium`,children:`Thinking`}),(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,"aria-hidden":`true`,children:[(0,T.jsx)(`span`,{className:`size-1 animate-pulse rounded-full bg-current motion-reduce:animate-none`}),(0,T.jsx)(`span`,{className:`size-1 animate-pulse rounded-full bg-current [animation-delay:150ms] motion-reduce:animate-none`}),(0,T.jsx)(`span`,{className:`size-1 animate-pulse rounded-full bg-current [animation-delay:300ms] motion-reduce:animate-none`})]})]})}function R(e){return(0,T.jsx)(`div`,{className:`mt-2 flex max-w-full flex-wrap gap-2`,children:e.attachments.map((e,t)=>{let n=`${e.kind}-${e.name??e.mediaType??t}-${t}`;if(e.kind===`image`){let t=e.url??(e.data===void 0?void 0:`data:${e.mediaType??`image/png`};base64,${e.data}`);return(0,T.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-border/80 bg-card/80`,children:t===void 0?(0,T.jsx)(`div`,{className:`grid h-20 w-24 place-items-center px-2 text-center text-xs text-muted-foreground`,children:`Image`}):(0,T.jsx)(`img`,{alt:e.name??`Attached image`,className:`h-20 w-24 object-cover`,src:t})},n)}return(0,T.jsx)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border/80 bg-card/80 px-2 py-1 text-xs font-medium text-muted-foreground`,children:(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name??e.mediaType??`Document`})},n)})})}function z(e){let t=e.split(`
2
- `);return t.some((e,n)=>{let r=t[n+1];return e.includes(`|`)&&r!==void 0&&/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(r)})}function B(e){let[t,n]=(0,h.useState)(e.entry.approval?.status!==`pending`&&e.entry.question?.status!==`pending`),i=e.entry.approval,s=e.entry.question,u=e.entry.childEvents??[],d=e.entry.args!==void 0||e.entry.result!==void 0||u.length>0||i!==void 0||s!==void 0,f=i?.status===`pending`,m=s?.status===`pending`,g=i?.status===`cancelled`||s?.status===`cancelled`,_=i?.status===`rejected`,v=i?.status===`timed_out`,y=i!==void 0&&e.decidingApprovals.has(i.id),b=s!==void 0&&e.answeringQuestions.has(s.id),x=f?`Approval required`:m?`Input required`:g?`Cancelled`:_?`Rejected`:v?`Timed out`:e.entry.result===void 0?`Running`:void 0;return(0,T.jsxs)(`article`,{className:`w-full justify-self-start text-foreground`,"data-entry-id":String(e.entry.entryId),children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 py-1.5`,children:[(0,T.jsxs)(a,{"aria-expanded":d?!t:void 0,"aria-label":`${t?`Expand`:`Collapse`} ${e.entry.toolName} tool call`,className:`h-auto min-h-8 min-w-0 flex-1 justify-start gap-2 border-0 bg-transparent p-0 text-left text-inherit shadow-none hover:bg-transparent hover:text-inherit`,type:`button`,variant:`ghost`,onClick:()=>n(e=>!e),children:[(0,T.jsx)(`span`,{className:`grid size-6 shrink-0 place-items-center text-muted-foreground`,children:(0,T.jsx)(l,{icon:c,className:`size-4`,"aria-hidden":`true`})}),(0,T.jsx)(`strong`,{className:`min-w-0 truncate font-mono text-base font-medium text-foreground`,children:e.entry.toolName}),x===void 0?null:(0,T.jsxs)(`span`,{className:`ml-auto inline-flex shrink-0 items-center gap-1.5 text-sm font-normal text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:r(`size-1.5 rounded-full bg-muted-foreground/60`,x===`Running`&&`animate-pulse bg-foreground motion-reduce:animate-none`,(g||_||v)&&`bg-destructive`),"aria-hidden":`true`}),x]}),d?(0,T.jsx)(`span`,{className:`grid size-6 shrink-0 place-items-center text-muted-foreground`,children:(0,T.jsx)(l,{icon:o,className:r(`size-4 transition-transform`,t&&`-rotate-90`),"aria-hidden":`true`})}):null]}),f&&i!==void 0?(0,T.jsx)(K,{disabled:y,onDecision:t=>e.onApprovalDecision(i.id,t)}):null]}),t||!d?null:(0,T.jsxs)(`div`,{className:`ml-8 grid gap-3 py-2`,children:[i===void 0?null:(0,T.jsx)(G,{approval:i}),s===void 0?null:(0,T.jsx)(H,{disabled:b,question:s,onAnswer:t=>e.onQuestionAnswer(s.id,t)}),s!==void 0||e.entry.args===void 0?null:(0,T.jsx)(p,{title:`Input`,value:e.entry.args}),u.length===0?null:(0,T.jsx)(V,{events:u}),s!==void 0||e.entry.result===void 0?null:(0,T.jsx)(p,{title:`Output`,value:e.entry.result})]})]})}function V(e){return(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/80 bg-background/65`,children:[(0,T.jsx)(`div`,{className:`bg-muted/20 px-3 py-2 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:`Subagent activity`}),(0,T.jsx)(`div`,{className:`grid gap-3 p-3`,children:e.events.map(e=>{let t=e.agentName??e.agentId;return e.kind===`message`||e.kind===`reasoning`?(0,T.jsxs)(`div`,{className:`grid gap-1 rounded-xl border border-border/80 bg-card/90 p-3`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(f,{className:`border-border bg-muted px-1.5 py-0.5 text-xs uppercase text-muted-foreground`,children:e.kind===`reasoning`?`Reasoning`:`Response`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate text-xs font-semibold text-muted-foreground`,children:t})]}),(0,T.jsx)(m,{size:`base`,text:e.text})]},`${e.kind}-${e.agentId}-${e.text}`):(0,T.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/80 bg-card/90 p-3`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(f,{className:`border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-foreground`,children:`Tool`}),(0,T.jsxs)(`span`,{className:`min-w-0 truncate text-xs font-semibold text-muted-foreground`,children:[t,` / `,e.toolName]})]}),e.args===void 0?null:(0,T.jsx)(p,{title:`Input`,value:e.args}),e.result===void 0?null:(0,T.jsx)(p,{title:`Output`,value:e.result})]},`${e.kind}-${e.agentId}-${e.toolName}-${e.callId??e.args??e.result??``}`)})})]})}function H(e){let[t,n]=(0,h.useState)({}),[r,i]=(0,h.useState)(0),o=e.question.status===`pending`,s=e.question.questions.length,c=e.question.questions.map(e=>{let n=t[e.id],r=n?.customValue?.trim()??``,i=r.length>0?r:n?.answer,a={questionId:e.id,answer:i?.trim()??``};return n?.choice!==void 0&&(a.choice=n.choice),r.length>0&&(a.custom=!0),a}),l=s===0?0:Math.min(r,s-1),u=e.question.questions[l],d=c[l]?.answer??``,f=c.filter(e=>e.answer.length>0).length,p=d.length>0,m=o&&c.every(e=>e.answer.length>0),g=l===0,_=l>=s-1;if(u===void 0)return(0,T.jsx)(`div`,{className:`rounded-xl border border-border bg-background p-4 text-sm font-medium text-muted-foreground`,children:`No questions`});let v=()=>i(e=>Math.max(0,e-1)),y=()=>i(t=>Math.min(e.question.questions.length-1,t+1)),b=(e,t)=>n(n=>({...n,[e]:t}));return(0,T.jsxs)(`div`,{className:`grid gap-3`,children:[e.question.status===`cancelled`?(0,T.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-muted/25 px-3 py-2.5 text-sm font-medium text-muted-foreground`,children:`Question cancelled`}):null,(0,T.jsx)(U,{disabled:e.disabled||!o,index:l,total:s,question:u,value:t[u.id],answer:e.question.answers?.find(e=>e.questionId===u.id),onChange:e=>b(u.id,e),onAdvance:_?void 0:y},u.id),o?(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-xl bg-muted/20 px-3 py-2`,children:[(0,T.jsxs)(`div`,{className:`min-w-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:[f,`/`,s,` answered`]}),(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[g?null:(0,T.jsx)(a,{type:`button`,variant:`secondary`,onClick:v,children:`Back`}),_?(0,T.jsx)(a,{className:`h-9 min-h-9 px-4`,disabled:e.disabled||!m,type:`button`,onClick:()=>e.onAnswer(c),children:`Submit answers`}):(0,T.jsx)(a,{className:`h-9 min-h-9 px-4`,disabled:e.disabled||!p,type:`button`,onClick:y,children:`Next question`})]})]}):s>1?(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-xl bg-muted/20 px-3 py-2`,children:[(0,T.jsx)(`div`,{className:`min-w-0 text-xs font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Answered`}),(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,T.jsx)(a,{disabled:g,type:`button`,variant:`secondary`,onClick:v,children:`Back`}),(0,T.jsx)(a,{disabled:_,type:`button`,variant:`secondary`,onClick:y,children:`Next`})]})]}):null]})}function U(e){let t=e.answer?.answer,n=W(e.value),i=t===void 0?n.length>0?`Ready`:`Waiting`:`Answered`;return(0,T.jsxs)(`section`,{className:`grid gap-4 rounded-xl border border-border/80 bg-background/70 p-4`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,T.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,T.jsxs)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:[`Question `,e.index+1,` of `,e.total]}),(0,T.jsx)(`h3`,{className:`m-0 text-base font-semibold leading-7 text-foreground [overflow-wrap:anywhere]`,children:e.question.question})]}),(0,T.jsx)(`span`,{className:r(`shrink-0 text-xs font-semibold uppercase tracking-[0.18em]`,i===`Answered`&&`text-foreground`,i===`Ready`&&`text-foreground`,i===`Waiting`&&`text-muted-foreground`),children:i})]}),t===void 0?null:(0,T.jsx)(`div`,{className:`rounded-lg border border-border/70 bg-muted/45 px-3 py-2 text-sm font-medium text-foreground`,children:t}),t===void 0&&e.question.choices.length>0?(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.question.choices.map(t=>{let n=e.value?.choice===t.value;return(0,T.jsx)(a,{className:r(`h-8 min-h-8 px-3 text-xs`,n&&`border-foreground/45`),disabled:e.disabled,size:`sm`,type:`button`,variant:n?`default`:`secondary`,onClick:()=>{e.onChange({answer:t.value,choice:t.value,customValue:e.value?.customValue??``}),e.onAdvance?.()},children:t.label},t.value)})}):null,t===void 0?(0,T.jsx)(d,{className:`min-h-24 text-sm`,disabled:e.disabled,placeholder:`Type a custom answer`,rows:3,value:e.value?.customValue??``,onChange:t=>e.onChange({...e.value,customValue:t.currentTarget.value})}):null]})}function W(e){let t=e?.customValue?.trim()??``;return t.length>0?t:e?.answer?.trim()??``}function G(e){return(0,T.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/70 bg-muted/25 px-3 py-2.5`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(f,{className:r(`border-border/70 bg-background/60 px-1.5 py-0.5 text-xs uppercase text-muted-foreground`,e.approval.status===`approved`&&`text-foreground`,e.approval.status===`rejected`&&`text-destructive`),children:`Approval`}),(0,T.jsx)(`div`,{className:`min-w-0`,children:(0,T.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:s(e.approval)})})]}),e.approval.reason===void 0?null:(0,T.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground [overflow-wrap:anywhere]`,children:e.approval.reason})]})}function K(e){return(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,T.jsx)(a,{className:`h-8 min-h-8 border-0 bg-transparent px-3 text-sm text-muted-foreground shadow-none hover:bg-destructive/10 hover:text-destructive`,disabled:e.disabled,size:`sm`,type:`button`,variant:`ghost`,onClick:()=>e.onDecision(!1),children:`Reject`}),(0,T.jsx)(a,{className:`h-8 min-h-8 px-3 text-sm`,disabled:e.disabled,size:`sm`,type:`button`,onClick:()=>e.onDecision(!0),children:`Approve`})]})}export{O as TranscriptItem};
3
- //# sourceMappingURL=transcript-item-ZNkQEaCw.js.map
1
+ import{i as e,r as t,s as n,t as r}from"./utils-C9GMruoG.js";import{B as i,F as a,H as o,L as s,S as c,W as l,Y as u,t as d}from"./index-DizotQot.js";import{t as f}from"./badge-BIWy1K8W.js";import{i as p,r as m}from"./renderers-DC_-TD_X.js";var h=n(e(),1),g=new Map([[`bold`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M224,196h-4V40a12,12,0,0,0-12-12H152a12,12,0,0,0-12,12V76H96A12,12,0,0,0,84,88v36H48a12,12,0,0,0-12,12v60H32a12,12,0,0,0,0,24H224a12,12,0,0,0,0-24ZM164,52h32V196H164Zm-56,48h32v96H108ZM60,148H84v48H60Z`}))],[`duotone`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M208,40V208H152V40Z`,opacity:`0.2`}),h.createElement(`path`,{d:`M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z`}))],[`fill`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M232,208a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16h8V136a8,8,0,0,1,8-8H72a8,8,0,0,1,8,8v64H96V88a8,8,0,0,1,8-8h32a8,8,0,0,1,8,8V200h16V40a8,8,0,0,1,8-8h40a8,8,0,0,1,8,8V200h8A8,8,0,0,1,232,208Z`}))],[`light`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M224,202H214V40a6,6,0,0,0-6-6H152a6,6,0,0,0-6,6V82H96a6,6,0,0,0-6,6v42H48a6,6,0,0,0-6,6v66H32a6,6,0,0,0,0,12H224a6,6,0,0,0,0-12ZM158,46h44V202H158ZM102,94h44V202H102ZM54,142H90v60H54Z`}))],[`regular`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z`}))],[`thin`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M224,204H212V40a4,4,0,0,0-4-4H152a4,4,0,0,0-4,4V84H96a4,4,0,0,0-4,4v44H48a4,4,0,0,0-4,4v68H32a4,4,0,0,0,0,8H224a4,4,0,0,0,0-8ZM156,44h48V204H156ZM100,92h48V204H100ZM52,140H92v64H52Z`}))]]),_=new Map([[`bold`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z`}))],[`duotone`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),h.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`fill`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`light`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z`}))],[`regular`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`thin`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z`}))]]),v=new Map([[`bold`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M200,164a36.07,36.07,0,0,0-33.94,24H72a28,28,0,0,1,0-56h96a44,44,0,0,0,0-88H72a12,12,0,0,0,0,24h96a20,20,0,0,1,0,40H72a52,52,0,0,0,0,104h94.06A36,36,0,1,0,200,164Zm0,48a12,12,0,1,1,12-12A12,12,0,0,1,200,212Z`}))],[`duotone`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M224,200a24,24,0,1,1-24-24A24,24,0,0,1,224,200Z`,opacity:`0.2`}),h.createElement(`path`,{d:`M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z`}))],[`fill`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M228,200a28,28,0,0,1-54.83,8H72a48,48,0,0,1,0-96h96a24,24,0,0,0,0-48H72a8,8,0,0,1,0-16h96a40,40,0,0,1,0,80H72a32,32,0,0,0,0,64H173.17A28,28,0,0,1,228,200Z`}))],[`light`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M200,170a30.05,30.05,0,0,0-29.4,24H72a34,34,0,0,1,0-68h96a38,38,0,0,0,0-76H72a6,6,0,0,0,0,12h96a26,26,0,0,1,0,52H72a46,46,0,0,0,0,92h98.6A30,30,0,1,0,200,170Zm0,48a18,18,0,1,1,18-18A18,18,0,0,1,200,218Z`}))],[`regular`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z`}))],[`thin`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M200,172a28,28,0,0,0-27.71,24H72a36,36,0,0,1,0-72h96a36,36,0,0,0,0-72H72a4,4,0,0,0,0,8h96a28,28,0,0,1,0,56H72a44,44,0,0,0,0,88H172.29A28,28,0,1,0,200,172Zm0,48a20,20,0,1,1,20-20A20,20,0,0,1,200,220Z`}))]]),y=h.forwardRef((e,t)=>h.createElement(l,{ref:t,...e,weights:g}));y.displayName=`ChartBarIcon`;var b=y,x=h.forwardRef((e,t)=>h.createElement(l,{ref:t,...e,weights:_}));x.displayName=`CopyIcon`;var S=x,C=h.forwardRef((e,t)=>h.createElement(l,{ref:t,...e,weights:v}));C.displayName=`PathIcon`;var w=C,T=t();function E(e){return e.durationMs===void 0?null:(0,T.jsx)(`span`,{"aria-live":`off`,className:r(`inline-flex items-center gap-1.5 text-xs font-medium tabular-nums text-muted-foreground`,e.className),children:D(e.durationMs)})}function D(e){let t=Math.floor((Number.isFinite(e)?Math.max(0,e):0)/1e3),n=Math.floor(t/60),r=t%60;return`Finished - ${n===0?`${r}s`:`${n}m ${r}s`}`}var O=(0,h.memo)(function(e){let t=e.displayText??(`text`in e.entry?e.entry.text:``);if(e.entry.kind===`reasoning`)return(0,T.jsxs)(`article`,{className:`max-w-205 justify-self-start text-muted-foreground`,"data-entry-id":String(e.entry.entryId),children:[(0,T.jsx)(`div`,{className:`mb-1 text-xs font-semibold uppercase text-muted-foreground`,children:`Reasoning`}),(0,T.jsx)(m,{live:e.live,size:`base`,text:t})]});if(e.entry.kind===`tool`)return(0,T.jsx)(B,{entry:e.entry,decidingApprovals:e.decidingApprovals,answeringQuestions:e.answeringQuestions,onApprovalDecision:e.onApprovalDecision,onQuestionAnswer:e.onQuestionAnswer});let n=e.entry.role===`assistant`?e.entry.traceId:void 0,i=e.entry.role===`assistant`&&z(t),a=e.entry.role===`assistant`&&`tone`in e.entry&&e.entry.tone===`error`,o=e.entry.role===`assistant`&&`tone`in e.entry&&e.entry.tone===`pending`,s=e.entry.role===`assistant`&&!o&&e.entry.text.trim().length>0,c=e.entry.durationMs??e.metrics?.durationMs,l=s||c!==void 0;return e.entry.role===`user`?(0,T.jsxs)(`article`,{className:`grid w-fit max-w-[min(64ch,82%)] justify-items-end justify-self-end self-start text-foreground`,"data-entry-id":String(e.entry.entryId),children:[e.entry.text.trim().length===0?null:(0,T.jsx)(`div`,{className:`rounded-2xl bg-muted px-4 py-2.5`,children:(0,T.jsx)(m,{size:`base`,text:e.entry.text})}),e.entry.attachments===void 0?null:(0,T.jsx)(R,{attachments:e.entry.attachments})]}):(0,T.jsxs)(`article`,{className:r(`self-start`,i?`w-full max-w-full`:`max-w-[min(82ch,100%)]`,e.entry.role===`assistant`&&r(`justify-self-start text-foreground`,a&&`text-destructive`)),"data-entry-id":String(e.entry.entryId),children:[o?(0,T.jsx)(L,{}):null,t.trim().length===0?null:(0,T.jsx)(m,{live:e.live,size:`base`,text:t}),l?(0,T.jsx)(k,{metrics:e.metrics,showActions:s,text:e.entry.text,traceId:n,durationMs:c,onOpenTrace:e.onOpenTrace}):null]})});function k(e){let[t,n]=(0,h.useState)(!1),r=e.traceId;async function o(){if(!(typeof navigator>`u`||navigator.clipboard===void 0))try{await navigator.clipboard.writeText(e.text),n(!0),window.setTimeout(()=>n(!1),1200)}catch{n(!1)}}return(0,T.jsxs)(`div`,{className:`mt-3 flex min-w-0 items-center gap-1.5`,children:[e.showActions?(0,T.jsx)(a,{"aria-label":t?`Response copied`:`Copy response`,className:`h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground`,title:t?`Copied`:`Copy response`,type:`button`,variant:`ghost`,onClick:()=>void o(),children:(0,T.jsx)(c,{icon:t?i:S,"aria-hidden":`true`})}):null,e.showActions?(0,T.jsxs)(`div`,{className:`group relative`,children:[(0,T.jsx)(a,{"aria-label":`Response metrics`,className:`h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground`,title:P(e.metrics),type:`button`,variant:`ghost`,children:(0,T.jsx)(c,{icon:b,"aria-hidden":`true`})}),(0,T.jsx)(`div`,{className:`pointer-events-none absolute left-0 top-full z-30 mt-2 hidden w-64 rounded-lg border border-border/90 bg-popover p-3 text-popover-foreground shadow-xl shadow-black/25 group-focus-within:grid group-hover:grid`,role:`tooltip`,children:(0,T.jsx)(A,{metrics:e.metrics})})]}):null,!e.showActions||r===void 0?null:(0,T.jsx)(a,{"aria-label":`Open trace ${r}`,className:`h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground`,title:`Open trace ${r}`,type:`button`,variant:`ghost`,onClick:()=>e.onOpenTrace(r),children:(0,T.jsx)(c,{icon:w,"aria-hidden":`true`})}),(0,T.jsx)(E,{className:e.showActions?`ml-1.5`:void 0,durationMs:e.durationMs})]})}function A(e){let t=M(e.metrics);return(0,T.jsxs)(`div`,{className:`grid min-w-0 gap-2 text-xs leading-5`,children:[(0,T.jsx)(`div`,{className:`font-semibold text-foreground`,children:`Response metrics`}),(0,T.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,T.jsx)(j,{label:`Cost`,value:`Unavailable`}),t.length===0?(0,T.jsx)(`div`,{className:`text-muted-foreground`,children:`No usage metrics yet`}):t.map(e=>(0,T.jsx)(j,{label:e.label,value:e.value},e.label))]})]})}function j(e){return(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,T.jsx)(`span`,{className:`shrink-0 font-medium tabular-nums text-foreground`,children:e.value})]})}function M(e){let t=[],n=e?.usage;return n?.totalTokens!==void 0&&t.push({label:`Total`,value:`${F(n.totalTokens)} tokens`}),n?.inputTokens!==void 0&&t.push({label:`Input`,value:F(n.inputTokens)}),n?.outputTokens!==void 0&&t.push({label:`Output`,value:F(n.outputTokens)}),N(t,`Cached`,n,`cachedInputTokens`),N(t,`Cache create`,n,`cacheCreationInputTokens`),e?.durationMs!==void 0&&t.push({label:`Duration`,value:I(e.durationMs)}),t}function N(e,t,n,r){let i=n?.[r];i!==void 0&&i>0&&e.push({label:t,value:F(i)})}function P(e){let t=M(e);return t.length===0?`Cost unavailable. No usage metrics yet.`:[`Cost unavailable`,...t.map(e=>`${e.label}: ${e.value}`)].join(`. `)}function F(e){return e.toLocaleString()}function I(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function L(){return(0,T.jsxs)(`div`,{"aria-label":`Assistant is thinking`,"aria-live":`polite`,className:`inline-flex min-h-8 items-center gap-2 py-1 text-muted-foreground`,role:`status`,children:[(0,T.jsx)(`span`,{className:`text-base font-medium`,children:`Thinking`}),(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,"aria-hidden":`true`,children:[(0,T.jsx)(`span`,{className:`size-1 animate-pulse rounded-full bg-current motion-reduce:animate-none`}),(0,T.jsx)(`span`,{className:`size-1 animate-pulse rounded-full bg-current [animation-delay:150ms] motion-reduce:animate-none`}),(0,T.jsx)(`span`,{className:`size-1 animate-pulse rounded-full bg-current [animation-delay:300ms] motion-reduce:animate-none`})]})]})}function R(e){return(0,T.jsx)(`div`,{className:`mt-2 flex max-w-full flex-wrap gap-2`,children:e.attachments.map((e,t)=>{let n=`${e.kind}-${e.name??e.mediaType??t}-${t}`;if(e.kind===`image`){let t=e.url??(e.data===void 0?void 0:`data:${e.mediaType??`image/png`};base64,${e.data}`);return(0,T.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-border/80 bg-card/80`,children:t===void 0?(0,T.jsx)(`div`,{className:`grid h-20 w-24 place-items-center px-2 text-center text-xs text-muted-foreground`,children:`Image`}):(0,T.jsx)(`img`,{alt:e.name??`Attached image`,className:`h-20 w-24 object-cover`,src:t})},n)}return(0,T.jsx)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border/80 bg-card/80 px-2 py-1 text-xs font-medium text-muted-foreground`,children:(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name??e.mediaType??`Document`})},n)})})}function z(e){let t=e.split(`
2
+ `);return t.some((e,n)=>{let r=t[n+1];return e.includes(`|`)&&r!==void 0&&/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(r)})}function B(e){let[t,n]=(0,h.useState)(e.entry.approval?.status!==`pending`&&e.entry.question?.status!==`pending`),i=e.entry.approval,l=e.entry.question,u=e.entry.childEvents??[],d=e.entry.args!==void 0||e.entry.result!==void 0||u.length>0||i!==void 0||l!==void 0,f=i?.status===`pending`,m=l?.status===`pending`,g=i?.status===`cancelled`||l?.status===`cancelled`,_=i?.status===`rejected`,v=i?.status===`timed_out`,y=i!==void 0&&e.decidingApprovals.has(i.id),b=l!==void 0&&e.answeringQuestions.has(l.id),x=f?`Approval required`:m?`Input required`:g?`Cancelled`:_?`Rejected`:v?`Timed out`:e.entry.result===void 0?`Running`:void 0;return(0,T.jsxs)(`article`,{className:`w-full justify-self-start text-foreground`,"data-entry-id":String(e.entry.entryId),children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 py-1.5`,children:[(0,T.jsxs)(a,{"aria-expanded":d?!t:void 0,"aria-label":`${t?`Expand`:`Collapse`} ${e.entry.toolName} tool call`,className:`h-auto min-h-8 min-w-0 flex-1 justify-start gap-2 border-0 bg-transparent p-0 text-left text-inherit shadow-none hover:bg-transparent hover:text-inherit`,type:`button`,variant:`ghost`,onClick:()=>n(e=>!e),children:[(0,T.jsx)(`span`,{className:`grid size-6 shrink-0 place-items-center text-muted-foreground`,children:(0,T.jsx)(c,{icon:s,className:`size-4`,"aria-hidden":`true`})}),(0,T.jsx)(`strong`,{className:`min-w-0 truncate font-mono text-base font-medium text-foreground`,children:e.entry.toolName}),x===void 0?null:(0,T.jsxs)(`span`,{className:`ml-auto inline-flex shrink-0 items-center gap-1.5 text-sm font-normal text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:r(`size-1.5 rounded-full bg-muted-foreground/60`,x===`Running`&&`animate-pulse bg-foreground motion-reduce:animate-none`,(g||_||v)&&`bg-destructive`),"aria-hidden":`true`}),x]}),d?(0,T.jsx)(`span`,{className:`grid size-6 shrink-0 place-items-center text-muted-foreground`,children:(0,T.jsx)(c,{icon:o,className:r(`size-4 transition-transform`,t&&`-rotate-90`),"aria-hidden":`true`})}):null]}),f&&i!==void 0?(0,T.jsx)(K,{disabled:y,onDecision:t=>e.onApprovalDecision(i.id,t)}):null]}),t||!d?null:(0,T.jsxs)(`div`,{className:`ml-8 grid gap-3 py-2`,children:[i===void 0?null:(0,T.jsx)(G,{approval:i}),l===void 0?null:(0,T.jsx)(H,{disabled:b,question:l,onAnswer:t=>e.onQuestionAnswer(l.id,t)}),l!==void 0||e.entry.args===void 0?null:(0,T.jsx)(p,{title:`Input`,value:e.entry.args}),u.length===0?null:(0,T.jsx)(V,{events:u}),l!==void 0||e.entry.result===void 0?null:(0,T.jsx)(p,{title:`Output`,value:e.entry.result})]})]})}function V(e){return(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/80 bg-background/65`,children:[(0,T.jsx)(`div`,{className:`bg-muted/20 px-3 py-2 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:`Subagent activity`}),(0,T.jsx)(`div`,{className:`grid gap-3 p-3`,children:e.events.map(e=>{let t=e.agentName??e.agentId;return e.kind===`message`||e.kind===`reasoning`?(0,T.jsxs)(`div`,{className:`grid gap-1 rounded-xl border border-border/80 bg-card/90 p-3`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(f,{className:`border-border bg-muted px-1.5 py-0.5 text-xs uppercase text-muted-foreground`,children:e.kind===`reasoning`?`Reasoning`:`Response`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate text-xs font-semibold text-muted-foreground`,children:t})]}),(0,T.jsx)(m,{size:`base`,text:e.text})]},`${e.kind}-${e.agentId}-${e.text}`):(0,T.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/80 bg-card/90 p-3`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(f,{className:`border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-foreground`,children:`Tool`}),(0,T.jsxs)(`span`,{className:`min-w-0 truncate text-xs font-semibold text-muted-foreground`,children:[t,` / `,e.toolName]})]}),e.args===void 0?null:(0,T.jsx)(p,{title:`Input`,value:e.args}),e.result===void 0?null:(0,T.jsx)(p,{title:`Output`,value:e.result})]},`${e.kind}-${e.agentId}-${e.toolName}-${e.callId??e.args??e.result??``}`)})})]})}function H(e){let[t,n]=(0,h.useState)({}),[r,i]=(0,h.useState)(0),o=e.question.status===`pending`,s=e.question.questions.length,c=e.question.questions.map(e=>{let n=t[e.id],r=n?.customValue?.trim()??``,i=r.length>0?r:n?.answer,a={questionId:e.id,answer:i?.trim()??``};return n?.choice!==void 0&&(a.choice=n.choice),r.length>0&&(a.custom=!0),a}),l=s===0?0:Math.min(r,s-1),u=e.question.questions[l],d=c[l]?.answer??``,f=c.filter(e=>e.answer.length>0).length,p=d.length>0,m=o&&c.every(e=>e.answer.length>0),g=l===0,_=l>=s-1;if(u===void 0)return(0,T.jsx)(`div`,{className:`rounded-xl border border-border bg-background p-4 text-sm font-medium text-muted-foreground`,children:`No questions`});let v=()=>i(e=>Math.max(0,e-1)),y=()=>i(t=>Math.min(e.question.questions.length-1,t+1)),b=(e,t)=>n(n=>({...n,[e]:t}));return(0,T.jsxs)(`div`,{className:`grid gap-3`,children:[e.question.status===`cancelled`?(0,T.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-muted/25 px-3 py-2.5 text-sm font-medium text-muted-foreground`,children:`Question cancelled`}):null,(0,T.jsx)(U,{disabled:e.disabled||!o,index:l,total:s,question:u,value:t[u.id],answer:e.question.answers?.find(e=>e.questionId===u.id),onChange:e=>b(u.id,e),onAdvance:_?void 0:y},u.id),o?(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-xl bg-muted/20 px-3 py-2`,children:[(0,T.jsxs)(`div`,{className:`min-w-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:[f,`/`,s,` answered`]}),(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[g?null:(0,T.jsx)(a,{type:`button`,variant:`secondary`,onClick:v,children:`Back`}),_?(0,T.jsx)(a,{className:`h-9 min-h-9 px-4`,disabled:e.disabled||!m,type:`button`,onClick:()=>e.onAnswer(c),children:`Submit answers`}):(0,T.jsx)(a,{className:`h-9 min-h-9 px-4`,disabled:e.disabled||!p,type:`button`,onClick:y,children:`Next question`})]})]}):s>1?(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-xl bg-muted/20 px-3 py-2`,children:[(0,T.jsx)(`div`,{className:`min-w-0 text-xs font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Answered`}),(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,T.jsx)(a,{disabled:g,type:`button`,variant:`secondary`,onClick:v,children:`Back`}),(0,T.jsx)(a,{disabled:_,type:`button`,variant:`secondary`,onClick:y,children:`Next`})]})]}):null]})}function U(e){let t=e.answer?.answer,n=W(e.value),i=t===void 0?n.length>0?`Ready`:`Waiting`:`Answered`;return(0,T.jsxs)(`section`,{className:`grid gap-4 rounded-xl border border-border/80 bg-background/70 p-4`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,T.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,T.jsxs)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:[`Question `,e.index+1,` of `,e.total]}),(0,T.jsx)(`h3`,{className:`m-0 text-base font-semibold leading-7 text-foreground [overflow-wrap:anywhere]`,children:e.question.question})]}),(0,T.jsx)(`span`,{className:r(`shrink-0 text-xs font-semibold uppercase tracking-[0.18em]`,i===`Answered`&&`text-foreground`,i===`Ready`&&`text-foreground`,i===`Waiting`&&`text-muted-foreground`),children:i})]}),t===void 0?null:(0,T.jsx)(`div`,{className:`rounded-lg border border-border/70 bg-muted/45 px-3 py-2 text-sm font-medium text-foreground`,children:t}),t===void 0&&e.question.choices.length>0?(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.question.choices.map(t=>{let n=e.value?.choice===t.value;return(0,T.jsx)(a,{className:r(`h-8 min-h-8 px-3 text-xs`,n&&`border-foreground/45`),disabled:e.disabled,size:`sm`,type:`button`,variant:n?`default`:`secondary`,onClick:()=>{e.onChange({answer:t.value,choice:t.value,customValue:e.value?.customValue??``}),e.onAdvance?.()},children:t.label},t.value)})}):null,t===void 0?(0,T.jsx)(d,{className:`min-h-24 text-sm`,disabled:e.disabled,placeholder:`Type a custom answer`,rows:3,value:e.value?.customValue??``,onChange:t=>e.onChange({...e.value,customValue:t.currentTarget.value})}):null]})}function W(e){let t=e?.customValue?.trim()??``;return t.length>0?t:e?.answer?.trim()??``}function G(e){return(0,T.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/70 bg-muted/25 px-3 py-2.5`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(f,{className:r(`border-border/70 bg-background/60 px-1.5 py-0.5 text-xs uppercase text-muted-foreground`,e.approval.status===`approved`&&`text-foreground`,e.approval.status===`rejected`&&`text-destructive`),children:`Approval`}),(0,T.jsx)(`div`,{className:`min-w-0`,children:(0,T.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:u(e.approval)})})]}),e.approval.reason===void 0?null:(0,T.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground [overflow-wrap:anywhere]`,children:e.approval.reason})]})}function K(e){return(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,T.jsx)(a,{className:`h-8 min-h-8 border-0 bg-transparent px-3 text-sm text-muted-foreground shadow-none hover:bg-destructive/10 hover:text-destructive`,disabled:e.disabled,size:`sm`,type:`button`,variant:`ghost`,onClick:()=>e.onDecision(!1),children:`Reject`}),(0,T.jsx)(a,{className:`h-8 min-h-8 px-3 text-sm`,disabled:e.disabled,size:`sm`,type:`button`,onClick:()=>e.onDecision(!0),children:`Approve`})]})}export{O as TranscriptItem};
3
+ //# sourceMappingURL=transcript-item-HFuuqmKM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transcript-item-ZNkQEaCw.js","names":["e","e","e","e","m","n","a","m","r","m"],"sources":["../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/defs/ChartBar.es.js","../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/defs/Copy.es.js","../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/defs/Path.es.js","../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/csr/ChartBar.es.js","../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/csr/Copy.es.js","../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/csr/Path.es.js","../../../src/ui/app/modules/playground/working-duration.tsx","../../../src/ui/app/modules/playground/transcript-item.tsx"],"sourcesContent":["import * as a from \"react\";\nconst e = /* @__PURE__ */ new Map([\n [\n \"bold\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,196h-4V40a12,12,0,0,0-12-12H152a12,12,0,0,0-12,12V76H96A12,12,0,0,0,84,88v36H48a12,12,0,0,0-12,12v60H32a12,12,0,0,0,0,24H224a12,12,0,0,0,0-24ZM164,52h32V196H164Zm-56,48h32v96H108ZM60,148H84v48H60Z\" }))\n ],\n [\n \"duotone\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M208,40V208H152V40Z\", opacity: \"0.2\" }), /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z\" }))\n ],\n [\n \"fill\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M232,208a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16h8V136a8,8,0,0,1,8-8H72a8,8,0,0,1,8,8v64H96V88a8,8,0,0,1,8-8h32a8,8,0,0,1,8,8V200h16V40a8,8,0,0,1,8-8h40a8,8,0,0,1,8,8V200h8A8,8,0,0,1,232,208Z\" }))\n ],\n [\n \"light\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,202H214V40a6,6,0,0,0-6-6H152a6,6,0,0,0-6,6V82H96a6,6,0,0,0-6,6v42H48a6,6,0,0,0-6,6v66H32a6,6,0,0,0,0,12H224a6,6,0,0,0,0-12ZM158,46h44V202H158ZM102,94h44V202H102ZM54,142H90v60H54Z\" }))\n ],\n [\n \"regular\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z\" }))\n ],\n [\n \"thin\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,204H212V40a4,4,0,0,0-4-4H152a4,4,0,0,0-4,4V84H96a4,4,0,0,0-4,4v44H48a4,4,0,0,0-4,4v68H32a4,4,0,0,0,0,8H224a4,4,0,0,0,0-8ZM156,44h48V204H156ZM100,92h48V204H100ZM52,140H92v64H52Z\" }))\n ]\n]);\nexport {\n e as default\n};\n","import * as a from \"react\";\nconst e = /* @__PURE__ */ new Map([\n [\n \"bold\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z\" }))\n ],\n [\n \"duotone\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,40V168H168V88H88V40Z\", opacity: \"0.2\" }), /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z\" }))\n ],\n [\n \"fill\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z\" }))\n ],\n [\n \"light\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z\" }))\n ],\n [\n \"regular\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z\" }))\n ],\n [\n \"thin\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z\" }))\n ]\n]);\nexport {\n e as default\n};\n","import * as a from \"react\";\nconst e = /* @__PURE__ */ new Map([\n [\n \"bold\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M200,164a36.07,36.07,0,0,0-33.94,24H72a28,28,0,0,1,0-56h96a44,44,0,0,0,0-88H72a12,12,0,0,0,0,24h96a20,20,0,0,1,0,40H72a52,52,0,0,0,0,104h94.06A36,36,0,1,0,200,164Zm0,48a12,12,0,1,1,12-12A12,12,0,0,1,200,212Z\" }))\n ],\n [\n \"duotone\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,200a24,24,0,1,1-24-24A24,24,0,0,1,224,200Z\", opacity: \"0.2\" }), /* @__PURE__ */ a.createElement(\"path\", { d: \"M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z\" }))\n ],\n [\n \"fill\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M228,200a28,28,0,0,1-54.83,8H72a48,48,0,0,1,0-96h96a24,24,0,0,0,0-48H72a8,8,0,0,1,0-16h96a40,40,0,0,1,0,80H72a32,32,0,0,0,0,64H173.17A28,28,0,0,1,228,200Z\" }))\n ],\n [\n \"light\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M200,170a30.05,30.05,0,0,0-29.4,24H72a34,34,0,0,1,0-68h96a38,38,0,0,0,0-76H72a6,6,0,0,0,0,12h96a26,26,0,0,1,0,52H72a46,46,0,0,0,0,92h98.6A30,30,0,1,0,200,170Zm0,48a18,18,0,1,1,18-18A18,18,0,0,1,200,218Z\" }))\n ],\n [\n \"regular\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z\" }))\n ],\n [\n \"thin\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M200,172a28,28,0,0,0-27.71,24H72a36,36,0,0,1,0-72h96a36,36,0,0,0,0-72H72a4,4,0,0,0,0,8h96a28,28,0,0,1,0,56H72a44,44,0,0,0,0,88H172.29A28,28,0,1,0,200,172Zm0,48a20,20,0,1,1,20-20A20,20,0,0,1,200,220Z\" }))\n ]\n]);\nexport {\n e as default\n};\n","import * as r from \"react\";\nimport e from \"../lib/IconBase.es.js\";\nimport m from \"../defs/ChartBar.es.js\";\nconst a = r.forwardRef((o, t) => /* @__PURE__ */ r.createElement(e, { ref: t, ...o, weights: m }));\na.displayName = \"ChartBarIcon\";\nconst n = a;\nexport {\n n as ChartBar,\n a as ChartBarIcon\n};\n","import * as o from \"react\";\nimport a from \"../lib/IconBase.es.js\";\nimport m from \"../defs/Copy.es.js\";\nconst e = o.forwardRef((r, t) => /* @__PURE__ */ o.createElement(a, { ref: t, ...r, weights: m }));\ne.displayName = \"CopyIcon\";\nconst s = e;\nexport {\n s as Copy,\n e as CopyIcon\n};\n","import * as o from \"react\";\nimport r from \"../lib/IconBase.es.js\";\nimport m from \"../defs/Path.es.js\";\nconst t = o.forwardRef((a, e) => /* @__PURE__ */ o.createElement(r, { ref: e, ...a, weights: m }));\nt.displayName = \"PathIcon\";\nconst n = t;\nexport {\n n as Path,\n t as PathIcon\n};\n","import { cn } from \"../../lib/utils\";\n\nexport function WorkingDuration(props: {\n className?: string | undefined;\n durationMs?: number | undefined;\n}) {\n if (props.durationMs === undefined) {\n return null;\n }\n\n return (\n <span\n aria-live=\"off\"\n className={cn(\n \"inline-flex items-center gap-1.5 text-xs font-medium tabular-nums text-muted-foreground\",\n props.className,\n )}\n >\n {formatWorkingDuration(props.durationMs)}\n </span>\n );\n}\n\nexport function formatWorkingDuration(durationMs: number): string {\n const normalizedDurationMs = Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0;\n const totalSeconds = Math.floor(normalizedDurationMs / 1_000);\n const minutes = Math.floor(totalSeconds / 60);\n const seconds = totalSeconds % 60;\n const duration = minutes === 0 ? `${seconds}s` : `${minutes}m ${seconds}s`;\n return `Finished - ${duration}`;\n}\n","import { CaretDown, ChartBar, Check, Copy, Path, Wrench } from \"@phosphor-icons/react\";\nimport { memo, useState } from \"react\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { StudioIcon } from \"../../components/ui/icon\";\nimport { Textarea } from \"../../components/ui/textarea\";\nimport { cn } from \"../../lib/utils\";\nimport { approvalLabel } from \"../shared/format\";\nimport { MarkdownText, ToolPayload } from \"../shared/renderers\";\nimport type { ToolApproval, ToolMessage, ToolQuestion, TranscriptEntry } from \"../shared/types\";\nimport type { AssistantResponseMetrics, ResponseUsageMetrics } from \"./response-metrics\";\nimport { WorkingDuration } from \"./working-duration\";\n\nexport const TranscriptItem = memo(function TranscriptItem(props: {\n entry: TranscriptEntry;\n displayText?: string | undefined;\n live?: boolean | undefined;\n metrics?: AssistantResponseMetrics | undefined;\n decidingApprovals: Set<string>;\n answeringQuestions: Set<string>;\n onApprovalDecision: (approvalId: string, approved: boolean) => void;\n onQuestionAnswer: (\n questionId: string,\n answers: Array<{ questionId: string; answer: string; choice?: string; custom?: boolean }>,\n ) => void;\n onOpenTrace: (traceId: string) => void;\n}) {\n const displayText = props.displayText ?? (\"text\" in props.entry ? props.entry.text : \"\");\n if (props.entry.kind === \"reasoning\") {\n return (\n <article\n className=\"max-w-205 justify-self-start text-muted-foreground\"\n data-entry-id={String(props.entry.entryId)}\n >\n <div className=\"mb-1 text-xs font-semibold uppercase text-muted-foreground\">Reasoning</div>\n <MarkdownText live={props.live} size=\"base\" text={displayText} />\n </article>\n );\n }\n\n if (props.entry.kind === \"tool\") {\n return (\n <ToolEntry\n entry={props.entry}\n decidingApprovals={props.decidingApprovals}\n answeringQuestions={props.answeringQuestions}\n onApprovalDecision={props.onApprovalDecision}\n onQuestionAnswer={props.onQuestionAnswer}\n />\n );\n }\n\n const traceId = props.entry.role === \"assistant\" ? props.entry.traceId : undefined;\n const hasTable = props.entry.role === \"assistant\" && hasMarkdownTable(displayText);\n const isError =\n props.entry.role === \"assistant\" && \"tone\" in props.entry && props.entry.tone === \"error\";\n const isPending =\n props.entry.role === \"assistant\" && \"tone\" in props.entry && props.entry.tone === \"pending\";\n const showAssistantActions =\n props.entry.role === \"assistant\" && !isPending && props.entry.text.trim().length > 0;\n const persistedDurationMs = props.entry.durationMs ?? props.metrics?.durationMs;\n const showAssistantFooter = showAssistantActions || persistedDurationMs !== undefined;\n\n if (props.entry.role === \"user\") {\n return (\n <article\n className=\"grid w-fit max-w-[min(64ch,82%)] justify-items-end justify-self-end self-start text-foreground\"\n data-entry-id={String(props.entry.entryId)}\n >\n {props.entry.text.trim().length === 0 ? null : (\n <div className=\"rounded-2xl bg-muted px-4 py-2.5\">\n <MarkdownText size=\"base\" text={props.entry.text} />\n </div>\n )}\n {props.entry.attachments !== undefined ? (\n <MessageAttachments attachments={props.entry.attachments} />\n ) : null}\n </article>\n );\n }\n\n return (\n <article\n className={cn(\n \"self-start\",\n hasTable ? \"w-full max-w-full\" : \"max-w-[min(82ch,100%)]\",\n props.entry.role === \"assistant\" &&\n cn(\"justify-self-start text-foreground\", isError && \"text-destructive\"),\n )}\n data-entry-id={String(props.entry.entryId)}\n >\n {isPending ? <AssistantLoadingIndicator /> : null}\n {displayText.trim().length === 0 ? null : (\n <MarkdownText live={props.live} size=\"base\" text={displayText} />\n )}\n {showAssistantFooter ? (\n <AssistantResponseFooter\n metrics={props.metrics}\n showActions={showAssistantActions}\n text={props.entry.text}\n traceId={traceId}\n durationMs={persistedDurationMs}\n onOpenTrace={props.onOpenTrace}\n />\n ) : null}\n </article>\n );\n});\n\nfunction AssistantResponseFooter(props: {\n durationMs?: number | undefined;\n metrics?: AssistantResponseMetrics | undefined;\n showActions: boolean;\n text: string;\n traceId?: string | undefined;\n onOpenTrace: (traceId: string) => void;\n}) {\n const [copied, setCopied] = useState(false);\n const traceId = props.traceId;\n\n async function copyResponse() {\n if (typeof navigator === \"undefined\" || navigator.clipboard === undefined) {\n return;\n }\n try {\n await navigator.clipboard.writeText(props.text);\n setCopied(true);\n window.setTimeout(() => setCopied(false), 1200);\n } catch {\n setCopied(false);\n }\n }\n\n return (\n <div className=\"mt-3 flex min-w-0 items-center gap-1.5\">\n {props.showActions ? (\n <Button\n aria-label={copied ? \"Response copied\" : \"Copy response\"}\n className=\"h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground\"\n title={copied ? \"Copied\" : \"Copy response\"}\n type=\"button\"\n variant=\"ghost\"\n onClick={() => void copyResponse()}\n >\n <StudioIcon icon={copied ? Check : Copy} aria-hidden=\"true\" />\n </Button>\n ) : null}\n {props.showActions ? (\n <div className=\"group relative\">\n <Button\n aria-label=\"Response metrics\"\n className=\"h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground\"\n title={metricsTitle(props.metrics)}\n type=\"button\"\n variant=\"ghost\"\n >\n <StudioIcon icon={ChartBar} aria-hidden=\"true\" />\n </Button>\n <div\n className=\"pointer-events-none absolute left-0 top-full z-30 mt-2 hidden w-64 rounded-lg border border-border/90 bg-popover p-3 text-popover-foreground shadow-xl shadow-black/25 group-focus-within:grid group-hover:grid\"\n role=\"tooltip\"\n >\n <ResponseMetricsTooltip metrics={props.metrics} />\n </div>\n </div>\n ) : null}\n {!props.showActions || traceId === undefined ? null : (\n <Button\n aria-label={`Open trace ${traceId}`}\n className=\"h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground\"\n title={`Open trace ${traceId}`}\n type=\"button\"\n variant=\"ghost\"\n onClick={() => props.onOpenTrace(traceId)}\n >\n <StudioIcon icon={Path} aria-hidden=\"true\" />\n </Button>\n )}\n <WorkingDuration\n className={props.showActions ? \"ml-1.5\" : undefined}\n durationMs={props.durationMs}\n />\n </div>\n );\n}\n\nfunction ResponseMetricsTooltip(props: { metrics?: AssistantResponseMetrics | undefined }) {\n const rows = responseMetricRows(props.metrics);\n return (\n <div className=\"grid min-w-0 gap-2 text-xs leading-5\">\n <div className=\"font-semibold text-foreground\">Response metrics</div>\n <div className=\"grid min-w-0 gap-1\">\n <MetricRow label=\"Cost\" value=\"Unavailable\" />\n {rows.length === 0 ? (\n <div className=\"text-muted-foreground\">No usage metrics yet</div>\n ) : (\n rows.map((row) => <MetricRow label={row.label} value={row.value} key={row.label} />)\n )}\n </div>\n </div>\n );\n}\n\nfunction MetricRow(props: { label: string; value: string }) {\n return (\n <div className=\"flex min-w-0 items-center justify-between gap-3\">\n <span className=\"text-muted-foreground\">{props.label}</span>\n <span className=\"shrink-0 font-medium tabular-nums text-foreground\">{props.value}</span>\n </div>\n );\n}\n\nfunction responseMetricRows(metrics: AssistantResponseMetrics | undefined): Array<{\n label: string;\n value: string;\n}> {\n const rows: Array<{ label: string; value: string }> = [];\n const usage = metrics?.usage;\n if (usage?.totalTokens !== undefined) {\n rows.push({ label: \"Total\", value: `${formatMetricNumber(usage.totalTokens)} tokens` });\n }\n if (usage?.inputTokens !== undefined) {\n rows.push({ label: \"Input\", value: formatMetricNumber(usage.inputTokens) });\n }\n if (usage?.outputTokens !== undefined) {\n rows.push({ label: \"Output\", value: formatMetricNumber(usage.outputTokens) });\n }\n pushOptionalUsageRow(rows, \"Cached\", usage, \"cachedInputTokens\");\n pushOptionalUsageRow(rows, \"Cache create\", usage, \"cacheCreationInputTokens\");\n if (metrics?.durationMs !== undefined) {\n rows.push({ label: \"Duration\", value: formatResponseDuration(metrics.durationMs) });\n }\n return rows;\n}\n\nfunction pushOptionalUsageRow(\n rows: Array<{ label: string; value: string }>,\n label: string,\n usage: ResponseUsageMetrics | undefined,\n key: keyof ResponseUsageMetrics,\n) {\n const value = usage?.[key];\n if (value !== undefined && value > 0) {\n rows.push({ label, value: formatMetricNumber(value) });\n }\n}\n\nfunction metricsTitle(metrics: AssistantResponseMetrics | undefined): string {\n const rows = responseMetricRows(metrics);\n if (rows.length === 0) {\n return \"Cost unavailable. No usage metrics yet.\";\n }\n return [\"Cost unavailable\", ...rows.map((row) => `${row.label}: ${row.value}`)].join(\". \");\n}\n\nfunction formatMetricNumber(value: number): string {\n return value.toLocaleString();\n}\n\nfunction formatResponseDuration(value: number): string {\n if (value < 1000) {\n return `${value}ms`;\n }\n return `${(value / 1000).toFixed(1)}s`;\n}\n\nfunction AssistantLoadingIndicator() {\n return (\n <div\n aria-label=\"Assistant is thinking\"\n aria-live=\"polite\"\n className=\"inline-flex min-h-8 items-center gap-2 py-1 text-muted-foreground\"\n role=\"status\"\n >\n <span className=\"text-base font-medium\">Thinking</span>\n <span className=\"flex items-center gap-1\" aria-hidden=\"true\">\n <span className=\"size-1 animate-pulse rounded-full bg-current motion-reduce:animate-none\" />\n <span className=\"size-1 animate-pulse rounded-full bg-current [animation-delay:150ms] motion-reduce:animate-none\" />\n <span className=\"size-1 animate-pulse rounded-full bg-current [animation-delay:300ms] motion-reduce:animate-none\" />\n </span>\n </div>\n );\n}\n\nfunction MessageAttachments(props: {\n attachments: NonNullable<Extract<TranscriptEntry, { kind: \"message\" }>[\"attachments\"]>;\n}) {\n return (\n <div className=\"mt-2 flex max-w-full flex-wrap gap-2\">\n {props.attachments.map((attachment, index) => {\n const key = `${attachment.kind}-${attachment.name ?? attachment.mediaType ?? index}-${index}`;\n if (attachment.kind === \"image\") {\n const src =\n attachment.url ??\n (attachment.data === undefined\n ? undefined\n : `data:${attachment.mediaType ?? \"image/png\"};base64,${attachment.data}`);\n return (\n <div\n className=\"overflow-hidden rounded-lg border border-border/80 bg-card/80\"\n key={key}\n >\n {src === undefined ? (\n <div className=\"grid h-20 w-24 place-items-center px-2 text-center text-xs text-muted-foreground\">\n Image\n </div>\n ) : (\n <img\n alt={attachment.name ?? \"Attached image\"}\n className=\"h-20 w-24 object-cover\"\n src={src}\n />\n )}\n </div>\n );\n }\n return (\n <span\n className=\"inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border/80 bg-card/80 px-2 py-1 text-xs font-medium text-muted-foreground\"\n key={key}\n >\n <span className=\"min-w-0 truncate\">\n {attachment.name ?? attachment.mediaType ?? \"Document\"}\n </span>\n </span>\n );\n })}\n </div>\n );\n}\n\nfunction hasMarkdownTable(text: string): boolean {\n const lines = text.split(\"\\n\");\n return lines.some((line, index) => {\n const next = lines[index + 1];\n return (\n line.includes(\"|\") &&\n next !== undefined &&\n /^\\s*\\|?\\s*:?-{3,}:?\\s*(\\|\\s*:?-{3,}:?\\s*)+\\|?\\s*$/.test(next)\n );\n });\n}\n\nfunction ToolEntry(props: {\n entry: ToolMessage;\n decidingApprovals: Set<string>;\n answeringQuestions: Set<string>;\n onApprovalDecision: (approvalId: string, approved: boolean) => void;\n onQuestionAnswer: (\n questionId: string,\n answers: Array<{ questionId: string; answer: string; choice?: string; custom?: boolean }>,\n ) => void;\n}) {\n const [collapsed, setCollapsed] = useState(\n props.entry.approval?.status !== \"pending\" && props.entry.question?.status !== \"pending\",\n );\n const approval = props.entry.approval;\n const question = props.entry.question;\n const childEvents = props.entry.childEvents ?? [];\n const hasPayload =\n props.entry.args !== undefined ||\n props.entry.result !== undefined ||\n childEvents.length > 0 ||\n approval !== undefined ||\n question !== undefined;\n const pendingApproval = approval?.status === \"pending\";\n const pendingQuestion = question?.status === \"pending\";\n const cancelledInteraction = approval?.status === \"cancelled\" || question?.status === \"cancelled\";\n const rejectedApproval = approval?.status === \"rejected\";\n const timedOutApproval = approval?.status === \"timed_out\";\n const deciding = approval !== undefined && props.decidingApprovals.has(approval.id);\n const answering = question !== undefined && props.answeringQuestions.has(question.id);\n const status = pendingApproval\n ? \"Approval required\"\n : pendingQuestion\n ? \"Input required\"\n : cancelledInteraction\n ? \"Cancelled\"\n : rejectedApproval\n ? \"Rejected\"\n : timedOutApproval\n ? \"Timed out\"\n : props.entry.result === undefined\n ? \"Running\"\n : undefined;\n\n return (\n <article\n className=\"w-full justify-self-start text-foreground\"\n data-entry-id={String(props.entry.entryId)}\n >\n <div className=\"flex min-w-0 items-center gap-2 py-1.5\">\n <Button\n aria-expanded={hasPayload ? !collapsed : undefined}\n aria-label={`${collapsed ? \"Expand\" : \"Collapse\"} ${props.entry.toolName} tool call`}\n className=\"h-auto min-h-8 min-w-0 flex-1 justify-start gap-2 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={() => setCollapsed((current) => !current)}\n >\n <span className=\"grid size-6 shrink-0 place-items-center text-muted-foreground\">\n <StudioIcon icon={Wrench} className=\"size-4\" aria-hidden=\"true\" />\n </span>\n <strong className=\"min-w-0 truncate font-mono text-base font-medium text-foreground\">\n {props.entry.toolName}\n </strong>\n {status === undefined ? null : (\n <span className=\"ml-auto inline-flex shrink-0 items-center gap-1.5 text-sm font-normal text-muted-foreground\">\n <span\n className={cn(\n \"size-1.5 rounded-full bg-muted-foreground/60\",\n status === \"Running\" && \"animate-pulse bg-foreground motion-reduce:animate-none\",\n (cancelledInteraction || rejectedApproval || timedOutApproval) &&\n \"bg-destructive\",\n )}\n aria-hidden=\"true\"\n />\n {status}\n </span>\n )}\n {hasPayload ? (\n <span className=\"grid size-6 shrink-0 place-items-center text-muted-foreground\">\n <StudioIcon\n icon={CaretDown}\n className={cn(\"size-4 transition-transform\", collapsed && \"-rotate-90\")}\n aria-hidden=\"true\"\n />\n </span>\n ) : null}\n </Button>\n {pendingApproval && approval !== undefined ? (\n <ToolApprovalActions\n disabled={deciding}\n onDecision={(approved) => props.onApprovalDecision(approval.id, approved)}\n />\n ) : null}\n </div>\n {collapsed || !hasPayload ? null : (\n <div className=\"ml-8 grid gap-3 py-2\">\n {approval === undefined ? null : <ToolApprovalPanel approval={approval} />}\n {question === undefined ? null : (\n <ToolQuestionPanel\n disabled={answering}\n question={question}\n onAnswer={(answers) => props.onQuestionAnswer(question.id, answers)}\n />\n )}\n {question !== undefined || props.entry.args === undefined ? null : (\n <ToolPayload title=\"Input\" value={props.entry.args} />\n )}\n {childEvents.length === 0 ? null : <ChildAgentActivity events={childEvents} />}\n {question !== undefined || props.entry.result === undefined ? null : (\n <ToolPayload title=\"Output\" value={props.entry.result} />\n )}\n </div>\n )}\n </article>\n );\n}\n\nfunction ChildAgentActivity(props: { events: NonNullable<ToolMessage[\"childEvents\"]> }) {\n return (\n <div className=\"overflow-hidden rounded-xl border border-border/80 bg-background/65\">\n <div className=\"bg-muted/20 px-3 py-2 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground\">\n Subagent activity\n </div>\n <div className=\"grid gap-3 p-3\">\n {props.events.map((event) => {\n const agentLabel = event.agentName ?? event.agentId;\n if (event.kind === \"message\" || event.kind === \"reasoning\") {\n return (\n <div\n className=\"grid gap-1 rounded-xl border border-border/80 bg-card/90 p-3\"\n key={`${event.kind}-${event.agentId}-${event.text}`}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n <Badge className=\"border-border bg-muted px-1.5 py-0.5 text-xs uppercase text-muted-foreground\">\n {event.kind === \"reasoning\" ? \"Reasoning\" : \"Response\"}\n </Badge>\n <span className=\"min-w-0 truncate text-xs font-semibold text-muted-foreground\">\n {agentLabel}\n </span>\n </div>\n <MarkdownText size=\"base\" text={event.text} />\n </div>\n );\n }\n return (\n <div\n className=\"grid gap-2 rounded-xl border border-border/80 bg-card/90 p-3\"\n key={`${event.kind}-${event.agentId}-${event.toolName}-${event.callId ?? event.args ?? event.result ?? \"\"}`}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n <Badge className=\"border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-foreground\">\n Tool\n </Badge>\n <span className=\"min-w-0 truncate text-xs font-semibold text-muted-foreground\">\n {agentLabel} / {event.toolName}\n </span>\n </div>\n {event.args === undefined ? null : <ToolPayload title=\"Input\" value={event.args} />}\n {event.result === undefined ? null : (\n <ToolPayload title=\"Output\" value={event.result} />\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction ToolQuestionPanel(props: {\n question: ToolQuestion;\n disabled: boolean;\n onAnswer: (\n answers: Array<{ questionId: string; answer: string; choice?: string; custom?: boolean }>,\n ) => void;\n}) {\n const [values, setValues] = useState<Record<string, QuestionDraft>>({});\n const [activeQuestionIndex, setActiveQuestionIndex] = useState(0);\n const pending = props.question.status === \"pending\";\n const total = props.question.questions.length;\n\n const answers = props.question.questions.map((question) => {\n const draft = values[question.id];\n const customAnswer = draft?.customValue?.trim() ?? \"\";\n const answer = customAnswer.length > 0 ? customAnswer : draft?.answer;\n const normalized: { questionId: string; answer: string; choice?: string; custom?: boolean } = {\n questionId: question.id,\n answer: answer?.trim() ?? \"\",\n };\n if (draft?.choice !== undefined) normalized.choice = draft.choice;\n if (customAnswer.length > 0) normalized.custom = true;\n return normalized;\n });\n const activeIndex = total === 0 ? 0 : Math.min(activeQuestionIndex, total - 1);\n const activeQuestion = props.question.questions[activeIndex];\n const activeAnswer = answers[activeIndex]?.answer ?? \"\";\n const answeredCount = answers.filter((answer) => answer.answer.length > 0).length;\n const canAdvance = activeAnswer.length > 0;\n const canSubmit = pending && answers.every((answer) => answer.answer.length > 0);\n const firstQuestion = activeIndex === 0;\n const lastQuestion = activeIndex >= total - 1;\n\n if (activeQuestion === undefined) {\n return (\n <div className=\"rounded-xl border border-border bg-background p-4 text-sm font-medium text-muted-foreground\">\n No questions\n </div>\n );\n }\n\n const goPrevious = () => setActiveQuestionIndex((current) => Math.max(0, current - 1));\n const goNext = () =>\n setActiveQuestionIndex((current) => Math.min(props.question.questions.length - 1, current + 1));\n const updateDraft = (questionId: string, value: QuestionDraft) =>\n setValues((current) => ({\n ...current,\n [questionId]: value,\n }));\n\n return (\n <div className=\"grid gap-3\">\n {props.question.status === \"cancelled\" ? (\n <div className=\"rounded-xl border border-border/70 bg-muted/25 px-3 py-2.5 text-sm font-medium text-muted-foreground\">\n Question cancelled\n </div>\n ) : null}\n <QuestionPromptControl\n key={activeQuestion.id}\n disabled={props.disabled || !pending}\n index={activeIndex}\n total={total}\n question={activeQuestion}\n value={values[activeQuestion.id]}\n answer={props.question.answers?.find((answer) => answer.questionId === activeQuestion.id)}\n onChange={(value) => updateDraft(activeQuestion.id, value)}\n onAdvance={lastQuestion ? undefined : goNext}\n />\n {pending ? (\n <div className=\"flex min-w-0 items-center justify-between gap-3 rounded-xl bg-muted/20 px-3 py-2\">\n <div className=\"min-w-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n {answeredCount}/{total} answered\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {firstQuestion ? null : (\n <Button type=\"button\" variant=\"secondary\" onClick={goPrevious}>\n Back\n </Button>\n )}\n {lastQuestion ? (\n <Button\n className=\"h-9 min-h-9 px-4\"\n disabled={props.disabled || !canSubmit}\n type=\"button\"\n onClick={() => props.onAnswer(answers)}\n >\n Submit answers\n </Button>\n ) : (\n <Button\n className=\"h-9 min-h-9 px-4\"\n disabled={props.disabled || !canAdvance}\n type=\"button\"\n onClick={goNext}\n >\n Next question\n </Button>\n )}\n </div>\n </div>\n ) : total > 1 ? (\n <div className=\"flex min-w-0 items-center justify-between gap-3 rounded-xl bg-muted/20 px-3 py-2\">\n <div className=\"min-w-0 text-xs font-semibold uppercase tracking-[0.2em] text-foreground\">\n Answered\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n <Button disabled={firstQuestion} type=\"button\" variant=\"secondary\" onClick={goPrevious}>\n Back\n </Button>\n <Button disabled={lastQuestion} type=\"button\" variant=\"secondary\" onClick={goNext}>\n Next\n </Button>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n\ntype QuestionDraft = {\n answer?: string;\n choice?: string;\n customValue?: string;\n};\n\nfunction QuestionPromptControl(props: {\n question: ToolQuestion[\"questions\"][number];\n value: QuestionDraft | undefined;\n answer: NonNullable<ToolQuestion[\"answers\"]>[number] | undefined;\n disabled: boolean;\n index: number;\n total: number;\n onChange: (value: QuestionDraft) => void;\n onAdvance: (() => void) | undefined;\n}) {\n const submittedAnswer = props.answer?.answer;\n const draftAnswer = questionDraftAnswer(props.value);\n const state =\n submittedAnswer !== undefined ? \"Answered\" : draftAnswer.length > 0 ? \"Ready\" : \"Waiting\";\n\n return (\n <section className=\"grid gap-4 rounded-xl border border-border/80 bg-background/70 p-4\">\n <div className=\"flex min-w-0 items-start justify-between gap-4\">\n <div className=\"grid min-w-0 gap-2\">\n <div className=\" text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n Question {props.index + 1} of {props.total}\n </div>\n <h3 className=\"m-0 text-base font-semibold leading-7 text-foreground [overflow-wrap:anywhere]\">\n {props.question.question}\n </h3>\n </div>\n <span\n className={cn(\n \"shrink-0 text-xs font-semibold uppercase tracking-[0.18em]\",\n state === \"Answered\" && \"text-foreground\",\n state === \"Ready\" && \"text-foreground\",\n state === \"Waiting\" && \"text-muted-foreground\",\n )}\n >\n {state}\n </span>\n </div>\n {submittedAnswer === undefined ? null : (\n <div className=\"rounded-lg border border-border/70 bg-muted/45 px-3 py-2 text-sm font-medium text-foreground\">\n {submittedAnswer}\n </div>\n )}\n {submittedAnswer !== undefined ? null : props.question.choices.length > 0 ? (\n <div className=\"flex flex-wrap gap-2\">\n {props.question.choices.map((choice) => {\n const active = props.value?.choice === choice.value;\n return (\n <Button\n key={choice.value}\n className={cn(\"h-8 min-h-8 px-3 text-xs\", active && \"border-foreground/45\")}\n disabled={props.disabled}\n size=\"sm\"\n type=\"button\"\n variant={active ? \"default\" : \"secondary\"}\n onClick={() => {\n props.onChange({\n answer: choice.value,\n choice: choice.value,\n customValue: props.value?.customValue ?? \"\",\n });\n props.onAdvance?.();\n }}\n >\n {choice.label}\n </Button>\n );\n })}\n </div>\n ) : null}\n {submittedAnswer !== undefined ? null : (\n <Textarea\n className=\"min-h-24 text-sm\"\n disabled={props.disabled}\n placeholder=\"Type a custom answer\"\n rows={3}\n value={props.value?.customValue ?? \"\"}\n onChange={(event) =>\n props.onChange({\n ...props.value,\n customValue: event.currentTarget.value,\n })\n }\n />\n )}\n </section>\n );\n}\n\nfunction questionDraftAnswer(value: QuestionDraft | undefined): string {\n const customAnswer = value?.customValue?.trim() ?? \"\";\n return customAnswer.length > 0 ? customAnswer : (value?.answer?.trim() ?? \"\");\n}\n\nfunction ToolApprovalPanel(props: { approval: ToolApproval }) {\n return (\n <div className=\"grid gap-2 rounded-xl border border-border/70 bg-muted/25 px-3 py-2.5\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <Badge\n className={cn(\n \"border-border/70 bg-background/60 px-1.5 py-0.5 text-xs uppercase text-muted-foreground\",\n props.approval.status === \"approved\" && \"text-foreground\",\n props.approval.status === \"rejected\" && \"text-destructive\",\n )}\n >\n Approval\n </Badge>\n <div className=\"min-w-0\">\n <div className=\"text-sm font-medium text-foreground\">{approvalLabel(props.approval)}</div>\n </div>\n </div>\n {props.approval.reason === undefined ? null : (\n <div className=\"text-xs font-medium text-muted-foreground [overflow-wrap:anywhere]\">\n {props.approval.reason}\n </div>\n )}\n </div>\n );\n}\n\nfunction ToolApprovalActions(props: {\n disabled: boolean;\n onDecision: (approved: boolean) => void;\n}) {\n return (\n <div className=\"flex shrink-0 items-center gap-1\">\n <Button\n className=\"h-8 min-h-8 border-0 bg-transparent px-3 text-sm text-muted-foreground shadow-none hover:bg-destructive/10 hover:text-destructive\"\n disabled={props.disabled}\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\"\n onClick={() => props.onDecision(false)}\n >\n Reject\n </Button>\n <Button\n className=\"h-8 min-h-8 px-3 text-sm\"\n disabled={props.disabled}\n size=\"sm\"\n type=\"button\"\n onClick={() => props.onDecision(true)}\n >\n Approve\n </Button>\n </div>\n );\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":"gQACMA,EAAoB,IAAI,IAAI,CAChC,CACE,OACgB,EAAE,cAAA,EAAgB,SAAU,KAAsB,EAAE,cAAc,OAAQ,CAAE,EAAG,4MAA6M,CAAC,CAAC,CAC/S,CACD,CACE,UACgB,EAAE,cAAA,EAAgB,SAAU,KAAsB,EAAE,cAAc,OAAQ,CAAE,EAAG,sBAAuB,QAAS,MAAO,CAAC,CAAkB,EAAE,cAAc,OAAQ,CAAE,EAAG,yLAA0L,CAAC,CAAC,CACnX,CACD,CACE,OACgB,EAAE,cAAA,EAAgB,SAAU,KAAsB,EAAE,cAAc,OAAQ,CAAE,EAAG,0LAA2L,CAAC,CAAC,CAC7R,CACD,CACE,QACgB,EAAE,cAAA,EAAgB,SAAU,KAAsB,EAAE,cAAc,OAAQ,CAAE,EAAG,0LAA2L,CAAC,CAAC,CAC7R,CACD,CACE,UACgB,EAAE,cAAA,EAAgB,SAAU,KAAsB,EAAE,cAAc,OAAQ,CAAE,EAAG,yLAA0L,CAAC,CAAC,CAC5R,CACD,CACE,OACgB,EAAE,cAAA,EAAgB,SAAU,KAAsB,EAAE,cAAc,OAAQ,CAAE,EAAG,wLAAyL,CAAC,CAAC,CAC3R,CACF,CAAC,CCzBIC,EAAoB,IAAI,IAAI,CAChC,CACE,OACgB,EAAE,cAAA,EAAgB,SAAU,KAAsB,EAAE,cAAc,OAAQ,CAAE,EAAG,kNAAmN,CAAC,CAAC,CACrT,CACD,CACE,UACgB,EAAE,cAAA,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AAW,GAAK,UACtC,UAEQ,CAAA,CACL"}
1
+ {"version":3,"file":"transcript-item-HFuuqmKM.js","names":["e","e","e","e","m","n","a","m","r","m"],"sources":["../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/defs/ChartBar.es.js","../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/defs/Copy.es.js","../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/defs/Path.es.js","../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/csr/ChartBar.es.js","../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/csr/Copy.es.js","../../../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@phosphor-icons/react/dist/csr/Path.es.js","../../../src/ui/app/modules/playground/working-duration.tsx","../../../src/ui/app/modules/playground/transcript-item.tsx"],"sourcesContent":["import * as a from \"react\";\nconst e = /* @__PURE__ */ new Map([\n [\n \"bold\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,196h-4V40a12,12,0,0,0-12-12H152a12,12,0,0,0-12,12V76H96A12,12,0,0,0,84,88v36H48a12,12,0,0,0-12,12v60H32a12,12,0,0,0,0,24H224a12,12,0,0,0,0-24ZM164,52h32V196H164Zm-56,48h32v96H108ZM60,148H84v48H60Z\" }))\n ],\n [\n \"duotone\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M208,40V208H152V40Z\", opacity: \"0.2\" }), /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z\" }))\n ],\n [\n \"fill\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M232,208a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16h8V136a8,8,0,0,1,8-8H72a8,8,0,0,1,8,8v64H96V88a8,8,0,0,1,8-8h32a8,8,0,0,1,8,8V200h16V40a8,8,0,0,1,8-8h40a8,8,0,0,1,8,8V200h8A8,8,0,0,1,232,208Z\" }))\n ],\n [\n \"light\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,202H214V40a6,6,0,0,0-6-6H152a6,6,0,0,0-6,6V82H96a6,6,0,0,0-6,6v42H48a6,6,0,0,0-6,6v66H32a6,6,0,0,0,0,12H224a6,6,0,0,0,0-12ZM158,46h44V202H158ZM102,94h44V202H102ZM54,142H90v60H54Z\" }))\n ],\n [\n \"regular\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z\" }))\n ],\n [\n \"thin\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,204H212V40a4,4,0,0,0-4-4H152a4,4,0,0,0-4,4V84H96a4,4,0,0,0-4,4v44H48a4,4,0,0,0-4,4v68H32a4,4,0,0,0,0,8H224a4,4,0,0,0,0-8ZM156,44h48V204H156ZM100,92h48V204H100ZM52,140H92v64H52Z\" }))\n ]\n]);\nexport {\n e as default\n};\n","import * as a from \"react\";\nconst e = /* @__PURE__ */ new Map([\n [\n \"bold\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z\" }))\n ],\n [\n \"duotone\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,40V168H168V88H88V40Z\", opacity: \"0.2\" }), /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z\" }))\n ],\n [\n \"fill\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z\" }))\n ],\n [\n \"light\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z\" }))\n ],\n [\n \"regular\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z\" }))\n ],\n [\n \"thin\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z\" }))\n ]\n]);\nexport {\n e as default\n};\n","import * as a from \"react\";\nconst e = /* @__PURE__ */ new Map([\n [\n \"bold\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M200,164a36.07,36.07,0,0,0-33.94,24H72a28,28,0,0,1,0-56h96a44,44,0,0,0,0-88H72a12,12,0,0,0,0,24h96a20,20,0,0,1,0,40H72a52,52,0,0,0,0,104h94.06A36,36,0,1,0,200,164Zm0,48a12,12,0,1,1,12-12A12,12,0,0,1,200,212Z\" }))\n ],\n [\n \"duotone\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M224,200a24,24,0,1,1-24-24A24,24,0,0,1,224,200Z\", opacity: \"0.2\" }), /* @__PURE__ */ a.createElement(\"path\", { d: \"M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z\" }))\n ],\n [\n \"fill\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M228,200a28,28,0,0,1-54.83,8H72a48,48,0,0,1,0-96h96a24,24,0,0,0,0-48H72a8,8,0,0,1,0-16h96a40,40,0,0,1,0,80H72a32,32,0,0,0,0,64H173.17A28,28,0,0,1,228,200Z\" }))\n ],\n [\n \"light\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M200,170a30.05,30.05,0,0,0-29.4,24H72a34,34,0,0,1,0-68h96a38,38,0,0,0,0-76H72a6,6,0,0,0,0,12h96a26,26,0,0,1,0,52H72a46,46,0,0,0,0,92h98.6A30,30,0,1,0,200,170Zm0,48a18,18,0,1,1,18-18A18,18,0,0,1,200,218Z\" }))\n ],\n [\n \"regular\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z\" }))\n ],\n [\n \"thin\",\n /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(\"path\", { d: \"M200,172a28,28,0,0,0-27.71,24H72a36,36,0,0,1,0-72h96a36,36,0,0,0,0-72H72a4,4,0,0,0,0,8h96a28,28,0,0,1,0,56H72a44,44,0,0,0,0,88H172.29A28,28,0,1,0,200,172Zm0,48a20,20,0,1,1,20-20A20,20,0,0,1,200,220Z\" }))\n ]\n]);\nexport {\n e as default\n};\n","import * as r from \"react\";\nimport e from \"../lib/IconBase.es.js\";\nimport m from \"../defs/ChartBar.es.js\";\nconst a = r.forwardRef((o, t) => /* @__PURE__ */ r.createElement(e, { ref: t, ...o, weights: m }));\na.displayName = \"ChartBarIcon\";\nconst n = a;\nexport {\n n as ChartBar,\n a as ChartBarIcon\n};\n","import * as o from \"react\";\nimport a from \"../lib/IconBase.es.js\";\nimport m from \"../defs/Copy.es.js\";\nconst e = o.forwardRef((r, t) => /* @__PURE__ */ o.createElement(a, { ref: t, ...r, weights: m }));\ne.displayName = \"CopyIcon\";\nconst s = e;\nexport {\n s as Copy,\n e as CopyIcon\n};\n","import * as o from \"react\";\nimport r from \"../lib/IconBase.es.js\";\nimport m from \"../defs/Path.es.js\";\nconst t = o.forwardRef((a, e) => /* @__PURE__ */ o.createElement(r, { ref: e, ...a, weights: m }));\nt.displayName = \"PathIcon\";\nconst n = t;\nexport {\n n as Path,\n t as PathIcon\n};\n","import { cn } from \"../../lib/utils\";\n\nexport function WorkingDuration(props: {\n className?: string | undefined;\n durationMs?: number | undefined;\n}) {\n if (props.durationMs === undefined) {\n return null;\n }\n\n return (\n <span\n aria-live=\"off\"\n className={cn(\n \"inline-flex items-center gap-1.5 text-xs font-medium tabular-nums text-muted-foreground\",\n props.className,\n )}\n >\n {formatWorkingDuration(props.durationMs)}\n </span>\n );\n}\n\nexport function formatWorkingDuration(durationMs: number): string {\n const normalizedDurationMs = Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0;\n const totalSeconds = Math.floor(normalizedDurationMs / 1_000);\n const minutes = Math.floor(totalSeconds / 60);\n const seconds = totalSeconds % 60;\n const duration = minutes === 0 ? `${seconds}s` : `${minutes}m ${seconds}s`;\n return `Finished - ${duration}`;\n}\n","import { CaretDown, ChartBar, Check, Copy, Path, Wrench } from \"@phosphor-icons/react\";\nimport { memo, useState } from \"react\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { StudioIcon } from \"../../components/ui/icon\";\nimport { Textarea } from \"../../components/ui/textarea\";\nimport { cn } from \"../../lib/utils\";\nimport { approvalLabel } from \"../shared/format\";\nimport { MarkdownText, ToolPayload } from \"../shared/renderers\";\nimport type { ToolApproval, ToolMessage, ToolQuestion, TranscriptEntry } from \"../shared/types\";\nimport type { AssistantResponseMetrics, ResponseUsageMetrics } from \"./response-metrics\";\nimport { WorkingDuration } from \"./working-duration\";\n\nexport const TranscriptItem = memo(function TranscriptItem(props: {\n entry: TranscriptEntry;\n displayText?: string | undefined;\n live?: boolean | undefined;\n metrics?: AssistantResponseMetrics | undefined;\n decidingApprovals: Set<string>;\n answeringQuestions: Set<string>;\n onApprovalDecision: (approvalId: string, approved: boolean) => void;\n onQuestionAnswer: (\n questionId: string,\n answers: Array<{ questionId: string; answer: string; choice?: string; custom?: boolean }>,\n ) => void;\n onOpenTrace: (traceId: string) => void;\n}) {\n const displayText = props.displayText ?? (\"text\" in props.entry ? props.entry.text : \"\");\n if (props.entry.kind === \"reasoning\") {\n return (\n <article\n className=\"max-w-205 justify-self-start text-muted-foreground\"\n data-entry-id={String(props.entry.entryId)}\n >\n <div className=\"mb-1 text-xs font-semibold uppercase text-muted-foreground\">Reasoning</div>\n <MarkdownText live={props.live} size=\"base\" text={displayText} />\n </article>\n );\n }\n\n if (props.entry.kind === \"tool\") {\n return (\n <ToolEntry\n entry={props.entry}\n decidingApprovals={props.decidingApprovals}\n answeringQuestions={props.answeringQuestions}\n onApprovalDecision={props.onApprovalDecision}\n onQuestionAnswer={props.onQuestionAnswer}\n />\n );\n }\n\n const traceId = props.entry.role === \"assistant\" ? props.entry.traceId : undefined;\n const hasTable = props.entry.role === \"assistant\" && hasMarkdownTable(displayText);\n const isError =\n props.entry.role === \"assistant\" && \"tone\" in props.entry && props.entry.tone === \"error\";\n const isPending =\n props.entry.role === \"assistant\" && \"tone\" in props.entry && props.entry.tone === \"pending\";\n const showAssistantActions =\n props.entry.role === \"assistant\" && !isPending && props.entry.text.trim().length > 0;\n const persistedDurationMs = props.entry.durationMs ?? props.metrics?.durationMs;\n const showAssistantFooter = showAssistantActions || persistedDurationMs !== undefined;\n\n if (props.entry.role === \"user\") {\n return (\n <article\n className=\"grid w-fit max-w-[min(64ch,82%)] justify-items-end justify-self-end self-start text-foreground\"\n data-entry-id={String(props.entry.entryId)}\n >\n {props.entry.text.trim().length === 0 ? null : (\n <div className=\"rounded-2xl bg-muted px-4 py-2.5\">\n <MarkdownText size=\"base\" text={props.entry.text} />\n </div>\n )}\n {props.entry.attachments !== undefined ? (\n <MessageAttachments attachments={props.entry.attachments} />\n ) : null}\n </article>\n );\n }\n\n return (\n <article\n className={cn(\n \"self-start\",\n hasTable ? \"w-full max-w-full\" : \"max-w-[min(82ch,100%)]\",\n props.entry.role === \"assistant\" &&\n cn(\"justify-self-start text-foreground\", isError && \"text-destructive\"),\n )}\n data-entry-id={String(props.entry.entryId)}\n >\n {isPending ? <AssistantLoadingIndicator /> : null}\n {displayText.trim().length === 0 ? null : (\n <MarkdownText live={props.live} size=\"base\" text={displayText} />\n )}\n {showAssistantFooter ? (\n <AssistantResponseFooter\n metrics={props.metrics}\n showActions={showAssistantActions}\n text={props.entry.text}\n traceId={traceId}\n durationMs={persistedDurationMs}\n onOpenTrace={props.onOpenTrace}\n />\n ) : null}\n </article>\n );\n});\n\nfunction AssistantResponseFooter(props: {\n durationMs?: number | undefined;\n metrics?: AssistantResponseMetrics | undefined;\n showActions: boolean;\n text: string;\n traceId?: string | undefined;\n onOpenTrace: (traceId: string) => void;\n}) {\n const [copied, setCopied] = useState(false);\n const traceId = props.traceId;\n\n async function copyResponse() {\n if (typeof navigator === \"undefined\" || navigator.clipboard === undefined) {\n return;\n }\n try {\n await navigator.clipboard.writeText(props.text);\n setCopied(true);\n window.setTimeout(() => setCopied(false), 1200);\n } catch {\n setCopied(false);\n }\n }\n\n return (\n <div className=\"mt-3 flex min-w-0 items-center gap-1.5\">\n {props.showActions ? (\n <Button\n aria-label={copied ? \"Response copied\" : \"Copy response\"}\n className=\"h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground\"\n title={copied ? \"Copied\" : \"Copy response\"}\n type=\"button\"\n variant=\"ghost\"\n onClick={() => void copyResponse()}\n >\n <StudioIcon icon={copied ? Check : Copy} aria-hidden=\"true\" />\n </Button>\n ) : null}\n {props.showActions ? (\n <div className=\"group relative\">\n <Button\n aria-label=\"Response metrics\"\n className=\"h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground\"\n title={metricsTitle(props.metrics)}\n type=\"button\"\n variant=\"ghost\"\n >\n <StudioIcon icon={ChartBar} aria-hidden=\"true\" />\n </Button>\n <div\n className=\"pointer-events-none absolute left-0 top-full z-30 mt-2 hidden w-64 rounded-lg border border-border/90 bg-popover p-3 text-popover-foreground shadow-xl shadow-black/25 group-focus-within:grid group-hover:grid\"\n role=\"tooltip\"\n >\n <ResponseMetricsTooltip metrics={props.metrics} />\n </div>\n </div>\n ) : null}\n {!props.showActions || traceId === undefined ? null : (\n <Button\n aria-label={`Open trace ${traceId}`}\n className=\"h-8 min-h-8 w-8 rounded-lg border border-border/70 bg-muted/30 p-0 text-muted-foreground shadow-none hover:border-border hover:bg-muted/55 hover:text-foreground\"\n title={`Open trace ${traceId}`}\n type=\"button\"\n variant=\"ghost\"\n onClick={() => props.onOpenTrace(traceId)}\n >\n <StudioIcon icon={Path} aria-hidden=\"true\" />\n </Button>\n )}\n <WorkingDuration\n className={props.showActions ? \"ml-1.5\" : undefined}\n durationMs={props.durationMs}\n />\n </div>\n );\n}\n\nfunction ResponseMetricsTooltip(props: { metrics?: AssistantResponseMetrics | undefined }) {\n const rows = responseMetricRows(props.metrics);\n return (\n <div className=\"grid min-w-0 gap-2 text-xs leading-5\">\n <div className=\"font-semibold text-foreground\">Response metrics</div>\n <div className=\"grid min-w-0 gap-1\">\n <MetricRow label=\"Cost\" value=\"Unavailable\" />\n {rows.length === 0 ? (\n <div className=\"text-muted-foreground\">No usage metrics yet</div>\n ) : (\n rows.map((row) => <MetricRow label={row.label} value={row.value} key={row.label} />)\n )}\n </div>\n </div>\n );\n}\n\nfunction MetricRow(props: { label: string; value: string }) {\n return (\n <div className=\"flex min-w-0 items-center justify-between gap-3\">\n <span className=\"text-muted-foreground\">{props.label}</span>\n <span className=\"shrink-0 font-medium tabular-nums text-foreground\">{props.value}</span>\n </div>\n );\n}\n\nfunction responseMetricRows(metrics: AssistantResponseMetrics | undefined): Array<{\n label: string;\n value: string;\n}> {\n const rows: Array<{ label: string; value: string }> = [];\n const usage = metrics?.usage;\n if (usage?.totalTokens !== undefined) {\n rows.push({ label: \"Total\", value: `${formatMetricNumber(usage.totalTokens)} tokens` });\n }\n if (usage?.inputTokens !== undefined) {\n rows.push({ label: \"Input\", value: formatMetricNumber(usage.inputTokens) });\n }\n if (usage?.outputTokens !== undefined) {\n rows.push({ label: \"Output\", value: formatMetricNumber(usage.outputTokens) });\n }\n pushOptionalUsageRow(rows, \"Cached\", usage, \"cachedInputTokens\");\n pushOptionalUsageRow(rows, \"Cache create\", usage, \"cacheCreationInputTokens\");\n if (metrics?.durationMs !== undefined) {\n rows.push({ label: \"Duration\", value: formatResponseDuration(metrics.durationMs) });\n }\n return rows;\n}\n\nfunction pushOptionalUsageRow(\n rows: Array<{ label: string; value: string }>,\n label: string,\n usage: ResponseUsageMetrics | undefined,\n key: keyof ResponseUsageMetrics,\n) {\n const value = usage?.[key];\n if (value !== undefined && value > 0) {\n rows.push({ label, value: formatMetricNumber(value) });\n }\n}\n\nfunction metricsTitle(metrics: AssistantResponseMetrics | undefined): string {\n const rows = responseMetricRows(metrics);\n if (rows.length === 0) {\n return \"Cost unavailable. No usage metrics yet.\";\n }\n return [\"Cost unavailable\", ...rows.map((row) => `${row.label}: ${row.value}`)].join(\". \");\n}\n\nfunction formatMetricNumber(value: number): string {\n return value.toLocaleString();\n}\n\nfunction formatResponseDuration(value: number): string {\n if (value < 1000) {\n return `${value}ms`;\n }\n return `${(value / 1000).toFixed(1)}s`;\n}\n\nfunction AssistantLoadingIndicator() {\n return (\n <div\n aria-label=\"Assistant is thinking\"\n aria-live=\"polite\"\n className=\"inline-flex min-h-8 items-center gap-2 py-1 text-muted-foreground\"\n role=\"status\"\n >\n <span className=\"text-base font-medium\">Thinking</span>\n <span className=\"flex items-center gap-1\" aria-hidden=\"true\">\n <span className=\"size-1 animate-pulse rounded-full bg-current motion-reduce:animate-none\" />\n <span className=\"size-1 animate-pulse rounded-full bg-current [animation-delay:150ms] motion-reduce:animate-none\" />\n <span className=\"size-1 animate-pulse rounded-full bg-current [animation-delay:300ms] motion-reduce:animate-none\" />\n </span>\n </div>\n );\n}\n\nfunction MessageAttachments(props: {\n attachments: NonNullable<Extract<TranscriptEntry, { kind: \"message\" }>[\"attachments\"]>;\n}) {\n return (\n <div className=\"mt-2 flex max-w-full flex-wrap gap-2\">\n {props.attachments.map((attachment, index) => {\n const key = `${attachment.kind}-${attachment.name ?? attachment.mediaType ?? index}-${index}`;\n if (attachment.kind === \"image\") {\n const src =\n attachment.url ??\n (attachment.data === undefined\n ? undefined\n : `data:${attachment.mediaType ?? \"image/png\"};base64,${attachment.data}`);\n return (\n <div\n className=\"overflow-hidden rounded-lg border border-border/80 bg-card/80\"\n key={key}\n >\n {src === undefined ? (\n <div className=\"grid h-20 w-24 place-items-center px-2 text-center text-xs text-muted-foreground\">\n Image\n </div>\n ) : (\n <img\n alt={attachment.name ?? \"Attached image\"}\n className=\"h-20 w-24 object-cover\"\n src={src}\n />\n )}\n </div>\n );\n }\n return (\n <span\n className=\"inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border/80 bg-card/80 px-2 py-1 text-xs font-medium text-muted-foreground\"\n key={key}\n >\n <span className=\"min-w-0 truncate\">\n {attachment.name ?? attachment.mediaType ?? \"Document\"}\n </span>\n </span>\n );\n })}\n </div>\n );\n}\n\nfunction hasMarkdownTable(text: string): boolean {\n const lines = text.split(\"\\n\");\n return lines.some((line, index) => {\n const next = lines[index + 1];\n return (\n line.includes(\"|\") &&\n next !== undefined &&\n /^\\s*\\|?\\s*:?-{3,}:?\\s*(\\|\\s*:?-{3,}:?\\s*)+\\|?\\s*$/.test(next)\n );\n });\n}\n\nfunction ToolEntry(props: {\n entry: ToolMessage;\n decidingApprovals: Set<string>;\n answeringQuestions: Set<string>;\n onApprovalDecision: (approvalId: string, approved: boolean) => void;\n onQuestionAnswer: (\n questionId: string,\n answers: Array<{ questionId: string; answer: string; choice?: string; custom?: boolean }>,\n ) => void;\n}) {\n const [collapsed, setCollapsed] = useState(\n props.entry.approval?.status !== \"pending\" && props.entry.question?.status !== \"pending\",\n );\n const approval = props.entry.approval;\n const question = props.entry.question;\n const childEvents = props.entry.childEvents ?? [];\n const hasPayload =\n props.entry.args !== undefined ||\n props.entry.result !== undefined ||\n childEvents.length > 0 ||\n approval !== undefined ||\n question !== undefined;\n const pendingApproval = approval?.status === \"pending\";\n const pendingQuestion = question?.status === \"pending\";\n const cancelledInteraction = approval?.status === \"cancelled\" || question?.status === \"cancelled\";\n const rejectedApproval = approval?.status === \"rejected\";\n const timedOutApproval = approval?.status === \"timed_out\";\n const deciding = approval !== undefined && props.decidingApprovals.has(approval.id);\n const answering = question !== undefined && props.answeringQuestions.has(question.id);\n const status = pendingApproval\n ? \"Approval required\"\n : pendingQuestion\n ? \"Input required\"\n : cancelledInteraction\n ? \"Cancelled\"\n : rejectedApproval\n ? \"Rejected\"\n : timedOutApproval\n ? \"Timed out\"\n : props.entry.result === undefined\n ? \"Running\"\n : undefined;\n\n return (\n <article\n className=\"w-full justify-self-start text-foreground\"\n data-entry-id={String(props.entry.entryId)}\n >\n <div className=\"flex min-w-0 items-center gap-2 py-1.5\">\n <Button\n aria-expanded={hasPayload ? !collapsed : undefined}\n aria-label={`${collapsed ? \"Expand\" : \"Collapse\"} ${props.entry.toolName} tool call`}\n className=\"h-auto min-h-8 min-w-0 flex-1 justify-start gap-2 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={() => setCollapsed((current) => !current)}\n >\n <span className=\"grid size-6 shrink-0 place-items-center text-muted-foreground\">\n <StudioIcon icon={Wrench} className=\"size-4\" aria-hidden=\"true\" />\n </span>\n <strong className=\"min-w-0 truncate font-mono text-base font-medium text-foreground\">\n {props.entry.toolName}\n </strong>\n {status === undefined ? null : (\n <span className=\"ml-auto inline-flex shrink-0 items-center gap-1.5 text-sm font-normal text-muted-foreground\">\n <span\n className={cn(\n \"size-1.5 rounded-full bg-muted-foreground/60\",\n status === \"Running\" && \"animate-pulse bg-foreground motion-reduce:animate-none\",\n (cancelledInteraction || rejectedApproval || timedOutApproval) &&\n \"bg-destructive\",\n )}\n aria-hidden=\"true\"\n />\n {status}\n </span>\n )}\n {hasPayload ? (\n <span className=\"grid size-6 shrink-0 place-items-center text-muted-foreground\">\n <StudioIcon\n icon={CaretDown}\n className={cn(\"size-4 transition-transform\", collapsed && \"-rotate-90\")}\n aria-hidden=\"true\"\n />\n </span>\n ) : null}\n </Button>\n {pendingApproval && approval !== undefined ? (\n <ToolApprovalActions\n disabled={deciding}\n onDecision={(approved) => props.onApprovalDecision(approval.id, approved)}\n />\n ) : null}\n </div>\n {collapsed || !hasPayload ? null : (\n <div className=\"ml-8 grid gap-3 py-2\">\n {approval === undefined ? null : <ToolApprovalPanel approval={approval} />}\n {question === undefined ? null : (\n <ToolQuestionPanel\n disabled={answering}\n question={question}\n onAnswer={(answers) => props.onQuestionAnswer(question.id, answers)}\n />\n )}\n {question !== undefined || props.entry.args === undefined ? null : (\n <ToolPayload title=\"Input\" value={props.entry.args} />\n )}\n {childEvents.length === 0 ? null : <ChildAgentActivity events={childEvents} />}\n {question !== undefined || props.entry.result === undefined ? null : (\n <ToolPayload title=\"Output\" value={props.entry.result} />\n )}\n </div>\n )}\n </article>\n );\n}\n\nfunction ChildAgentActivity(props: { events: NonNullable<ToolMessage[\"childEvents\"]> }) {\n return (\n <div className=\"overflow-hidden rounded-xl border border-border/80 bg-background/65\">\n <div className=\"bg-muted/20 px-3 py-2 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground\">\n Subagent activity\n </div>\n <div className=\"grid gap-3 p-3\">\n {props.events.map((event) => {\n const agentLabel = event.agentName ?? event.agentId;\n if (event.kind === \"message\" || event.kind === \"reasoning\") {\n return (\n <div\n className=\"grid gap-1 rounded-xl border border-border/80 bg-card/90 p-3\"\n key={`${event.kind}-${event.agentId}-${event.text}`}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n <Badge className=\"border-border bg-muted px-1.5 py-0.5 text-xs uppercase text-muted-foreground\">\n {event.kind === \"reasoning\" ? \"Reasoning\" : \"Response\"}\n </Badge>\n <span className=\"min-w-0 truncate text-xs font-semibold text-muted-foreground\">\n {agentLabel}\n </span>\n </div>\n <MarkdownText size=\"base\" text={event.text} />\n </div>\n );\n }\n return (\n <div\n className=\"grid gap-2 rounded-xl border border-border/80 bg-card/90 p-3\"\n key={`${event.kind}-${event.agentId}-${event.toolName}-${event.callId ?? event.args ?? event.result ?? \"\"}`}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n <Badge className=\"border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-foreground\">\n Tool\n </Badge>\n <span className=\"min-w-0 truncate text-xs font-semibold text-muted-foreground\">\n {agentLabel} / {event.toolName}\n </span>\n </div>\n {event.args === undefined ? null : <ToolPayload title=\"Input\" value={event.args} />}\n {event.result === undefined ? null : (\n <ToolPayload title=\"Output\" value={event.result} />\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction ToolQuestionPanel(props: {\n question: ToolQuestion;\n disabled: boolean;\n onAnswer: (\n answers: Array<{ questionId: string; answer: string; choice?: string; custom?: boolean }>,\n ) => void;\n}) {\n const [values, setValues] = useState<Record<string, QuestionDraft>>({});\n const [activeQuestionIndex, setActiveQuestionIndex] = useState(0);\n const pending = props.question.status === \"pending\";\n const total = props.question.questions.length;\n\n const answers = props.question.questions.map((question) => {\n const draft = values[question.id];\n const customAnswer = draft?.customValue?.trim() ?? \"\";\n const answer = customAnswer.length > 0 ? customAnswer : draft?.answer;\n const normalized: { questionId: string; answer: string; choice?: string; custom?: boolean } = {\n questionId: question.id,\n answer: answer?.trim() ?? \"\",\n };\n if (draft?.choice !== undefined) normalized.choice = draft.choice;\n if (customAnswer.length > 0) normalized.custom = true;\n return normalized;\n });\n const activeIndex = total === 0 ? 0 : Math.min(activeQuestionIndex, total - 1);\n const activeQuestion = props.question.questions[activeIndex];\n const activeAnswer = answers[activeIndex]?.answer ?? \"\";\n const answeredCount = answers.filter((answer) => answer.answer.length > 0).length;\n const canAdvance = activeAnswer.length > 0;\n const canSubmit = pending && answers.every((answer) => answer.answer.length > 0);\n const firstQuestion = activeIndex === 0;\n const lastQuestion = activeIndex >= total - 1;\n\n if (activeQuestion === undefined) {\n return (\n <div className=\"rounded-xl border border-border bg-background p-4 text-sm font-medium text-muted-foreground\">\n No questions\n </div>\n );\n }\n\n const goPrevious = () => setActiveQuestionIndex((current) => Math.max(0, current - 1));\n const goNext = () =>\n setActiveQuestionIndex((current) => Math.min(props.question.questions.length - 1, current + 1));\n const updateDraft = (questionId: string, value: QuestionDraft) =>\n setValues((current) => ({\n ...current,\n [questionId]: value,\n }));\n\n return (\n <div className=\"grid gap-3\">\n {props.question.status === \"cancelled\" ? (\n <div className=\"rounded-xl border border-border/70 bg-muted/25 px-3 py-2.5 text-sm font-medium text-muted-foreground\">\n Question cancelled\n </div>\n ) : null}\n <QuestionPromptControl\n key={activeQuestion.id}\n disabled={props.disabled || !pending}\n index={activeIndex}\n total={total}\n question={activeQuestion}\n value={values[activeQuestion.id]}\n answer={props.question.answers?.find((answer) => answer.questionId === activeQuestion.id)}\n onChange={(value) => updateDraft(activeQuestion.id, value)}\n onAdvance={lastQuestion ? undefined : goNext}\n />\n {pending ? (\n <div className=\"flex min-w-0 items-center justify-between gap-3 rounded-xl bg-muted/20 px-3 py-2\">\n <div className=\"min-w-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n {answeredCount}/{total} answered\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {firstQuestion ? null : (\n <Button type=\"button\" variant=\"secondary\" onClick={goPrevious}>\n Back\n </Button>\n )}\n {lastQuestion ? (\n <Button\n className=\"h-9 min-h-9 px-4\"\n disabled={props.disabled || !canSubmit}\n type=\"button\"\n onClick={() => props.onAnswer(answers)}\n >\n Submit answers\n </Button>\n ) : (\n <Button\n className=\"h-9 min-h-9 px-4\"\n disabled={props.disabled || !canAdvance}\n type=\"button\"\n onClick={goNext}\n >\n Next question\n </Button>\n )}\n </div>\n </div>\n ) : total > 1 ? (\n <div className=\"flex min-w-0 items-center justify-between gap-3 rounded-xl bg-muted/20 px-3 py-2\">\n <div className=\"min-w-0 text-xs font-semibold uppercase tracking-[0.2em] text-foreground\">\n Answered\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n <Button disabled={firstQuestion} type=\"button\" variant=\"secondary\" onClick={goPrevious}>\n Back\n </Button>\n <Button disabled={lastQuestion} type=\"button\" variant=\"secondary\" onClick={goNext}>\n Next\n </Button>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n\ntype QuestionDraft = {\n answer?: string;\n choice?: string;\n customValue?: string;\n};\n\nfunction QuestionPromptControl(props: {\n question: ToolQuestion[\"questions\"][number];\n value: QuestionDraft | undefined;\n answer: NonNullable<ToolQuestion[\"answers\"]>[number] | undefined;\n disabled: boolean;\n index: number;\n total: number;\n onChange: (value: QuestionDraft) => void;\n onAdvance: (() => void) | undefined;\n}) {\n const submittedAnswer = props.answer?.answer;\n const draftAnswer = questionDraftAnswer(props.value);\n const state =\n submittedAnswer !== undefined ? \"Answered\" : draftAnswer.length > 0 ? \"Ready\" : \"Waiting\";\n\n return (\n <section className=\"grid gap-4 rounded-xl border border-border/80 bg-background/70 p-4\">\n <div className=\"flex min-w-0 items-start justify-between gap-4\">\n <div className=\"grid min-w-0 gap-2\">\n <div className=\" text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n Question {props.index + 1} of {props.total}\n </div>\n <h3 className=\"m-0 text-base font-semibold leading-7 text-foreground [overflow-wrap:anywhere]\">\n {props.question.question}\n </h3>\n </div>\n <span\n className={cn(\n \"shrink-0 text-xs font-semibold uppercase tracking-[0.18em]\",\n state === \"Answered\" && \"text-foreground\",\n state === \"Ready\" && \"text-foreground\",\n state === \"Waiting\" && \"text-muted-foreground\",\n )}\n >\n {state}\n </span>\n </div>\n {submittedAnswer === undefined ? null : (\n <div className=\"rounded-lg border border-border/70 bg-muted/45 px-3 py-2 text-sm font-medium text-foreground\">\n {submittedAnswer}\n </div>\n )}\n {submittedAnswer !== undefined ? null : props.question.choices.length > 0 ? (\n <div className=\"flex flex-wrap gap-2\">\n {props.question.choices.map((choice) => {\n const active = props.value?.choice === choice.value;\n return (\n <Button\n key={choice.value}\n className={cn(\"h-8 min-h-8 px-3 text-xs\", active && \"border-foreground/45\")}\n disabled={props.disabled}\n size=\"sm\"\n type=\"button\"\n variant={active ? \"default\" : \"secondary\"}\n onClick={() => {\n props.onChange({\n answer: choice.value,\n choice: choice.value,\n customValue: props.value?.customValue ?? \"\",\n });\n props.onAdvance?.();\n }}\n >\n {choice.label}\n </Button>\n );\n })}\n </div>\n ) : null}\n {submittedAnswer !== undefined ? null : (\n <Textarea\n className=\"min-h-24 text-sm\"\n disabled={props.disabled}\n placeholder=\"Type a custom answer\"\n rows={3}\n value={props.value?.customValue ?? \"\"}\n onChange={(event) =>\n props.onChange({\n ...props.value,\n customValue: event.currentTarget.value,\n })\n }\n />\n )}\n </section>\n );\n}\n\nfunction questionDraftAnswer(value: QuestionDraft | undefined): string {\n const customAnswer = value?.customValue?.trim() ?? \"\";\n return customAnswer.length > 0 ? customAnswer : (value?.answer?.trim() ?? \"\");\n}\n\nfunction ToolApprovalPanel(props: { approval: ToolApproval }) {\n return (\n <div className=\"grid gap-2 rounded-xl border border-border/70 bg-muted/25 px-3 py-2.5\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <Badge\n className={cn(\n \"border-border/70 bg-background/60 px-1.5 py-0.5 text-xs uppercase text-muted-foreground\",\n props.approval.status === \"approved\" && \"text-foreground\",\n props.approval.status === \"rejected\" && \"text-destructive\",\n )}\n >\n Approval\n </Badge>\n <div className=\"min-w-0\">\n <div className=\"text-sm font-medium text-foreground\">{approvalLabel(props.approval)}</div>\n </div>\n </div>\n {props.approval.reason === undefined ? null : (\n <div className=\"text-xs font-medium text-muted-foreground [overflow-wrap:anywhere]\">\n {props.approval.reason}\n </div>\n )}\n </div>\n );\n}\n\nfunction ToolApprovalActions(props: {\n disabled: boolean;\n onDecision: (approved: boolean) => void;\n}) {\n return (\n <div className=\"flex shrink-0 items-center gap-1\">\n <Button\n className=\"h-8 min-h-8 border-0 bg-transparent px-3 text-sm text-muted-foreground shadow-none hover:bg-destructive/10 hover:text-destructive\"\n disabled={props.disabled}\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\"\n onClick={() => props.onDecision(false)}\n >\n Reject\n </Button>\n <Button\n className=\"h-8 min-h-8 px-3 text-sm\"\n disabled={props.disabled}\n size=\"sm\"\n type=\"button\"\n onClick={() => props.onDecision(true)}\n >\n Approve\n </Button>\n </div>\n );\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":"gQACMA,EAAoB,IAAI,IAAI,CAChC,CACE,OACgB,EAAE,cAAA,EAAgB,SAAU,KAAsB,EAAE,cAAc,OAAQ,CAAE,EAAG,4MAA6M,CAAC,CAAC,CAC/S,CACD,CACE,UACgB,EAAE,cAAA,EAAgB,SAAU,KAAsB,EAAE,cAAc,OAAQ,CAAE,EAAG,sBAAuB,QAAS,MAAO,CAAC,CAAkB,EAAE,cAAc,OAAQ,CAAE,EAAG,yLAA0L,CAAC,CAAC,CACnX,CACD,CACE,OACgB,EAAE,cAAA,EAAgB,SAAU,KAAsB,EAAE,cAAc,OAAQ,CAAE,EAAG,0LAA2L,CAAC,CAAC,CAC7R,CACD,CACE,QACgB,EAAE,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AM,SAAS,CAAO,CAAA,CACtF,CAAA,CACF,GACL,EAAM,SAAS,SAAW,IAAA,GAAY,MACrC,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,8EACZ,EAAM,SAAS,OACZ,CAAA,CAEJ,GAIV,SAAS,EAAoB,EAG1B,CACD,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,4CAAf,EACE,EAAA,EAAA,KAAC,EAAD,CACE,UAAU,oIACV,SAAU,EAAM,SAChB,KAAK,KACL,KAAK,SACL,QAAQ,QACR,YAAe,EAAM,WAAW,GAAM,UACvC,SAEQ,CAAA,EACT,EAAA,EAAA,KAAC,EAAD,CACE,UAAU,2BACV,SAAU,EAAM,SAChB,KAAK,KACL,KAAK,SACL,YAAe,EAAM,WAAW,GAAK,UACtC,UAEQ,CAAA,CACL"}
@@ -21,9 +21,8 @@
21
21
  })();
22
22
  </script>
23
23
  <link rel="icon" type="image/svg+xml" href="/ui/assets/favicon.svg" />
24
- <script type="module" crossorigin src="/ui/assets/index-Bh7RLPBw.js"></script>
24
+ <script type="module" crossorigin src="/ui/assets/index-DizotQot.js"></script>
25
25
  <link rel="modulepreload" crossorigin href="/ui/assets/utils-C9GMruoG.js">
26
- <link rel="modulepreload" crossorigin href="/ui/assets/chunk-ADH7NNCS-DM6fsnDI.js">
27
26
  <link rel="stylesheet" crossorigin href="/ui/assets/index-D-CbFx6c.css">
28
27
  </head>
29
28
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvia/studio",
3
- "version": "0.8.1",
3
+ "version": "1.0.0-rc.2",
4
4
  "description": "Studio UI and HTTP runtime for Anvia agents.",
5
5
  "author": "anvia",
6
6
  "maintainer": "Indra Zulfi",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@fontsource-variable/geist": "^5.3.0",
30
30
  "@fontsource-variable/geist-mono": "^5.3.0",
31
- "@hono/node-server": "^2.1.0",
31
+ "@hono/node-server": "^2.1.1",
32
32
  "@phosphor-icons/react": "^2.1.10",
33
33
  "@radix-ui/react-alert-dialog": "^1.1.23",
34
34
  "@radix-ui/react-dialog": "^1.1.23",
@@ -36,17 +36,18 @@
36
36
  "@radix-ui/react-select": "^2.3.7",
37
37
  "@radix-ui/react-separator": "^1.1.15",
38
38
  "@radix-ui/react-slot": "^1.3.3",
39
- "@tanstack/react-router": "1.170.23",
40
- "@xyflow/react": "^12.11.2",
39
+ "@tanstack/react-router": "1.170.29",
40
+ "@xyflow/react": "^12.11.3",
41
41
  "class-variance-authority": "^0.7.1",
42
42
  "clsx": "^2.1.1",
43
- "hono": "^4.13.1",
43
+ "hono": "^4.13.2",
44
44
  "react": "^19.2.8",
45
45
  "react-dom": "^19.2.8",
46
46
  "tailwind-merge": "^3.6.0",
47
- "@anvia/react": "0.11.6",
48
- "@anvia/react-ui": "0.7.1",
49
- "@anvia/server": "0.7.6"
47
+ "@anvia/react-ui": "1.0.0-rc.2",
48
+ "@anvia/client": "1.0.0-rc.2",
49
+ "@anvia/react": "1.0.0-rc.2",
50
+ "@anvia/server": "1.0.0-rc.2"
50
51
  },
51
52
  "devDependencies": {
52
53
  "@tailwindcss/typography": "^0.5.19",
@@ -61,14 +62,14 @@
61
62
  "vite": "^8.0.10",
62
63
  "vitest": "^4.0.8",
63
64
  "zod": "^4.4.3",
64
- "@anvia/core": "0.26.0"
65
+ "@anvia/core": "1.0.0-rc.2"
65
66
  },
66
67
  "peerDependencies": {
67
- "@anvia/core": ">=0.25.0 <1.0.0"
68
+ "@anvia/core": "1.0.0-rc.2"
68
69
  },
69
70
  "scripts": {
70
71
  "build": "pnpm run build:deps && tsup && vite build --config vite.config.ts",
71
- "build:deps": "(test -f ../core/dist/index.d.ts || pnpm --filter @anvia/core build) && pnpm --filter @anvia/server --filter @anvia/react --filter @anvia/react-ui build",
72
+ "build:deps": "(test -f ../core/dist/index.d.ts || pnpm --filter @anvia/core build) && pnpm --filter @anvia/client build && pnpm --filter @anvia/server --filter @anvia/react --filter @anvia/react-ui build",
72
73
  "coverage": "pnpm run build:deps && vitest run --coverage",
73
74
  "test": "pnpm run build:deps && vitest run",
74
75
  "typecheck": "pnpm run build:deps && tsc --noEmit"
@@ -1 +0,0 @@
1
- {"version":3,"file":"agents-page-CkNSbqAj.js","names":[],"sources":["../../../src/ui/app/modules/agents/agents-page.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useState } from \"react\";\nimport type { StudioAgentRuntimeSummary, StudioConfig } from \"../../../../types\";\nimport { Badge } from \"../../components/ui/badge\";\nimport {\n StudioEmptyState,\n StudioHeaderMetric,\n StudioPageContent,\n StudioPageHeader,\n StudioPageShell,\n} from \"../../components/ui/studio\";\nimport { cn } from \"../../lib/utils\";\n\nexport function AgentsPage(props: { agents: StudioConfig[\"agents\"]; selectedAgentId: string }) {\n const [runtimeByAgentId, setRuntimeByAgentId] = useState<\n Record<string, StudioAgentRuntimeSummary | undefined>\n >({});\n\n useEffect(() => {\n let cancelled = false;\n async function loadRuntimeSummaries() {\n const entries = await Promise.all(\n props.agents.map(async (agent) => {\n try {\n const response = await fetch(`/agents/${encodeURIComponent(agent.id)}/runtime`);\n if (!response.ok) {\n return [agent.id, undefined] as const;\n }\n return [agent.id, (await response.json()) as StudioAgentRuntimeSummary] as const;\n } catch {\n return [agent.id, undefined] as const;\n }\n }),\n );\n if (!cancelled) {\n setRuntimeByAgentId(Object.fromEntries(entries));\n }\n }\n void loadRuntimeSummaries();\n return () => {\n cancelled = true;\n };\n }, [props.agents]);\n\n const totals = registryTotals(props.agents, runtimeByAgentId);\n\n return (\n <StudioPageShell className=\"grid-rows-[auto_minmax(0,1fr)]\" aria-label=\"Agents\">\n <StudioPageHeader\n title=\"Studio\"\n description=\"Registered agents and the runtime capabilities exposed to Studio.\"\n action={\n <div className=\"flex min-w-0 flex-wrap justify-end gap-2 max-sm:justify-start\">\n <StudioHeaderMetric label=\"agents\" value={props.agents.length} />\n <StudioHeaderMetric label=\"tools\" value={totals.tools} />\n <StudioHeaderMetric label=\"context\" value={totals.context} />\n <StudioHeaderMetric label=\"prompts\" value={totals.prompts} />\n </div>\n }\n />\n\n <StudioPageContent className=\"overflow-auto\">\n {props.agents.length === 0 ? (\n <StudioEmptyState title=\"No agents\" text=\"Studio has no registered agents to inspect.\" />\n ) : (\n <AgentRegistryTable\n agents={props.agents}\n runtimeByAgentId={runtimeByAgentId}\n selectedAgentId={props.selectedAgentId}\n />\n )}\n </StudioPageContent>\n </StudioPageShell>\n );\n}\n\ntype RuntimeByAgentId = Record<string, StudioAgentRuntimeSummary | undefined>;\n\nfunction AgentRegistryTable(props: {\n agents: StudioConfig[\"agents\"];\n runtimeByAgentId: RuntimeByAgentId;\n selectedAgentId: string;\n}) {\n return (\n <div className=\"min-w-[980px]\">\n <table className=\"w-full border-separate border-spacing-0 text-left\">\n <thead className=\"sticky top-0 z-10 bg-background/95 backdrop-blur\">\n <tr>\n <TableHead>Agent</TableHead>\n <TableHead>Model</TableHead>\n <TableHead>Runtime</TableHead>\n <TableHead>Capabilities</TableHead>\n </tr>\n </thead>\n <tbody>\n {props.agents.map((agent) => (\n <AgentRegistryRow\n agent={agent}\n active={agent.id === props.selectedAgentId}\n key={agent.id}\n runtime={props.runtimeByAgentId[agent.id]}\n />\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\nfunction AgentRegistryRow(props: {\n agent: StudioConfig[\"agents\"][number];\n runtime: StudioAgentRuntimeSummary | undefined;\n active: boolean;\n}) {\n const runtime = props.runtime;\n const modelLabel =\n runtime === undefined\n ? \"Runtime unavailable\"\n : runtime.model === undefined\n ? \"No model reported\"\n : formatModelValue(runtime.model);\n\n return (\n <tr>\n <TableCell>\n <div className=\"grid min-w-0 gap-1.5\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"min-w-0 truncate text-sm font-semibold text-foreground\">\n {props.agent.name ?? props.agent.id}\n </span>\n {props.active ? <Badge className={selectedBadge}>selected</Badge> : null}\n </div>\n <span className=\"min-w-0 break-all text-xs font-medium leading-5 text-muted-foreground\">\n {props.agent.id}\n </span>\n <p className=\"m-0 max-w-[64ch] truncate text-sm leading-6 text-muted-foreground\">\n {props.agent.description ?? \"No description\"}\n </p>\n </div>\n </TableCell>\n <TableCell>\n <span\n className={cn(\n \"block max-w-[260px] truncate text-sm leading-6\",\n runtime === undefined ? \"text-muted-foreground\" : \"text-foreground\",\n )}\n title={modelLabel}\n >\n {modelLabel}\n </span>\n </TableCell>\n <TableCell>\n {runtime === undefined ? (\n <span className=\"text-sm leading-6 text-muted-foreground\">Waiting for summary</span>\n ) : (\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n <MetricPill label=\"tools\" value={runtime.toolCount} />\n <MetricPill label=\"mcp\" value={runtime.mcpToolCount} />\n <MetricPill\n label=\"context\"\n value={runtime.staticContextCount + runtime.dynamicContextCount}\n />\n <MetricPill label=\"observers\" value={runtime.observerCount} />\n <MetricPill label=\"prompts\" value={props.agent.quickPrompts.length} />\n </div>\n )}\n </TableCell>\n <TableCell>\n {runtime === undefined ? (\n <span className=\"text-sm leading-6 text-muted-foreground\">Not loaded</span>\n ) : (\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n <CapabilityBadge enabled={runtime.hasMemory}>memory</CapabilityBadge>\n <CapabilityBadge enabled={runtime.hasHook}>hook</CapabilityBadge>\n <CapabilityBadge enabled={runtime.hasOutputSchema}>schema</CapabilityBadge>\n {runtime.defaultMaxTurns === undefined ? null : (\n <Badge className={neutralBadge}>{runtime.defaultMaxTurns} turns</Badge>\n )}\n </div>\n )}\n </TableCell>\n </tr>\n );\n}\n\nfunction TableHead(props: { children: string }) {\n return (\n <th className=\"border-b border-border/80 py-2.5 pr-5 text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground first:pl-0\">\n {props.children}\n </th>\n );\n}\n\nfunction TableCell(props: { children: ReactNode }) {\n return (\n <td className=\"border-b border-border/70 py-3.5 pr-5 align-top first:pl-0\">{props.children}</td>\n );\n}\n\nfunction MetricPill(props: { label: string; value: number }) {\n return (\n <span className=\"inline-flex min-h-7 items-center gap-1.5 rounded-md bg-muted/25 px-2.5 text-xs font-medium text-muted-foreground\">\n <span className=\"font-semibold tabular-nums text-foreground\">{props.value}</span>\n {props.label}\n </span>\n );\n}\n\nfunction CapabilityBadge(props: { enabled: boolean; children: string }) {\n return <Badge className={props.enabled ? enabledBadge : disabledBadge}>{props.children}</Badge>;\n}\n\nconst selectedBadge = \"border-border/80 bg-muted/45 text-foreground\";\nconst enabledBadge = \"border-border/80 bg-muted/35 text-foreground\";\nconst disabledBadge = \"border-transparent bg-transparent text-muted-foreground/60\";\nconst neutralBadge = \"border-border/80 bg-muted/35 text-muted-foreground\";\n\nfunction registryTotals(agents: StudioConfig[\"agents\"], runtimeByAgentId: RuntimeByAgentId) {\n return agents.reduce(\n (totals, agent) => {\n const runtime = runtimeByAgentId[agent.id];\n totals.prompts += agent.quickPrompts.length;\n if (runtime !== undefined) {\n totals.tools += runtime.toolCount + runtime.mcpToolCount;\n totals.context += runtime.staticContextCount + runtime.dynamicContextCount;\n }\n return totals;\n },\n { context: 0, prompts: 0, tools: 0 },\n );\n}\n\nfunction formatModelValue(value: unknown): string {\n if (value === null) {\n return \"null\";\n }\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n if (Array.isArray(value)) {\n return `[${value.length}]`;\n }\n if (typeof value === \"object\") {\n const model = objectString(value, \"model\") ?? objectString(value, \"defaultModel\");\n const provider = objectString(value, \"provider\");\n const id = objectString(value, \"id\") ?? objectString(value, \"name\");\n const modelName = model ?? id;\n\n if (provider !== undefined && modelName !== undefined && provider !== modelName) {\n return `${provider} / ${modelName}`;\n }\n return modelName ?? provider ?? \"Custom model\";\n }\n return \"\";\n}\n\nfunction objectString(value: object, key: string): string | undefined {\n const record = value as Record<string, unknown>;\n return typeof record[key] === \"string\" ? record[key] : undefined;\n}\n"],"mappings":"8LAYA,SAAgB,EAAW,EAAoE,CAC7F,GAAM,CAAC,EAAkB,IAAA,EAAA,E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AO,GAE1B,GAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAQ,EAAa,EAAO,QAAQ,EAAI,EAAa,EAAO,eAAe,CAC3E,EAAW,EAAa,EAAO,WAAW,CAC1C,EAAK,EAAa,EAAO,KAAK,EAAI,EAAa,EAAO,OAAO,CAC7D,EAAY,GAAS,EAK3B,OAHI,IAAa,IAAA,IAAa,IAAc,IAAA,IAAa,IAAa,EAC7D,GAAG,EAAS,KAAK,IAEnB,GAAa,GAAY,eAElC,MAAO,GAGT,SAAS,EAAa,EAAe,EAAiC,CACpE,IAAM,EAAS,EACf,OAAO,OAAO,EAAO,IAAS,SAAW,EAAO,GAAO,IAAA"}
@@ -1,2 +0,0 @@
1
- function e(e){return t(e,new WeakSet)}function t(e,r){if(e===null||typeof e==`string`||typeof e==`boolean`)return!0;if(typeof e==`number`)return Number.isFinite(e);if(typeof e!=`object`||r.has(e))return!1;r.add(e);try{if(Array.isArray(e)){if(!n(e))return!1;for(let n=0;n<e.length;n+=1)if(!t(e[n],r))return!1;return!0}let i=Object.getPrototypeOf(e);if(i!==Object.prototype&&i!==null)return!1;for(let n of Reflect.ownKeys(e)){if(typeof n!=`string`)return!1;let i=Object.getOwnPropertyDescriptor(e,n);if(i===void 0||!i.enumerable||!(`value`in i)||!t(i.value,r))return!1}return!0}catch{return!1}finally{r.delete(e)}}function n(e){let t=Reflect.ownKeys(e);if(t.length!==e.length+1||t.at(-1)!==`length`)return!1;for(let n=0;n<e.length;n+=1){let r=String(n);if(t[n]!==r)return!1;let i=Object.getOwnPropertyDescriptor(e,r);if(i===void 0||!i.enumerable||!(`value`in i))return!1}return!0}var r={text(e){return{type:`text`,text:e}},imageUrl(e,t={}){let n={type:`image`,source:{type:`url`,url:e}};return t.detail!==void 0&&(n.detail=t.detail),n},imageBase64(e,t,n={}){let r={type:`image`,source:{type:`base64`,data:e,mediaType:t}};return n.detail!==void 0&&(r.detail=n.detail),r},documentUrl(e,t,n={}){return{type:`document`,source:n.filename===void 0?{type:`url`,url:e,mediaType:t}:{type:`url`,url:e,mediaType:t,filename:n.filename}}},documentBase64(e,t,n={}){return{type:`document`,source:n.filename===void 0?{type:`base64`,data:e,mediaType:t}:{type:`base64`,data:e,mediaType:t,filename:n.filename}}},documentText(e){return{type:`text`,text:e}}},i={toolResult(e,t,n,r){let i=typeof t==`string`?[{type:`text`,text:t}]:t,o=a(n,r),s={type:`tool_result`,id:e,content:i};return o.callId!==void 0&&(s.callId=o.callId),o.toolName!==void 0&&(s.toolName=o.toolName),s}};function a(e,t){return e===void 0?t===void 0?{}:{toolName:t}:typeof e==`string`?t===void 0?{callId:e}:{callId:e,toolName:t}:t===void 0?e:{...e,toolName:t}}function o(e){if(typeof e==`string`)return e;try{let t=JSON.stringify(e);return t===void 0?String(e):t}catch{return String(e)}}function s(e){return Array.isArray(e)&&e.length>0&&e.every(e=>typeof e!=`object`||!e||!(`type`in e)?!1:e.type===`text`?`text`in e&&typeof e.text==`string`:e.type===`image`?`data`in e&&typeof e.data==`string`&&(!(`mediaType`in e)||e.mediaType===void 0||typeof e.mediaType==`string`):!1)}var c={text(e){return{type:`text`,text:e}},imageUrl(e,t={}){let n={type:`image`,source:{type:`url`,url:e}};return t.detail!==void 0&&(n.detail=t.detail),n},imageBase64(e,t,n={}){let r={type:`image`,source:{type:`base64`,data:e,mediaType:t}};return n.detail!==void 0&&(r.detail=n.detail),r},reasoning(e,t){return t===void 0?{type:`reasoning`,text:e}:{type:`reasoning`,text:e,id:t}},reasoningFromContent(e,t){let n={type:`reasoning`,text:l(e),content:e};return t===void 0?n:{...n,id:t}},reasoningSummary(e,t){return c.reasoningFromContent([{type:`summary`,text:e}],t)},reasoningEncrypted(e,t){return c.reasoningFromContent([{type:`encrypted`,data:e}],t)},reasoningRedacted(e,t){return c.reasoningFromContent([{type:`redacted`,data:e}],t)},toolCall(e,t,n,r){let i={type:`tool_call`,id:e,function:{name:t,arguments:n}};return r===void 0?i:{...i,callId:r}}};function l(e){let t=Array.isArray(e)?e:e.content;return t===void 0?Array.isArray(e)?``:e.text:t.flatMap(e=>e.type===`text`||e.type===`summary`?[e.text]:[]).join(``)}var u={system(e,t={}){return{role:`system`,content:e,...d(t)}},user(e,t={}){return{role:`user`,content:typeof e==`string`?[r.text(e)]:e,...d(t)}},assistant(e,t){let n=typeof e==`string`?[c.text(e)]:e,r=typeof t==`string`?{id:t}:t??{},i=d(r).metadata,a=r.id===void 0?{role:`assistant`,content:n}:{role:`assistant`,id:r.id,content:n};return i!==void 0&&(a.metadata=i),a},tool(e,t={}){return{role:`tool`,content:Array.isArray(e)?e:[e],...d(t)}},toolResult(e,t,n={}){let r=s(t)?t:o(t);return u.tool(i.toolResult(e,r,{callId:n.callId,toolName:n.toolName}),{metadata:n.metadata})}};function d(t){if(t.metadata===void 0)return{};if(!e(t.metadata))throw TypeError(`Message metadata must be a strict JSON value.`);return{metadata:t.metadata}}function f(e){if(e.role!==`assistant`||!p(e.metadata))return;let t=e.metadata.anvia;if(!p(t))return;let n=t.generation;if(!p(n)||typeof n.provider!=`string`||typeof n.model!=`string`||!y(n.usage))return;let r={provider:n.provider,model:n.model,usage:{...n.usage,...n.usage.details===void 0?{}:{details:{...n.usage.details}}}};return m(n.contextUsage)&&(r.contextUsage={...n.contextUsage,model:{...n.contextUsage.model,context:{...n.contextUsage.model.context}}}),S(n.sources)&&(r.sources=n.sources.map(e=>({...e}))),C(n.providerToolCalls)&&(r.providerToolCalls=n.providerToolCalls.map(e=>({...e,...e.details===void 0?{}:{details:{...e.details}}}))),r}function p(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function m(e){if(!p(e)||!p(e.model))return!1;let t=e.model.context;if(typeof e.model.id==`string`&&p(t)&&g(t.contextWindow)&&_(t.maxInputTokens)&&_(t.maxOutputTokens)&&b(e.usedTokens)&&b(e.remainingTokens)&&v(e.usedPercent)&&v(e.remainingPercent)){let n=t.contextWindow,r=Math.max(0,n-e.usedTokens),i=Math.min(100,e.usedTokens/n*100),a=r/n*100;return e.remainingTokens===r&&h(e.usedPercent,i)&&h(e.remainingPercent,a)}return!1}function h(e,t){let n=Math.max(1,Math.abs(e),Math.abs(t));return Math.abs(e-t)<=2**-52*n*8}function g(e){return b(e)&&e>0}function _(e){return e===void 0||g(e)}function v(e){return b(e)&&e<=100}function y(e){return p(e)?b(e.inputTokens)&&b(e.outputTokens)&&b(e.totalTokens)&&b(e.cachedInputTokens)&&b(e.cacheCreationInputTokens)&&x(e.details):!1}function b(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0}function x(e){if(e===void 0)return!0;if(!p(e))return!1;let t,n=0;for(let[r,i]of Object.entries(e)){if(i===void 0||!b(i))return!1;r===`total`?t=i:n+=i}return t!==void 0&&t===n}function S(e){return Array.isArray(e)&&e.every(e=>p(e)&&e.type===`url`&&typeof e.url==`string`&&(e.title===void 0||typeof e.title==`string`)&&(e.id===void 0||typeof e.id==`string`)&&(e.startIndex===void 0||typeof e.startIndex==`number`)&&(e.endIndex===void 0||typeof e.endIndex==`number`))}function C(e){return Array.isArray(e)&&e.every(e=>p(e)&&typeof e.id==`string`&&typeof e.name==`string`&&(e.status===void 0||typeof e.status==`string`)&&(e.details===void 0||p(e.details)))}export{f as a,o as c,r as i,u as n,e as o,i as r,l as s,c as t};
2
- //# sourceMappingURL=chunk-ADH7NNCS-DM6fsnDI.js.map