@ycodium-ai/plugin-conversation 0.2.2860 → 0.2.2862

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 (2) hide show
  1. package/assets/ui.js +1 -1
  2. package/package.json +2 -2
package/assets/ui.js CHANGED
@@ -3787,7 +3787,7 @@ ${a}`:r).join(`
3787
3787
  ${t.context.body}`:t.context.header;return u(YS,{label:t.context.header,tooltipText:n})}),oI=me(function(t){let n=t.context.body?`${t.context.header}
3788
3788
  ${t.context.body}`:t.context.header;return S(He,{children:[S($e,{render:u("span",{className:"inline-flex max-w-full items-center gap-1 rounded-md border border-border/70 bg-background/70 px-1.5 py-0.5 text-foreground/85 text-chat-row"}),children:[u(yr,{className:"size-3 shrink-0"}),u("span",{className:"truncate",children:t.context.header})]}),u(Ke,{side:"top",className:"max-w-96 whitespace-pre-wrap leading-tight",children:n})]})});function rI(e){let t=at(kt),{t:n}=Xe();return S("div",{className:"mb-2 flex max-w-full items-center overflow-hidden rounded-lg border border-border/70 bg-background/70",children:[e.image?.previewUrl?u("button",{type:"button",className:"size-14 shrink-0 cursor-zoom-in overflow-hidden border-r border-border/70 bg-muted","aria-label":n("attachments.preview",{name:e.image.name}),onClick:()=>{if(!e.image)return;let o=mf([e.image],e.image.id);o&&t.onImageExpand(o)},children:u("img",{src:e.image.previewUrl,alt:n("previewAnnotation.cropAlt"),className:"size-full object-cover"})}):null,S("div",{className:"min-w-0 px-2.5 py-2",children:[e.annotation.comment?u("div",{className:"max-w-80 truncate text-foreground text-chat-row font-medium",children:e.annotation.comment}):null,S("div",{className:K("flex items-center gap-2 text-secondary-label text-chat-meta",e.annotation.comment&&"mt-1"),children:[e.annotation.targetSummary?u("span",{className:"truncate",children:e.annotation.targetSummary}):null,e.annotation.styleChanges.length>0?S("span",{className:"inline-flex shrink-0 items-center gap-1",children:[u(vs,{className:"size-3"}),e.annotation.styleChanges.length]}):null]})]})]})}var lU=8,dU=600,cU=1.75,nI=`linear-gradient(to bottom, black calc(100% - ${cU}rem), transparent)`;function uU(e){return e.trim().length===0?!1:e.length>dU||e.split(`
3789
3789
  `).length>lU}var aI=me(function(t){let n=at(kt),{t:o}=Xe(),[r,a]=io(n.threadKey,`${t.disclosureKey}:expanded`,!1),s=t.text.trim().length>0||t.terminalContexts.length>0,i=s&&uU(t.text),l=i&&!r;return S("div",{children:[s?u("div",{className:K("relative",l&&"max-h-44 overflow-hidden"),"data-user-message-body":"true","data-user-message-collapsed":l?"true":"false","data-user-message-collapsible":i?"true":"false","data-user-message-fade":l?"true":"false",style:l?{WebkitMaskImage:nI,maskImage:nI}:void 0,children:u(fU,{disclosureKey:t.disclosureKey,text:t.text,terminalContexts:t.terminalContexts,skills:t.skills,markdownCwd:t.markdownCwd})}):null,i||t.footer?S("div",{className:K("mt-1.5 flex items-center gap-2",i&&t.footer?"justify-between":"justify-end"),"data-user-message-footer":"true",children:[i?u(ie,{type:"button",size:"xs",variant:"ghost","aria-expanded":r,"data-scroll-anchor-ignore":!0,onClick:()=>a(!r),className:"-ml-1 h-6 rounded-control-2 px-1.5 text-secondary-label text-chat-row hover:bg-muted/40 hover:text-message-foreground",children:o(r?"timeline.showLess":"timeline.expandMessage")}):null,t.footer?u("div",{className:"ml-auto flex items-center gap-2",children:t.footer}):null]}):null]})}),fU=me(function(t){let n=at(kt),o=(a,s)=>{let i=/^\s+/.exec(a)?.[0]??"",l=a.slice(i.length),d=/\s+$/.exec(l)?.[0]??"",c=l.slice(0,l.length-d.length);return S(zr,{children:[i?u("span",{"aria-hidden":"true",children:i}):null,c?u(yo,{disclosureKey:`${t.disclosureKey}:inline:${s}`,text:c,cwd:t.markdownCwd,threadRef:n.threadRef??void 0,skills:t.skills,className:"text-message-foreground",lineBreaks:!0,parseRawHtml:!1}):null,d?u("span",{"aria-hidden":"true",children:d}):null]},s)},r=vf(t.text);if(r.some(a=>a.kind==="review-comment"))return u("div",{className:"space-y-3 text-message-foreground text-chat",children:r.map(a=>a.kind==="text"?a.text.trim().length>0?u("div",{className:"wrap-break-word",children:u(yo,{disclosureKey:`${t.disclosureKey}:review:${a.id}`,text:a.text.trim(),cwd:t.markdownCwd,threadRef:n.threadRef??void 0,skills:t.skills,className:"text-message-foreground",lineBreaks:!0,parseRawHtml:!1})},a.id):null:u(pU,{comment:a.comment,disclosureKey:`${t.disclosureKey}:review-comment:${a.comment.id}`},a.comment.id))});if(t.terminalContexts.length>0){let a=eI(t.text,t.terminalContexts),s=ZS(t.terminalContexts),i=[];if(a){let l=0;for(let d of t.terminalContexts){let c=If(d.header),f=t.text.indexOf(c,l);if(f===-1){i.length=0;break}f>l&&i.push(o(t.text.slice(l,f),`user-terminal-context-inline-before:${d.header}:${l}`)),i.push(u(tI,{context:d},`user-terminal-context-inline:${d.header}`)),l=f+c.length}if(i.length>0)return l<t.text.length&&i.push(o(t.text.slice(l),`user-message-terminal-context-inline-rest:${l}`)),u("div",{className:"whitespace-pre-wrap wrap-break-word text-message-foreground text-chat",children:i})}for(let l of t.terminalContexts)i.push(u(tI,{context:l},`user-terminal-context-inline:${l.header}`)),i.push(u("span",{"aria-hidden":"true",children:" "},`user-terminal-context-inline-space:${l.header}`));if(t.text.length>0)i.push(u(yo,{disclosureKey:`${t.disclosureKey}:terminal-main`,text:t.text,cwd:t.markdownCwd,threadRef:n.threadRef??void 0,skills:t.skills,className:"text-message-foreground",lineBreaks:!0,parseRawHtml:!1,onImageExpand:n.onImageExpand},"user-message-terminal-context-inline-text"));else if(s.length===0)return null;return u("div",{className:"whitespace-pre-wrap wrap-break-word text-message-foreground text-chat",children:i})}return t.text.length===0?null:u(yo,{disclosureKey:`${t.disclosureKey}:body`,text:t.text,cwd:t.markdownCwd,threadRef:n.threadRef??void 0,skills:t.skills,className:"text-message-foreground",lineBreaks:!0,parseRawHtml:!1,onImageExpand:n.onImageExpand})});function pU({comment:e,disclosureKey:t}){let n=at(kt),{t:o}=Xe(),r=e.fenceLanguage??"diff",a=$S(e);return S("div",{className:"space-y-2 rounded-lg border border-border/70 bg-background/70 p-3",children:[S("div",{className:"space-y-1",children:[u("div",{className:"text-message-foreground text-chat-row font-medium",children:hf(e.filePath,n.workspaceRoot)}),S("div",{className:"text-secondary-label text-chat-dense",children:[e.sectionTitle??o("timeline.reviewCommentDefaultSection")," \xB7"," ",e.rangeLabel??o("timeline.reviewCommentDefaultRange")]})]}),e.text.length>0&&u("div",{className:"whitespace-pre-wrap wrap-break-word text-chat",children:u(XS,{text:e.text,skills:n.skills})}),r!=="diff"&&e.diff.trim().length>0&&u(yo,{disclosureKey:`${t}:fence`,text:KS(r,e.diff),cwd:n.markdownCwd,threadRef:n.threadRef??void 0,skills:n.skills,className:"text-message-foreground"}),a?u(rS,{patch:a}):null]})}var mU=/\n*<preview_annotation>\n((?:(?!<preview_annotation>)[\s\S])*)\n<\/preview_annotation>\s*$/;function wf(e){let t=mU.exec(e);if(!t)return{promptText:e,annotation:null};let n=t[1]??"",o=n.split(`
