@ycodium-ai/plugin-conversation 0.2.2870 → 0.2.2874

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
@@ -3836,7 +3836,7 @@ ${a}`:r).join(`
3836
3836
  ${t.context.body}`:t.context.header;return u(uI,{label:t.context.header,tooltipText:n})}),vI=me(function(t){let n=t.context.body?`${t.context.header}
3837
3837
  ${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(Cr,{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 yI(e){let t=it(Mt),{t:n}=Ye();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=yf([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(xs,{className:"size-3"}),e.annotation.styleChanges.length]}):null]})]})]})}var PU=8,kU=600,LU=1.75,hI=`linear-gradient(to bottom, black calc(100% - ${LU}rem), transparent)`;function AU(e){return e.trim().length===0?!1:e.length>kU||e.split(`
3838
3838
  `).length>PU}var CI=me(function(t){let n=it(Mt),{t:o}=Ye(),[r,a]=lo(n.threadKey,`${t.disclosureKey}:expanded`,!1),s=t.text.trim().length>0||t.terminalContexts.length>0,i=s&&AU(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:hI,maskImage:hI}:void 0,children:u(RU,{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]})}),RU=me(function(t){let n=it(Mt),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(Co,{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=bf(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(Co,{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(EU,{comment:a.comment,disclosureKey:`${t.disclosureKey}:review-comment:${a.comment.id}`},a.comment.id))});if(t.terminalContexts.length>0){let a=mI(t.text,t.terminalContexts),s=pI(t.terminalContexts),i=[];if(a){let l=0;for(let d of t.terminalContexts){let c=kf(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(gI,{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(gI,{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(Co,{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(Co,{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 EU({comment:e,disclosureKey:t}){let n=it(Mt),{t:o}=Ye(),r=e.fenceLanguage??"diff",a=oI(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:xf(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(cI,{text:e.text,skills:n.skills})}),r!=="diff"&&e.diff.trim().length>0&&u(Co,{disclosureKey:`${t}:fence`,text:nI(r,e.diff),cwd:n.markdownCwd,threadRef:n.threadRef??void 0,skills:n.skills,className:"text-message-foreground"}),a?u(cS,{patch:a}):null]})}var MU=/\n*<preview_annotation>\n((?:(?!<preview_annotation>)[\s\S])*)\n<\/preview_annotation>\s*$/;function Lf(e){let t=MU.exec(e);if(!t)return{promptText:e,annotation:null};let n=t[1]??"",o=n.split(`
3839
- `),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 xI({row:e,text:t}){let{t:n}=Ye(),o=it(Mt),r=e.message.attachments??[],a=Pf(t),s=a.contexts,i=[],l=a.visibleText;for(;;){let C=Lf(l);if(!C.annotation)break;i.unshift(C.annotation),l=C.promptText}let d=Hi(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=>Pr(C)==="image"),h=p.filter(C=>Pr(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(NU,{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(Kd,{images:m}),h.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:h.map(C=>u($d,{attachment:C},C.id))}),i.map((C,x)=>u(yI,{annotation:C,image:f[x]??null},C.id)),c.length>0?u("div",{className:"mb-2 flex flex-wrap gap-1.5",children:c.map(C=>u(vI,{context:C},`${C.header}:${C.body}`))}):null,u(CI,{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 select-none 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:Tr(e.message.createdAt,o.timestampFormat)})]}),o.onForkFromUserMessage!==null&&u(_U,{messageId:e.message.id,onFork:o.onForkFromUserMessage}),a.copyText&&u(Ls,{text:a.copyText,variant:"ghost"})]})]})}function NU({author:e}){return S("div",{className:"flex min-w-0 max-w-[min(70%,40rem)] select-none items-center gap-1.5 text-chat-dense text-muted-foreground",children:[u(Vb,{userId:e.userId,displayName:e.displayName,size:16}),u("span",{className:"min-w-0 truncate",children:e.displayName})]})}function _U({messageId:e,onFork:t}){let{t:n}=Ye(),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(fd,{className:"size-3"})}),u(Ke,{side:"top",children:o})]})}function oh({row:e}){let t=it(Mt).derive;if(Cf(e.message.text)){let n=t.parsePresetPrefixText(e.message.text);return n?S(Ce,{children:[u(DU,{parsed:n}),n.body.length>0||(e.message.attachments?.length??0)>0?u(oh,{row:{...e,message:{...e.message,text:n.body}}}):null]}):u(FU,{row:e})}return u(xI,{row:e,text:e.message.text})}function Af({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 DU({parsed:e}){let{t}=Ye();return S(Af,{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 OU={"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 FU({row:e}){let{t}=Ye(),n=it(Mt).derive,o=e.message.attachments??[],r=o.filter(l=>Pr(l)==="image"),a=o.filter(l=>Pr(l)!=="image"),s=l=>{let d=XS(l);if(d)return S(Af,{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(Af,{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(Af,{children:[u("p",{className:"font-medium text-foreground/80",children:t(OU[f.kind],{title:f.title})}),f.summary.trim().length>0?u("p",{className:"mt-1 whitespace-pre-wrap",children:f.summary}):null]}):null},i=QS(e.message.text).map(s).filter(l=>l!==null);return i.length===0&&o.length===0?null:S(Ce,{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(Kd,{images:r}),a.map(l=>u($d,{attachment:l},l.id))]}):null]})}function bI(e,t){let n=t.parsePresetPrefixText(e??"")?.body??null;if(n===null&&Cf(e??""))return null;let r=Pf(n??e??"").visibleText;for(;;){let i=Lf(r);if(!i.annotation)break;r=i.promptText}let a=Hi(r).promptText,s=bf(a).map(i=>i.kind==="text"?i.text:i.comment.text).join(" ").replace(/\s+/g," ").trim();return s.length>0?s:null}var SI=34,II=8,qd=SI+II,wI=me(function({ref:t,textRef:n,initialText:o,expanded:r,onToggleExpanded:a}){let{t:s}=Ye(),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:II},"data-timeline-turn-header":"true","data-truncated":"false",children:S("div",{className:K("transcript-col-wide pointer-events-auto flex select-none 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:SI}},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(sd,{}):u(Qt,{})}),u(Ke,{side:"bottom",children:i})]})]})})});function TI({row:e}){let t=it(Mt),{t:n}=Ye(),[o,r]=lo(t.threadKey,`message:${e.message.id}`,!1);if(e.presentation==="compact"&&!o)return u(hf,{state:"idle",children:S("button",{type:"button",className:K(gf,"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(Hd,{status:null}),u(zd,{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=>Pr(c)==="image"),l=s.filter(c=>Pr(c)!=="image"),d=e.message.text||(e.message.streaming||s.length>0?"":n("timeline.emptyResponse"));return u(Ce,{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(Ls,{text:e.message.text,variant:"ghost"})]}):null,e.modelBadge?u(UU,{badge:e.modelBadge,createdAt:e.message.createdAt}):null,u("div",{"data-assistant-quote-body":"",children:u(Co,{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(Kd,{images:i}),l.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:l.map(c=>u($d,{attachment:c},c.id))}),e.showAssistantMeta||e.showAssistantCopyButton&&!e.assistantCopyStreaming&&e.message.text.trim().length>0?S("div",{className:"mt-1.5 flex select-none 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(BU,{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:Tr(e.message.updatedAt,t.timestampFormat)})]})]}):null]})})}function BU({row:e}){let n=it(Mt).derive.resolveAssistantMessageCopyState({text:e.message.text??null,showCopyButton:e.showAssistantCopyButton,streaming:e.assistantCopyStreaming});return n.visible?u(Ls,{text:n.text??"",variant:"ghost"}):null}function rh({badge:e}){let{t}=Ye(),n=eh(t,e);return S(Ce,{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}),n?S("span",{children:[" \xB7 ",n]}):null]})]})}function UU({badge:e,createdAt:t}){let n=it(Mt),{t:o}=Ye();return S("div",{className:"mb-3 flex min-w-0 select-none flex-wrap items-center gap-x-2.5 gap-y-1 text-chat-dense text-muted-foreground","data-testid":"assistant-model-header",children:[u(rh,{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:Tr(t,n.timestampFormat)})]})]})}function PI({row:e}){let{t}=Ye(),n=eh(t,e.badge),o=n?`${e.badge.modelLabel} \xB7 ${n}`:e.badge.modelLabel,r=[e.badge.providerDisplayName,o].filter(s=>typeof s=="string"&&s.length>0).join(" \xB7 "),a=e.pending?t("timeline.modelSwitchPending",{model:r}):t("timeline.modelSwitched",{model:r});return S("div",{role:"separator","aria-label":a,"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:a})]}),u("span",{"aria-hidden":!0,className:"h-px min-w-4 flex-1 bg-border/60"})]})}var ah=240,zU=/\s/u;function kI(e){if(!e)return null;let t=[],n=0,o=!1,r=()=>{for(;n>ah-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(zU.test(a)){o=t.length>0;continue}if(o&&(t.push(" "),n+=1,o=!1,n>ah)||(t.push(a),n+=a.length,n>ah))return r()}return t.length>0?t.join(""):null}function HU(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:kI(n.parseSystemNotificationText(r.text)?.summary??n.parseThreadHandoverText(r.text)?.body??r.text),assistantText:kI(a),headerText:r===null?null:bI(r.text,n)}}function KU(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 $U(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 qU(e,t,n){for(let o=0;o<e.length;o+=1)if(e[o]!==n[t.firstRowIndex+o])return!1;return!0}function VU(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 WU(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&&qU(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=HU(d.key,f,e),m={...p,turnId:KU(f)},h=c!==void 0&&$U(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&&VU(n.entries,s)?n.entries:s;return n={store:o,version:r,entries:l},l}}var LI=new WeakMap;function EI(e,t){let n=LI.get(e);return(n===void 0||n.derive!==t)&&(n={derive:t,read:WU(t)},LI.set(e,n)),n.read(e)}var AI=new WeakMap;function MI(e,t){let n=EI(e,t),o=AI.get(n);return o===void 0&&(o=n.flatMap(({summary:r})=>r.headerText===null?[]:[{sectionKey:r.sectionKey,text:r.headerText}]),AI.set(n,o)),o}function NI(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 RI=new WeakMap;function _I(e,t){let n=EI(e,t),o=RI.get(n);return o===void 0&&(o=n.filter(({summary:r})=>r.userText!==null).map(({item:r})=>r),RI.set(n,o)),o}function DI(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,o)=>n===t[o])}var GU=[],jU=e=>e.getMeta().usageByTurnId,QU=e=>e.getMeta().exportApi,XU=e=>e.getMeta().status.totalTurnCount??null,OI=me(function({rowsStore:t,derive:n,paneVisible:o,bottomInset:r,onSelect:a,onTurnNavigatorChange:s}){let i=E(m=>o?_I(m,n):GU,[n,o]),l=In(t,i,DI),d=In(t,jU),c=In(t,QU),f=In(t,XU),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 FI({timeline:e,previousOverlayHeight:t,overlayHeight:n,followingEnd:o}){e&&o&&n>t&&e.scrollToEnd({animated:!1})}function BI(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 UI({measurement:e,followingEnd:t}){return t?null:e.rowAtScroll()}function Rf(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 YU=e=>e.getMeta().status.workingStepLabel??null,JU=e=>e.getMeta().status.stall??null,ZU=e=>e.getMeta().status.retry??null,ez=e=>e.getMeta().status.isWorking,zI=me(function({rowsStore:t,historyWindow:n,children:o}){let r=In(t,YU),a=In(t,JU),s=In(t,ZU),i=q(()=>n?{workingStepLabel:null,stall:null,retry:null}:{workingStepLabel:r,stall:a,retry:s},[n,s,a,r]);return u(ff,{value:i,children:o})});function HI({rowsStore:e,historyWindow:t}){let{t:n}=Ye();return In(e,ez)&&!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")})})}Z();function Ef(e){return e==="loading"?"threadSync.loading":"threadSync.syncing"}var tz=1e3,KI=150;function Mf(e,t=tz){let[n,o]=Q(null);return $(()=>{if(e===null){o(null);return}let r=globalThis.setTimeout(()=>{o(e)},t);return()=>{globalThis.clearTimeout(r)}},[e,t]),n}var nz=5;function $I(e){let t=e.data.useThreadSyncPhase(e.target);return Mf(t,KI)==="loading"?u(oz,{}):e.hideEmptyPlaceholder?null:u(HI,{rowsStore:e.rowsStore,historyWindow:e.historyWindow})}function oz(){let{t:e}=le();return S("div",{className:"pointer-events-none absolute inset-0 overflow-hidden bg-background px-3 pt-4 sm:px-5","data-timeline-loading-skeleton":"",role:"status",children:[u("span",{className:"sr-only",children:e(Ef("loading"))}),u("div",{className:"transcript-col flex flex-col gap-6",children:Array.from({length:nz},(t,n)=>S("div",{"aria-hidden":"true",className:"flex flex-col gap-3",children:[u("div",{className:"h-9 self-end rounded-[18px] bg-muted-foreground/15",style:{width:`${44-n%2*14}%`}}),[92,84,61].map((o,r)=>u("div",{className:"h-3 rounded-control-1 bg-muted-foreground/15",style:{width:`${o-n%3*6}%`}},r))]},n))})]})}var qI=u("div",{className:"h-3 sm:h-4"}),VI=u("div",{className:"h-10 sm:h-12"});function WI({loading:e,blocked:t,onLoadEarlier:n,fade:o}){let{t:r}=Ye();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 select-none 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 GI({loading:e,blocked:t,onLoadLater:n,onReturnToLatest:o}){let{t:r}=Ye();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 jI({onReveal:e,fade:t}){let{t:n}=Ye();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 select-none 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 QI=u("div",{className:"h-3 sm:h-4"});Z();var rz=Object.freeze([]),XI=e=>e.getMeta().status.scheduledWakes??rz;function YI(e,t){let n=N(e);return t&&(n.current=e),n.current}Z();function Nf(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 JI({badge:e,startedAt:t,completedAt:n,timestampFormat:o}){let{t:r}=Ye();if(e===null&&t===void 0)return null;let a=r("timeline.turnInfo");return S(Sr,{children:[u(wr,{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(hd,{className:"size-3.5","aria-hidden":!0})}),u(Ir,{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(rh,{badge:e})}):null,t!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnStarted",{time:Tr(t,o)})}):null,n!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnFinished",{time:Tr(n,o)})}):null]})})]})}function az(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 sh({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 ZI=me(function({footer:t,timestampFormat:n,copyText:o,identity:r}){let{t:a}=Ye(),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 select-none 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(sh,{label:i,children:[s==="error"?u(qt,{className:"size-icon-1 text-destructive","aria-hidden":!0}):u(kd,{className:"size-3","aria-hidden":!0}),u("span",{className:"sr-only",children:i})]}):null,t.workingElapsedMs!==void 0?u(sh,{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(sh,{label:`${a("timeline.outputTokens")}: ${t.outputTokens.toLocaleString()}`,children:a("timeline.outputTokenCount",{count:t.outputTokens,value:az(t.outputTokens)})}):null]}),u(JI,{badge:r?.badge??null,startedAt:r?.createdAt,completedAt:t.completedAt,timestampFormat:n}),o?u(Ls,{text:o,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"}):null]})});Z();Z();function ew(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 tw=me(function(t){let{additions:n,deletions:o,className:r,showParentheses:a=!1,layout:s="aligned"}=t,{t:i}=Ye(),l=new Intl.ListFormat(void 0,{type:"unit"}).format([i("changedFiles.additions",{count:n}),i("changedFiles.deletions",{count:o})]);return S(Ce,{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:["+",ew(n)]}),S("span",{"aria-hidden":"true",className:"font-mono text-diff-deletion",children:["-",ew(o)]})]}),a&&u("span",{className:"text-muted-foreground/70",children:")"})]})});function Vd({name:e,className:t}){switch(e){case"bot":return u(us,{className:t,"aria-hidden":!0});case"check":return u(Mn,{className:t,"aria-hidden":!0});case"circle-alert":return u(en,{className:t,"aria-hidden":!0});case"eye":return u(dd,{className:t,"aria-hidden":!0});case"globe":return u(pd,{className:t,"aria-hidden":!0});case"hammer":return u(gd,{className:t,"aria-hidden":!0});case"message-circle":return u(ys,{className:t,"aria-hidden":!0});case"search":return u(Is,{className:t,"aria-hidden":!0});case"square-pen":return u(ro,{className:t,"aria-hidden":!0});case"terminal":return u(vo,{className:t,"aria-hidden":!0});case"wrench":return u(Ad,{className:t,"aria-hidden":!0});case"x":return u(qt,{className:t,"aria-hidden":!0});case"zap":return u(Ts,{className:t,"aria-hidden":!0})}}function sz(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 ih(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:sz(o),count:r}))}function lh(e,t){let n;for(let o of ih(e,t))(!n||o.count>n.count)&&(n=o);return n?.icon??"wrench"}var Ki=20;function $i(e){return Nf(e)}function nw(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?xf(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 ow({entry:e,failed:t}){let n=e.toolLabel?.diffStat;return!n||t||dh(e)?null:u(tw,{...n,layout:"inline",className:"chat-process-meta ms-2 shrink-0"})}function dh(e){return e.toolLifecycleStatus==="declined"||e.toolLifecycleStatus==="stopped"}function rw({toolIcon:e,glyphClassName:t}){let n=it(Mt),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(Vd,{name:"globe",className:t})}function iz({entry:e,failed:t=!1,derive:n}){return t?u(en,{"aria-hidden":!0,className:"size-icon-1 shrink-0 text-destructive"}):e.toolIcon!==void 0?u(rw,{toolIcon:e.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"}):u(Vd,{name:lh([e],n.toolGroupAction),className:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"})}function lz({entries:e,failed:t,derive:n}){let{t:o}=Ye(),r=q(()=>ih(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(Vd,{name:i,className:K("size-icon-1 shrink-0 stroke-[1.8] opacity-70",t?"text-destructive":"text-icon-muted")}),l]},s))})}function aw({entry:e}){let t=it(Mt),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(Ce,{children:r}):u("pre",{className:"chat-tool-body overflow-x-auto rounded-md bg-muted/40 p-2",children:n??""})})}var dz=me(function(t){let{entry:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}=t,i=it(Mt).derive,{t:l}=Ye(),[d,c]=lo(o,`call:${$i(n)}`,!1),f=i.workEntryIndicatesFailure(n),p=dh(n),m=i.resolveWorkEntryStatus(n),h=m==="failed"||m==="running"?m:null,g=Ro();return S("div",{"data-tool-call-id":n.toolCallId??n.id,"data-tool-identity":$i(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(Hd,{status:h}),u(zd,{children:u(iz,{entry:n,failed:f,derive:i})}),S("span",{className:"flex min-w-0 flex-1 items-center",children:[u("span",{className:"truncate",children:nw(n,r,i)??l("toolGroup.calls",{count:1})}),u(ow,{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(aw,{entry:n})}):null]})});function cz({threadKey:e,stateKey:t,maxHeight:n,children:o}){let r=N(null);return ve(()=>{let a=r.current;if(!a)return;a.scrollTop=Jg(e,`${t}:scroll`,0);let s=()=>{Ud(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 sw=me(function({entries:t,groupId:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}){let i=it(Mt).derive,{t:l}=Ye(),[d,c]=lo(o,`group:${n}`,!1),[f,p]=lo(o,`group-page:${n}`,0),m=Ro(),h=N(null),[g,v]=Q(null),y=t.at(-1),C=q(()=>t.filter(_=>i.workEntryIndicatesFailure(_)),[t,i]),x=q(()=>t.filter(dh),[t]),b=t.filter(_=>_.toolLifecycleStatus==="inProgress").length,I=C[0]??x[0],w=I??y,k=Math.max(0,Math.ceil(t.length/Ki)-1),P=Math.min(f,k),T=P*Ki,L=t.slice(T,T+Ki),A=t.length>1;if(ve(()=>{if(!g)return;let _=h.current,G=Array.from(_?.querySelectorAll("[data-tool-identity]")??[]).find(U=>U.dataset.toolIdentity===g.id);if(!G)return;let O=G.closest('[data-slot="scroll-area-viewport"]');O&&(O.scrollTop+=G.getBoundingClientRect().top-O.getBoundingClientRect().top),G.querySelector("button")?.focus({preventScroll:!0})},[g]),!y||!w)return null;let M=_=>{a?.(),p(_)},R={threadKey:o,workspaceRoot:r,onDisclosureChange:a},F=WS(t.map(_=>VS(i.resolveWorkEntryStatus(_)))),H=lh(t,i.toolGroupAction),z=F==="failed"?"failed":F==="running"?"running":"success";return u(hf,{state:F,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&&Ud(o,`call:${$i(y)}`,!0)},className:K(gf,"flex-1",I?"text-destructive":"text-muted-foreground"),children:[u(Hd,{status:z}),u(zd,{children:!A&&y.toolIcon!==void 0&&C.length===0?u(rw,{toolIcon:y.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] opacity-70 text-icon-muted"}):u(Vd,{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}):nw(w,r,i)??l("toolGroup.calls",{count:1})}),d&&A?null:u(ow,{entry:w,failed:i.workEntryIndicatesFailure(w)})]}),b>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.running",{count:b})}):null,C.length>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.failed",{count:C.length})}):null,x.length>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.cancelled",{count:x.length})}):null,d&&A?null:u(lz,{entries:t,failed:C.length>0,derive:i}),u(Qt,{"aria-hidden":!0,className:K("size-icon-1 shrink-0",!d&&"-rotate-90")})]}),I&&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(I)/Ki)),Ud(o,`call:${$i(I)}`,!0),v({id:$i(I)})},children:l("toolGroup.showFailure")}):null]}),d?u("div",{id:m,className:"border-t border-border/50",children:A?S(Ce,{children:[t.length>Ki?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+Ki,t.length),count:t.length})}),[{label:l("toolGroup.firstPage"),target:0,disabled:P===0,Icon:id},{label:l("toolGroup.previousPage"),target:P-1,disabled:P===0,Icon:fs},{label:l("toolGroup.nextPage"),target:P+1,disabled:P===k,Icon:Gn},{label:l("toolGroup.lastPage"),target:k,disabled:P===k,Icon:ld}].map(({label:_,target:G,disabled:O,Icon:U})=>u("button",{type:"button","aria-label":_,disabled:O,onClick:()=>M(G),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"})},_))]}):null,u(cz,{threadKey:o,stateKey:`group-scroll:${n}:${P}`,maxHeight:"min(320px, 50dvh)",children:u("div",{className:"space-y-0.5 py-1",children:L.map(_=>u(dz,{entry:_,...R},$i(_)))})})]}):u(aw,{entry:y})}):null]})})});Z();function iw(){let e=Mo(),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 _f(e){let t=e.match(/^\s{0,3}#{1,6}\s+(.+)$/m)?.[1]?.trim();return t&&t.length>0?t:null}function ch(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(`
3839
+ `),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 xI({row:e,text:t}){let{t:n}=Ye(),o=it(Mt),r=e.message.attachments??[],a=Pf(t),s=a.contexts,i=[],l=a.visibleText;for(;;){let C=Lf(l);if(!C.annotation)break;i.unshift(C.annotation),l=C.promptText}let d=Hi(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=>Pr(C)==="image"),h=p.filter(C=>Pr(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(NU,{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(Kd,{images:m}),h.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:h.map(C=>u($d,{attachment:C},C.id))}),i.map((C,x)=>u(yI,{annotation:C,image:f[x]??null},C.id)),c.length>0?u("div",{className:"mb-2 flex flex-wrap gap-1.5",children:c.map(C=>u(vI,{context:C},`${C.header}:${C.body}`))}):null,u(CI,{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 select-none 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:Tr(e.message.createdAt,o.timestampFormat)})]}),o.onForkFromUserMessage!==null&&u(_U,{messageId:e.message.id,onFork:o.onForkFromUserMessage}),a.copyText&&u(Ls,{text:a.copyText,variant:"ghost"})]})]})}function NU({author:e}){return S("div",{className:"flex min-w-0 max-w-[min(70%,40rem)] select-none items-center gap-1.5 text-chat-dense text-muted-foreground",children:[u(Vb,{userId:e.userId,displayName:e.displayName,size:16}),u("span",{className:"min-w-0 truncate",children:e.displayName})]})}function _U({messageId:e,onFork:t}){let{t:n}=Ye(),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(fd,{className:"size-3"})}),u(Ke,{side:"top",children:o})]})}function oh({row:e}){let t=it(Mt).derive;if(Cf(e.message.text)){let n=t.parsePresetPrefixText(e.message.text);return n?S(Ce,{children:[u(DU,{parsed:n}),n.body.length>0||(e.message.attachments?.length??0)>0?u(oh,{row:{...e,message:{...e.message,text:n.body}}}):null]}):u(FU,{row:e})}return u(xI,{row:e,text:e.message.text})}function Af({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 DU({parsed:e}){let{t}=Ye();return S(Af,{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 OU={"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 FU({row:e}){let{t}=Ye(),n=it(Mt).derive,o=e.message.attachments??[],r=o.filter(l=>Pr(l)==="image"),a=o.filter(l=>Pr(l)!=="image"),s=l=>{let d=XS(l);if(d)return S(Af,{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(Af,{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(Af,{children:[u("p",{className:"font-medium text-foreground/80",children:t(OU[f.kind],{title:f.title})}),f.summary.trim().length>0?u("p",{className:"mt-1 whitespace-pre-wrap",children:f.summary}):null]}):null},i=QS(e.message.text).map(s).filter(l=>l!==null);return i.length===0&&o.length===0?null:S(Ce,{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(Kd,{images:r}),a.map(l=>u($d,{attachment:l},l.id))]}):null]})}function bI(e,t){let n=t.parsePresetPrefixText(e??"")?.body??null;if(n===null&&Cf(e??""))return null;let r=Pf(n??e??"").visibleText;for(;;){let i=Lf(r);if(!i.annotation)break;r=i.promptText}let a=Hi(r).promptText,s=bf(a).map(i=>i.kind==="text"?i.text:i.comment.text).join(" ").replace(/\s+/g," ").trim();return s.length>0?s:null}var SI=34,II=8,qd=SI+II,wI=me(function({ref:t,textRef:n,initialText:o,expanded:r,onToggleExpanded:a}){let{t:s}=Ye(),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","data-timeline-turn-header":"true","data-truncated":"false",children:u("div",{className:K("transcript-col-wide pointer-events-auto bg-background",r&&"pb-1"),style:{paddingTop:II},children:S("div",{"data-user-bubble":"",className:K("flex select-none gap-2 rounded-sm bg-user-bubble pe-1 ps-3 text-user-bubble-foreground shadow-md shadow-black/10",r?"items-start py-1.5":"items-center"),...r?{}:{style:{height:SI}},children:[u("span",{ref:n,className:K("min-w-0 flex-1 text-left 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(sd,{}):u(Qt,{})}),u(Ke,{side:"bottom",children:i})]})]})})})});function TI({row:e}){let t=it(Mt),{t:n}=Ye(),[o,r]=lo(t.threadKey,`message:${e.message.id}`,!1);if(e.presentation==="compact"&&!o)return u(hf,{state:"idle",children:S("button",{type:"button",className:K(gf,"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(Hd,{status:null}),u(zd,{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=>Pr(c)==="image"),l=s.filter(c=>Pr(c)!=="image"),d=e.message.text||(e.message.streaming||s.length>0?"":n("timeline.emptyResponse"));return u(Ce,{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(Ls,{text:e.message.text,variant:"ghost"})]}):null,e.modelBadge?u(UU,{badge:e.modelBadge,createdAt:e.message.createdAt}):null,u("div",{"data-assistant-quote-body":"",children:u(Co,{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(Kd,{images:i}),l.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:l.map(c=>u($d,{attachment:c},c.id))}),e.showAssistantMeta||e.showAssistantCopyButton&&!e.assistantCopyStreaming&&e.message.text.trim().length>0?S("div",{className:"mt-1.5 flex select-none 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(BU,{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:Tr(e.message.updatedAt,t.timestampFormat)})]})]}):null]})})}function BU({row:e}){let n=it(Mt).derive.resolveAssistantMessageCopyState({text:e.message.text??null,showCopyButton:e.showAssistantCopyButton,streaming:e.assistantCopyStreaming});return n.visible?u(Ls,{text:n.text??"",variant:"ghost"}):null}function rh({badge:e}){let{t}=Ye(),n=eh(t,e);return S(Ce,{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}),n?S("span",{children:[" \xB7 ",n]}):null]})]})}function UU({badge:e,createdAt:t}){let n=it(Mt),{t:o}=Ye();return S("div",{className:"mb-3 flex min-w-0 select-none flex-wrap items-center gap-x-2.5 gap-y-1 text-chat-dense text-muted-foreground","data-testid":"assistant-model-header",children:[u(rh,{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:Tr(t,n.timestampFormat)})]})]})}function PI({row:e}){let{t}=Ye(),n=eh(t,e.badge),o=n?`${e.badge.modelLabel} \xB7 ${n}`:e.badge.modelLabel,r=[e.badge.providerDisplayName,o].filter(s=>typeof s=="string"&&s.length>0).join(" \xB7 "),a=e.pending?t("timeline.modelSwitchPending",{model:r}):t("timeline.modelSwitched",{model:r});return S("div",{role:"separator","aria-label":a,"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:a})]}),u("span",{"aria-hidden":!0,className:"h-px min-w-4 flex-1 bg-border/60"})]})}var ah=240,zU=/\s/u;function kI(e){if(!e)return null;let t=[],n=0,o=!1,r=()=>{for(;n>ah-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(zU.test(a)){o=t.length>0;continue}if(o&&(t.push(" "),n+=1,o=!1,n>ah)||(t.push(a),n+=a.length,n>ah))return r()}return t.length>0?t.join(""):null}function HU(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:kI(n.parseSystemNotificationText(r.text)?.summary??n.parseThreadHandoverText(r.text)?.body??r.text),assistantText:kI(a),headerText:r===null?null:bI(r.text,n)}}function KU(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 $U(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 qU(e,t,n){for(let o=0;o<e.length;o+=1)if(e[o]!==n[t.firstRowIndex+o])return!1;return!0}function VU(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 WU(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&&qU(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=HU(d.key,f,e),m={...p,turnId:KU(f)},h=c!==void 0&&$U(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&&VU(n.entries,s)?n.entries:s;return n={store:o,version:r,entries:l},l}}var LI=new WeakMap;function EI(e,t){let n=LI.get(e);return(n===void 0||n.derive!==t)&&(n={derive:t,read:WU(t)},LI.set(e,n)),n.read(e)}var AI=new WeakMap;function MI(e,t){let n=EI(e,t),o=AI.get(n);return o===void 0&&(o=n.flatMap(({summary:r})=>r.headerText===null?[]:[{sectionKey:r.sectionKey,text:r.headerText}]),AI.set(n,o)),o}function NI(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 RI=new WeakMap;function _I(e,t){let n=EI(e,t),o=RI.get(n);return o===void 0&&(o=n.filter(({summary:r})=>r.userText!==null).map(({item:r})=>r),RI.set(n,o)),o}function DI(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,o)=>n===t[o])}var GU=[],jU=e=>e.getMeta().usageByTurnId,QU=e=>e.getMeta().exportApi,XU=e=>e.getMeta().status.totalTurnCount??null,OI=me(function({rowsStore:t,derive:n,paneVisible:o,bottomInset:r,onSelect:a,onTurnNavigatorChange:s}){let i=E(m=>o?_I(m,n):GU,[n,o]),l=In(t,i,DI),d=In(t,jU),c=In(t,QU),f=In(t,XU),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 FI({timeline:e,previousOverlayHeight:t,overlayHeight:n,followingEnd:o}){e&&o&&n>t&&e.scrollToEnd({animated:!1})}function BI(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 UI({measurement:e,followingEnd:t}){return t?null:e.rowAtScroll()}function Rf(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 YU=e=>e.getMeta().status.workingStepLabel??null,JU=e=>e.getMeta().status.stall??null,ZU=e=>e.getMeta().status.retry??null,ez=e=>e.getMeta().status.isWorking,zI=me(function({rowsStore:t,historyWindow:n,children:o}){let r=In(t,YU),a=In(t,JU),s=In(t,ZU),i=q(()=>n?{workingStepLabel:null,stall:null,retry:null}:{workingStepLabel:r,stall:a,retry:s},[n,s,a,r]);return u(ff,{value:i,children:o})});function HI({rowsStore:e,historyWindow:t}){let{t:n}=Ye();return In(e,ez)&&!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")})})}Z();function Ef(e){return e==="loading"?"threadSync.loading":"threadSync.syncing"}var tz=1e3,KI=150;function Mf(e,t=tz){let[n,o]=Q(null);return $(()=>{if(e===null){o(null);return}let r=globalThis.setTimeout(()=>{o(e)},t);return()=>{globalThis.clearTimeout(r)}},[e,t]),n}var nz=5;function $I(e){let t=e.data.useThreadSyncPhase(e.target);return Mf(t,KI)==="loading"?u(oz,{}):e.hideEmptyPlaceholder?null:u(HI,{rowsStore:e.rowsStore,historyWindow:e.historyWindow})}function oz(){let{t:e}=le();return S("div",{className:"pointer-events-none absolute inset-0 overflow-hidden bg-background px-3 pt-4 sm:px-5","data-timeline-loading-skeleton":"",role:"status",children:[u("span",{className:"sr-only",children:e(Ef("loading"))}),u("div",{className:"transcript-col flex flex-col gap-6",children:Array.from({length:nz},(t,n)=>S("div",{"aria-hidden":"true",className:"flex flex-col gap-3",children:[u("div",{className:"h-9 self-end rounded-[18px] bg-muted-foreground/15",style:{width:`${44-n%2*14}%`}}),[92,84,61].map((o,r)=>u("div",{className:"h-3 rounded-control-1 bg-muted-foreground/15",style:{width:`${o-n%3*6}%`}},r))]},n))})]})}var qI=u("div",{className:"h-3 sm:h-4"}),VI=u("div",{className:"h-10 sm:h-12"});function WI({loading:e,blocked:t,onLoadEarlier:n,fade:o}){let{t:r}=Ye();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 select-none 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 GI({loading:e,blocked:t,onLoadLater:n,onReturnToLatest:o}){let{t:r}=Ye();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 jI({onReveal:e,fade:t}){let{t:n}=Ye();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 select-none 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 QI=u("div",{className:"h-3 sm:h-4"});Z();var rz=Object.freeze([]),XI=e=>e.getMeta().status.scheduledWakes??rz;function YI(e,t){let n=N(e);return t&&(n.current=e),n.current}Z();function Nf(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 JI({badge:e,startedAt:t,completedAt:n,timestampFormat:o}){let{t:r}=Ye();if(e===null&&t===void 0)return null;let a=r("timeline.turnInfo");return S(Sr,{children:[u(wr,{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(hd,{className:"size-3.5","aria-hidden":!0})}),u(Ir,{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(rh,{badge:e})}):null,t!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnStarted",{time:Tr(t,o)})}):null,n!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnFinished",{time:Tr(n,o)})}):null]})})]})}function az(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 sh({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 ZI=me(function({footer:t,timestampFormat:n,copyText:o,identity:r}){let{t:a}=Ye(),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 select-none 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(sh,{label:i,children:[s==="error"?u(qt,{className:"size-icon-1 text-destructive","aria-hidden":!0}):u(kd,{className:"size-3","aria-hidden":!0}),u("span",{className:"sr-only",children:i})]}):null,t.workingElapsedMs!==void 0?u(sh,{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(sh,{label:`${a("timeline.outputTokens")}: ${t.outputTokens.toLocaleString()}`,children:a("timeline.outputTokenCount",{count:t.outputTokens,value:az(t.outputTokens)})}):null]}),u(JI,{badge:r?.badge??null,startedAt:r?.createdAt,completedAt:t.completedAt,timestampFormat:n}),o?u(Ls,{text:o,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"}):null]})});Z();Z();function ew(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 tw=me(function(t){let{additions:n,deletions:o,className:r,showParentheses:a=!1,layout:s="aligned"}=t,{t:i}=Ye(),l=new Intl.ListFormat(void 0,{type:"unit"}).format([i("changedFiles.additions",{count:n}),i("changedFiles.deletions",{count:o})]);return S(Ce,{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:["+",ew(n)]}),S("span",{"aria-hidden":"true",className:"font-mono text-diff-deletion",children:["-",ew(o)]})]}),a&&u("span",{className:"text-muted-foreground/70",children:")"})]})});function Vd({name:e,className:t}){switch(e){case"bot":return u(us,{className:t,"aria-hidden":!0});case"check":return u(Mn,{className:t,"aria-hidden":!0});case"circle-alert":return u(en,{className:t,"aria-hidden":!0});case"eye":return u(dd,{className:t,"aria-hidden":!0});case"globe":return u(pd,{className:t,"aria-hidden":!0});case"hammer":return u(gd,{className:t,"aria-hidden":!0});case"message-circle":return u(ys,{className:t,"aria-hidden":!0});case"search":return u(Is,{className:t,"aria-hidden":!0});case"square-pen":return u(ro,{className:t,"aria-hidden":!0});case"terminal":return u(vo,{className:t,"aria-hidden":!0});case"wrench":return u(Ad,{className:t,"aria-hidden":!0});case"x":return u(qt,{className:t,"aria-hidden":!0});case"zap":return u(Ts,{className:t,"aria-hidden":!0})}}function sz(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 ih(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:sz(o),count:r}))}function lh(e,t){let n;for(let o of ih(e,t))(!n||o.count>n.count)&&(n=o);return n?.icon??"wrench"}var Ki=20;function $i(e){return Nf(e)}function nw(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?xf(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 ow({entry:e,failed:t}){let n=e.toolLabel?.diffStat;return!n||t||dh(e)?null:u(tw,{...n,layout:"inline",className:"chat-process-meta ms-2 shrink-0"})}function dh(e){return e.toolLifecycleStatus==="declined"||e.toolLifecycleStatus==="stopped"}function rw({toolIcon:e,glyphClassName:t}){let n=it(Mt),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(Vd,{name:"globe",className:t})}function iz({entry:e,failed:t=!1,derive:n}){return t?u(en,{"aria-hidden":!0,className:"size-icon-1 shrink-0 text-destructive"}):e.toolIcon!==void 0?u(rw,{toolIcon:e.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"}):u(Vd,{name:lh([e],n.toolGroupAction),className:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"})}function lz({entries:e,failed:t,derive:n}){let{t:o}=Ye(),r=q(()=>ih(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(Vd,{name:i,className:K("size-icon-1 shrink-0 stroke-[1.8] opacity-70",t?"text-destructive":"text-icon-muted")}),l]},s))})}function aw({entry:e}){let t=it(Mt),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(Ce,{children:r}):u("pre",{className:"chat-tool-body overflow-x-auto rounded-md bg-muted/40 p-2",children:n??""})})}var dz=me(function(t){let{entry:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}=t,i=it(Mt).derive,{t:l}=Ye(),[d,c]=lo(o,`call:${$i(n)}`,!1),f=i.workEntryIndicatesFailure(n),p=dh(n),m=i.resolveWorkEntryStatus(n),h=m==="failed"||m==="running"?m:null,g=Ro();return S("div",{"data-tool-call-id":n.toolCallId??n.id,"data-tool-identity":$i(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(Hd,{status:h}),u(zd,{children:u(iz,{entry:n,failed:f,derive:i})}),S("span",{className:"flex min-w-0 flex-1 items-center",children:[u("span",{className:"truncate",children:nw(n,r,i)??l("toolGroup.calls",{count:1})}),u(ow,{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(aw,{entry:n})}):null]})});function cz({threadKey:e,stateKey:t,maxHeight:n,children:o}){let r=N(null);return ve(()=>{let a=r.current;if(!a)return;a.scrollTop=Jg(e,`${t}:scroll`,0);let s=()=>{Ud(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 sw=me(function({entries:t,groupId:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}){let i=it(Mt).derive,{t:l}=Ye(),[d,c]=lo(o,`group:${n}`,!1),[f,p]=lo(o,`group-page:${n}`,0),m=Ro(),h=N(null),[g,v]=Q(null),y=t.at(-1),C=q(()=>t.filter(_=>i.workEntryIndicatesFailure(_)),[t,i]),x=q(()=>t.filter(dh),[t]),b=t.filter(_=>_.toolLifecycleStatus==="inProgress").length,I=C[0]??x[0],w=I??y,k=Math.max(0,Math.ceil(t.length/Ki)-1),P=Math.min(f,k),T=P*Ki,L=t.slice(T,T+Ki),A=t.length>1;if(ve(()=>{if(!g)return;let _=h.current,G=Array.from(_?.querySelectorAll("[data-tool-identity]")??[]).find(U=>U.dataset.toolIdentity===g.id);if(!G)return;let O=G.closest('[data-slot="scroll-area-viewport"]');O&&(O.scrollTop+=G.getBoundingClientRect().top-O.getBoundingClientRect().top),G.querySelector("button")?.focus({preventScroll:!0})},[g]),!y||!w)return null;let M=_=>{a?.(),p(_)},R={threadKey:o,workspaceRoot:r,onDisclosureChange:a},F=WS(t.map(_=>VS(i.resolveWorkEntryStatus(_)))),H=lh(t,i.toolGroupAction),z=F==="failed"?"failed":F==="running"?"running":"success";return u(hf,{state:F,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&&Ud(o,`call:${$i(y)}`,!0)},className:K(gf,"flex-1",I?"text-destructive":"text-muted-foreground"),children:[u(Hd,{status:z}),u(zd,{children:!A&&y.toolIcon!==void 0&&C.length===0?u(rw,{toolIcon:y.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] opacity-70 text-icon-muted"}):u(Vd,{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}):nw(w,r,i)??l("toolGroup.calls",{count:1})}),d&&A?null:u(ow,{entry:w,failed:i.workEntryIndicatesFailure(w)})]}),b>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.running",{count:b})}):null,C.length>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.failed",{count:C.length})}):null,x.length>0?u("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.cancelled",{count:x.length})}):null,d&&A?null:u(lz,{entries:t,failed:C.length>0,derive:i}),u(Qt,{"aria-hidden":!0,className:K("size-icon-1 shrink-0",!d&&"-rotate-90")})]}),I&&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(I)/Ki)),Ud(o,`call:${$i(I)}`,!0),v({id:$i(I)})},children:l("toolGroup.showFailure")}):null]}),d?u("div",{id:m,className:"border-t border-border/50",children:A?S(Ce,{children:[t.length>Ki?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+Ki,t.length),count:t.length})}),[{label:l("toolGroup.firstPage"),target:0,disabled:P===0,Icon:id},{label:l("toolGroup.previousPage"),target:P-1,disabled:P===0,Icon:fs},{label:l("toolGroup.nextPage"),target:P+1,disabled:P===k,Icon:Gn},{label:l("toolGroup.lastPage"),target:k,disabled:P===k,Icon:ld}].map(({label:_,target:G,disabled:O,Icon:U})=>u("button",{type:"button","aria-label":_,disabled:O,onClick:()=>M(G),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"})},_))]}):null,u(cz,{threadKey:o,stateKey:`group-scroll:${n}:${P}`,maxHeight:"min(320px, 50dvh)",children:u("div",{className:"space-y-0.5 py-1",children:L.map(_=>u(dz,{entry:_,...R},$i(_)))})})]}):u(aw,{entry:y})}):null]})})});Z();function iw(){let e=Mo(),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 _f(e){let t=e.match(/^\s{0,3}#{1,6}\s+(.+)$/m)?.[1]?.trim();return t&&t.length>0?t:null}function ch(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(`
3840
3840
  `)}function lw(e,t,n){let o=n?.maxLines??8,r=ch(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?_f(e)??t("proposedPlan.previewUnavailable"):(i&&a.push("","..."),a.join(`
3841
3841
  `))}function uz(e){let t=e.toLowerCase().replace(/[`'".,!?()[\]{}]+/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return t.length>0?t:"plan"}function dw(e){let t=_f(e);return`${uz(t??"plan")}.md`}function cw(e){return`${e.trimEnd()}
3842
3842
  `}function uw(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 Wd(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(Ce,{children:[e,t]}):S(Ce,{children:[s[0],t,s[1]]})}var Df=1024,fw=me(function({planMarkdown:t,threadKey:n,rowId:o,environmentId:r,threadRef:a,cwd:s,workspaceRoot:i,onSavePlanToWorkspace:l}){let{t:d}=Ye(),c=iw(),[f,p]=lo(n,`proposed-plan:${o}:expanded`,!1),[m,h]=Q(!1),[g,v]=lo(n,`proposed-plan:${o}:save-path`,""),[y,C]=Q(!1);_u(o,m||y);let x=N(!1),b=N(!1);ve(()=>(x.current=!0,()=>{x.current=!1}),[]);let{copyToClipboard:I,isCopied:w}=vf({target:"plan",onError:O=>{c.error(d("proposedPlan.couldNotCopy"),O,{description:d("proposedPlan.copyErrorDescription")})}}),k=Ro(),P=_f(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.2870",
3
+ "version": "0.2.2874",
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.2870"
45
+ "@ycodium-ai/plugin-api": "0.2.2874"
46
46
  },
47
47
  "ycodium": {
48
48
  "plugin": "./dist/index.js",