@anvia/studio 0.7.41 → 0.7.42

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 (31) hide show
  1. package/dist/ui/assets/{chunk-TIV3WFSR-BCFNcVBW.js → chunk-R6QERZAB-CzentEUZ.js} +2 -2
  2. package/dist/ui/assets/chunk-R6QERZAB-CzentEUZ.js.map +1 -0
  3. package/dist/ui/assets/{evals-page-CtsKzSlO.js → evals-page-CR1zsWxS.js} +2 -2
  4. package/dist/ui/assets/{evals-page-CtsKzSlO.js.map → evals-page-CR1zsWxS.js.map} +1 -1
  5. package/dist/ui/assets/{index-Br02DQhZ.js → index-C66C9CGh.js} +5 -5
  6. package/dist/ui/assets/{index-Br02DQhZ.js.map → index-C66C9CGh.js.map} +1 -1
  7. package/dist/ui/assets/{knowledge-page-4XUY0A05.js → knowledge-page-t_dYi3c5.js} +2 -2
  8. package/dist/ui/assets/{knowledge-page-4XUY0A05.js.map → knowledge-page-t_dYi3c5.js.map} +1 -1
  9. package/dist/ui/assets/{mcps-page-D2bfql9X.js → mcps-page-Cd2dn0-7.js} +2 -2
  10. package/dist/ui/assets/{mcps-page-D2bfql9X.js.map → mcps-page-Cd2dn0-7.js.map} +1 -1
  11. package/dist/ui/assets/{memory-page-Bv_jKRIe.js → memory-page-f80T-0fS.js} +2 -2
  12. package/dist/ui/assets/{memory-page-Bv_jKRIe.js.map → memory-page-f80T-0fS.js.map} +1 -1
  13. package/dist/ui/assets/{pipelines-page-Ccc7drvi.js → pipelines-page-DMWimh3n.js} +2 -2
  14. package/dist/ui/assets/{pipelines-page-Ccc7drvi.js.map → pipelines-page-DMWimh3n.js.map} +1 -1
  15. package/dist/ui/assets/{sandboxes-page-lr90zS3G.js → sandboxes-page-CtS1MtOm.js} +2 -2
  16. package/dist/ui/assets/{sandboxes-page-lr90zS3G.js.map → sandboxes-page-CtS1MtOm.js.map} +1 -1
  17. package/dist/ui/assets/{sessions-page-_9Crnndq.js → sessions-page-DPx8oYf3.js} +2 -2
  18. package/dist/ui/assets/{sessions-page-_9Crnndq.js.map → sessions-page-DPx8oYf3.js.map} +1 -1
  19. package/dist/ui/assets/{status-page-BguURb9e.js → status-page-CP-rdN2T.js} +2 -2
  20. package/dist/ui/assets/{status-page-BguURb9e.js.map → status-page-CP-rdN2T.js.map} +1 -1
  21. package/dist/ui/assets/{tool-runner-Doo0UBcS.js → tool-runner-CKSY-Xu1.js} +2 -2
  22. package/dist/ui/assets/{tool-runner-Doo0UBcS.js.map → tool-runner-CKSY-Xu1.js.map} +1 -1
  23. package/dist/ui/assets/{tools-page-Bl4RGn6w.js → tools-page-BgP8S9Cm.js} +2 -2
  24. package/dist/ui/assets/{tools-page-Bl4RGn6w.js.map → tools-page-BgP8S9Cm.js.map} +1 -1
  25. package/dist/ui/assets/{trace-browser-B-5APgrF.js → trace-browser-CJNK5BWY.js} +2 -2
  26. package/dist/ui/assets/{trace-browser-B-5APgrF.js.map → trace-browser-CJNK5BWY.js.map} +1 -1
  27. package/dist/ui/assets/{transcript-item-oaLLzHaS.js → transcript-item-BO57NvIn.js} +2 -2
  28. package/dist/ui/assets/{transcript-item-oaLLzHaS.js.map → transcript-item-BO57NvIn.js.map} +1 -1
  29. package/dist/ui/index.html +2 -2
  30. package/package.json +4 -4
  31. package/dist/ui/assets/chunk-TIV3WFSR-BCFNcVBW.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{n as i}from"./format-D43vTqrO.js";import{G as a,I as o,J as s,L as c,Y as l,n as u,nt as d,st as f,t as p}from"./index-Br02DQhZ.js";import{t as m}from"./badge-D7D2A73-.js";import{i as h,r as g}from"./renderers-BgRlCTll.js";var _=n(e(),1),v=t(),y=(0,_.memo)(function(e){let t=e.displayText??(`text`in e.entry?e.entry.text:``);if(e.entry.kind===`reasoning`)return(0,v.jsxs)(`article`,{className:`max-w-205 justify-self-start text-muted-foreground`,"data-entry-id":String(e.entry.entryId),children:[(0,v.jsx)(`div`,{className:`mb-1 text-xs font-semibold uppercase text-muted-foreground`,children:`Reasoning`}),(0,v.jsx)(g,{live:e.live,size:`base`,text:t})]});if(e.entry.kind===`tool`)return(0,v.jsx)(j,{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`&&A(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||e.workingStartedAt!==void 0||c!==void 0;return e.entry.role===`user`?(0,v.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,v.jsx)(`div`,{className:`rounded-2xl bg-muted/55 px-4 py-2.5 shadow-sm shadow-black/[0.04] dark:bg-white/[0.08] dark:shadow-black/20`,children:(0,v.jsx)(g,{size:`base`,text:e.entry.text})}),e.entry.attachments===void 0?null:(0,v.jsx)(k,{attachments:e.entry.attachments})]}):(0,v.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,v.jsx)(O,{}):null,t.trim().length===0?null:(0,v.jsx)(g,{live:e.live,size:`base`,text:t}),l?(0,v.jsx)(b,{metrics:e.metrics,showActions:s,text:e.entry.text,traceId:n,durationMs:e.workingStartedAt===void 0?c:void 0,startedAt:e.workingStartedAt,onOpenTrace:e.onOpenTrace}):null]})});function b(e){let[t,n]=(0,_.useState)(!1),r=e.traceId;async function i(){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,v.jsxs)(`div`,{className:`mt-3 flex min-w-0 items-center gap-1.5`,children:[e.showActions?(0,v.jsx)(c,{"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 i(),children:(0,v.jsx)(o,{icon:t?l:s,"aria-hidden":`true`})}):null,e.showActions?(0,v.jsxs)(`div`,{className:`group relative`,children:[(0,v.jsx)(c,{"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:T(e.metrics),type:`button`,variant:`ghost`,children:(0,v.jsx)(o,{icon:a,"aria-hidden":`true`})}),(0,v.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,v.jsx)(x,{metrics:e.metrics})})]}):null,!e.showActions||r===void 0?null:(0,v.jsx)(c,{"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,v.jsx)(o,{icon:d,"aria-hidden":`true`})}),(0,v.jsx)(p,{className:e.showActions?`ml-1.5`:void 0,durationMs:e.durationMs,startedAt:e.startedAt})]})}function x(e){let t=C(e.metrics);return(0,v.jsxs)(`div`,{className:`grid min-w-0 gap-2 text-xs leading-5`,children:[(0,v.jsx)(`div`,{className:`font-semibold text-foreground`,children:`Response metrics`}),(0,v.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,v.jsx)(S,{label:`Cost`,value:`Unavailable`}),t.length===0?(0,v.jsx)(`div`,{className:`text-muted-foreground`,children:`No usage metrics yet`}):t.map(e=>(0,v.jsx)(S,{label:e.label,value:e.value},e.label))]})]})}function S(e){return(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,v.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,v.jsx)(`span`,{className:`shrink-0 font-medium tabular-nums text-foreground`,children:e.value})]})}function C(e){let t=[],n=e?.usage;return n?.totalTokens!==void 0&&t.push({label:`Total`,value:`${E(n.totalTokens)} tokens`}),n?.inputTokens!==void 0&&t.push({label:`Input`,value:E(n.inputTokens)}),n?.outputTokens!==void 0&&t.push({label:`Output`,value:E(n.outputTokens)}),w(t,`Cached`,n,`cachedInputTokens`),w(t,`Cache create`,n,`cacheCreationInputTokens`),e?.durationMs!==void 0&&t.push({label:`Duration`,value:D(e.durationMs)}),t}function w(e,t,n,r){let i=n?.[r];i!==void 0&&i>0&&e.push({label:t,value:E(i)})}function T(e){let t=C(e);return t.length===0?`Cost unavailable. No usage metrics yet.`:[`Cost unavailable`,...t.map(e=>`${e.label}: ${e.value}`)].join(`. `)}function E(e){return e.toLocaleString()}function D(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function O(){return(0,v.jsxs)(`div`,{"aria-label":`Assistant is responding`,className:`inline-flex h-9 min-h-9 items-center gap-2 rounded-xl border border-border/70 bg-muted/35 px-3 text-muted-foreground shadow-sm`,role:`status`,children:[(0,v.jsxs)(`span`,{className:`flex items-center gap-1`,"aria-hidden":`true`,children:[(0,v.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-foreground`}),(0,v.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-foreground [animation-delay:150ms]`}),(0,v.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-foreground [animation-delay:300ms]`})]}),(0,v.jsx)(`span`,{className:` text-xs font-semibold uppercase text-muted-foreground`,children:`Thinking`})]})}function k(e){return(0,v.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,v.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-border/80 bg-card/80`,children:t===void 0?(0,v.jsx)(`div`,{className:`grid h-20 w-24 place-items-center px-2 text-center text-xs text-muted-foreground`,children:`Image`}):(0,v.jsx)(`img`,{alt:e.name??`Attached image`,className:`h-20 w-24 object-cover`,src:t})},n)}return(0,v.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,v.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name??e.mediaType??`Document`})},n)})})}function A(e){let t=e.split(`
1
+ import{i as e,r as t,s as n,t as r}from"./utils-C9GMruoG.js";import{n as i}from"./format-D43vTqrO.js";import{G as a,I as o,J as s,L as c,Y as l,n as u,nt as d,st as f,t as p}from"./index-C66C9CGh.js";import{t as m}from"./badge-D7D2A73-.js";import{i as h,r as g}from"./renderers-BgRlCTll.js";var _=n(e(),1),v=t(),y=(0,_.memo)(function(e){let t=e.displayText??(`text`in e.entry?e.entry.text:``);if(e.entry.kind===`reasoning`)return(0,v.jsxs)(`article`,{className:`max-w-205 justify-self-start text-muted-foreground`,"data-entry-id":String(e.entry.entryId),children:[(0,v.jsx)(`div`,{className:`mb-1 text-xs font-semibold uppercase text-muted-foreground`,children:`Reasoning`}),(0,v.jsx)(g,{live:e.live,size:`base`,text:t})]});if(e.entry.kind===`tool`)return(0,v.jsx)(j,{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`&&A(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||e.workingStartedAt!==void 0||c!==void 0;return e.entry.role===`user`?(0,v.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,v.jsx)(`div`,{className:`rounded-2xl bg-muted/55 px-4 py-2.5 shadow-sm shadow-black/[0.04] dark:bg-white/[0.08] dark:shadow-black/20`,children:(0,v.jsx)(g,{size:`base`,text:e.entry.text})}),e.entry.attachments===void 0?null:(0,v.jsx)(k,{attachments:e.entry.attachments})]}):(0,v.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,v.jsx)(O,{}):null,t.trim().length===0?null:(0,v.jsx)(g,{live:e.live,size:`base`,text:t}),l?(0,v.jsx)(b,{metrics:e.metrics,showActions:s,text:e.entry.text,traceId:n,durationMs:e.workingStartedAt===void 0?c:void 0,startedAt:e.workingStartedAt,onOpenTrace:e.onOpenTrace}):null]})});function b(e){let[t,n]=(0,_.useState)(!1),r=e.traceId;async function i(){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,v.jsxs)(`div`,{className:`mt-3 flex min-w-0 items-center gap-1.5`,children:[e.showActions?(0,v.jsx)(c,{"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 i(),children:(0,v.jsx)(o,{icon:t?l:s,"aria-hidden":`true`})}):null,e.showActions?(0,v.jsxs)(`div`,{className:`group relative`,children:[(0,v.jsx)(c,{"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:T(e.metrics),type:`button`,variant:`ghost`,children:(0,v.jsx)(o,{icon:a,"aria-hidden":`true`})}),(0,v.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,v.jsx)(x,{metrics:e.metrics})})]}):null,!e.showActions||r===void 0?null:(0,v.jsx)(c,{"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,v.jsx)(o,{icon:d,"aria-hidden":`true`})}),(0,v.jsx)(p,{className:e.showActions?`ml-1.5`:void 0,durationMs:e.durationMs,startedAt:e.startedAt})]})}function x(e){let t=C(e.metrics);return(0,v.jsxs)(`div`,{className:`grid min-w-0 gap-2 text-xs leading-5`,children:[(0,v.jsx)(`div`,{className:`font-semibold text-foreground`,children:`Response metrics`}),(0,v.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,v.jsx)(S,{label:`Cost`,value:`Unavailable`}),t.length===0?(0,v.jsx)(`div`,{className:`text-muted-foreground`,children:`No usage metrics yet`}):t.map(e=>(0,v.jsx)(S,{label:e.label,value:e.value},e.label))]})]})}function S(e){return(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,v.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,v.jsx)(`span`,{className:`shrink-0 font-medium tabular-nums text-foreground`,children:e.value})]})}function C(e){let t=[],n=e?.usage;return n?.totalTokens!==void 0&&t.push({label:`Total`,value:`${E(n.totalTokens)} tokens`}),n?.inputTokens!==void 0&&t.push({label:`Input`,value:E(n.inputTokens)}),n?.outputTokens!==void 0&&t.push({label:`Output`,value:E(n.outputTokens)}),w(t,`Cached`,n,`cachedInputTokens`),w(t,`Cache create`,n,`cacheCreationInputTokens`),e?.durationMs!==void 0&&t.push({label:`Duration`,value:D(e.durationMs)}),t}function w(e,t,n,r){let i=n?.[r];i!==void 0&&i>0&&e.push({label:t,value:E(i)})}function T(e){let t=C(e);return t.length===0?`Cost unavailable. No usage metrics yet.`:[`Cost unavailable`,...t.map(e=>`${e.label}: ${e.value}`)].join(`. `)}function E(e){return e.toLocaleString()}function D(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function O(){return(0,v.jsxs)(`div`,{"aria-label":`Assistant is responding`,className:`inline-flex h-9 min-h-9 items-center gap-2 rounded-xl border border-border/70 bg-muted/35 px-3 text-muted-foreground shadow-sm`,role:`status`,children:[(0,v.jsxs)(`span`,{className:`flex items-center gap-1`,"aria-hidden":`true`,children:[(0,v.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-foreground`}),(0,v.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-foreground [animation-delay:150ms]`}),(0,v.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-foreground [animation-delay:300ms]`})]}),(0,v.jsx)(`span`,{className:` text-xs font-semibold uppercase text-muted-foreground`,children:`Thinking`})]})}function k(e){return(0,v.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,v.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-border/80 bg-card/80`,children:t===void 0?(0,v.jsx)(`div`,{className:`grid h-20 w-24 place-items-center px-2 text-center text-xs text-muted-foreground`,children:`Image`}):(0,v.jsx)(`img`,{alt:e.name??`Attached image`,className:`h-20 w-24 object-cover`,src:t})},n)}return(0,v.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,v.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name??e.mediaType??`Document`})},n)})})}function A(e){let t=e.split(`
2
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 j(e){let[t,n]=(0,_.useState)(e.entry.approval?.status!==`pending`&&e.entry.question?.status!==`pending`),i=e.entry.approval,a=e.entry.question,s=e.entry.childEvents??[],l=e.entry.args!==void 0||e.entry.result!==void 0||s.length>0||i!==void 0||a!==void 0,u=i?.status===`pending`,d=a?.status===`pending`,p=i?.status===`cancelled`||a?.status===`cancelled`,g=i!==void 0&&e.decidingApprovals.has(i.id),y=a!==void 0&&e.answeringQuestions.has(a.id);return(0,v.jsxs)(`article`,{className:`w-full justify-self-start overflow-hidden rounded-xl border border-border/80 bg-card/90 text-foreground shadow-sm shadow-black/20`,"data-entry-id":String(e.entry.entryId),children:[(0,v.jsxs)(`div`,{className:r(`flex min-w-0 items-center gap-2 px-3 py-2.5`,!t&&l&&`bg-muted/20`),children:[(0,v.jsxs)(c,{"aria-expanded":!t,className:`h-auto min-h-0 min-w-0 flex-1 justify-between 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,v.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,v.jsx)(`span`,{className:`grid h-6 w-4 shrink-0 place-items-center text-foreground`,children:(0,v.jsx)(o,{icon:f,className:`h-3.5 w-3.5`,"aria-hidden":`true`})}),(0,v.jsx)(`strong`,{className:`min-w-0 truncate text-sm font-semibold text-foreground`,children:e.entry.toolName})]}),u?null:(0,v.jsx)(`span`,{className:`ml-auto shrink-0 text-xs font-medium text-muted-foreground`,children:t?`Show`:`Hide`})]}),u&&i!==void 0?(0,v.jsx)(L,{disabled:g,onDecision:t=>e.onApprovalDecision(i.id,t)}):null,d?(0,v.jsx)(m,{className:`border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-foreground`,children:`Waiting for input`}):null,p?(0,v.jsx)(m,{className:`border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-muted-foreground`,children:`Cancelled`}):null,u||d?(0,v.jsx)(c,{"aria-expanded":!t,className:`h-7 min-h-7 px-2 text-xs font-medium`,size:`sm`,type:`button`,variant:`ghost`,onClick:()=>n(e=>!e),children:t?`Show`:`Hide`}):null]}),t||!l?null:(0,v.jsxs)(`div`,{className:`grid gap-3 p-3`,children:[i===void 0?null:(0,v.jsx)(I,{approval:i}),a===void 0?null:(0,v.jsx)(N,{disabled:y,question:a,onAnswer:t=>e.onQuestionAnswer(a.id,t)}),a!==void 0||e.entry.args===void 0?null:(0,v.jsx)(h,{title:`Input`,value:e.entry.args}),s.length===0?null:(0,v.jsx)(M,{events:s}),a!==void 0||e.entry.result===void 0?null:(0,v.jsx)(h,{title:`Output`,value:e.entry.result})]})]})}function M(e){return(0,v.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/80 bg-background/65`,children:[(0,v.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,v.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,v.jsxs)(`div`,{className:`grid gap-1 rounded-xl border border-border/80 bg-card/90 p-3`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,v.jsx)(m,{className:`border-border bg-muted px-1.5 py-0.5 text-xs uppercase text-muted-foreground`,children:e.kind===`reasoning`?`Reasoning`:`Response`}),(0,v.jsx)(`span`,{className:`min-w-0 truncate text-xs font-semibold text-muted-foreground`,children:t})]}),(0,v.jsx)(g,{size:`base`,text:e.text})]},`${e.kind}-${e.agentId}-${e.text}`):(0,v.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/80 bg-card/90 p-3`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,v.jsx)(m,{className:`border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-foreground`,children:`Tool`}),(0,v.jsxs)(`span`,{className:`min-w-0 truncate text-xs font-semibold text-muted-foreground`,children:[t,` / `,e.toolName]})]}),e.args===void 0?null:(0,v.jsx)(h,{title:`Input`,value:e.args}),e.result===void 0?null:(0,v.jsx)(h,{title:`Output`,value:e.result})]},`${e.kind}-${e.agentId}-${e.toolName}-${e.callId??e.args??e.result??``}`)})})]})}function N(e){let[t,n]=(0,_.useState)({}),[r,i]=(0,_.useState)(0),a=e.question.status===`pending`,o=e.question.questions.length,s=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=o===0?0:Math.min(r,o-1),u=e.question.questions[l],d=s[l]?.answer??``,f=s.filter(e=>e.answer.length>0).length,p=d.length>0,m=a&&s.every(e=>e.answer.length>0),h=l===0,g=l>=o-1;if(u===void 0)return(0,v.jsx)(`div`,{className:`rounded-xl border border-border bg-background p-4 text-sm font-medium text-muted-foreground`,children:`No questions`});let y=()=>i(e=>Math.max(0,e-1)),b=()=>i(t=>Math.min(e.question.questions.length-1,t+1)),x=(e,t)=>n(n=>({...n,[e]:t}));return(0,v.jsxs)(`div`,{className:`grid gap-3`,children:[e.question.status===`cancelled`?(0,v.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,v.jsx)(P,{disabled:e.disabled||!a,index:l,total:o,question:u,value:t[u.id],answer:e.question.answers?.find(e=>e.questionId===u.id),onChange:e=>x(u.id,e),onAdvance:g?void 0:b},u.id),a?(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-xl bg-muted/20 px-3 py-2`,children:[(0,v.jsxs)(`div`,{className:`min-w-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:[f,`/`,o,` answered`]}),(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[h?null:(0,v.jsx)(c,{type:`button`,variant:`secondary`,onClick:y,children:`Back`}),g?(0,v.jsx)(c,{className:`h-9 min-h-9 px-4`,disabled:e.disabled||!m,type:`button`,onClick:()=>e.onAnswer(s),children:`Submit answers`}):(0,v.jsx)(c,{className:`h-9 min-h-9 px-4`,disabled:e.disabled||!p,type:`button`,onClick:b,children:`Next question`})]})]}):o>1?(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-xl bg-muted/20 px-3 py-2`,children:[(0,v.jsx)(`div`,{className:`min-w-0 text-xs font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Answered`}),(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,v.jsx)(c,{disabled:h,type:`button`,variant:`secondary`,onClick:y,children:`Back`}),(0,v.jsx)(c,{disabled:g,type:`button`,variant:`secondary`,onClick:b,children:`Next`})]})]}):null]})}function P(e){let t=e.answer?.answer,n=F(e.value),i=t===void 0?n.length>0?`Ready`:`Waiting`:`Answered`;return(0,v.jsxs)(`section`,{className:`grid gap-4 rounded-xl border border-border/80 bg-background/70 p-4`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,v.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,v.jsxs)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:[`Question `,e.index+1,` of `,e.total]}),(0,v.jsx)(`h3`,{className:`m-0 text-base font-semibold leading-7 text-foreground [overflow-wrap:anywhere]`,children:e.question.question})]}),(0,v.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,v.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,v.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.question.choices.map(t=>{let n=e.value?.choice===t.value;return(0,v.jsx)(c,{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,v.jsx)(u,{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 F(e){let t=e?.customValue?.trim()??``;return t.length>0?t:e?.answer?.trim()??``}function I(e){return(0,v.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/70 bg-muted/25 px-3 py-2.5`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,v.jsx)(m,{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,v.jsx)(`div`,{className:`min-w-0`,children:(0,v.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:i(e.approval)})})]}),e.approval.reason===void 0?null:(0,v.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground [overflow-wrap:anywhere]`,children:e.approval.reason})]})}function L(e){return(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-border/80 bg-background/55 p-0.5`,children:[(0,v.jsx)(c,{className:`h-7 min-h-7 rounded-md border-0 bg-transparent px-2.5 text-xs 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,v.jsx)(c,{className:`h-7 min-h-7 rounded-md px-2.5 text-xs`,disabled:e.disabled,size:`sm`,type:`button`,onClick:()=>e.onDecision(!0),children:`Approve`})]})}export{y as TranscriptItem};
3
- //# sourceMappingURL=transcript-item-oaLLzHaS.js.map
3
+ //# sourceMappingURL=transcript-item-BO57NvIn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transcript-item-oaLLzHaS.js","names":[],"sources":["../../../src/ui/app/modules/playground/transcript-item.tsx"],"sourcesContent":["import {\n ChartBarLineIcon,\n Copy01Icon,\n CopyCheckIcon,\n PathIcon,\n Wrench01Icon,\n} from \"@hugeicons/core-free-icons\";\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 workingStartedAt?: number | 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 =\n showAssistantActions ||\n props.workingStartedAt !== undefined ||\n 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/55 px-4 py-2.5 shadow-sm shadow-black/[0.04] dark:bg-white/[0.08] dark:shadow-black/20\">\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={props.workingStartedAt === undefined ? persistedDurationMs : undefined}\n startedAt={props.workingStartedAt}\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 startedAt?: number | undefined;\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 ? CopyCheckIcon : Copy01Icon} 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={ChartBarLineIcon} 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={PathIcon} aria-hidden=\"true\" />\n </Button>\n )}\n <WorkingDuration\n className={props.showActions ? \"ml-1.5\" : undefined}\n durationMs={props.durationMs}\n startedAt={props.startedAt}\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 responding\"\n className=\"inline-flex h-9 min-h-9 items-center gap-2 rounded-xl border border-border/70 bg-muted/35 px-3 text-muted-foreground shadow-sm\"\n role=\"status\"\n >\n <span className=\"flex items-center gap-1\" aria-hidden=\"true\">\n <span className=\"h-1.5 w-1.5 animate-pulse rounded-full bg-foreground\" />\n <span className=\"h-1.5 w-1.5 animate-pulse rounded-full bg-foreground [animation-delay:150ms]\" />\n <span className=\"h-1.5 w-1.5 animate-pulse rounded-full bg-foreground [animation-delay:300ms]\" />\n </span>\n <span className=\" text-xs font-semibold uppercase text-muted-foreground\">Thinking</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 deciding = approval !== undefined && props.decidingApprovals.has(approval.id);\n const answering = question !== undefined && props.answeringQuestions.has(question.id);\n\n return (\n <article\n className=\"w-full justify-self-start overflow-hidden rounded-xl border border-border/80 bg-card/90 text-foreground shadow-sm shadow-black/20\"\n data-entry-id={String(props.entry.entryId)}\n >\n <div\n className={cn(\n \"flex min-w-0 items-center gap-2 px-3 py-2.5\",\n !collapsed && hasPayload && \"bg-muted/20\",\n )}\n >\n <Button\n aria-expanded={!collapsed}\n className=\"h-auto min-h-0 min-w-0 flex-1 justify-between 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=\"flex min-w-0 items-center gap-2\">\n <span className=\"grid h-6 w-4 shrink-0 place-items-center text-foreground\">\n <StudioIcon icon={Wrench01Icon} className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </span>\n <strong className=\"min-w-0 truncate text-sm font-semibold text-foreground\">\n {props.entry.toolName}\n </strong>\n </span>\n {pendingApproval ? null : (\n <span className=\"ml-auto shrink-0 text-xs font-medium text-muted-foreground\">\n {collapsed ? \"Show\" : \"Hide\"}\n </span>\n )}\n </Button>\n {pendingApproval && approval !== undefined ? (\n <ToolApprovalActions\n disabled={deciding}\n onDecision={(approved) => props.onApprovalDecision(approval.id, approved)}\n />\n ) : null}\n {pendingQuestion ? (\n <Badge className=\"border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-foreground\">\n Waiting for input\n </Badge>\n ) : null}\n {cancelledInteraction ? (\n <Badge className=\"border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-muted-foreground\">\n Cancelled\n </Badge>\n ) : null}\n {pendingApproval || pendingQuestion ? (\n <Button\n aria-expanded={!collapsed}\n className=\"h-7 min-h-7 px-2 text-xs font-medium\"\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setCollapsed((current) => !current)}\n >\n {collapsed ? \"Show\" : \"Hide\"}\n </Button>\n ) : null}\n </div>\n {collapsed || !hasPayload ? null : (\n <div className=\"grid gap-3 p-3\">\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 rounded-lg border border-border/80 bg-background/55 p-0.5\">\n <Button\n className=\"h-7 min-h-7 rounded-md border-0 bg-transparent px-2.5 text-xs 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-7 min-h-7 rounded-md px-2.5 text-xs\"\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"],"mappings":"wTAmBa,GAAA,EAAA,EAAA,MAAsB,SAAwB,EAcxD,CACD,IAAM,EAAc,EAAM,cAAgB,SAAU,EAAM,MAAQ,EAAM,MAAM,KAAO,IACrF,GAAI,EAAM,MAAM,OAAS,YACvB,OACE,EAAA,EAAA,MAAC,UAAD,CACE,UAAU,qDACV,gBAAe,OAAO,EAAM,MAAM,QAAQ,UAF5C,EAIE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,sEAA6D,YAAe,CAAA,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"transcript-item-BO57NvIn.js","names":[],"sources":["../../../src/ui/app/modules/playground/transcript-item.tsx"],"sourcesContent":["import {\n ChartBarLineIcon,\n Copy01Icon,\n CopyCheckIcon,\n PathIcon,\n Wrench01Icon,\n} from \"@hugeicons/core-free-icons\";\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 workingStartedAt?: number | 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 =\n showAssistantActions ||\n props.workingStartedAt !== undefined ||\n 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/55 px-4 py-2.5 shadow-sm shadow-black/[0.04] dark:bg-white/[0.08] dark:shadow-black/20\">\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={props.workingStartedAt === undefined ? persistedDurationMs : undefined}\n startedAt={props.workingStartedAt}\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 startedAt?: number | undefined;\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 ? CopyCheckIcon : Copy01Icon} 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={ChartBarLineIcon} 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={PathIcon} aria-hidden=\"true\" />\n </Button>\n )}\n <WorkingDuration\n className={props.showActions ? \"ml-1.5\" : undefined}\n durationMs={props.durationMs}\n startedAt={props.startedAt}\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 responding\"\n className=\"inline-flex h-9 min-h-9 items-center gap-2 rounded-xl border border-border/70 bg-muted/35 px-3 text-muted-foreground shadow-sm\"\n role=\"status\"\n >\n <span className=\"flex items-center gap-1\" aria-hidden=\"true\">\n <span className=\"h-1.5 w-1.5 animate-pulse rounded-full bg-foreground\" />\n <span className=\"h-1.5 w-1.5 animate-pulse rounded-full bg-foreground [animation-delay:150ms]\" />\n <span className=\"h-1.5 w-1.5 animate-pulse rounded-full bg-foreground [animation-delay:300ms]\" />\n </span>\n <span className=\" text-xs font-semibold uppercase text-muted-foreground\">Thinking</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 deciding = approval !== undefined && props.decidingApprovals.has(approval.id);\n const answering = question !== undefined && props.answeringQuestions.has(question.id);\n\n return (\n <article\n className=\"w-full justify-self-start overflow-hidden rounded-xl border border-border/80 bg-card/90 text-foreground shadow-sm shadow-black/20\"\n data-entry-id={String(props.entry.entryId)}\n >\n <div\n className={cn(\n \"flex min-w-0 items-center gap-2 px-3 py-2.5\",\n !collapsed && hasPayload && \"bg-muted/20\",\n )}\n >\n <Button\n aria-expanded={!collapsed}\n className=\"h-auto min-h-0 min-w-0 flex-1 justify-between 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=\"flex min-w-0 items-center gap-2\">\n <span className=\"grid h-6 w-4 shrink-0 place-items-center text-foreground\">\n <StudioIcon icon={Wrench01Icon} className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </span>\n <strong className=\"min-w-0 truncate text-sm font-semibold text-foreground\">\n {props.entry.toolName}\n </strong>\n </span>\n {pendingApproval ? null : (\n <span className=\"ml-auto shrink-0 text-xs font-medium text-muted-foreground\">\n {collapsed ? \"Show\" : \"Hide\"}\n </span>\n )}\n </Button>\n {pendingApproval && approval !== undefined ? (\n <ToolApprovalActions\n disabled={deciding}\n onDecision={(approved) => props.onApprovalDecision(approval.id, approved)}\n />\n ) : null}\n {pendingQuestion ? (\n <Badge className=\"border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-foreground\">\n Waiting for input\n </Badge>\n ) : null}\n {cancelledInteraction ? (\n <Badge className=\"border-border/70 bg-muted/45 px-1.5 py-0.5 text-xs uppercase text-muted-foreground\">\n Cancelled\n </Badge>\n ) : null}\n {pendingApproval || pendingQuestion ? (\n <Button\n aria-expanded={!collapsed}\n className=\"h-7 min-h-7 px-2 text-xs font-medium\"\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setCollapsed((current) => !current)}\n >\n {collapsed ? \"Show\" : \"Hide\"}\n </Button>\n ) : null}\n </div>\n {collapsed || !hasPayload ? null : (\n <div className=\"grid gap-3 p-3\">\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 rounded-lg border border-border/80 bg-background/55 p-0.5\">\n <Button\n className=\"h-7 min-h-7 rounded-md border-0 bg-transparent px-2.5 text-xs 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-7 min-h-7 rounded-md px-2.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8EACZ,EAAM,SAAS,OACZ,CAAA,CAEJ,GAIV,SAAS,EAAoB,EAG1B,CACD,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,sGAAf,EACE,EAAA,EAAA,KAAC,EAAD,CACE,UAAU,iJACV,SAAU,EAAM,SAChB,KAAK,KACL,KAAK,SACL,QAAQ,QACR,YAAe,EAAM,WAAW,GAAM,UACvC,SAEQ,CAAA,EACT,EAAA,EAAA,KAAC,EAAD,CACE,UAAU,wCACV,SAAU,EAAM,SAChB,KAAK,KACL,KAAK,SACL,YAAe,EAAM,WAAW,GAAK,UACtC,UAEQ,CAAA,CACL"}
@@ -9,9 +9,9 @@
9
9
  content="Professional Studio interface for Anvia agents, sessions, tools, knowledge, and traces."