3790
- `),r=o.find(p=>p.startsWith("Page: ")),a=o.find(p=>p.startsWith("Id: ")),s=o.find(p=>p.startsWith("Comment: ")),i=o.find(p=>p.startsWith("Targets: ")),l=o.indexOf("Requested visual changes:"),d=o.slice(l+1),c=d.indexOf("<element_context>"),f=l<0?[]:d.slice(0,c<0?void 0:c).filter(p=>p.startsWith("- ")).map(p=>p.slice(2));return{promptText:e.slice(0,t.index).replace(/\n+$/,""),annotation:{id:a?.slice(4).trim()||`${t.index}`,title:r?.slice(6).trim()||"Preview annotation",comment:s?.slice(9).trim()||"",targetSummary:i?.slice(9).trim()||"",styleChanges:f,hasScreenshot:n.includes("The attached screenshot is the annotated preview crop.")}}}function sI({row:e,text:t}){let{t:n}=Xe(),o=at(kt),r=e.message.attachments??[],a=Sf(t),s=a.contexts,i=[],l=a.visibleText;for(;;){let C=wf(l);if(!C.annotation)break;i.unshift(C.annotation),l=C.promptText}let d=Fi(l),c=[...a.elementContexts,...d.contexts],f=r.filter(C=>C.name.startsWith("preview-annotation-")),p=r.filter(C=>!C.name.startsWith("preview-annotation-")),m=p.filter(C=>Tr(C)==="image"),h=p.filter(C=>Tr(C)!=="image"),g=e.message.author??null,v=g!==null&&g.userId!==(o.selfUserId??null),y=v?n("message.saidBy",{name:g.displayName}):n("message.saidByYou");return S("div",{className:`group/user flex min-w-0 flex-col gap-1 ${v?"items-start":"items-end"}`,role:"group","aria-label":y,tabIndex:-1,children:[v?u(gU,{author:g}):null,S("div",{...v?{"data-teammate-bubble":""}:{"data-user-bubble":""},className:`relative min-w-0 max-w-[min(70%,40rem)] rounded-[18px] px-3.5 py-2.5 text-pretty ${v?"border border-border/60 bg-teammate-bubble text-message-foreground":"bg-user-bubble text-user-bubble-foreground"}`,children:[u(Ud,{images:m}),h.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:h.map(C=>u(zd,{attachment:C},C.id))}),i.map((C,b)=>u(rI,{annotation:C,image:f[b]??null},C.id)),c.length>0?u("div",{className:"mb-2 flex flex-wrap gap-1.5",children:c.map(C=>u(oI,{context:C},`${C.header}:${C.body}`))}):null,u(aI,{disclosureKey:`message:${e.message.id}:user`,text:d.promptText,terminalContexts:s,skills:o.skills,markdownCwd:o.markdownCwd})]}),S("div",{"data-user-message-actions":"",className:"flex min-h-6 items-center gap-0.5 text-chat-row text-muted-foreground opacity-0 transition-opacity duration-(--control-duration) group-focus-within/user:opacity-100 group-hover/user:opacity-100",children:[S(He,{children:[u($e,{render:u("span",{tabIndex:0,className:"me-1 rounded-sm tabular-nums"}),children:Gr(e.message.createdAt,o.timestampFormat,n)}),u(Ke,{children:wr(e.message.createdAt,o.timestampFormat)})]}),o.onForkFromUserMessage!==null&&u(hU,{messageId:e.message.id,onFork:o.onForkFromUserMessage}),a.copyText&&u(Ts,{text:a.copyText,variant:"ghost"})]})]})}function gU({author:e}){return S("div",{className:"flex min-w-0 max-w-[min(70%,40rem)] items-center gap-1.5 text-chat-dense text-muted-foreground",children:[u(Ub,{userId:e.userId,displayName:e.displayName,size:16}),u("span",{className:"min-w-0 truncate",children:e.displayName})]})}function hU({messageId:e,onFork:t}){let{t:n}=Xe(),o=n("fork.action");return S(He,{children:[u($e,{render:u(ie,{type:"button",size:"xs",variant:"ghost",onClick:()=>t(e),"aria-label":o}),children:u(cd,{className:"size-3"})}),u(Ke,{side:"top",children:o})]})}function Xg({row:e}){let t=at(kt).derive;if(gf(e.message.text)){let n=t.parsePresetPrefixText(e.message.text);return n?S(xe,{children:[u(vU,{parsed:n}),n.body.length>0||(e.message.attachments?.length??0)>0?u(Xg,{row:{...e,message:{...e.message,text:n.body}}}):null]}):u(CU,{row:e})}return u(sI,{row:e,text:e.message.text})}function Tf({children:e}){return u("div",{className:"flex justify-center py-1",children:u("div",{className:"max-w-[80%] rounded-lg border border-border/60 bg-muted/30 px-3 py-2 text-chat-row text-muted-foreground",children:e})})}function vU({parsed:e}){let{t}=Xe();return S(Tf,{children:[u("p",{className:"font-medium text-foreground/80",children:t("preset.systemBlockTitle",{name:e.presetId})}),e.prefix.trim().length>0?u("p",{className:"mt-1 whitespace-pre-wrap",children:e.prefix}):null]})}var yU={"child.settled":"childThread.notification.settled","child.failed":"childThread.notification.failed","child.approval":"childThread.notification.approval","child.stopped":"childThread.notification.stopped","plugin.notice":"childThread.notification.pluginNotice","selfdev.resolved":"childThread.notification.selfdevResolved"};function CU({row:e}){let{t}=Xe(),n=at(kt).derive,o=e.message.attachments??[],r=o.filter(l=>Tr(l)==="image"),a=o.filter(l=>Tr(l)!=="image"),s=l=>{let d=OS(l);if(d)return S(Tf,{children:[u("p",{className:"font-medium text-foreground/80",children:d.title}),d.body.length>0?u("p",{className:"mt-1 whitespace-pre-wrap",children:d.body}):null]});let c=n.parseThreadHandoverText(l);if(c)return S(Tf,{children:[u("p",{className:"font-medium text-foreground/80",children:t("continuation.systemBlockTitle")}),u("p",{className:"mt-1",children:t("continuation.systemBlockTurns",{count:c.includedTurns})}),u("p",{className:"mt-1 whitespace-pre-wrap",children:c.body})]});let f=n.parseSystemNotificationText(l);return f?S(Tf,{children:[u("p",{className:"font-medium text-foreground/80",children:t(yU[f.kind],{title:f.title})}),f.summary.trim().length>0?u("p",{className:"mt-1 whitespace-pre-wrap",children:f.summary}):null]}):null},i=DS(e.message.text).map(s).filter(l=>l!==null);return i.length===0&&o.length===0?null:S(xe,{children:[i.map((l,d)=>u(zr,{children:l},d)),o.length>0?S("div",{className:"min-w-0 px-3 py-2",children:[u(Ud,{images:r}),a.map(l=>u(zd,{attachment:l},l.id))]}):null]})}function iI(e,t){let n=t.parsePresetPrefixText(e??"")?.body??null;if(n===null&&gf(e??""))return null;let r=Sf(n??e??"").visibleText;for(;;){let i=wf(r);if(!i.annotation)break;r=i.promptText}let a=Fi(r).promptText,s=vf(a).map(i=>i.kind==="text"?i.text:i.comment.text).join(" ").replace(/\s+/g," ").trim();return s.length>0?s:null}var lI=34,dI=8,Hd=lI+dI,cI=me(function({ref:t,textRef:n,initialText:o,expanded:r,onToggleExpanded:a}){let{t:s}=Xe(),i=s(r?"timeline.pinnedTurnHeaderShowLess":"timeline.pinnedTurnHeaderShowMore");return u("div",{ref:t,className:"group pointer-events-none absolute inset-x-0 top-0 z-10 px-3 sm:px-5",style:{paddingTop:dI},"data-timeline-turn-header":"true","data-truncated":"false",children:S("div",{className:K("transcript-col-wide pointer-events-auto flex gap-2 rounded-sm border border-border/70 bg-background pe-1 ps-3 shadow-md shadow-black/10",r?"items-start py-1.5":"items-center"),...r?{}:{style:{height:lI}},children:[u("span",{ref:n,className:K("min-w-0 flex-1 text-foreground/85 text-chat",r?"max-h-40 overflow-y-auto whitespace-pre-wrap":"truncate"),children:o}),S(He,{children:[u($e,{render:u(ie,{type:"button",size:"xs",variant:"ghost",className:"group-data-[truncated=false]:hidden","aria-label":i,onClick:a}),children:r?u(rd,{}):u(Qt,{})}),u(Ke,{side:"bottom",children:i})]})]})})});function uI({row:e}){let t=at(kt),{t:n}=Xe(),[o,r]=io(t.threadKey,`message:${e.message.id}`,!1);if(e.presentation==="compact"&&!o)return u(ff,{state:"idle",children:S("button",{type:"button",className:K(uf,"chat-process-text cursor-pointer text-secondary-label hover:bg-accent/20"),"aria-expanded":!1,"aria-label":n("timeline.expandMessage"),onClick:()=>{t.onProcessDisclosureChange?.(e.id),r(!0)},children:[u(Bd,{status:null}),u(Fd,{children:u(Vr,{className:"size-icon-1","aria-hidden":!0})}),u("span",{className:"min-w-0 flex-1 truncate",children:t.derive.reasoningPreviewText(e.message.text)}),u(Qt,{className:"size-icon-1 shrink-0 -rotate-90","aria-hidden":!0})]})});let s=e.message.attachments??[],i=s.filter(c=>Tr(c)==="image"),l=s.filter(c=>Tr(c)!=="image"),d=e.message.text||(e.message.streaming||s.length>0?"":n("timeline.emptyResponse"));return u(xe,{children:S("div",{className:"relative min-w-0 px-1 py-0.5","data-assistant-text-tone":e.textTone==="process"&&e.presentation!=="compact"?"process":"primary",children:[e.presentation==="compact"?S("div",{className:"mb-1 flex items-center gap-2",children:[u("button",{type:"button",className:"chat-process-meta mb-1 rounded-sm text-secondary-label","aria-expanded":!0,onClick:()=>{t.onProcessDisclosureChange?.(e.id),r(!1)},children:n("timeline.collapseMessage")}),e.copyInFooter?null:u(Ts,{text:e.message.text,variant:"ghost"})]}):null,e.modelBadge?u(bU,{badge:e.modelBadge,createdAt:e.message.createdAt}):null,u("div",{"data-assistant-quote-body":"",children:u(yo,{disclosureKey:`message:${e.message.id}:assistant`,text:d,className:e.textTone==="process"&&e.presentation!=="compact"?"chat-commentary":"chat-readable-body",cwd:t.markdownCwd,threadRef:t.threadRef??void 0,isStreaming:!!e.message.streaming,lineBreaks:t.derive.shouldPreserveAssistantLineBreaks(d),skills:t.skills,onImageExpand:t.onImageExpand})}),u(Ud,{images:i}),l.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:l.map(c=>u(zd,{attachment:c},c.id))}),e.showAssistantMeta||e.showAssistantCopyButton&&!e.assistantCopyStreaming&&e.message.text.trim().length>0?S("div",{className:"mt-1.5 flex items-center gap-2 text-chat-row tabular-nums opacity-0 transition-opacity duration-(--control-duration) focus-within:opacity-100 group-hover/assistant:opacity-100 [@media(pointer:coarse)]:opacity-100",children:[u(xU,{row:e}),e.showAssistantMeta&&!e.message.streaming&&e.modelBadge===null&&S(He,{children:[u($e,{render:u("p",{className:"text-muted-foreground text-chat-row tabular-nums"}),children:Gr(e.message.updatedAt,t.timestampFormat,n)}),u(Ke,{children:wr(e.message.updatedAt,t.timestampFormat)})]})]}):null]})})}function xU({row:e}){let n=at(kt).derive.resolveAssistantMessageCopyState({text:e.message.text??null,showCopyButton:e.showAssistantCopyButton,streaming:e.assistantCopyStreaming});return n.visible?u(Ts,{text:n.text??"",variant:"ghost"}):null}function Yg({badge:e}){return S(xe,{children:[e.driverKind?u("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg border border-border/60 bg-card","aria-label":e.providerDisplayName??void 0,children:u(Qo,{driver:e.driverKind,displayName:e.providerDisplayName,accentColor:e.accentColor,className:"size-5",iconClassName:"size-4"})}):null,S("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[e.driverKind?u("span",{className:"font-medium text-foreground",children:e.providerDisplayName}):null,u("span",{className:"min-w-0 truncate text-muted-foreground",children:e.modelLabel}),e.effortLabel?S("span",{children:[" \xB7 ",e.effortLabel]}):null]})]})}function bU({badge:e,createdAt:t}){let n=at(kt),{t:o}=Xe();return S("div",{className:"mb-3 flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 text-chat-dense text-muted-foreground","data-testid":"assistant-model-header",children:[u(Yg,{badge:e}),u("span",{"aria-hidden":!0,children:"\xB7"}),S(He,{children:[u($e,{render:u("span",{className:"shrink-0 tabular-nums"}),children:Gr(t,n.timestampFormat,o)}),u(Ke,{children:wr(t,n.timestampFormat)})]})]})}function fI({row:e}){let{t}=Xe(),n=e.badge.effortLabel?`${e.badge.modelLabel} \xB7 ${e.badge.effortLabel}`:e.badge.modelLabel,o=[e.badge.providerDisplayName,n].filter(a=>typeof a=="string"&&a.length>0).join(" \xB7 "),r=e.pending?t("timeline.modelSwitchPending",{model:o}):t("timeline.modelSwitched",{model:o});return S("div",{role:"separator","aria-label":r,"data-pending":e.pending?"true":void 0,className:"flex items-center gap-2 px-1 py-1 text-chat-dense text-muted-foreground/70",children:[u("span",{"aria-hidden":!0,className:"h-px min-w-4 flex-1 bg-border/60"}),S("span",{className:"flex min-w-0 shrink items-center gap-1.5",children:[e.badge.driverKind?u(Qo,{driver:e.badge.driverKind,displayName:e.badge.providerDisplayName,accentColor:e.badge.accentColor,className:"size-icon-1",iconClassName:"size-icon-1"}):null,u("span",{className:"truncate",children:r})]}),u("span",{"aria-hidden":!0,className:"h-px min-w-4 flex-1 bg-border/60"})]})}var Jg=240,SU=/\s/u;function pI(e){if(!e)return null;let t=[],n=0,o=!1,r=()=>{for(;n>Jg-1;)n-=t.pop()?.length??0;for(;t.at(-1)===" ";)t.pop(),n-=1;return t.push("\u2026"),t.join("")};for(let a of e){if(SU.test(a)){o=t.length>0;continue}if(o&&(t.push(" "),n+=1,o=!1,n>Jg)||(t.push(a),n+=a.length,n>Jg))return r()}return t.length>0?t.join(""):null}function IU(e,t,n){let o=t.find(s=>s.kind==="message"&&s.message.role==="user"),r=o?.kind==="message"?o.message:null,a=null;for(let s of t)s.kind==="message"&&s.message.role==="assistant"&&(a=s.message.text??null);return{id:e,sectionKey:e,anchorRowId:o?.id??t[0]?.id??e,userText:r===null?null:pI(n.parseSystemNotificationText(r.text)?.summary??n.parseThreadHandoverText(r.text)?.body??r.text),assistantText:pI(a),headerText:r===null?null:iI(r.text,n)}}function wU(e){for(let t of e){let n=t.kind==="message"?t.message.turnId??null:t.kind==="turn-summary"?t.footer.turnId:null;if(n!==null)return n}return null}function TU(e,t){return e.sectionKey===t.sectionKey&&e.anchorRowId===t.anchorRowId&&e.userText===t.userText&&e.assistantText===t.assistantText&&e.headerText===t.headerText&&e.turnId===t.turnId}function PU(e,t,n){for(let o=0;o<e.length;o+=1)if(e[o]!==n[t.firstRowIndex+o])return!1;return!0}function kU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function LU(e){let t=new Map,n=null;return o=>{let r=o.getVersion();if(n!==null&&n.store===o&&n.version===r)return n.entries;let a=new Map,s=[],i=o.getRows();for(let d of o.getStructure().sections){let c=t.get(d.key);if(c!==void 0&&c.rowIds===d.rowIds&&PU(c.rows,d,i)){a.set(d.key,c),s.push(c.entry);continue}let f=i.slice(d.firstRowIndex,d.firstRowIndex+d.rowIds.length),p=IU(d.key,f,e),m={...p,turnId:wU(f)},h=c!==void 0&&TU(c.entry.item,m)?c.entry:{summary:p,item:m};a.set(d.key,{rowIds:d.rowIds,rows:f,entry:h}),s.push(h)}t=a;let l=n!==null&&kU(n.entries,s)?n.entries:s;return n={store:o,version:r,entries:l},l}}var mI=new WeakMap;function vI(e,t){let n=mI.get(e);return(n===void 0||n.derive!==t)&&(n={derive:t,read:LU(t)},mI.set(e,n)),n.read(e)}var gI=new WeakMap;function yI(e,t){let n=vI(e,t),o=gI.get(n);return o===void 0&&(o=n.flatMap(({summary:r})=>r.headerText===null?[]:[{sectionKey:r.sectionKey,text:r.headerText}]),gI.set(n,o)),o}function CI(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,o)=>n.sectionKey===t[o].sectionKey&&n.text===t[o].text)}var hI=new WeakMap;function xI(e,t){let n=vI(e,t),o=hI.get(n);return o===void 0&&(o=n.filter(({summary:r})=>r.userText!==null).map(({item:r})=>r),hI.set(n,o)),o}function bI(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,o)=>n===t[o])}var AU=[],RU=e=>e.getMeta().usageByTurnId,EU=e=>e.getMeta().exportApi,MU=e=>e.getMeta().status.totalTurnCount??null,SI=me(function({rowsStore:t,derive:n,paneVisible:o,bottomInset:r,onSelect:a,onTurnNavigatorChange:s}){let i=E(m=>o?xI(m,n):AU,[n,o]),l=Tn(t,i,bI),d=Tn(t,RU),c=Tn(t,EU),f=Tn(t,MU),p=q(()=>o?{items:l,totalTurnCount:f,bottomInset:r,usageByTurnId:d,onSelect:a,exportMarkdown:c.markdown,onDownload:c.download}:null,[r,c,l,a,o,f,d]);return $(()=>{p!==null&&s(p)},[s,p]),$(()=>{if(o)return()=>s(null)},[s,o]),null});function II({timeline:e,previousOverlayHeight:t,overlayHeight:n,followingEnd:o}){e&&o&&n>t&&e.scrollToEnd({animated:!1})}function wI(e,t){let n=e.topOf(t),o=e.heightOf(t);return typeof n!="number"||typeof o!="number"||!Number.isFinite(n)||!Number.isFinite(o)?null:n+Math.max(1,o)}function TI({measurement:e,followingEnd:t}){return t?null:e.rowAtScroll()}function Pf(e,t){let n=Array.from(e.querySelectorAll("[data-timeline-turn-section]")),o=n.findIndex(a=>a.querySelector(`[data-timeline-row-id="${CSS.escape(t)}"]`)),r=o<0?n:n.slice(0,o+1);for(let a of r)a.style.contentVisibility="visible";e.offsetHeight,requestAnimationFrame(()=>{for(let a of r)a.style.removeProperty("content-visibility")})}Z();var NU=e=>e.getMeta().status.workingStepLabel??null,_U=e=>e.getMeta().status.stall??null,DU=e=>e.getMeta().status.retry??null,OU=e=>e.getMeta().status.isWorking,PI=me(function({rowsStore:t,historyWindow:n,children:o}){let r=Tn(t,NU),a=Tn(t,_U),s=Tn(t,DU),i=q(()=>n?{workingStepLabel:null,stall:null,retry:null}:{workingStepLabel:r,stall:a,retry:s},[n,s,a,r]);return u(cf,{value:i,children:o})});function kI({rowsStore:e,historyWindow:t}){let{t:n}=Xe();return Tn(e,OU)&&!t?null:u("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:u("p",{className:"text-placeholder text-chat",children:n("timeline.empty")})})}var LI=u("div",{className:"h-3 sm:h-4"}),AI=u("div",{className:"h-10 sm:h-12"});function RI({loading:e,blocked:t,onLoadEarlier:n,fade:o}){let{t:r}=Xe();return u("div",{className:o?"pt-10 sm:pt-12":"pt-3 sm:pt-4",children:u("div",{className:"transcript-col pb-2",children:u("button",{type:"button",onClick:n,disabled:e||t,className:"relative w-full py-1.5 text-chat-row text-muted-foreground/60 hover:text-foreground disabled:cursor-default pointer-coarse:after:absolute pointer-coarse:after:inset-0 pointer-coarse:after:min-h-11",children:r(e?"timeline.loadingEarlier":"timeline.loadEarlier")})})})}function EI({loading:e,blocked:t,onLoadLater:n,onReturnToLatest:o}){let{t:r}=Xe();return S("div",{className:"transcript-col flex items-center justify-center gap-2 py-2",children:[u(ie,{variant:"ghost",size:"sm",onClick:n,disabled:e||t,children:r(e?"timeline.loadingLater":"timeline.loadLater")}),o?u(ie,{variant:"ghost",size:"sm",onClick:o,children:r("timeline.returnToLatest")}):null]})}function MI({onReveal:e,fade:t}){let{t:n}=Xe();return u("div",{className:t?"pt-10 sm:pt-12":"pt-3 sm:pt-4",children:u("div",{className:"transcript-col pb-2",children:u("button",{type:"button",onClick:e,className:"relative w-full py-1.5 text-chat-row text-muted-foreground/60 hover:text-foreground pointer-coarse:after:absolute pointer-coarse:after:inset-0 pointer-coarse:after:min-h-11",children:n("timeline.loadEarlier")})})})}var NI=u("div",{className:"h-3 sm:h-4"});Z();var FU=Object.freeze([]),_I=e=>e.getMeta().status.scheduledWakes??FU;function DI(e,t){let n=M(e);return t&&(n.current=e),n.current}Z();function kf(e){return JSON.stringify([e.turnId??null,e.toolCallId?"tool":"entry",e.toolCallId||e.id])}Z();function Qr(e){if(!Number.isFinite(e)||e<0)return"0ms";if(e<1e3)return`${Math.max(1,Math.round(e))}ms`;if(e<1e4){let s=Math.round(e/100)/10;return s>=10?"10s":`${s.toFixed(1)}s`}if(e<6e4)return`${Math.round(e/1e3)}s`;let t=Math.round(e/1e3),n=Math.floor(t/3600),o=Math.floor(t%3600/60),r=t%60,a=[];return n>0&&a.push(`${n}h`),o>0&&a.push(`${o}m`),r>0&&a.push(`${r}s`),a.join(" ")}function OI({badge:e,startedAt:t,completedAt:n,timestampFormat:o}){let{t:r}=Xe();if(e===null&&t===void 0)return null;let a=r("timeline.turnInfo");return S(br,{children:[u(Ir,{openOnHover:!0,delay:250,render:u(ie,{type:"button",size:"icon-xs",variant:"ghost","data-turn-info":"","aria-label":a,className:"shrink-0 text-muted-foreground"}),children:u(md,{className:"size-3.5","aria-hidden":!0})}),u(Sr,{side:"top",align:"start",className:"max-w-80",children:S("div",{className:"flex flex-col gap-2 text-chat-dense",children:[e!==null?u("div",{className:"flex min-w-0 items-center gap-2",children:u(Yg,{badge:e})}):null,t!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnStarted",{time:wr(t,o)})}):null,n!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnFinished",{time:wr(n,o)})}):null]})})]})}function BU(e){return e<1e3?Math.round(e).toLocaleString():e<1e6?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,"")}m`}function Zg({label:e,children:t}){let[n,o]=Q(!1);return S(He,{open:n,onOpenChange:o,children:[u($e,{render:u("button",{type:"button",className:"inline-flex items-center gap-1 rounded-sm"}),"aria-label":e,onClick:()=>o(r=>!r),children:t}),u(Ke,{children:e})]})}var FI=me(function({footer:t,timestampFormat:n,copyText:o,identity:r}){let{t:a}=Xe(),s=t.state,i=s==="error"?a("timeline.error"):s==="interrupted"?a("timeline.interrupted"):null;return S("div",{"data-turn-summary":t.turnId,className:"chat-process-meta flex min-w-0 items-center gap-2 px-1 text-muted-foreground",children:[S("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[i!==null?S(Zg,{label:i,children:[s==="error"?u(qt,{className:"size-icon-1 text-destructive","aria-hidden":!0}):u(Td,{className:"size-3","aria-hidden":!0}),u("span",{className:"sr-only",children:i})]}):null,t.workingElapsedMs!==void 0?u(Zg,{label:a("timeline.workingTime",{duration:Qr(t.workingElapsedMs)}),children:Qr(t.workingElapsedMs)}):null,t.workingElapsedMs!==void 0&&t.outputTokens!==void 0?u("span",{"aria-hidden":!0,children:"\xB7"}):null,t.outputTokens!==void 0?u(Zg,{label:`${a("timeline.outputTokens")}: ${t.outputTokens.toLocaleString()}`,children:a("timeline.outputTokenCount",{count:t.outputTokens,value:BU(t.outputTokens)})}):null]}),u(OI,{badge:r?.badge??null,startedAt:r?.createdAt,completedAt:t.completedAt,timestampFormat:n}),o?u(Ts,{text:o,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"}):null]})});Z();Z();function BI(e){if(e<1e3)return String(e);if(e<1e6){let n=e/1e3;return`${n<10?n.toFixed(1).replace(/\.0$/,""):Math.round(n)}k`}if(e<1e9){let n=e/1e6;return`${n<10?n.toFixed(1).replace(/\.0$/,""):Math.round(n)}m`}let t=e/1e9;return`${t<10?t.toFixed(1).replace(/\.0$/,""):Math.round(t)}b`}var UI=me(function(t){let{additions:n,deletions:o,className:r,showParentheses:a=!1,layout:s="aligned"}=t,{t:i}=Xe(),l=new Intl.ListFormat(void 0,{type:"unit"}).format([i("changedFiles.additions",{count:n}),i("changedFiles.deletions",{count:o})]);return S(xe,{children:[a&&u("span",{className:"text-muted-foreground/70",children:"("}),S("span",{role:"group","aria-label":l,className:K(s==="inline"?"inline-flex items-center gap-1 tabular-nums align-middle":"inline-grid grid-cols-[4ch_4ch] gap-2 text-right tabular-nums align-middle",r),children:[S("span",{"aria-hidden":"true",className:"font-mono text-diff-addition",children:["+",BI(n)]}),S("span",{"aria-hidden":"true",className:"font-mono text-diff-deletion",children:["-",BI(o)]})]}),a&&u("span",{className:"text-muted-foreground/70",children:")"})]})});function Kd({name:e,className:t}){switch(e){case"bot":return u(ls,{className:t,"aria-hidden":!0});case"check":return u(Nn,{className:t,"aria-hidden":!0});case"circle-alert":return u(Zt,{className:t,"aria-hidden":!0});case"eye":return u(id,{className:t,"aria-hidden":!0});case"globe":return u(ud,{className:t,"aria-hidden":!0});case"hammer":return u(pd,{className:t,"aria-hidden":!0});case"message-circle":return u(gs,{className:t,"aria-hidden":!0});case"search":return u(xs,{className:t,"aria-hidden":!0});case"square-pen":return u(oo,{className:t,"aria-hidden":!0});case"terminal":return u(ho,{className:t,"aria-hidden":!0});case"wrench":return u(Pd,{className:t,"aria-hidden":!0});case"x":return u(qt,{className:t,"aria-hidden":!0});case"zap":return u(Ss,{className:t,"aria-hidden":!0})}}function UU(e){switch(e){case"read":return"eye";case"edit":return"square-pen";case"command":return"terminal";case"search":return"globe";case"code-search":return"search";case"other":return"wrench";case"dynamic-tool":return"hammer";case"agent-tool":return"bot";case"tone-tool":return"zap";case"mixed":case null:return"hammer"}}function eh(e,t){let n=new Map;for(let o of e){let r=t(o);n.set(r,(n.get(r)??0)+1)}return Array.from(n,([o,r])=>({action:o,icon:UU(o),count:r}))}function th(e,t){let n;for(let o of eh(e,t))(!n||o.count>n.count)&&(n=o);return n?.icon??"wrench"}var Bi=20;function Ui(e){return kf(e)}function zI(e,t,n){let o=e.toolLabel,r=n.resolveToolCommand(e);if(r&&o?.descriptive&&!o.path&&o.detail?.trim())return o.detail.replace(/\s+/g," ").trim();for(let p of[e.rawCommand,e.command]){let m=n.parseToolCommandInput(p)?.description;if(m)return m.replace(/\s+/g," ").trim()}if(r)return r.replace(/\s+/g," ").trim();let a=typeof e.toolData=="object"&&e.toolData!==null&&!Array.isArray(e.toolData)?e.toolData:null,s=typeof a?.toolName=="string"?a.toolName:typeof a?.name=="string"?a.name:void 0,i=o?.name??s??e.toolTitle??e.label,l=o?.path??e.changedFiles?.[0],d=l?hf(l,t):void 0,c=[i.trim().toLowerCase()==="tool"?void 0:i,d,o?.detail??e.detail],f=[];for(let p of c){let m=p?.replace(/\s+/g," ").trim();m&&!f.some(h=>h.toLowerCase()===m.toLowerCase())&&f.push(m)}return f.join(" ")||null}function HI({entry:e,failed:t}){let n=e.toolLabel?.diffStat;return!n||t||nh(e)?null:u(UI,{...n,layout:"inline",className:"chat-process-meta ms-2 shrink-0"})}function nh(e){return e.toolLifecycleStatus==="declined"||e.toolLifecycleStatus==="stopped"}function KI({toolIcon:e,glyphClassName:t}){let n=at(kt),o=n.SiteIcon;return e.pageUrl!==void 0&&o!==void 0?u(o,{threadRef:n.threadRef,pageUrl:e.pageUrl,className:"size-3.5 shrink-0 rounded-sm object-contain"}):u(Kd,{name:"globe",className:t})}function zU({entry:e,failed:t=!1,derive:n}){return t?u(Zt,{"aria-hidden":!0,className:"size-icon-1 shrink-0 text-destructive"}):e.toolIcon!==void 0?u(KI,{toolIcon:e.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"}):u(Kd,{name:th([e],n.toolGroupAction),className:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"})}function HU({entries:e,failed:t,derive:n}){let{t:o}=Xe(),r=q(()=>eh(e,n.toolGroupAction),[e,n]),a=r.length===1;return a&&r[0].count<2?null:u("span",{className:"chat-process-meta flex shrink-0 items-center gap-2 tabular-nums","aria-label":o("toolGroup.calls",{count:e.length}),children:r.map(({action:s,icon:i,count:l})=>S("span",{"aria-hidden":!0,className:"flex items-center gap-1",children:[a?null:u(Kd,{name:i,className:K("size-icon-1 shrink-0 stroke-[1.8] opacity-70",t?"text-destructive":"text-icon-muted")}),l]},s))})}function $I({entry:e}){let t=at(kt),n=e.detail??e.command??e.rawCommand??e.toolLabel?.detail,o=JSON.stringify([e.id,e.sourceActivityKind,e.toolLifecycleStatus]),r=t.renderToolCallDetail?.({entry:e,threadRef:t.threadRef,threadKey:t.threadKey,workspaceRoot:t.workspaceRoot,revision:o,onOpenFileDiff:t.onOpenFileDiff});return u("div",{className:"min-w-0 space-y-2 p-3",children:r!==void 0?u(xe,{children:r}):u("pre",{className:"chat-tool-body overflow-x-auto rounded-md bg-muted/40 p-2",children:n??""})})}var KU=me(function(t){let{entry:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}=t,i=at(kt).derive,{t:l}=Xe(),[d,c]=io(o,`call:${Ui(n)}`,!1),f=i.workEntryIndicatesFailure(n),p=nh(n),m=i.resolveWorkEntryStatus(n),h=m==="failed"||m==="running"?m:null,g=hr();return S("div",{"data-tool-call-id":n.toolCallId??n.id,"data-tool-identity":Ui(n),className:"border-b border-border/50 last:border-b-0",children:[S("button",{type:"button","aria-expanded":d,"aria-controls":g,onClick:()=>{a?.(),c(!d)},className:K("chat-tool-member-row chat-tool-summary flex w-full min-w-0 items-center gap-1.5 px-3 text-left hover:bg-accent/20",f?"text-destructive":"text-muted-foreground"),children:[u(Bd,{status:h}),u(Fd,{children:u(zU,{entry:n,failed:f,derive:i})}),S("span",{className:"flex min-w-0 flex-1 items-center",children:[u("span",{className:"truncate",children:zI(n,r,i)??l("toolGroup.calls",{count:1})}),u(HI,{entry:n,failed:f})]}),f||p?u("span",{className:"chat-process-meta shrink-0",children:f?l("toolGroup.failed",{count:1}):l("toolGroup.cancelled",{count:1})}):null,u(Qt,{"aria-hidden":!0,className:K("size-icon-1 shrink-0",!d&&"-rotate-90")})]}),d?u("div",{id:g,children:u($I,{entry:n})}):null]})});function $U({threadKey:e,stateKey:t,maxHeight:n,children:o}){let r=M(null);return ve(()=>{let a=r.current;if(!a)return;a.scrollTop=Gg(e,`${t}:scroll`,0);let s=()=>{Od(e,`${t}:scroll`,a.scrollTop,!1)};return a.addEventListener("scroll",s,{passive:!0}),()=>a.removeEventListener("scroll",s)},[e,t]),u("div",{ref:r,"data-slot":"scroll-area-viewport",className:"min-w-0 overflow-y-auto overscroll-y-contain",style:{maxHeight:n},children:o})}var qI=me(function({entries:t,groupId:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}){let i=at(kt).derive,{t:l}=Xe(),[d,c]=io(o,`group:${n}`,!1),[f,p]=io(o,`group-page:${n}`,0),m=hr(),h=M(null),[g,v]=Q(null),y=t.at(-1),C=q(()=>t.filter(O=>i.workEntryIndicatesFailure(O)),[t,i]),b=q(()=>t.filter(nh),[t]),x=t.filter(O=>O.toolLifecycleStatus==="inProgress").length,w=C[0]??b[0],I=w??y,P=Math.max(0,Math.ceil(t.length/Bi)-1),k=Math.min(f,P),T=k*Bi,L=t.slice(T,T+Bi),A=t.length>1;if(ve(()=>{if(!g)return;let O=h.current,j=Array.from(O?.querySelectorAll("[data-tool-identity]")??[]).find(U=>U.dataset.toolIdentity===g.id);if(!j)return;let F=j.closest('[data-slot="scroll-area-viewport"]');F&&(F.scrollTop+=j.getBoundingClientRect().top-F.getBoundingClientRect().top),j.querySelector("button")?.focus({preventScroll:!0})},[g]),!y||!I)return null;let N=O=>{a?.(),p(O)},R={threadKey:o,workspaceRoot:r,onDisclosureChange:a},D=MS(t.map(O=>ES(i.resolveWorkEntryStatus(O)))),H=th(t,i.toolGroupAction),z=D==="failed"?"failed":D==="running"?"running":"success";return u(ff,{state:D,variant:"tool",children:S("section",{ref:h,"data-tool-group-id":n,className:"min-w-0",children:[S("div",{className:"flex min-w-0 items-center",children:[S("button",{type:"button","aria-expanded":d,"aria-controls":m,onClick:()=>{a?.(),c(!d),!A&&!d&&Od(o,`call:${Ui(y)}`,!0)},className:K(uf,"flex-1",w?"text-destructive":"text-muted-foreground"),children:[u(Bd,{status:z}),u(Fd,{children:!A&&y.toolIcon!==void 0&&C.length===0?u(KI,{toolIcon:y.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] opacity-70 text-icon-muted"}):u(Kd,{name:H,className:K("size-icon-1 shrink-0 stroke-[1.8] opacity-70",C.length>0?"text-destructive":"text-icon-muted")})}),S("span",{className:K("flex min-w-0 flex-1 items-center",d&&A?"chat-process-text":"chat-tool-summary"),children:[u("span",{className:"truncate",children:d&&A?l("toolGroup.calls",{count:t.length}):zI(I,r,i)??l("toolGroup.calls",{count:1})}),d&&A?null:u(HI,{entry:I,failed:i.workEntryIndicatesFailure(I)})]}),x>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.running",{count:x})}):null,C.length>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.failed",{count:C.length})}):null,b.length>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.cancelled",{count:b.length})}):null,d&&A?null:u(HU,{entries:t,failed:C.length>0,derive:i}),u(Qt,{"aria-hidden":!0,className:K("size-icon-1 shrink-0",!d&&"-rotate-90")})]}),w&&A?u("button",{type:"button",className:"chat-process-meta me-2 min-h-8 shrink-0 rounded-control-4 px-1 text-destructive underline [@media(pointer:coarse)]:min-h-11",onClick:()=>{a?.(),c(!0),p(Math.floor(t.indexOf(w)/Bi)),Od(o,`call:${Ui(w)}`,!0),v({id:Ui(w)})},children:l("toolGroup.showFailure")}):null]}),d?u("div",{id:m,className:"border-t border-border/50",children:A?S(xe,{children:[t.length>Bi?S("div",{className:"chat-process-meta flex items-center gap-1 border-b border-border/40 px-2 py-1 text-muted-foreground",children:[u("span",{className:"min-w-0 flex-1 tabular-nums",children:l("toolGroup.pageRange",{from:T+1,to:Math.min(T+Bi,t.length),count:t.length})}),[{label:l("toolGroup.firstPage"),target:0,disabled:k===0,Icon:ad},{label:l("toolGroup.previousPage"),target:k-1,disabled:k===0,Icon:ds},{label:l("toolGroup.nextPage"),target:k+1,disabled:k===P,Icon:go},{label:l("toolGroup.lastPage"),target:P,disabled:k===P,Icon:sd}].map(({label:O,target:j,disabled:F,Icon:U})=>u("button",{type:"button","aria-label":O,disabled:F,onClick:()=>N(j),className:"flex size-7 items-center justify-center rounded-control-3 disabled:opacity-64 [@media(pointer:coarse)]:size-11",children:u(U,{"aria-hidden":!0,className:"size-icon-1"})},O))]}):null,u($U,{threadKey:o,stateKey:`group-scroll:${n}:${k}`,maxHeight:"min(320px, 50dvh)",children:u("div",{className:"space-y-0.5 py-1",children:L.map(O=>u(KU,{entry:O,...R},Ui(O)))})})]}):u($I,{entry:y})}):null]})})});Z();function VI(){let e=Eo(),t=r=>r instanceof Error?r.message:void 0,n=(r,a)=>a!==void 0&&a.length>0?`${r}: ${a}`:r,o=(r,a,s)=>e.notify(r,a,s);return{error:(r,a,s)=>{let i=s?.description??t(a);o(n(r,i),"error",i)},warning:(r,a,s)=>{let i=s?.description??t(a);o(n(r,i),"warning",i)},success:(r,a,s)=>{let i=a??s?.description;o(n(r,i),"success",i)}}}function Lf(e){let t=e.match(/^\s{0,3}#{1,6}\s+(.+)$/m)?.[1]?.trim();return t&&t.length>0?t:null}function oh(e){let t=e.trimEnd().split(/\r?\n/),n=t[0]&&/^\s{0,3}#{1,6}\s+/.test(t[0])?t.slice(1):[...t];for(;n[0]?.trim().length===0;)n.shift();if(n[0]?.match(/^\s{0,3}#{1,6}\s+(.+)$/)?.[1]?.trim().toLowerCase()==="summary")for(n.shift();n[0]?.trim().length===0;)n.shift();return n.join(`
3790
+ `),r=o.find(p=>p.startsWith("Page: ")),a=o.find(p=>p.startsWith("Id: ")),s=o.find(p=>p.startsWith("Comment: ")),i=o.find(p=>p.startsWith("Targets: ")),l=o.indexOf("Requested visual changes:"),d=o.slice(l+1),c=d.indexOf("<element_context>"),f=l<0?[]:d.slice(0,c<0?void 0:c).filter(p=>p.startsWith("- ")).map(p=>p.slice(2));return{promptText:e.slice(0,t.index).replace(/\n+$/,""),annotation:{id:a?.slice(4).trim()||`${t.index}`,title:r?.slice(6).trim()||"Preview annotation",comment:s?.slice(9).trim()||"",targetSummary:i?.slice(9).trim()||"",styleChanges:f,hasScreenshot:n.includes("The attached screenshot is the annotated preview crop.")}}}function sI({row:e,text:t}){let{t:n}=Xe(),o=at(kt),r=e.message.attachments??[],a=Sf(t),s=a.contexts,i=[],l=a.visibleText;for(;;){let C=wf(l);if(!C.annotation)break;i.unshift(C.annotation),l=C.promptText}let d=Fi(l),c=[...a.elementContexts,...d.contexts],f=r.filter(C=>C.name.startsWith("preview-annotation-")),p=r.filter(C=>!C.name.startsWith("preview-annotation-")),m=p.filter(C=>Tr(C)==="image"),h=p.filter(C=>Tr(C)!=="image"),g=e.message.author??null,v=g!==null&&g.userId!==(o.selfUserId??null),y=v?n("message.saidBy",{name:g.displayName}):n("message.saidByYou");return S("div",{className:`group/user flex min-w-0 flex-col gap-1 ${v?"items-start":"items-end"}`,role:"group","aria-label":y,tabIndex:-1,children:[v?u(gU,{author:g}):null,S("div",{...v?{"data-teammate-bubble":""}:{"data-user-bubble":""},className:`relative min-w-0 max-w-[min(70%,40rem)] rounded-[18px] px-3.5 py-2.5 text-pretty ${v?"border border-border/60 bg-teammate-bubble text-message-foreground":"bg-user-bubble text-user-bubble-foreground"}`,children:[u(Ud,{images:m}),h.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:h.map(C=>u(zd,{attachment:C},C.id))}),i.map((C,b)=>u(rI,{annotation:C,image:f[b]??null},C.id)),c.length>0?u("div",{className:"mb-2 flex flex-wrap gap-1.5",children:c.map(C=>u(oI,{context:C},`${C.header}:${C.body}`))}):null,u(aI,{disclosureKey:`message:${e.message.id}:user`,text:d.promptText,terminalContexts:s,skills:o.skills,markdownCwd:o.markdownCwd})]}),S("div",{"data-user-message-actions":"",className:"flex min-h-6 items-center gap-0.5 text-chat-row text-muted-foreground opacity-0 transition-opacity duration-(--control-duration) group-focus-within/user:opacity-100 group-hover/user:opacity-100",children:[S(He,{children:[u($e,{render:u("span",{tabIndex:0,className:"me-1 rounded-sm tabular-nums"}),children:Gr(e.message.createdAt,o.timestampFormat,n)}),u(Ke,{children:wr(e.message.createdAt,o.timestampFormat)})]}),o.onForkFromUserMessage!==null&&u(hU,{messageId:e.message.id,onFork:o.onForkFromUserMessage}),a.copyText&&u(Ts,{text:a.copyText,variant:"ghost"})]})]})}function gU({author:e}){return S("div",{className:"flex min-w-0 max-w-[min(70%,40rem)] items-center gap-1.5 text-chat-dense text-muted-foreground",children:[u(Ub,{userId:e.userId,displayName:e.displayName,size:16}),u("span",{className:"min-w-0 truncate",children:e.displayName})]})}function hU({messageId:e,onFork:t}){let{t:n}=Xe(),o=n("fork.action");return S(He,{children:[u($e,{render:u(ie,{type:"button",size:"xs",variant:"ghost",onClick:()=>t(e),"aria-label":o}),children:u(cd,{className:"size-3"})}),u(Ke,{side:"top",children:o})]})}function Xg({row:e}){let t=at(kt).derive;if(gf(e.message.text)){let n=t.parsePresetPrefixText(e.message.text);return n?S(xe,{children:[u(vU,{parsed:n}),n.body.length>0||(e.message.attachments?.length??0)>0?u(Xg,{row:{...e,message:{...e.message,text:n.body}}}):null]}):u(CU,{row:e})}return u(sI,{row:e,text:e.message.text})}function Tf({children:e}){return u("div",{className:"flex justify-center py-1",children:u("div",{className:"max-w-[80%] rounded-lg border border-border/60 bg-muted/30 px-3 py-2 text-chat-row text-muted-foreground",children:e})})}function vU({parsed:e}){let{t}=Xe();return S(Tf,{children:[u("p",{className:"font-medium text-foreground/80",children:t("preset.systemBlockTitle",{name:e.presetId})}),e.prefix.trim().length>0?u("p",{className:"mt-1 whitespace-pre-wrap",children:e.prefix}):null]})}var yU={"child.settled":"childThread.notification.settled","child.failed":"childThread.notification.failed","child.approval":"childThread.notification.approval","child.stopped":"childThread.notification.stopped","plugin.notice":"childThread.notification.pluginNotice","selfdev.resolved":"childThread.notification.selfdevResolved"};function CU({row:e}){let{t}=Xe(),n=at(kt).derive,o=e.message.attachments??[],r=o.filter(l=>Tr(l)==="image"),a=o.filter(l=>Tr(l)!=="image"),s=l=>{let d=OS(l);if(d)return S(Tf,{children:[u("p",{className:"font-medium text-foreground/80",children:d.title}),d.body.length>0?u("p",{className:"mt-1 whitespace-pre-wrap",children:d.body}):null]});let c=n.parseThreadHandoverText(l);if(c)return S(Tf,{children:[u("p",{className:"font-medium text-foreground/80",children:t("continuation.systemBlockTitle")}),u("p",{className:"mt-1",children:t("continuation.systemBlockTurns",{count:c.includedTurns})}),u("p",{className:"mt-1 whitespace-pre-wrap",children:c.body})]});let f=n.parseSystemNotificationText(l);return f?S(Tf,{children:[u("p",{className:"font-medium text-foreground/80",children:t(yU[f.kind],{title:f.title})}),f.summary.trim().length>0?u("p",{className:"mt-1 whitespace-pre-wrap",children:f.summary}):null]}):null},i=DS(e.message.text).map(s).filter(l=>l!==null);return i.length===0&&o.length===0?null:S(xe,{children:[i.map((l,d)=>u(zr,{children:l},d)),o.length>0?S("div",{className:"min-w-0 px-3 py-2",children:[u(Ud,{images:r}),a.map(l=>u(zd,{attachment:l},l.id))]}):null]})}function iI(e,t){let n=t.parsePresetPrefixText(e??"")?.body??null;if(n===null&&gf(e??""))return null;let r=Sf(n??e??"").visibleText;for(;;){let i=wf(r);if(!i.annotation)break;r=i.promptText}let a=Fi(r).promptText,s=vf(a).map(i=>i.kind==="text"?i.text:i.comment.text).join(" ").replace(/\s+/g," ").trim();return s.length>0?s:null}var lI=34,dI=8,Hd=lI+dI,cI=me(function({ref:t,textRef:n,initialText:o,expanded:r,onToggleExpanded:a}){let{t:s}=Xe(),i=s(r?"timeline.pinnedTurnHeaderShowLess":"timeline.pinnedTurnHeaderShowMore");return u("div",{ref:t,className:"group pointer-events-none absolute inset-x-0 top-0 z-10 px-3 sm:px-5",style:{paddingTop:dI},"data-timeline-turn-header":"true","data-truncated":"false",children:S("div",{className:K("transcript-col-wide pointer-events-auto flex gap-2 rounded-sm border border-border/70 bg-background pe-1 ps-3 shadow-md shadow-black/10",r?"items-start py-1.5":"items-center"),...r?{}:{style:{height:lI}},children:[u("span",{ref:n,className:K("min-w-0 flex-1 text-foreground/85 text-chat",r?"max-h-40 overflow-y-auto whitespace-pre-wrap":"truncate"),children:o}),S(He,{children:[u($e,{render:u(ie,{type:"button",size:"xs",variant:"ghost",className:"group-data-[truncated=false]:hidden","aria-label":i,onClick:a}),children:r?u(rd,{}):u(Qt,{})}),u(Ke,{side:"bottom",children:i})]})]})})});function uI({row:e}){let t=at(kt),{t:n}=Xe(),[o,r]=io(t.threadKey,`message:${e.message.id}`,!1);if(e.presentation==="compact"&&!o)return u(ff,{state:"idle",children:S("button",{type:"button",className:K(uf,"chat-process-text cursor-pointer text-secondary-label hover:bg-accent/20"),"aria-expanded":!1,"aria-label":n("timeline.expandMessage"),onClick:()=>{t.onProcessDisclosureChange?.(e.id),r(!0)},children:[u(Bd,{status:null}),u(Fd,{children:u(Vr,{className:"size-icon-1","aria-hidden":!0})}),u("span",{className:"min-w-0 flex-1 truncate",children:t.derive.reasoningPreviewText(e.message.text)}),u(Qt,{className:"size-icon-1 shrink-0 -rotate-90","aria-hidden":!0})]})});let s=e.message.attachments??[],i=s.filter(c=>Tr(c)==="image"),l=s.filter(c=>Tr(c)!=="image"),d=e.message.text||(e.message.streaming||s.length>0?"":n("timeline.emptyResponse"));return u(xe,{children:S("div",{className:"relative min-w-0 px-1 py-0.5","data-assistant-text-tone":e.textTone==="process"&&e.presentation!=="compact"?"process":"primary",children:[e.presentation==="compact"?S("div",{className:"mb-1 flex items-center gap-2",children:[u("button",{type:"button",className:"chat-process-meta mb-1 rounded-sm text-secondary-label","aria-expanded":!0,onClick:()=>{t.onProcessDisclosureChange?.(e.id),r(!1)},children:n("timeline.collapseMessage")}),e.copyInFooter?null:u(Ts,{text:e.message.text,variant:"ghost"})]}):null,e.modelBadge?u(bU,{badge:e.modelBadge,createdAt:e.message.createdAt}):null,u("div",{"data-assistant-quote-body":"",children:u(yo,{disclosureKey:`message:${e.message.id}:assistant`,text:d,className:e.textTone==="process"&&e.presentation!=="compact"?"chat-commentary":"chat-readable-body",cwd:t.markdownCwd,threadRef:t.threadRef??void 0,isStreaming:!!e.message.streaming,lineBreaks:t.derive.shouldPreserveAssistantLineBreaks(d),skills:t.skills,onImageExpand:t.onImageExpand,artifactTurnId:e.message.turnId})}),u(Ud,{images:i}),l.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:l.map(c=>u(zd,{attachment:c},c.id))}),e.showAssistantMeta||e.showAssistantCopyButton&&!e.assistantCopyStreaming&&e.message.text.trim().length>0?S("div",{className:"mt-1.5 flex items-center gap-2 text-chat-row tabular-nums opacity-0 transition-opacity duration-(--control-duration) focus-within:opacity-100 group-hover/assistant:opacity-100 [@media(pointer:coarse)]:opacity-100",children:[u(xU,{row:e}),e.showAssistantMeta&&!e.message.streaming&&e.modelBadge===null&&S(He,{children:[u($e,{render:u("p",{className:"text-muted-foreground text-chat-row tabular-nums"}),children:Gr(e.message.updatedAt,t.timestampFormat,n)}),u(Ke,{children:wr(e.message.updatedAt,t.timestampFormat)})]})]}):null]})})}function xU({row:e}){let n=at(kt).derive.resolveAssistantMessageCopyState({text:e.message.text??null,showCopyButton:e.showAssistantCopyButton,streaming:e.assistantCopyStreaming});return n.visible?u(Ts,{text:n.text??"",variant:"ghost"}):null}function Yg({badge:e}){return S(xe,{children:[e.driverKind?u("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg border border-border/60 bg-card","aria-label":e.providerDisplayName??void 0,children:u(Qo,{driver:e.driverKind,displayName:e.providerDisplayName,accentColor:e.accentColor,className:"size-5",iconClassName:"size-4"})}):null,S("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[e.driverKind?u("span",{className:"font-medium text-foreground",children:e.providerDisplayName}):null,u("span",{className:"min-w-0 truncate text-muted-foreground",children:e.modelLabel}),e.effortLabel?S("span",{children:[" \xB7 ",e.effortLabel]}):null]})]})}function bU({badge:e,createdAt:t}){let n=at(kt),{t:o}=Xe();return S("div",{className:"mb-3 flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 text-chat-dense text-muted-foreground","data-testid":"assistant-model-header",children:[u(Yg,{badge:e}),u("span",{"aria-hidden":!0,children:"\xB7"}),S(He,{children:[u($e,{render:u("span",{className:"shrink-0 tabular-nums"}),children:Gr(t,n.timestampFormat,o)}),u(Ke,{children:wr(t,n.timestampFormat)})]})]})}function fI({row:e}){let{t}=Xe(),n=e.badge.effortLabel?`${e.badge.modelLabel} \xB7 ${e.badge.effortLabel}`:e.badge.modelLabel,o=[e.badge.providerDisplayName,n].filter(a=>typeof a=="string"&&a.length>0).join(" \xB7 "),r=e.pending?t("timeline.modelSwitchPending",{model:o}):t("timeline.modelSwitched",{model:o});return S("div",{role:"separator","aria-label":r,"data-pending":e.pending?"true":void 0,className:"flex items-center gap-2 px-1 py-1 text-chat-dense text-muted-foreground/70",children:[u("span",{"aria-hidden":!0,className:"h-px min-w-4 flex-1 bg-border/60"}),S("span",{className:"flex min-w-0 shrink items-center gap-1.5",children:[e.badge.driverKind?u(Qo,{driver:e.badge.driverKind,displayName:e.badge.providerDisplayName,accentColor:e.badge.accentColor,className:"size-icon-1",iconClassName:"size-icon-1"}):null,u("span",{className:"truncate",children:r})]}),u("span",{"aria-hidden":!0,className:"h-px min-w-4 flex-1 bg-border/60"})]})}var Jg=240,SU=/\s/u;function pI(e){if(!e)return null;let t=[],n=0,o=!1,r=()=>{for(;n>Jg-1;)n-=t.pop()?.length??0;for(;t.at(-1)===" ";)t.pop(),n-=1;return t.push("\u2026"),t.join("")};for(let a of e){if(SU.test(a)){o=t.length>0;continue}if(o&&(t.push(" "),n+=1,o=!1,n>Jg)||(t.push(a),n+=a.length,n>Jg))return r()}return t.length>0?t.join(""):null}function IU(e,t,n){let o=t.find(s=>s.kind==="message"&&s.message.role==="user"),r=o?.kind==="message"?o.message:null,a=null;for(let s of t)s.kind==="message"&&s.message.role==="assistant"&&(a=s.message.text??null);return{id:e,sectionKey:e,anchorRowId:o?.id??t[0]?.id??e,userText:r===null?null:pI(n.parseSystemNotificationText(r.text)?.summary??n.parseThreadHandoverText(r.text)?.body??r.text),assistantText:pI(a),headerText:r===null?null:iI(r.text,n)}}function wU(e){for(let t of e){let n=t.kind==="message"?t.message.turnId??null:t.kind==="turn-summary"?t.footer.turnId:null;if(n!==null)return n}return null}function TU(e,t){return e.sectionKey===t.sectionKey&&e.anchorRowId===t.anchorRowId&&e.userText===t.userText&&e.assistantText===t.assistantText&&e.headerText===t.headerText&&e.turnId===t.turnId}function PU(e,t,n){for(let o=0;o<e.length;o+=1)if(e[o]!==n[t.firstRowIndex+o])return!1;return!0}function kU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function LU(e){let t=new Map,n=null;return o=>{let r=o.getVersion();if(n!==null&&n.store===o&&n.version===r)return n.entries;let a=new Map,s=[],i=o.getRows();for(let d of o.getStructure().sections){let c=t.get(d.key);if(c!==void 0&&c.rowIds===d.rowIds&&PU(c.rows,d,i)){a.set(d.key,c),s.push(c.entry);continue}let f=i.slice(d.firstRowIndex,d.firstRowIndex+d.rowIds.length),p=IU(d.key,f,e),m={...p,turnId:wU(f)},h=c!==void 0&&TU(c.entry.item,m)?c.entry:{summary:p,item:m};a.set(d.key,{rowIds:d.rowIds,rows:f,entry:h}),s.push(h)}t=a;let l=n!==null&&kU(n.entries,s)?n.entries:s;return n={store:o,version:r,entries:l},l}}var mI=new WeakMap;function vI(e,t){let n=mI.get(e);return(n===void 0||n.derive!==t)&&(n={derive:t,read:LU(t)},mI.set(e,n)),n.read(e)}var gI=new WeakMap;function yI(e,t){let n=vI(e,t),o=gI.get(n);return o===void 0&&(o=n.flatMap(({summary:r})=>r.headerText===null?[]:[{sectionKey:r.sectionKey,text:r.headerText}]),gI.set(n,o)),o}function CI(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,o)=>n.sectionKey===t[o].sectionKey&&n.text===t[o].text)}var hI=new WeakMap;function xI(e,t){let n=vI(e,t),o=hI.get(n);return o===void 0&&(o=n.filter(({summary:r})=>r.userText!==null).map(({item:r})=>r),hI.set(n,o)),o}function bI(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,o)=>n===t[o])}var AU=[],RU=e=>e.getMeta().usageByTurnId,EU=e=>e.getMeta().exportApi,MU=e=>e.getMeta().status.totalTurnCount??null,SI=me(function({rowsStore:t,derive:n,paneVisible:o,bottomInset:r,onSelect:a,onTurnNavigatorChange:s}){let i=E(m=>o?xI(m,n):AU,[n,o]),l=Tn(t,i,bI),d=Tn(t,RU),c=Tn(t,EU),f=Tn(t,MU),p=q(()=>o?{items:l,totalTurnCount:f,bottomInset:r,usageByTurnId:d,onSelect:a,exportMarkdown:c.markdown,onDownload:c.download}:null,[r,c,l,a,o,f,d]);return $(()=>{p!==null&&s(p)},[s,p]),$(()=>{if(o)return()=>s(null)},[s,o]),null});function II({timeline:e,previousOverlayHeight:t,overlayHeight:n,followingEnd:o}){e&&o&&n>t&&e.scrollToEnd({animated:!1})}function wI(e,t){let n=e.topOf(t),o=e.heightOf(t);return typeof n!="number"||typeof o!="number"||!Number.isFinite(n)||!Number.isFinite(o)?null:n+Math.max(1,o)}function TI({measurement:e,followingEnd:t}){return t?null:e.rowAtScroll()}function Pf(e,t){let n=Array.from(e.querySelectorAll("[data-timeline-turn-section]")),o=n.findIndex(a=>a.querySelector(`[data-timeline-row-id="${CSS.escape(t)}"]`)),r=o<0?n:n.slice(0,o+1);for(let a of r)a.style.contentVisibility="visible";e.offsetHeight,requestAnimationFrame(()=>{for(let a of r)a.style.removeProperty("content-visibility")})}Z();var NU=e=>e.getMeta().status.workingStepLabel??null,_U=e=>e.getMeta().status.stall??null,DU=e=>e.getMeta().status.retry??null,OU=e=>e.getMeta().status.isWorking,PI=me(function({rowsStore:t,historyWindow:n,children:o}){let r=Tn(t,NU),a=Tn(t,_U),s=Tn(t,DU),i=q(()=>n?{workingStepLabel:null,stall:null,retry:null}:{workingStepLabel:r,stall:a,retry:s},[n,s,a,r]);return u(cf,{value:i,children:o})});function kI({rowsStore:e,historyWindow:t}){let{t:n}=Xe();return Tn(e,OU)&&!t?null:u("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:u("p",{className:"text-placeholder text-chat",children:n("timeline.empty")})})}var LI=u("div",{className:"h-3 sm:h-4"}),AI=u("div",{className:"h-10 sm:h-12"});function RI({loading:e,blocked:t,onLoadEarlier:n,fade:o}){let{t:r}=Xe();return u("div",{className:o?"pt-10 sm:pt-12":"pt-3 sm:pt-4",children:u("div",{className:"transcript-col pb-2",children:u("button",{type:"button",onClick:n,disabled:e||t,className:"relative w-full py-1.5 text-chat-row text-muted-foreground/60 hover:text-foreground disabled:cursor-default pointer-coarse:after:absolute pointer-coarse:after:inset-0 pointer-coarse:after:min-h-11",children:r(e?"timeline.loadingEarlier":"timeline.loadEarlier")})})})}function EI({loading:e,blocked:t,onLoadLater:n,onReturnToLatest:o}){let{t:r}=Xe();return S("div",{className:"transcript-col flex items-center justify-center gap-2 py-2",children:[u(ie,{variant:"ghost",size:"sm",onClick:n,disabled:e||t,children:r(e?"timeline.loadingLater":"timeline.loadLater")}),o?u(ie,{variant:"ghost",size:"sm",onClick:o,children:r("timeline.returnToLatest")}):null]})}function MI({onReveal:e,fade:t}){let{t:n}=Xe();return u("div",{className:t?"pt-10 sm:pt-12":"pt-3 sm:pt-4",children:u("div",{className:"transcript-col pb-2",children:u("button",{type:"button",onClick:e,className:"relative w-full py-1.5 text-chat-row text-muted-foreground/60 hover:text-foreground pointer-coarse:after:absolute pointer-coarse:after:inset-0 pointer-coarse:after:min-h-11",children:n("timeline.loadEarlier")})})})}var NI=u("div",{className:"h-3 sm:h-4"});Z();var FU=Object.freeze([]),_I=e=>e.getMeta().status.scheduledWakes??FU;function DI(e,t){let n=M(e);return t&&(n.current=e),n.current}Z();function kf(e){return JSON.stringify([e.turnId??null,e.toolCallId?"tool":"entry",e.toolCallId||e.id])}Z();function Qr(e){if(!Number.isFinite(e)||e<0)return"0ms";if(e<1e3)return`${Math.max(1,Math.round(e))}ms`;if(e<1e4){let s=Math.round(e/100)/10;return s>=10?"10s":`${s.toFixed(1)}s`}if(e<6e4)return`${Math.round(e/1e3)}s`;let t=Math.round(e/1e3),n=Math.floor(t/3600),o=Math.floor(t%3600/60),r=t%60,a=[];return n>0&&a.push(`${n}h`),o>0&&a.push(`${o}m`),r>0&&a.push(`${r}s`),a.join(" ")}function OI({badge:e,startedAt:t,completedAt:n,timestampFormat:o}){let{t:r}=Xe();if(e===null&&t===void 0)return null;let a=r("timeline.turnInfo");return S(br,{children:[u(Ir,{openOnHover:!0,delay:250,render:u(ie,{type:"button",size:"icon-xs",variant:"ghost","data-turn-info":"","aria-label":a,className:"shrink-0 text-muted-foreground"}),children:u(md,{className:"size-3.5","aria-hidden":!0})}),u(Sr,{side:"top",align:"start",className:"max-w-80",children:S("div",{className:"flex flex-col gap-2 text-chat-dense",children:[e!==null?u("div",{className:"flex min-w-0 items-center gap-2",children:u(Yg,{badge:e})}):null,t!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnStarted",{time:wr(t,o)})}):null,n!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnFinished",{time:wr(n,o)})}):null]})})]})}function BU(e){return e<1e3?Math.round(e).toLocaleString():e<1e6?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,"")}m`}function Zg({label:e,children:t}){let[n,o]=Q(!1);return S(He,{open:n,onOpenChange:o,children:[u($e,{render:u("button",{type:"button",className:"inline-flex items-center gap-1 rounded-sm"}),"aria-label":e,onClick:()=>o(r=>!r),children:t}),u(Ke,{children:e})]})}var FI=me(function({footer:t,timestampFormat:n,copyText:o,identity:r}){let{t:a}=Xe(),s=t.state,i=s==="error"?a("timeline.error"):s==="interrupted"?a("timeline.interrupted"):null;return S("div",{"data-turn-summary":t.turnId,className:"chat-process-meta flex min-w-0 items-center gap-2 px-1 text-muted-foreground",children:[S("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[i!==null?S(Zg,{label:i,children:[s==="error"?u(qt,{className:"size-icon-1 text-destructive","aria-hidden":!0}):u(Td,{className:"size-3","aria-hidden":!0}),u("span",{className:"sr-only",children:i})]}):null,t.workingElapsedMs!==void 0?u(Zg,{label:a("timeline.workingTime",{duration:Qr(t.workingElapsedMs)}),children:Qr(t.workingElapsedMs)}):null,t.workingElapsedMs!==void 0&&t.outputTokens!==void 0?u("span",{"aria-hidden":!0,children:"\xB7"}):null,t.outputTokens!==void 0?u(Zg,{label:`${a("timeline.outputTokens")}: ${t.outputTokens.toLocaleString()}`,children:a("timeline.outputTokenCount",{count:t.outputTokens,value:BU(t.outputTokens)})}):null]}),u(OI,{badge:r?.badge??null,startedAt:r?.createdAt,completedAt:t.completedAt,timestampFormat:n}),o?u(Ts,{text:o,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"}):null]})});Z();Z();function BI(e){if(e<1e3)return String(e);if(e<1e6){let n=e/1e3;return`${n<10?n.toFixed(1).replace(/\.0$/,""):Math.round(n)}k`}if(e<1e9){let n=e/1e6;return`${n<10?n.toFixed(1).replace(/\.0$/,""):Math.round(n)}m`}let t=e/1e9;return`${t<10?t.toFixed(1).replace(/\.0$/,""):Math.round(t)}b`}var UI=me(function(t){let{additions:n,deletions:o,className:r,showParentheses:a=!1,layout:s="aligned"}=t,{t:i}=Xe(),l=new Intl.ListFormat(void 0,{type:"unit"}).format([i("changedFiles.additions",{count:n}),i("changedFiles.deletions",{count:o})]);return S(xe,{children:[a&&u("span",{className:"text-muted-foreground/70",children:"("}),S("span",{role:"group","aria-label":l,className:K(s==="inline"?"inline-flex items-center gap-1 tabular-nums align-middle":"inline-grid grid-cols-[4ch_4ch] gap-2 text-right tabular-nums align-middle",r),children:[S("span",{"aria-hidden":"true",className:"font-mono text-diff-addition",children:["+",BI(n)]}),S("span",{"aria-hidden":"true",className:"font-mono text-diff-deletion",children:["-",BI(o)]})]}),a&&u("span",{className:"text-muted-foreground/70",children:")"})]})});function Kd({name:e,className:t}){switch(e){case"bot":return u(ls,{className:t,"aria-hidden":!0});case"check":return u(Nn,{className:t,"aria-hidden":!0});case"circle-alert":return u(Zt,{className:t,"aria-hidden":!0});case"eye":return u(id,{className:t,"aria-hidden":!0});case"globe":return u(ud,{className:t,"aria-hidden":!0});case"hammer":return u(pd,{className:t,"aria-hidden":!0});case"message-circle":return u(gs,{className:t,"aria-hidden":!0});case"search":return u(xs,{className:t,"aria-hidden":!0});case"square-pen":return u(oo,{className:t,"aria-hidden":!0});case"terminal":return u(ho,{className:t,"aria-hidden":!0});case"wrench":return u(Pd,{className:t,"aria-hidden":!0});case"x":return u(qt,{className:t,"aria-hidden":!0});case"zap":return u(Ss,{className:t,"aria-hidden":!0})}}function UU(e){switch(e){case"read":return"eye";case"edit":return"square-pen";case"command":return"terminal";case"search":return"globe";case"code-search":return"search";case"other":return"wrench";case"dynamic-tool":return"hammer";case"agent-tool":return"bot";case"tone-tool":return"zap";case"mixed":case null:return"hammer"}}function eh(e,t){let n=new Map;for(let o of e){let r=t(o);n.set(r,(n.get(r)??0)+1)}return Array.from(n,([o,r])=>({action:o,icon:UU(o),count:r}))}function th(e,t){let n;for(let o of eh(e,t))(!n||o.count>n.count)&&(n=o);return n?.icon??"wrench"}var Bi=20;function Ui(e){return kf(e)}function zI(e,t,n){let o=e.toolLabel,r=n.resolveToolCommand(e);if(r&&o?.descriptive&&!o.path&&o.detail?.trim())return o.detail.replace(/\s+/g," ").trim();for(let p of[e.rawCommand,e.command]){let m=n.parseToolCommandInput(p)?.description;if(m)return m.replace(/\s+/g," ").trim()}if(r)return r.replace(/\s+/g," ").trim();let a=typeof e.toolData=="object"&&e.toolData!==null&&!Array.isArray(e.toolData)?e.toolData:null,s=typeof a?.toolName=="string"?a.toolName:typeof a?.name=="string"?a.name:void 0,i=o?.name??s??e.toolTitle??e.label,l=o?.path??e.changedFiles?.[0],d=l?hf(l,t):void 0,c=[i.trim().toLowerCase()==="tool"?void 0:i,d,o?.detail??e.detail],f=[];for(let p of c){let m=p?.replace(/\s+/g," ").trim();m&&!f.some(h=>h.toLowerCase()===m.toLowerCase())&&f.push(m)}return f.join(" ")||null}function HI({entry:e,failed:t}){let n=e.toolLabel?.diffStat;return!n||t||nh(e)?null:u(UI,{...n,layout:"inline",className:"chat-process-meta ms-2 shrink-0"})}function nh(e){return e.toolLifecycleStatus==="declined"||e.toolLifecycleStatus==="stopped"}function KI({toolIcon:e,glyphClassName:t}){let n=at(kt),o=n.SiteIcon;return e.pageUrl!==void 0&&o!==void 0?u(o,{threadRef:n.threadRef,pageUrl:e.pageUrl,className:"size-3.5 shrink-0 rounded-sm object-contain"}):u(Kd,{name:"globe",className:t})}function zU({entry:e,failed:t=!1,derive:n}){return t?u(Zt,{"aria-hidden":!0,className:"size-icon-1 shrink-0 text-destructive"}):e.toolIcon!==void 0?u(KI,{toolIcon:e.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"}):u(Kd,{name:th([e],n.toolGroupAction),className:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"})}function HU({entries:e,failed:t,derive:n}){let{t:o}=Xe(),r=q(()=>eh(e,n.toolGroupAction),[e,n]),a=r.length===1;return a&&r[0].count<2?null:u("span",{className:"chat-process-meta flex shrink-0 items-center gap-2 tabular-nums","aria-label":o("toolGroup.calls",{count:e.length}),children:r.map(({action:s,icon:i,count:l})=>S("span",{"aria-hidden":!0,className:"flex items-center gap-1",children:[a?null:u(Kd,{name:i,className:K("size-icon-1 shrink-0 stroke-[1.8] opacity-70",t?"text-destructive":"text-icon-muted")}),l]},s))})}function $I({entry:e}){let t=at(kt),n=e.detail??e.command??e.rawCommand??e.toolLabel?.detail,o=JSON.stringify([e.id,e.sourceActivityKind,e.toolLifecycleStatus]),r=t.renderToolCallDetail?.({entry:e,threadRef:t.threadRef,threadKey:t.threadKey,workspaceRoot:t.workspaceRoot,revision:o,onOpenFileDiff:t.onOpenFileDiff});return u("div",{className:"min-w-0 space-y-2 p-3",children:r!==void 0?u(xe,{children:r}):u("pre",{className:"chat-tool-body overflow-x-auto rounded-md bg-muted/40 p-2",children:n??""})})}var KU=me(function(t){let{entry:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}=t,i=at(kt).derive,{t:l}=Xe(),[d,c]=io(o,`call:${Ui(n)}`,!1),f=i.workEntryIndicatesFailure(n),p=nh(n),m=i.resolveWorkEntryStatus(n),h=m==="failed"||m==="running"?m:null,g=hr();return S("div",{"data-tool-call-id":n.toolCallId??n.id,"data-tool-identity":Ui(n),className:"border-b border-border/50 last:border-b-0",children:[S("button",{type:"button","aria-expanded":d,"aria-controls":g,onClick:()=>{a?.(),c(!d)},className:K("chat-tool-member-row chat-tool-summary flex w-full min-w-0 items-center gap-1.5 px-3 text-left hover:bg-accent/20",f?"text-destructive":"text-muted-foreground"),children:[u(Bd,{status:h}),u(Fd,{children:u(zU,{entry:n,failed:f,derive:i})}),S("span",{className:"flex min-w-0 flex-1 items-center",children:[u("span",{className:"truncate",children:zI(n,r,i)??l("toolGroup.calls",{count:1})}),u(HI,{entry:n,failed:f})]}),f||p?u("span",{className:"chat-process-meta shrink-0",children:f?l("toolGroup.failed",{count:1}):l("toolGroup.cancelled",{count:1})}):null,u(Qt,{"aria-hidden":!0,className:K("size-icon-1 shrink-0",!d&&"-rotate-90")})]}),d?u("div",{id:g,children:u($I,{entry:n})}):null]})});function $U({threadKey:e,stateKey:t,maxHeight:n,children:o}){let r=M(null);return ve(()=>{let a=r.current;if(!a)return;a.scrollTop=Gg(e,`${t}:scroll`,0);let s=()=>{Od(e,`${t}:scroll`,a.scrollTop,!1)};return a.addEventListener("scroll",s,{passive:!0}),()=>a.removeEventListener("scroll",s)},[e,t]),u("div",{ref:r,"data-slot":"scroll-area-viewport",className:"min-w-0 overflow-y-auto overscroll-y-contain",style:{maxHeight:n},children:o})}var qI=me(function({entries:t,groupId:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}){let i=at(kt).derive,{t:l}=Xe(),[d,c]=io(o,`group:${n}`,!1),[f,p]=io(o,`group-page:${n}`,0),m=hr(),h=M(null),[g,v]=Q(null),y=t.at(-1),C=q(()=>t.filter(O=>i.workEntryIndicatesFailure(O)),[t,i]),b=q(()=>t.filter(nh),[t]),x=t.filter(O=>O.toolLifecycleStatus==="inProgress").length,w=C[0]??b[0],I=w??y,P=Math.max(0,Math.ceil(t.length/Bi)-1),k=Math.min(f,P),T=k*Bi,L=t.slice(T,T+Bi),A=t.length>1;if(ve(()=>{if(!g)return;let O=h.current,j=Array.from(O?.querySelectorAll("[data-tool-identity]")??[]).find(U=>U.dataset.toolIdentity===g.id);if(!j)return;let F=j.closest('[data-slot="scroll-area-viewport"]');F&&(F.scrollTop+=j.getBoundingClientRect().top-F.getBoundingClientRect().top),j.querySelector("button")?.focus({preventScroll:!0})},[g]),!y||!I)return null;let N=O=>{a?.(),p(O)},R={threadKey:o,workspaceRoot:r,onDisclosureChange:a},D=MS(t.map(O=>ES(i.resolveWorkEntryStatus(O)))),H=th(t,i.toolGroupAction),z=D==="failed"?"failed":D==="running"?"running":"success";return u(ff,{state:D,variant:"tool",children:S("section",{ref:h,"data-tool-group-id":n,className:"min-w-0",children:[S("div",{className:"flex min-w-0 items-center",children:[S("button",{type:"button","aria-expanded":d,"aria-controls":m,onClick:()=>{a?.(),c(!d),!A&&!d&&Od(o,`call:${Ui(y)}`,!0)},className:K(uf,"flex-1",w?"text-destructive":"text-muted-foreground"),children:[u(Bd,{status:z}),u(Fd,{children:!A&&y.toolIcon!==void 0&&C.length===0?u(KI,{toolIcon:y.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] opacity-70 text-icon-muted"}):u(Kd,{name:H,className:K("size-icon-1 shrink-0 stroke-[1.8] opacity-70",C.length>0?"text-destructive":"text-icon-muted")})}),S("span",{className:K("flex min-w-0 flex-1 items-center",d&&A?"chat-process-text":"chat-tool-summary"),children:[u("span",{className:"truncate",children:d&&A?l("toolGroup.calls",{count:t.length}):zI(I,r,i)??l("toolGroup.calls",{count:1})}),d&&A?null:u(HI,{entry:I,failed:i.workEntryIndicatesFailure(I)})]}),x>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.running",{count:x})}):null,C.length>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.failed",{count:C.length})}):null,b.length>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.cancelled",{count:b.length})}):null,d&&A?null:u(HU,{entries:t,failed:C.length>0,derive:i}),u(Qt,{"aria-hidden":!0,className:K("size-icon-1 shrink-0",!d&&"-rotate-90")})]}),w&&A?u("button",{type:"button",className:"chat-process-meta me-2 min-h-8 shrink-0 rounded-control-4 px-1 text-destructive underline [@media(pointer:coarse)]:min-h-11",onClick:()=>{a?.(),c(!0),p(Math.floor(t.indexOf(w)/Bi)),Od(o,`call:${Ui(w)}`,!0),v({id:Ui(w)})},children:l("toolGroup.showFailure")}):null]}),d?u("div",{id:m,className:"border-t border-border/50",children:A?S(xe,{children:[t.length>Bi?S("div",{className:"chat-process-meta flex items-center gap-1 border-b border-border/40 px-2 py-1 text-muted-foreground",children:[u("span",{className:"min-w-0 flex-1 tabular-nums",children:l("toolGroup.pageRange",{from:T+1,to:Math.min(T+Bi,t.length),count:t.length})}),[{label:l("toolGroup.firstPage"),target:0,disabled:k===0,Icon:ad},{label:l("toolGroup.previousPage"),target:k-1,disabled:k===0,Icon:ds},{label:l("toolGroup.nextPage"),target:k+1,disabled:k===P,Icon:go},{label:l("toolGroup.lastPage"),target:P,disabled:k===P,Icon:sd}].map(({label:O,target:j,disabled:F,Icon:U})=>u("button",{type:"button","aria-label":O,disabled:F,onClick:()=>N(j),className:"flex size-7 items-center justify-center rounded-control-3 disabled:opacity-64 [@media(pointer:coarse)]:size-11",children:u(U,{"aria-hidden":!0,className:"size-icon-1"})},O))]}):null,u($U,{threadKey:o,stateKey:`group-scroll:${n}:${k}`,maxHeight:"min(320px, 50dvh)",children:u("div",{className:"space-y-0.5 py-1",children:L.map(O=>u(KU,{entry:O,...R},Ui(O)))})})]}):u($I,{entry:y})}):null]})})});Z();function VI(){let e=Eo(),t=r=>r instanceof Error?r.message:void 0,n=(r,a)=>a!==void 0&&a.length>0?`${r}: ${a}`:r,o=(r,a,s)=>e.notify(r,a,s);return{error:(r,a,s)=>{let i=s?.description??t(a);o(n(r,i),"error",i)},warning:(r,a,s)=>{let i=s?.description??t(a);o(n(r,i),"warning",i)},success:(r,a,s)=>{let i=a??s?.description;o(n(r,i),"success",i)}}}function Lf(e){let t=e.match(/^\s{0,3}#{1,6}\s+(.+)$/m)?.[1]?.trim();return t&&t.length>0?t:null}function oh(e){let t=e.trimEnd().split(/\r?\n/),n=t[0]&&/^\s{0,3}#{1,6}\s+/.test(t[0])?t.slice(1):[...t];for(;n[0]?.trim().length===0;)n.shift();if(n[0]?.match(/^\s{0,3}#{1,6}\s+(.+)$/)?.[1]?.trim().toLowerCase()==="summary")for(n.shift();n[0]?.trim().length===0;)n.shift();return n.join(`
3791
3791
  `)}function WI(e,t,n){let o=n?.maxLines??8,r=oh(e).trimEnd().split(/\r?\n/).map(l=>l.trimEnd()),a=[],s=0,i=!1;for(let l of r){let d=l.trim().length>0;if(d&&s>=o){i=!0;break}a.push(l),d&&(s+=1)}for(;a.length>0&&a.at(-1)?.trim().length===0;)a.pop();return a.length===0?Lf(e)??t("proposedPlan.previewUnavailable"):(i&&a.push("","..."),a.join(`
3792
3792
  `))}function qU(e){let t=e.toLowerCase().replace(/[`'".,!?()[\]{}]+/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return t.length>0?t:"plan"}function GI(e){let t=Lf(e);return`${qU(t??"plan")}.md`}function jI(e){return`${e.trimEnd()}
3793
3793
  `}function QI(e,t){let n=new Blob([t],{type:"text/markdown;charset=utf-8"}),o=URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download=e,r.click(),window.setTimeout(()=>{URL.revokeObjectURL(o)},0)}function $d(e,t,n="duration"){let o=`<${n}></${n}>`,r=`<${n}/>`,a=i=>{let l=e.indexOf(i);return l<0?null:[e.slice(0,l),e.slice(l+i.length)]},s=a(o)??a(r);return s===null?S(xe,{children:[e,t]}):S(xe,{children:[s[0],t,s[1]]})}var Af=1024,XI=me(function({planMarkdown:t,threadKey:n,rowId:o,environmentId:r,threadRef:a,cwd:s,workspaceRoot:i,onSavePlanToWorkspace:l}){let{t:d}=Xe(),c=VI(),[f,p]=io(n,`proposed-plan:${o}:expanded`,!1),[m,h]=Q(!1),[g,v]=io(n,`proposed-plan:${o}:save-path`,""),[y,C]=Q(!1);Mu(o,m||y);let b=M(!1),x=M(!1);ve(()=>(b.current=!0,()=>{b.current=!1}),[]);let{copyToClipboard:w,isCopied:I}=pf({target:"plan",onError:F=>{c.error(d("proposedPlan.couldNotCopy"),F,{description:d("proposedPlan.copyErrorDescription")})}}),P=hr(),k=Lf(t)??d("proposedPlan.defaultTitle"),T=t.split(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-conversation",
3
- "version": "0.2.2860",
3
+ "version": "0.2.2862",
4
4
  "description": "The conversation surface: chat and trajectory views, the input card, the queue, and turn navigation.",
5
5
  "keywords": [
6
6
  "chat",
@@ -42,7 +42,7 @@
42
42
  "typescript": "~6.0.3",
43
43
  "vite-plus": "0.2.2",
44
44
  "zustand": "^5.0.11",
45
- "@ycodium-ai/plugin-api": "0.2.2860"
45
+ "@ycodium-ai/plugin-api": "0.2.0"
46
46
  },
47
47
  "ycodium": {
48
48
  "plugin": "./dist/index.js",