10
10
  />
11
11
  <link rel="icon" type="image/png" href="/ui/assets/anvia.png" />
12
- <script type="module" crossorigin src="/ui/assets/index-Br02DQhZ.js"></script>
12
+ <script type="module" crossorigin src="/ui/assets/index-C66C9CGh.js"></script>
13
13
  <link rel="modulepreload" crossorigin href="/ui/assets/utils-C9GMruoG.js">
14
- <link rel="modulepreload" crossorigin href="/ui/assets/chunk-TIV3WFSR-BCFNcVBW.js">
14
+ <link rel="modulepreload" crossorigin href="/ui/assets/chunk-R6QERZAB-CzentEUZ.js">
15
15
  <link rel="modulepreload" crossorigin href="/ui/assets/format-D43vTqrO.js">
16
16
  <link rel="stylesheet" crossorigin href="/ui/assets/index-CQmSyO8y.css">
17
17
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvia/studio",
3
- "version": "0.7.41",
3
+ "version": "0.7.42",
4
4
  "description": "Studio UI and HTTP runtime for Anvia agents.",
5
5
  "author": "anvia",
6
6
  "maintainer": "Indra Zulfi",
@@ -43,9 +43,9 @@
43
43
  "react": "^19.2.8",
44
44
  "react-dom": "^19.2.8",
45
45
  "tailwind-merge": "^3.6.0",
46
- "@anvia/react": "0.9.2",
46
+ "@anvia/react": "0.9.3",
47
47
  "@anvia/react-ui": "0.6.2",
48
- "@anvia/server": "0.5.13"
48
+ "@anvia/server": "0.5.14"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@tailwindcss/typography": "^0.5.19",
@@ -60,7 +60,7 @@
60
60
  "vite": "^8.0.10",
61
61
  "vitest": "^4.0.8",
62
62
  "zod": "^4.4.3",
63
- "@anvia/core": "0.15.0"
63
+ "@anvia/core": "0.16.0"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@anvia/core": ">=0.13.4 <1.0.0"
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunk-TIV3WFSR-BCFNcVBW.js","names":[],"sources":["../../../../core/dist/chunk-TIV3WFSR.js"],"sourcesContent":["// src/completion/json.ts\nfunction isJsonValue(value) {\n return isJsonValueWithAncestors(value, /* @__PURE__ */ new WeakSet());\n}\nfunction isJsonValueWithAncestors(value, ancestors) {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\") {\n return true;\n }\n if (typeof value === \"number\") {\n return Number.isFinite(value);\n }\n if (typeof value !== \"object\" || ancestors.has(value)) {\n return false;\n }\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n if (!hasOnlyDenseArrayProperties(value)) {\n return false;\n }\n for (let index = 0; index < value.length; index += 1) {\n if (!isJsonValueWithAncestors(value[index], ancestors)) {\n return false;\n }\n }\n return true;\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n return false;\n }\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== \"string\") {\n return false;\n }\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === void 0 || !descriptor.enumerable || !(\"value\" in descriptor) || !isJsonValueWithAncestors(descriptor.value, ancestors)) {\n return false;\n }\n }\n return true;\n } catch {\n return false;\n } finally {\n ancestors.delete(value);\n }\n}\nfunction hasOnlyDenseArrayProperties(value) {\n const keys = Reflect.ownKeys(value);\n if (keys.length !== value.length + 1 || keys.at(-1) !== \"length\") {\n return false;\n }\n for (let index = 0; index < value.length; index += 1) {\n const key = String(index);\n if (keys[index] !== key) {\n return false;\n }\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === void 0 || !descriptor.enumerable || !(\"value\" in descriptor)) {\n return false;\n }\n }\n return true;\n}\n\n// src/completion/types.ts\nvar UserContent = {\n text(text) {\n return { type: \"text\", text };\n },\n imageUrl(url, options = {}) {\n const image = { type: \"image\", source: { type: \"url\", url } };\n if (options.detail !== void 0) {\n image.detail = options.detail;\n }\n return image;\n },\n imageBase64(data, mediaType, options = {}) {\n const image = {\n type: \"image\",\n source: { type: \"base64\", data, mediaType }\n };\n if (options.detail !== void 0) {\n image.detail = options.detail;\n }\n return image;\n },\n documentUrl(url, mediaType, options = {}) {\n return {\n type: \"document\",\n source: options.filename === void 0 ? { type: \"url\", url, mediaType } : { type: \"url\", url, mediaType, filename: options.filename }\n };\n },\n documentBase64(data, mediaType, options = {}) {\n return {\n type: \"document\",\n source: options.filename === void 0 ? { type: \"base64\", data, mediaType } : { type: \"base64\", data, mediaType, filename: options.filename }\n };\n },\n documentText(text) {\n return { type: \"text\", text };\n }\n};\nvar ToolContent = {\n toolResult(id, content, callIdOrOptions, toolName) {\n const normalized = typeof content === \"string\" ? [{ type: \"text\", text: content }] : content;\n const options = normalizeToolResultOptions(callIdOrOptions, toolName);\n const result = { type: \"tool_result\", id, content: normalized };\n if (options.callId !== void 0) {\n result.callId = options.callId;\n }\n if (options.toolName !== void 0) {\n result.toolName = options.toolName;\n }\n return result;\n }\n};\nfunction normalizeToolResultOptions(callIdOrOptions, toolName) {\n if (callIdOrOptions === void 0) {\n return toolName === void 0 ? {} : { toolName };\n }\n if (typeof callIdOrOptions === \"string\") {\n return toolName === void 0 ? { callId: callIdOrOptions } : { callId: callIdOrOptions, toolName };\n }\n return toolName === void 0 ? callIdOrOptions : { ...callIdOrOptions, toolName };\n}\nfunction serializeToolResultOutput(output) {\n if (typeof output === \"string\") {\n return output;\n }\n try {\n const serialized = JSON.stringify(output);\n return serialized === void 0 ? String(output) : serialized;\n } catch {\n return String(output);\n }\n}\nfunction isToolResultContentArray(value) {\n return Array.isArray(value) && value.length > 0 && value.every((item) => {\n if (typeof item !== \"object\" || item === null || !(\"type\" in item)) {\n return false;\n }\n if (item.type === \"text\") {\n return \"text\" in item && typeof item.text === \"string\";\n }\n if (item.type === \"image\") {\n return \"data\" in item && typeof item.data === \"string\" && (!(\"mediaType\" in item) || item.mediaType === void 0 || typeof item.mediaType === \"string\");\n }\n return false;\n });\n}\nvar AssistantContent = {\n text(text) {\n return { type: \"text\", text };\n },\n imageUrl(url, options = {}) {\n const image = { type: \"image\", source: { type: \"url\", url } };\n if (options.detail !== void 0) {\n image.detail = options.detail;\n }\n return image;\n },\n imageBase64(data, mediaType, options = {}) {\n const image = {\n type: \"image\",\n source: { type: \"base64\", data, mediaType }\n };\n if (options.detail !== void 0) {\n image.detail = options.detail;\n }\n return image;\n },\n reasoning(text, id) {\n return id === void 0 ? { type: \"reasoning\", text } : { type: \"reasoning\", text, id };\n },\n reasoningFromContent(content, id) {\n const text = reasoningDisplayText(content);\n const reasoning = { type: \"reasoning\", text, content };\n return id === void 0 ? reasoning : { ...reasoning, id };\n },\n reasoningSummary(text, id) {\n return AssistantContent.reasoningFromContent([{ type: \"summary\", text }], id);\n },\n reasoningEncrypted(data, id) {\n return AssistantContent.reasoningFromContent([{ type: \"encrypted\", data }], id);\n },\n reasoningRedacted(data, id) {\n return AssistantContent.reasoningFromContent([{ type: \"redacted\", data }], id);\n },\n toolCall(id, name, args, callId) {\n const base = {\n type: \"tool_call\",\n id,\n function: {\n name,\n arguments: args\n }\n };\n return callId === void 0 ? base : { ...base, callId };\n }\n};\nfunction reasoningDisplayText(reasoning) {\n const content = Array.isArray(reasoning) ? reasoning : reasoning.content;\n if (content === void 0) {\n return Array.isArray(reasoning) ? \"\" : reasoning.text;\n }\n return content.flatMap((item) => {\n if (item.type === \"text\" || item.type === \"summary\") {\n return [item.text];\n }\n return [];\n }).join(\"\");\n}\nvar Message = {\n system(content, options = {}) {\n return { role: \"system\", content, ...messageMetadata(options) };\n },\n user(content, options = {}) {\n return {\n role: \"user\",\n content: typeof content === \"string\" ? [UserContent.text(content)] : content,\n ...messageMetadata(options)\n };\n },\n assistant(content, idOrOptions) {\n const normalized = typeof content === \"string\" ? [AssistantContent.text(content)] : content;\n const options = typeof idOrOptions === \"string\" ? { id: idOrOptions } : idOrOptions ?? {};\n const metadata = messageMetadata(options).metadata;\n const message = options.id === void 0 ? { role: \"assistant\", content: normalized } : { role: \"assistant\", id: options.id, content: normalized };\n if (metadata !== void 0) {\n message.metadata = metadata;\n }\n return message;\n },\n tool(content, options = {}) {\n return {\n role: \"tool\",\n content: Array.isArray(content) ? content : [content],\n ...messageMetadata(options)\n };\n },\n toolResult(id, output, options = {}) {\n const content = isToolResultContentArray(output) ? output : serializeToolResultOutput(output);\n return Message.tool(\n ToolContent.toolResult(id, content, {\n callId: options.callId,\n toolName: options.toolName\n }),\n { metadata: options.metadata }\n );\n }\n};\nfunction messageMetadata(options) {\n if (options.metadata === void 0) {\n return {};\n }\n if (!isJsonValue(options.metadata)) {\n throw new TypeError(\"Message metadata must be a strict JSON value.\");\n }\n return { metadata: options.metadata };\n}\nvar Usage = {\n empty() {\n return {\n inputTokens: 0,\n outputTokens: 0,\n totalTokens: 0,\n cachedInputTokens: 0,\n cacheCreationInputTokens: 0\n };\n },\n add(left, right) {\n return {\n inputTokens: left.inputTokens + right.inputTokens,\n outputTokens: left.outputTokens + right.outputTokens,\n totalTokens: left.totalTokens + right.totalTokens,\n cachedInputTokens: left.cachedInputTokens + right.cachedInputTokens,\n cacheCreationInputTokens: left.cacheCreationInputTokens + right.cacheCreationInputTokens\n };\n }\n};\nfunction getAssistantGenerationMetadata(message) {\n if (message.role !== \"assistant\" || !isJsonObjectValue(message.metadata)) {\n return void 0;\n }\n const frameworkMetadata = message.metadata.anvia;\n if (!isJsonObjectValue(frameworkMetadata)) {\n return void 0;\n }\n const generation = frameworkMetadata.generation;\n if (!isJsonObjectValue(generation) || typeof generation.provider !== \"string\" || typeof generation.model !== \"string\" || !isUsageValue(generation.usage)) {\n return void 0;\n }\n return {\n provider: generation.provider,\n model: generation.model,\n usage: { ...generation.usage }\n };\n}\nfunction isJsonObjectValue(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isUsageValue(value) {\n if (!isJsonObjectValue(value)) {\n return false;\n }\n return isNonnegativeFiniteNumber(value.inputTokens) && isNonnegativeFiniteNumber(value.outputTokens) && isNonnegativeFiniteNumber(value.totalTokens) && isNonnegativeFiniteNumber(value.cachedInputTokens) && isNonnegativeFiniteNumber(value.cacheCreationInputTokens);\n}\nfunction isNonnegativeFiniteNumber(value) {\n return typeof value === \"number\" && Number.isFinite(value) && value >= 0;\n}\nvar CompletionCapabilityError = class extends Error {\n constructor(message) {\n super(message);\n this.name = \"CompletionCapabilityError\";\n }\n};\nfunction assertCompletionRequestSupported(model, request, options = {}) {\n const modelLabel = `${model.provider}:${request.model ?? model.defaultModel}`;\n const capabilities = model.capabilities;\n if (options.streaming === true && !capabilities.streaming) {\n throw new CompletionCapabilityError(`${modelLabel} does not support streaming completions.`);\n }\n if (request.tools.length > 0 && !capabilities.tools) {\n throw new CompletionCapabilityError(`${modelLabel} does not support tool definitions.`);\n }\n if (request.toolChoice !== void 0 && !capabilities.toolChoice) {\n throw new CompletionCapabilityError(`${modelLabel} does not support tool choice.`);\n }\n if (request.outputSchema !== void 0 && !capabilities.outputSchema) {\n throw new CompletionCapabilityError(`${modelLabel} does not support output schemas.`);\n }\n if (!capabilities.imageInput && requestHasImageInput(request)) {\n throw new CompletionCapabilityError(`${modelLabel} does not support image input.`);\n }\n if (!capabilities.documentInput && requestHasFileDocumentInput(request)) {\n throw new CompletionCapabilityError(`${modelLabel} does not support document file input.`);\n }\n}\nfunction textFromAssistantContent(content) {\n return content.flatMap((item) => item.type === \"text\" ? [item.text] : []).join(\"\\n\");\n}\nfunction requestHasImageInput(request) {\n return request.chatHistory.some(\n (message) => message.role === \"system\" ? false : message.content.some((content) => content.type === \"image\")\n );\n}\nfunction requestHasFileDocumentInput(request) {\n return request.chatHistory.some(\n (message) => message.role === \"user\" ? message.content.some(\n (content) => content.type === \"document\" && content.source.type !== \"text\"\n ) : false\n );\n}\n\nexport {\n isJsonValue,\n UserContent,\n ToolContent,\n serializeToolResultOutput,\n isToolResultContentArray,\n AssistantContent,\n reasoningDisplayText,\n Message,\n Usage,\n getAssistantGenerationMetadata,\n CompletionCapabilityError,\n assertCompletionRequestSupported,\n textFromAssistantContent\n};\n//# sourceMappingURL=chunk-TIV3WFSR.js.map"],"mappings":"AACA,SAAS,EAAY,EAAO,CAC1B,OAAO,EAAyB,EAAuB,IAAI,QAAU,CAEvE,SAAS,EAAyB,EAAO,EAAW,CAClD,GAAI,IAAU,MAAQ,OAAO,GAAU,UAAY,OAAO,GAAU,UAClE,MAAO,GAET,GAAI,OAAO,GAAU,SACnB,OAAO,OAAO,SAAS,EAAM,CAE/B,GAAI,OAAO,GAAU,UAAY,EAAU,IAAI,EAAM,CACnD,MAAO,GAET,EAAU,IAAI,EAAM,CACpB,GAAI,CACF,GAAI,MAAM,QAAQ,EAAM,CAAE,CACxB,GAAI,CAAC,EAA4B,EAAM,CACrC,MAAO,GAET,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,GAAS,EACjD,GAAI,CAAC,EAAyB,EAAM,GAAQ,EAAU,CACpD,MAAO,GAGX,MAAO,GAET,IAAM,EAAY,OAAO,eAAe,EAAM,CAC9C,GAAI,IAAc,OAAO,WAAa,IAAc,KAClD,MAAO,GAET,IAAK,IAAM,KAAO,QAAQ,QAAQ,EAAM,CAAE,CACxC,GAAI,OAAO,GAAQ,SACjB,MAAO,GAET,IAAM,EAAa,OAAO,yBAAyB,EAAO,EAAI,CAC9D,GAAI,IAAe,IAAK,IAAK,CAAC,EAAW,YAAc,EAAE,UAAW,IAAe,CAAC,EAAyB,EAAW,MAAO,EAAU,CAC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