@ycodium-ai/plugin-conversation 0.2.2926 → 0.2.2934
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.
- package/assets/ui.js +4 -1
- package/package.json +3 -3
package/assets/ui.js
CHANGED
|
@@ -1298,6 +1298,9 @@ var vF=Object.create;var Ru=Object.defineProperty;var yF=Object.getOwnPropertyDe
|
|
|
1298
1298
|
background-color: color-mix(in oklab, var(--card) 70%, transparent);
|
|
1299
1299
|
}
|
|
1300
1300
|
}
|
|
1301
|
+
.bg-chat-canvas:where(:scope, *) {
|
|
1302
|
+
background-color: var(--chat-canvas);
|
|
1303
|
+
}
|
|
1301
1304
|
.bg-destructive:where(:scope, *) {
|
|
1302
1305
|
background-color: var(--destructive);
|
|
1303
1306
|
}
|
|
@@ -3814,7 +3817,7 @@ ${t.context.body}`:t.context.header;return S(Ke,{children:[S(qe,{render:u("span"
|
|
|
3814
3817
|
`).length>ZU}var _I=pe(function(t){let n=nt(At),{t:o}=Ye(),[r,a]=lo(n.threadKey,`${t.disclosureKey}:expanded`,!1),i=t.text.trim().length>0||t.terminalContexts.length>0,s=i&&nz(t.text),l=s&&!r;return S("div",{children:[i?u("div",{className:q("relative",l&&"max-h-44 overflow-hidden"),"data-user-message-body":"true","data-user-message-collapsed":l?"true":"false","data-user-message-collapsible":s?"true":"false","data-user-message-fade":l?"true":"false",style:l?{WebkitMaskImage:EI,maskImage:EI}:void 0,children:u(oz,{disclosureKey:t.disclosureKey,text:t.text,terminalContexts:t.terminalContexts,skills:t.skills,markdownCwd:t.markdownCwd})}):null,s||t.footer?S("div",{className:q("mt-1.5 flex items-center gap-2",s&&t.footer?"justify-between":"justify-end"),"data-user-message-footer":"true",children:[s?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]})}),oz=pe(function(t){let n=nt(At),o=(a,i)=>{let s=/^\s+/.exec(a)?.[0]??"",l=a.slice(s.length),d=/\s+$/.exec(l)?.[0]??"",c=l.slice(0,l.length-d.length);return S(Hr,{children:[s?u("span",{"aria-hidden":"true",children:s}):null,c?u(bo,{disclosureKey:`${t.disclosureKey}:inline:${i}`,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]},i)},r=Ef(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(bo,{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(rz,{comment:a.comment,disclosureKey:`${t.disclosureKey}:review-comment:${a.comment.id}`},a.comment.id))});if(t.terminalContexts.length>0){let a=AI(t.text,t.terminalContexts),i=LI(t.terminalContexts),s=[];if(a){let l=0;for(let d of t.terminalContexts){let c=Bf(d.header),f=t.text.indexOf(c,l);if(f===-1){s.length=0;break}f>l&&s.push(o(t.text.slice(l,f),`user-terminal-context-inline-before:${d.header}:${l}`)),s.push(u(RI,{context:d},`user-terminal-context-inline:${d.header}`)),l=f+c.length}if(s.length>0)return l<t.text.length&&s.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:s})}for(let l of t.terminalContexts)s.push(u(RI,{context:l},`user-terminal-context-inline:${l.header}`)),s.push(u("span",{"aria-hidden":"true",children:" "},`user-terminal-context-inline-space:${l.header}`));if(t.text.length>0)s.push(u(bo,{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(i.length===0)return null;return u("div",{className:"whitespace-pre-wrap wrap-break-word text-message-foreground text-chat",children:s})}return t.text.length===0?null:u(bo,{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 rz({comment:e,disclosureKey:t}){let n=nt(At),{t:o}=Ye(),r=e.fenceLanguage??"diff",a=pI(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:Rf(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(TI,{text:e.text,index:n.skillIndex})}),r!=="diff"&&e.diff.trim().length>0&&u(bo,{disclosureKey:`${t}:fence`,text:fI(r,e.diff),cwd:n.markdownCwd,threadRef:n.threadRef??void 0,skills:n.skills,className:"text-message-foreground"}),a?u(TS,{patch:a}):null]})}var az=/\n*<preview_annotation>\n((?:(?!<preview_annotation>)[\s\S])*)\n<\/preview_annotation>\s*$/;function Uf(e){let t=az.exec(e);if(!t)return{promptText:e,annotation:null};let n=t[1]??"",o=n.split(`
|
|
3815
3818
|
`),r=o.find(p=>p.startsWith("Page: ")),a=o.find(p=>p.startsWith("Id: ")),i=o.find(p=>p.startsWith("Comment: ")),s=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:i?.slice(9).trim()||"",targetSummary:s?.slice(9).trim()||"",styleChanges:f,hasScreenshot:n.includes("The attached screenshot is the annotated preview crop.")}}}function DI({row:e,text:t}){let{t:n}=Ye(),o=nt(At),r=e.message.attachments??[],a=Ff(t),i=a.contexts,s=[],l=a.visibleText;for(;;){let C=Uf(l);if(!C.annotation)break;s.unshift(C.annotation),l=C.promptText}let d=Vs(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=>Ua(C)),h=p.filter(C=>!Ua(C)),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(iz,{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(Yd,{images:m}),h.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:h.map(C=>u(Xd,{attachment:C},C.id))}),s.map((C,x)=>u(NI,{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(MI,{context:C},`${C.header}:${C.body}`))}):null,u(_I,{disclosureKey:`message:${e.message.id}:user`,text:d.promptText,terminalContexts:i,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(Ke,{children:[u(qe,{render:u("span",{tabIndex:0,className:"me-1 rounded-sm tabular-nums"}),children:jr(e.message.createdAt,o.timestampFormat,n)}),u($e,{children:Pr(e.message.createdAt,o.timestampFormat)})]}),o.onForkFromUserMessage!==null&&u(sz,{messageId:e.message.id,onFork:o.onForkFromUserMessage}),a.copyText&&u(Ba,{text:a.copyText,variant:"ghost"})]})]})}function iz({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(lS,{userId:e.userId,displayName:e.displayName,size:16}),u("span",{className:"min-w-0 truncate",children:e.displayName})]})}function sz({messageId:e,onFork:t}){let{t:n}=Ye(),o=n("fork.action");return S(Ke,{children:[u(qe,{render:u(ie,{type:"button",size:"xs",variant:"ghost",onClick:()=>t(e),"aria-label":o}),children:u(Cd,{className:"size-3"})}),u($e,{side:"top",children:o})]})}var lz="<ycodium-system>";function zf(e){return e.startsWith(lz)}var dz=/[ \t]*\(record [^\s()]+\)/g,cz=/^<\/?[a-z][a-z-]*(?:\s[^>]*)?>$/;function yh(e){return zf(e)?e.split(`
|
|
3816
3819
|
`).filter(t=>!cz.test(t.trim())).join(`
|
|
3817
|
-
`).replace(dz,""):e}var uz=/<ycodium-system>[\s\S]*?<\/ycodium-system>/g;function OI(e){let t=e.match(uz);return t&&t.length>0?t:[e]}function FI(e){let t=e.match(/<plugin-instruction>\n([\s\S]*?)\n<\/plugin-instruction>/)?.[1];if(t===void 0)return null;try{let n=JSON.parse(t);if(n===null||typeof n!="object"||Array.isArray(n))return null;let o=n;return typeof o.pluginId!="string"||typeof o.title!="string"||typeof o.body!="string"?null:{pluginId:o.pluginId,title:o.title,body:o.body}}catch{return null}}function Ch({row:e}){let t=nt(At).derive;if(zf(e.message.text)){let n=t.parsePresetPrefixText(e.message.text);return n?S(xe,{children:[u(fz,{parsed:n}),n.body.length>0||(e.message.attachments?.length??0)>0?u(Ch,{row:{...e,message:{...e.message,text:n.body}}}):null]}):u(mz,{row:e})}return u(DI,{row:e,text:e.message.text})}function Hf({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 fz({parsed:e}){let{t}=Ye();return S(Hf,{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 pz={"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 mz({row:e}){let{t}=Ye(),n=nt(At).derive,o=e.message.attachments??[],r=o.filter(l=>Ua(l)),a=o.filter(l=>!Ua(l)),i=l=>{let d=FI(l);if(d)return S(Hf,{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(Hf,{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(Hf,{children:[u("p",{className:"font-medium text-foreground/80",children:t(pz[f.kind],{title:f.title})}),f.summary.trim().length>0?u("p",{className:"mt-1 whitespace-pre-wrap",children:f.summary}):null]}):null},s=OI(e.message.text).map(i).filter(l=>l!==null);return s.length===0&&o.length===0?null:S(xe,{children:[s.map((l,d)=>u(Hr,{children:l},d)),o.length>0?S("div",{className:"min-w-0 px-3 py-2",children:[u(Yd,{images:r}),a.map(l=>u(Xd,{attachment:l},l.id))]}):null]})}function BI(e,t){let n=t.parsePresetPrefixText(e??"")?.body??null;if(n===null&&zf(e??""))return null;let r=Ff(n??e??"").visibleText;for(;;){let s=Uf(r);if(!s.annotation)break;r=s.promptText}let a=Vs(r).promptText,i=Ef(a).map(s=>s.kind==="text"?s.text:s.comment.text).join(" ").replace(/\s+/g," ").trim();return i.length>0?i:null}var UI=34,zI=8,Zd=UI+zI,HI=pe(function({ref:t,textRef:n,initialText:o,expanded:r,onToggleExpanded:a}){let{t:i}=Ye(),s=i(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:q("transcript-col-wide pointer-events-auto bg-background",r&&"pb-1"),style:{paddingTop:zI},children:S("div",{"data-user-bubble":"",className:q("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:UI}},children:[u("span",{ref:n,className:q("min-w-0 flex-1 text-left text-chat",r?"max-h-40 overflow-y-auto whitespace-pre-wrap":"truncate"),children:o}),S(Ke,{children:[u(qe,{render:u(ie,{type:"button",size:"xs",variant:"ghost",className:"group-data-[truncated=false]:hidden","aria-label":s,onClick:a}),children:r?u(cd,{}):u(Jt,{})}),u($e,{side:"bottom",children:s})]})]})})})});function KI({row:e}){let t=nt(At),{t:n}=Ye(),[o,r]=lo(t.threadKey,`message:${e.message.id}`,!1);if(e.presentation==="compact"&&!o)return u(Tf,{state:"idle",children:S("button",{type:"button",className:q(wf,"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(Qd,{status:null}),u(jd,{children:u(Wr,{className:"size-icon-1","aria-hidden":!0})}),u("span",{className:"min-w-0 flex-1 truncate",children:t.derive.reasoningPreviewText(e.message.text)}),u(Jt,{className:"size-icon-1 shrink-0 -rotate-90","aria-hidden":!0})]})});let i=e.message.attachments??[],s=i.filter(c=>Ua(c)),l=i.filter(c=>!Ua(c)),d=e.message.text||(e.message.streaming||i.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(Ba,{text:e.message.text,variant:"ghost"})]}):null,e.modelBadge?u(hz,{badge:e.modelBadge,createdAt:e.message.createdAt}):null,u("div",{"data-assistant-quote-body":"",children:u(bo,{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(Yd,{images:s}),l.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:l.map(c=>u(Xd,{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(gz,{row:e}),e.showAssistantMeta&&!e.message.streaming&&e.modelBadge===null&&S(Ke,{children:[u(qe,{render:u("p",{className:"text-muted-foreground text-chat-row tabular-nums"}),children:jr(e.message.updatedAt,t.timestampFormat,n)}),u($e,{children:Pr(e.message.updatedAt,t.timestampFormat)})]})]}):null]})})}function gz({row:e}){let n=nt(At).derive.resolveAssistantMessageCopyState({text:e.message.text??null,showCopyButton:e.showAssistantCopyButton,streaming:e.assistantCopyStreaming});return n.visible?u(Ba,{text:n.text??"",variant:"ghost"}):null}function xh({badge:e}){let{t}=Ye(),n=uh(t,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(Yo,{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(kf,{text:e.modelLabel,label:t("copyButton.copyModelName"),children:u("span",{className:"min-w-0 truncate text-muted-foreground",children:e.modelLabel})}),n?S("span",{children:[" \xB7 ",n]}):null]})]})}function hz({badge:e,createdAt:t}){let n=nt(At),{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(xh,{badge:e}),u("span",{"aria-hidden":!0,children:"\xB7"}),S(Ke,{children:[u(qe,{render:u("span",{className:"shrink-0 tabular-nums"}),children:jr(t,n.timestampFormat,o)}),u($e,{children:Pr(t,n.timestampFormat)})]})]})}function $I({row:e}){let{t}=Ye(),n=uh(t,e.badge),o=n?`${e.badge.modelLabel} \xB7 ${n}`:e.badge.modelLabel,r=[e.badge.providerDisplayName,o].filter(i=>typeof i=="string"&&i.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(Yo,{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 bh=240,vz=/\s/u;function qI(e){if(!e)return null;let t=[],n=0,o=!1,r=()=>{for(;n>bh-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(vz.test(a)){o=t.length>0;continue}if(o&&(t.push(" "),n+=1,o=!1,n>bh)||(t.push(a),n+=a.length,n>bh))return r()}return t.length>0?t.join(""):null}function yz(e,t,n){let o=t.find(i=>i.kind==="message"&&i.message.role==="user"),r=o?.kind==="message"?o.message:null,a=null;for(let i of t)i.kind==="message"&&i.message.role==="assistant"&&(a=i.message.text??null);return{id:e,sectionKey:e,anchorRowId:o?.id??t[0]?.id??e,userText:r===null?null:qI(n.parseSystemNotificationText(r.text)?.summary??n.parseThreadHandoverText(r.text)?.body??r.text),assistantText:qI(a),headerText:r===null?null:BI(r.text,n)}}function Cz(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 xz(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 bz(e,t,n){for(let o=0;o<e.length;o+=1)if(e[o]!==n[t.firstRowIndex+o])return!1;return!0}function Sz(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 Iz(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,i=[],s=o.getRows();for(let d of o.getStructure().sections){let c=t.get(d.key);if(c!==void 0&&c.rowIds===d.rowIds&&bz(c.rows,d,s)){a.set(d.key,c),i.push(c.entry);continue}let f=s.slice(d.firstRowIndex,d.firstRowIndex+d.rowIds.length),p=yz(d.key,f,e),m={...p,turnId:Cz(f)},h=c!==void 0&&xz(c.entry.item,m)?c.entry:{summary:p,item:m};a.set(d.key,{rowIds:d.rowIds,rows:f,entry:h}),i.push(h)}t=a;let l=n!==null&&Sz(n.entries,i)?n.entries:i;return n={store:o,version:r,entries:l},l}}var VI=new WeakMap;function jI(e,t){let n=VI.get(e);return(n===void 0||n.derive!==t)&&(n={derive:t,read:Iz(t)},VI.set(e,n)),n.read(e)}var WI=new WeakMap;function QI(e,t){let n=jI(e,t),o=WI.get(n);return o===void 0&&(o=n.flatMap(({summary:r})=>r.headerText===null?[]:[{sectionKey:r.sectionKey,text:r.headerText}]),WI.set(n,o)),o}function YI(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 GI=new WeakMap;function XI(e,t){let n=jI(e,t),o=GI.get(n);return o===void 0&&(o=n.filter(({summary:r})=>r.userText!==null).map(({item:r})=>r),GI.set(n,o)),o}function JI(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,o)=>n===t[o])}var wz=[],Tz=e=>e.getMeta().usageByTurnId,Pz=e=>e.getMeta().exportApi,kz=e=>e.getMeta().status.totalTurnCount??null,ZI=pe(function({rowsStore:t,derive:n,paneVisible:o,bottomInset:r,onSelect:a,onTurnNavigatorChange:i}){let s=E(m=>o?XI(m,n):wz,[n,o]),l=In(t,s,JI),d=In(t,Tz),c=In(t,Pz),f=In(t,kz),p=$(()=>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 K(()=>{p!==null&&i(p)},[i,p]),K(()=>{if(o)return()=>i(null)},[i,o]),null});function ew({timeline:e,previousOverlayHeight:t,overlayHeight:n,followingEnd:o}){e&&o&&n>t&&e.scrollToEnd({animated:!1})}function tw(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 nw({measurement:e,followingEnd:t}){return t?null:e.rowAtScroll()}function Kf(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")})}Y();var Lz=e=>e.getMeta().status.workingStepLabel??null,Az=e=>e.getMeta().status.stall??null,Rz=e=>e.getMeta().status.retry??null,Ez=e=>e.getMeta().status.isWorking,ow=pe(function({rowsStore:t,historyWindow:n,children:o}){let r=In(t,Lz),a=In(t,Az),i=In(t,Rz),s=$(()=>n?{workingStepLabel:null,stall:null,retry:null}:{workingStepLabel:r,stall:a,retry:i},[n,i,a,r]);return u(bf,{value:s,children:o})});function rw({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")})})}Y();function $f(e){return e==="loading"?"threadSync.loading":"threadSync.syncing"}var Mz=1e3,aw=150;function qf(e,t=Mz){let[n,o]=j(null);return K(()=>{if(e===null){o(null);return}let r=globalThis.setTimeout(()=>{o(e)},t);return()=>{globalThis.clearTimeout(r)}},[e,t]),n}var Nz=5;function iw(e){let t=e.data.useThreadSyncPhase(e.target);return qf(t,aw)==="loading"?u(_z,{}):e.hideEmptyPlaceholder?null:u(rw,{rowsStore:e.rowsStore,historyWindow:e.historyWindow})}function _z(){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($f("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 sw=u("div",{className:"h-3 sm:h-4"}),lw=u("div",{className:"h-10 sm:h-12"});function dw({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 cw({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 uw({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 fw=u("div",{className:"h-3 sm:h-4"});Y();var Dz=Object.freeze([]),pw=e=>e.getMeta().status.scheduledWakes??Dz;function mw(e,t){let n=N(e);return t&&(n.current=e),n.current}Y();function Vf(e){return JSON.stringify([e.turnId??null,e.toolCallId?"tool":"entry",e.toolCallId||e.id])}Y();function Yr(e){if(!Number.isFinite(e)||e<0)return"0ms";if(e<1e3)return`${Math.max(1,Math.round(e))}ms`;if(e<1e4){let i=Math.round(e/100)/10;return i>=10?"10s":`${i.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 gw({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(Ir,{children:[u(Tr,{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(wd,{className:"size-3.5","aria-hidden":!0})}),u(wr,{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(xh,{badge:e})}):null,t!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnStarted",{time:Pr(t,o)})}):null,n!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnFinished",{time:Pr(n,o)})}):null]})})]})}function Oz(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]=j(!1);return S(Ke,{open:n,onOpenChange:o,children:[u(qe,{render:u("button",{type:"button",className:"inline-flex items-center gap-1 rounded-sm"}),"aria-label":e,onClick:()=>o(r=>!r),children:t}),u($e,{children:e})]})}var hw=pe(function({footer:t,timestampFormat:n,copyText:o,identity:r}){let{t:a}=Ye(),i=t.state,s=i==="error"?a("timeline.error"):i==="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:[s!==null?S(Sh,{label:s,children:[i==="error"?u(Kt,{className:"size-icon-1 text-destructive-foreground","aria-hidden":!0}):u(Dd,{className:"size-3","aria-hidden":!0}),u("span",{className:"sr-only",children:s})]}):null,t.workingElapsedMs!==void 0?u(Sh,{label:a("timeline.workingTime",{duration:Yr(t.workingElapsedMs)}),children:Yr(t.workingElapsedMs)}):null,t.workingElapsedMs!==void 0&&t.outputTokens!==void 0?u("span",{"aria-hidden":!0,children:"\xB7"}):null,t.outputTokens!==void 0?u(kf,{text:String(t.outputTokens),label:a("copyButton.copyTokenCount"),children:u(Sh,{label:`${a("timeline.outputTokens")}: ${t.outputTokens.toLocaleString()}`,children:a("timeline.outputTokenCount",{count:t.outputTokens,value:Oz(t.outputTokens)})})}):null]}),u(gw,{badge:r?.badge??null,startedAt:r?.createdAt,completedAt:t.completedAt,timestampFormat:n}),o?u(Ba,{text:o,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"}):null]})});Y();Y();function vw(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 yw=pe(function(t){let{additions:n,deletions:o,className:r,showParentheses:a=!1,layout:i="aligned"}=t,{t:s}=Ye(),l=new Intl.ListFormat(void 0,{type:"unit"}).format([s("changedFiles.additions",{count:n}),s("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:q(i==="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:["+",vw(n)]}),S("span",{"aria-hidden":"true",className:"font-mono text-diff-deletion",children:["-",vw(o)]})]}),a&&u("span",{className:"text-muted-foreground/70",children:")"})]})});function ec({name:e,className:t}){switch(e){case"bot":return u(hi,{className:t,"aria-hidden":!0});case"check":return u(qn,{className:t,"aria-hidden":!0});case"circle-alert":return u(Zt,{className:t,"aria-hidden":!0});case"eye":return u(pd,{className:t,"aria-hidden":!0});case"globe":return u(xd,{className:t,"aria-hidden":!0});case"hammer":return u(Sd,{className:t,"aria-hidden":!0});case"message-circle":return u(xi,{className:t,"aria-hidden":!0});case"search":return u(Ti,{className:t,"aria-hidden":!0});case"square-pen":return u(ro,{className:t,"aria-hidden":!0});case"terminal":return u(Co,{className:t,"aria-hidden":!0});case"wrench":return u(Fd,{className:t,"aria-hidden":!0});case"x":return u(Kt,{className:t,"aria-hidden":!0});case"zap":return u(ki,{className:t,"aria-hidden":!0})}}function Fz(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:Fz(o),count:r}))}function wh(e,t){let n;for(let o of Ih(e,t))(!n||o.count>n.count)&&(n=o);return n?.icon??"wrench"}var Ws=20;function Gs(e){return Vf(e)}function Cw(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,i=typeof a?.toolName=="string"?a.toolName:typeof a?.name=="string"?a.name:void 0,s=o?.name??i??e.toolTitle??e.label,l=o?.path??e.changedFiles?.[0],d=l?Rf(l,t):void 0,c=[s.trim().toLowerCase()==="tool"?void 0:s,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 xw({entry:e,failed:t}){let n=e.toolLabel?.diffStat;return!n||t||Th(e)?null:u(yw,{...n,layout:"inline",className:"chat-process-meta ms-2 shrink-0"})}function Th(e){return e.toolLifecycleStatus==="declined"||e.toolLifecycleStatus==="stopped"}function bw({toolIcon:e,glyphClassName:t}){let n=nt(At),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(ec,{name:"globe",className:t})}function Bz({entry:e,failed:t=!1,derive:n}){return t?u(Zt,{"aria-hidden":!0,className:"size-icon-1 shrink-0 text-destructive-foreground"}):e.toolIcon!==void 0?u(bw,{toolIcon:e.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"}):u(ec,{name:wh([e],n.toolGroupAction),className:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"})}function Uz({entries:e,failed:t,derive:n}){let{t:o}=Ye(),r=$(()=>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:i,icon:s,count:l})=>S("span",{"aria-hidden":!0,className:"flex items-center gap-1",children:[a?null:u(ec,{name:s,className:q("size-icon-1 shrink-0 stroke-[1.8] opacity-70",t?"text-destructive-foreground":"text-icon-muted")}),l]},i))})}function Sw({entry:e}){let t=nt(At),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 zz=pe(function(t){let{entry:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}=t,s=nt(At).derive,{t:l}=Ye(),[d,c]=lo(o,`call:${Gs(n)}`,!1),f=s.workEntryIndicatesFailure(n),p=Th(n),m=s.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":Gs(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:q("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-foreground":"text-muted-foreground"),children:[u(Qd,{status:h}),u(jd,{children:u(Bz,{entry:n,failed:f,derive:s})}),S("span",{className:"flex min-w-0 flex-1 items-center",children:[u("span",{className:"truncate",children:Cw(n,r,s)??l("toolGroup.calls",{count:1})}),u(xw,{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(Jt,{"aria-hidden":!0,className:q("size-icon-1 shrink-0",!d&&"-rotate-90")})]}),d?u("div",{id:g,children:u(Sw,{entry:n})}):null]})});function Hz({threadKey:e,stateKey:t,maxHeight:n,children:o}){let r=N(null);return he(()=>{let a=r.current;if(!a)return;a.scrollTop=dh(e,`${t}:scroll`,0);let i=()=>{Gd(e,`${t}:scroll`,a.scrollTop,!1)};return a.addEventListener("scroll",i,{passive:!0}),()=>a.removeEventListener("scroll",i)},[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 Iw=pe(function({entries:t,groupId:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}){let s=nt(At).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]=j(null),y=t.at(-1),C=$(()=>t.filter(_=>s.workEntryIndicatesFailure(_)),[t,s]),x=$(()=>t.filter(Th),[t]),b=t.filter(_=>_.toolLifecycleStatus==="inProgress").length,w=C[0]??x[0],I=w??y,k=Math.max(0,Math.ceil(t.length/Ws)-1),T=Math.min(f,k),P=T*Ws,L=t.slice(P,P+Ws),R=t.length>1;if(he(()=>{if(!g)return;let _=h.current,W=Array.from(_?.querySelectorAll("[data-tool-identity]")??[]).find(U=>U.dataset.toolIdentity===g.id);if(!W)return;let D=W.closest('[data-slot="scroll-area-viewport"]');D&&(D.scrollTop+=W.getBoundingClientRect().top-D.getBoundingClientRect().top),W.querySelector("button")?.focus({preventScroll:!0})},[g]),!y||!I)return null;let M=_=>{a?.(),p(_)},A={threadKey:o,workspaceRoot:r,onDisclosureChange:a},B=lI(t.map(_=>sI(s.resolveWorkEntryStatus(_)))),z=wh(t,s.toolGroupAction),H=B==="failed"?"failed":B==="running"?"running":"success";return u(Tf,{state:B,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),!R&&!d&&Gd(o,`call:${Gs(y)}`,!0)},className:q(wf,"flex-1",w?"text-destructive-foreground":"text-muted-foreground"),children:[u(Qd,{status:H}),u(jd,{children:!R&&y.toolIcon!==void 0&&C.length===0?u(bw,{toolIcon:y.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] opacity-70 text-icon-muted"}):u(ec,{name:z,className:q("size-icon-1 shrink-0 stroke-[1.8] opacity-70",C.length>0?"text-destructive-foreground":"text-icon-muted")})}),S("span",{className:q("flex min-w-0 flex-1 items-center",d&&R?"chat-process-text":"chat-tool-summary"),children:[u("span",{className:"truncate",children:d&&R?l("toolGroup.calls",{count:t.length}):Cw(I,r,s)??l("toolGroup.calls",{count:1})}),d&&R?null:u(xw,{entry:I,failed:s.workEntryIndicatesFailure(I)})]}),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&&R?null:u(Uz,{entries:t,failed:C.length>0,derive:s}),u(Jt,{"aria-hidden":!0,className:q("size-icon-1 shrink-0",!d&&"-rotate-90")})]}),w&&R?u("button",{type:"button",className:"chat-process-meta me-2 min-h-8 shrink-0 rounded-control-4 px-1 text-destructive-foreground underline [@media(pointer:coarse)]:min-h-11",onClick:()=>{a?.(),c(!0),p(Math.floor(t.indexOf(w)/Ws)),Gd(o,`call:${Gs(w)}`,!0),v({id:Gs(w)})},children:l("toolGroup.showFailure")}):null]}),d?u("div",{id:m,className:"border-t border-border/50",children:R?S(xe,{children:[t.length>Ws?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:P+1,to:Math.min(P+Ws,t.length),count:t.length})}),[{label:l("toolGroup.firstPage"),target:0,disabled:T===0,Icon:ud},{label:l("toolGroup.previousPage"),target:T-1,disabled:T===0,Icon:vi},{label:l("toolGroup.nextPage"),target:T+1,disabled:T===k,Icon:Vn},{label:l("toolGroup.lastPage"),target:k,disabled:T===k,Icon:fd}].map(({label:_,target:W,disabled:D,Icon:U})=>u("button",{type:"button","aria-label":_,disabled:D,onClick:()=>M(W),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(Hz,{threadKey:o,stateKey:`group-scroll:${n}:${T}`,maxHeight:"min(320px, 50dvh)",children:u("div",{className:"space-y-0.5 py-1",children:L.map(_=>u(zz,{entry:_,...A},Gs(_)))})})]}):u(Sw,{entry:y})}):null]})})});Y();function ww(){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,i)=>e.notify(r,a,i);return{error:(r,a,i)=>{let s=i?.description??t(a);o(n(r,s),"error",s)},warning:(r,a,i)=>{let s=i?.description??t(a);o(n(r,s),"warning",s)},success:(r,a,i)=>{let s=a??i?.description;o(n(r,s),"success",s)}}}function Wf(e){let t=e.match(/^\s{0,3}#{1,6}\s+(.+)$/m)?.[1]?.trim();return t&&t.length>0?t:null}function Ph(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(`
|
|
3820
|
+
`).replace(dz,""):e}var uz=/<ycodium-system>[\s\S]*?<\/ycodium-system>/g;function OI(e){let t=e.match(uz);return t&&t.length>0?t:[e]}function FI(e){let t=e.match(/<plugin-instruction>\n([\s\S]*?)\n<\/plugin-instruction>/)?.[1];if(t===void 0)return null;try{let n=JSON.parse(t);if(n===null||typeof n!="object"||Array.isArray(n))return null;let o=n;return typeof o.pluginId!="string"||typeof o.title!="string"||typeof o.body!="string"?null:{pluginId:o.pluginId,title:o.title,body:o.body}}catch{return null}}function Ch({row:e}){let t=nt(At).derive;if(zf(e.message.text)){let n=t.parsePresetPrefixText(e.message.text);return n?S(xe,{children:[u(fz,{parsed:n}),n.body.length>0||(e.message.attachments?.length??0)>0?u(Ch,{row:{...e,message:{...e.message,text:n.body}}}):null]}):u(mz,{row:e})}return u(DI,{row:e,text:e.message.text})}function Hf({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 fz({parsed:e}){let{t}=Ye();return S(Hf,{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 pz={"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 mz({row:e}){let{t}=Ye(),n=nt(At).derive,o=e.message.attachments??[],r=o.filter(l=>Ua(l)),a=o.filter(l=>!Ua(l)),i=l=>{let d=FI(l);if(d)return S(Hf,{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(Hf,{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(Hf,{children:[u("p",{className:"font-medium text-foreground/80",children:t(pz[f.kind],{title:f.title})}),f.summary.trim().length>0?u("p",{className:"mt-1 whitespace-pre-wrap",children:f.summary}):null]}):null},s=OI(e.message.text).map(i).filter(l=>l!==null);return s.length===0&&o.length===0?null:S(xe,{children:[s.map((l,d)=>u(Hr,{children:l},d)),o.length>0?S("div",{className:"min-w-0 px-3 py-2",children:[u(Yd,{images:r}),a.map(l=>u(Xd,{attachment:l},l.id))]}):null]})}function BI(e,t){let n=t.parsePresetPrefixText(e??"")?.body??null;if(n===null&&zf(e??""))return null;let r=Ff(n??e??"").visibleText;for(;;){let s=Uf(r);if(!s.annotation)break;r=s.promptText}let a=Vs(r).promptText,i=Ef(a).map(s=>s.kind==="text"?s.text:s.comment.text).join(" ").replace(/\s+/g," ").trim();return i.length>0?i:null}var UI=34,zI=8,Zd=UI+zI,HI=pe(function({ref:t,textRef:n,initialText:o,expanded:r,onToggleExpanded:a}){let{t:i}=Ye(),s=i(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:q("transcript-col-wide pointer-events-auto bg-chat-canvas",r&&"pb-1"),style:{paddingTop:zI},children:S("div",{"data-user-bubble":"",className:q("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:UI}},children:[u("span",{ref:n,className:q("min-w-0 flex-1 text-left text-chat",r?"max-h-40 overflow-y-auto whitespace-pre-wrap":"truncate"),children:o}),S(Ke,{children:[u(qe,{render:u(ie,{type:"button",size:"xs",variant:"ghost",className:"group-data-[truncated=false]:hidden","aria-label":s,onClick:a}),children:r?u(cd,{}):u(Jt,{})}),u($e,{side:"bottom",children:s})]})]})})})});function KI({row:e}){let t=nt(At),{t:n}=Ye(),[o,r]=lo(t.threadKey,`message:${e.message.id}`,!1);if(e.presentation==="compact"&&!o)return u(Tf,{state:"idle",children:S("button",{type:"button",className:q(wf,"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(Qd,{status:null}),u(jd,{children:u(Wr,{className:"size-icon-1","aria-hidden":!0})}),u("span",{className:"min-w-0 flex-1 truncate",children:t.derive.reasoningPreviewText(e.message.text)}),u(Jt,{className:"size-icon-1 shrink-0 -rotate-90","aria-hidden":!0})]})});let i=e.message.attachments??[],s=i.filter(c=>Ua(c)),l=i.filter(c=>!Ua(c)),d=e.message.text||(e.message.streaming||i.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(Ba,{text:e.message.text,variant:"ghost"})]}):null,e.modelBadge?u(hz,{badge:e.modelBadge,createdAt:e.message.createdAt}):null,u("div",{"data-assistant-quote-body":"",children:u(bo,{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(Yd,{images:s}),l.length>0&&u("div",{className:"mb-2 flex max-w-[420px] flex-col gap-1.5",children:l.map(c=>u(Xd,{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(gz,{row:e}),e.showAssistantMeta&&!e.message.streaming&&e.modelBadge===null&&S(Ke,{children:[u(qe,{render:u("p",{className:"text-muted-foreground text-chat-row tabular-nums"}),children:jr(e.message.updatedAt,t.timestampFormat,n)}),u($e,{children:Pr(e.message.updatedAt,t.timestampFormat)})]})]}):null]})})}function gz({row:e}){let n=nt(At).derive.resolveAssistantMessageCopyState({text:e.message.text??null,showCopyButton:e.showAssistantCopyButton,streaming:e.assistantCopyStreaming});return n.visible?u(Ba,{text:n.text??"",variant:"ghost"}):null}function xh({badge:e}){let{t}=Ye(),n=uh(t,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(Yo,{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(kf,{text:e.modelLabel,label:t("copyButton.copyModelName"),children:u("span",{className:"min-w-0 truncate text-muted-foreground",children:e.modelLabel})}),n?S("span",{children:[" \xB7 ",n]}):null]})]})}function hz({badge:e,createdAt:t}){let n=nt(At),{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(xh,{badge:e}),u("span",{"aria-hidden":!0,children:"\xB7"}),S(Ke,{children:[u(qe,{render:u("span",{className:"shrink-0 tabular-nums"}),children:jr(t,n.timestampFormat,o)}),u($e,{children:Pr(t,n.timestampFormat)})]})]})}function $I({row:e}){let{t}=Ye(),n=uh(t,e.badge),o=n?`${e.badge.modelLabel} \xB7 ${n}`:e.badge.modelLabel,r=[e.badge.providerDisplayName,o].filter(i=>typeof i=="string"&&i.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(Yo,{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 bh=240,vz=/\s/u;function qI(e){if(!e)return null;let t=[],n=0,o=!1,r=()=>{for(;n>bh-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(vz.test(a)){o=t.length>0;continue}if(o&&(t.push(" "),n+=1,o=!1,n>bh)||(t.push(a),n+=a.length,n>bh))return r()}return t.length>0?t.join(""):null}function yz(e,t,n){let o=t.find(i=>i.kind==="message"&&i.message.role==="user"),r=o?.kind==="message"?o.message:null,a=null;for(let i of t)i.kind==="message"&&i.message.role==="assistant"&&(a=i.message.text??null);return{id:e,sectionKey:e,anchorRowId:o?.id??t[0]?.id??e,userText:r===null?null:qI(n.parseSystemNotificationText(r.text)?.summary??n.parseThreadHandoverText(r.text)?.body??r.text),assistantText:qI(a),headerText:r===null?null:BI(r.text,n)}}function Cz(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 xz(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 bz(e,t,n){for(let o=0;o<e.length;o+=1)if(e[o]!==n[t.firstRowIndex+o])return!1;return!0}function Sz(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 Iz(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,i=[],s=o.getRows();for(let d of o.getStructure().sections){let c=t.get(d.key);if(c!==void 0&&c.rowIds===d.rowIds&&bz(c.rows,d,s)){a.set(d.key,c),i.push(c.entry);continue}let f=s.slice(d.firstRowIndex,d.firstRowIndex+d.rowIds.length),p=yz(d.key,f,e),m={...p,turnId:Cz(f)},h=c!==void 0&&xz(c.entry.item,m)?c.entry:{summary:p,item:m};a.set(d.key,{rowIds:d.rowIds,rows:f,entry:h}),i.push(h)}t=a;let l=n!==null&&Sz(n.entries,i)?n.entries:i;return n={store:o,version:r,entries:l},l}}var VI=new WeakMap;function jI(e,t){let n=VI.get(e);return(n===void 0||n.derive!==t)&&(n={derive:t,read:Iz(t)},VI.set(e,n)),n.read(e)}var WI=new WeakMap;function QI(e,t){let n=jI(e,t),o=WI.get(n);return o===void 0&&(o=n.flatMap(({summary:r})=>r.headerText===null?[]:[{sectionKey:r.sectionKey,text:r.headerText}]),WI.set(n,o)),o}function YI(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 GI=new WeakMap;function XI(e,t){let n=jI(e,t),o=GI.get(n);return o===void 0&&(o=n.filter(({summary:r})=>r.userText!==null).map(({item:r})=>r),GI.set(n,o)),o}function JI(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,o)=>n===t[o])}var wz=[],Tz=e=>e.getMeta().usageByTurnId,Pz=e=>e.getMeta().exportApi,kz=e=>e.getMeta().status.totalTurnCount??null,ZI=pe(function({rowsStore:t,derive:n,paneVisible:o,bottomInset:r,onSelect:a,onTurnNavigatorChange:i}){let s=E(m=>o?XI(m,n):wz,[n,o]),l=In(t,s,JI),d=In(t,Tz),c=In(t,Pz),f=In(t,kz),p=$(()=>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 K(()=>{p!==null&&i(p)},[i,p]),K(()=>{if(o)return()=>i(null)},[i,o]),null});function ew({timeline:e,previousOverlayHeight:t,overlayHeight:n,followingEnd:o}){e&&o&&n>t&&e.scrollToEnd({animated:!1})}function tw(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 nw({measurement:e,followingEnd:t}){return t?null:e.rowAtScroll()}function Kf(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")})}Y();var Lz=e=>e.getMeta().status.workingStepLabel??null,Az=e=>e.getMeta().status.stall??null,Rz=e=>e.getMeta().status.retry??null,Ez=e=>e.getMeta().status.isWorking,ow=pe(function({rowsStore:t,historyWindow:n,children:o}){let r=In(t,Lz),a=In(t,Az),i=In(t,Rz),s=$(()=>n?{workingStepLabel:null,stall:null,retry:null}:{workingStepLabel:r,stall:a,retry:i},[n,i,a,r]);return u(bf,{value:s,children:o})});function rw({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")})})}Y();function $f(e){return e==="loading"?"threadSync.loading":"threadSync.syncing"}var Mz=1e3,aw=150;function qf(e,t=Mz){let[n,o]=j(null);return K(()=>{if(e===null){o(null);return}let r=globalThis.setTimeout(()=>{o(e)},t);return()=>{globalThis.clearTimeout(r)}},[e,t]),n}var Nz=5;function iw(e){let t=e.data.useThreadSyncPhase(e.target);return qf(t,aw)==="loading"?u(_z,{}):e.hideEmptyPlaceholder?null:u(rw,{rowsStore:e.rowsStore,historyWindow:e.historyWindow})}function _z(){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($f("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 sw=u("div",{className:"h-3 sm:h-4"}),lw=u("div",{className:"h-10 sm:h-12"});function dw({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 cw({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 uw({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 fw=u("div",{className:"h-3 sm:h-4"});Y();var Dz=Object.freeze([]),pw=e=>e.getMeta().status.scheduledWakes??Dz;function mw(e,t){let n=N(e);return t&&(n.current=e),n.current}Y();function Vf(e){return JSON.stringify([e.turnId??null,e.toolCallId?"tool":"entry",e.toolCallId||e.id])}Y();function Yr(e){if(!Number.isFinite(e)||e<0)return"0ms";if(e<1e3)return`${Math.max(1,Math.round(e))}ms`;if(e<1e4){let i=Math.round(e/100)/10;return i>=10?"10s":`${i.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 gw({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(Ir,{children:[u(Tr,{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(wd,{className:"size-3.5","aria-hidden":!0})}),u(wr,{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(xh,{badge:e})}):null,t!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnStarted",{time:Pr(t,o)})}):null,n!==void 0?u("div",{className:"text-muted-foreground tabular-nums",children:r("timeline.turnFinished",{time:Pr(n,o)})}):null]})})]})}function Oz(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]=j(!1);return S(Ke,{open:n,onOpenChange:o,children:[u(qe,{render:u("button",{type:"button",className:"inline-flex items-center gap-1 rounded-sm"}),"aria-label":e,onClick:()=>o(r=>!r),children:t}),u($e,{children:e})]})}var hw=pe(function({footer:t,timestampFormat:n,copyText:o,identity:r}){let{t:a}=Ye(),i=t.state,s=i==="error"?a("timeline.error"):i==="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:[s!==null?S(Sh,{label:s,children:[i==="error"?u(Kt,{className:"size-icon-1 text-destructive-foreground","aria-hidden":!0}):u(Dd,{className:"size-3","aria-hidden":!0}),u("span",{className:"sr-only",children:s})]}):null,t.workingElapsedMs!==void 0?u(Sh,{label:a("timeline.workingTime",{duration:Yr(t.workingElapsedMs)}),children:Yr(t.workingElapsedMs)}):null,t.workingElapsedMs!==void 0&&t.outputTokens!==void 0?u("span",{"aria-hidden":!0,children:"\xB7"}):null,t.outputTokens!==void 0?u(kf,{text:String(t.outputTokens),label:a("copyButton.copyTokenCount"),children:u(Sh,{label:`${a("timeline.outputTokens")}: ${t.outputTokens.toLocaleString()}`,children:a("timeline.outputTokenCount",{count:t.outputTokens,value:Oz(t.outputTokens)})})}):null]}),u(gw,{badge:r?.badge??null,startedAt:r?.createdAt,completedAt:t.completedAt,timestampFormat:n}),o?u(Ba,{text:o,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"}):null]})});Y();Y();function vw(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 yw=pe(function(t){let{additions:n,deletions:o,className:r,showParentheses:a=!1,layout:i="aligned"}=t,{t:s}=Ye(),l=new Intl.ListFormat(void 0,{type:"unit"}).format([s("changedFiles.additions",{count:n}),s("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:q(i==="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:["+",vw(n)]}),S("span",{"aria-hidden":"true",className:"font-mono text-diff-deletion",children:["-",vw(o)]})]}),a&&u("span",{className:"text-muted-foreground/70",children:")"})]})});function ec({name:e,className:t}){switch(e){case"bot":return u(hi,{className:t,"aria-hidden":!0});case"check":return u(qn,{className:t,"aria-hidden":!0});case"circle-alert":return u(Zt,{className:t,"aria-hidden":!0});case"eye":return u(pd,{className:t,"aria-hidden":!0});case"globe":return u(xd,{className:t,"aria-hidden":!0});case"hammer":return u(Sd,{className:t,"aria-hidden":!0});case"message-circle":return u(xi,{className:t,"aria-hidden":!0});case"search":return u(Ti,{className:t,"aria-hidden":!0});case"square-pen":return u(ro,{className:t,"aria-hidden":!0});case"terminal":return u(Co,{className:t,"aria-hidden":!0});case"wrench":return u(Fd,{className:t,"aria-hidden":!0});case"x":return u(Kt,{className:t,"aria-hidden":!0});case"zap":return u(ki,{className:t,"aria-hidden":!0})}}function Fz(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:Fz(o),count:r}))}function wh(e,t){let n;for(let o of Ih(e,t))(!n||o.count>n.count)&&(n=o);return n?.icon??"wrench"}var Ws=20;function Gs(e){return Vf(e)}function Cw(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,i=typeof a?.toolName=="string"?a.toolName:typeof a?.name=="string"?a.name:void 0,s=o?.name??i??e.toolTitle??e.label,l=o?.path??e.changedFiles?.[0],d=l?Rf(l,t):void 0,c=[s.trim().toLowerCase()==="tool"?void 0:s,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 xw({entry:e,failed:t}){let n=e.toolLabel?.diffStat;return!n||t||Th(e)?null:u(yw,{...n,layout:"inline",className:"chat-process-meta ms-2 shrink-0"})}function Th(e){return e.toolLifecycleStatus==="declined"||e.toolLifecycleStatus==="stopped"}function bw({toolIcon:e,glyphClassName:t}){let n=nt(At),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(ec,{name:"globe",className:t})}function Bz({entry:e,failed:t=!1,derive:n}){return t?u(Zt,{"aria-hidden":!0,className:"size-icon-1 shrink-0 text-destructive-foreground"}):e.toolIcon!==void 0?u(bw,{toolIcon:e.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"}):u(ec,{name:wh([e],n.toolGroupAction),className:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"})}function Uz({entries:e,failed:t,derive:n}){let{t:o}=Ye(),r=$(()=>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:i,icon:s,count:l})=>S("span",{"aria-hidden":!0,className:"flex items-center gap-1",children:[a?null:u(ec,{name:s,className:q("size-icon-1 shrink-0 stroke-[1.8] opacity-70",t?"text-destructive-foreground":"text-icon-muted")}),l]},i))})}function Sw({entry:e}){let t=nt(At),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 zz=pe(function(t){let{entry:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}=t,s=nt(At).derive,{t:l}=Ye(),[d,c]=lo(o,`call:${Gs(n)}`,!1),f=s.workEntryIndicatesFailure(n),p=Th(n),m=s.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":Gs(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:q("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-foreground":"text-muted-foreground"),children:[u(Qd,{status:h}),u(jd,{children:u(Bz,{entry:n,failed:f,derive:s})}),S("span",{className:"flex min-w-0 flex-1 items-center",children:[u("span",{className:"truncate",children:Cw(n,r,s)??l("toolGroup.calls",{count:1})}),u(xw,{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(Jt,{"aria-hidden":!0,className:q("size-icon-1 shrink-0",!d&&"-rotate-90")})]}),d?u("div",{id:g,children:u(Sw,{entry:n})}):null]})});function Hz({threadKey:e,stateKey:t,maxHeight:n,children:o}){let r=N(null);return he(()=>{let a=r.current;if(!a)return;a.scrollTop=dh(e,`${t}:scroll`,0);let i=()=>{Gd(e,`${t}:scroll`,a.scrollTop,!1)};return a.addEventListener("scroll",i,{passive:!0}),()=>a.removeEventListener("scroll",i)},[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 Iw=pe(function({entries:t,groupId:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}){let s=nt(At).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]=j(null),y=t.at(-1),C=$(()=>t.filter(_=>s.workEntryIndicatesFailure(_)),[t,s]),x=$(()=>t.filter(Th),[t]),b=t.filter(_=>_.toolLifecycleStatus==="inProgress").length,w=C[0]??x[0],I=w??y,k=Math.max(0,Math.ceil(t.length/Ws)-1),T=Math.min(f,k),P=T*Ws,L=t.slice(P,P+Ws),R=t.length>1;if(he(()=>{if(!g)return;let _=h.current,W=Array.from(_?.querySelectorAll("[data-tool-identity]")??[]).find(U=>U.dataset.toolIdentity===g.id);if(!W)return;let D=W.closest('[data-slot="scroll-area-viewport"]');D&&(D.scrollTop+=W.getBoundingClientRect().top-D.getBoundingClientRect().top),W.querySelector("button")?.focus({preventScroll:!0})},[g]),!y||!I)return null;let M=_=>{a?.(),p(_)},A={threadKey:o,workspaceRoot:r,onDisclosureChange:a},B=lI(t.map(_=>sI(s.resolveWorkEntryStatus(_)))),z=wh(t,s.toolGroupAction),H=B==="failed"?"failed":B==="running"?"running":"success";return u(Tf,{state:B,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),!R&&!d&&Gd(o,`call:${Gs(y)}`,!0)},className:q(wf,"flex-1",w?"text-destructive-foreground":"text-muted-foreground"),children:[u(Qd,{status:H}),u(jd,{children:!R&&y.toolIcon!==void 0&&C.length===0?u(bw,{toolIcon:y.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] opacity-70 text-icon-muted"}):u(ec,{name:z,className:q("size-icon-1 shrink-0 stroke-[1.8] opacity-70",C.length>0?"text-destructive-foreground":"text-icon-muted")})}),S("span",{className:q("flex min-w-0 flex-1 items-center",d&&R?"chat-process-text":"chat-tool-summary"),children:[u("span",{className:"truncate",children:d&&R?l("toolGroup.calls",{count:t.length}):Cw(I,r,s)??l("toolGroup.calls",{count:1})}),d&&R?null:u(xw,{entry:I,failed:s.workEntryIndicatesFailure(I)})]}),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&&R?null:u(Uz,{entries:t,failed:C.length>0,derive:s}),u(Jt,{"aria-hidden":!0,className:q("size-icon-1 shrink-0",!d&&"-rotate-90")})]}),w&&R?u("button",{type:"button",className:"chat-process-meta me-2 min-h-8 shrink-0 rounded-control-4 px-1 text-destructive-foreground underline [@media(pointer:coarse)]:min-h-11",onClick:()=>{a?.(),c(!0),p(Math.floor(t.indexOf(w)/Ws)),Gd(o,`call:${Gs(w)}`,!0),v({id:Gs(w)})},children:l("toolGroup.showFailure")}):null]}),d?u("div",{id:m,className:"border-t border-border/50",children:R?S(xe,{children:[t.length>Ws?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:P+1,to:Math.min(P+Ws,t.length),count:t.length})}),[{label:l("toolGroup.firstPage"),target:0,disabled:T===0,Icon:ud},{label:l("toolGroup.previousPage"),target:T-1,disabled:T===0,Icon:vi},{label:l("toolGroup.nextPage"),target:T+1,disabled:T===k,Icon:Vn},{label:l("toolGroup.lastPage"),target:k,disabled:T===k,Icon:fd}].map(({label:_,target:W,disabled:D,Icon:U})=>u("button",{type:"button","aria-label":_,disabled:D,onClick:()=>M(W),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(Hz,{threadKey:o,stateKey:`group-scroll:${n}:${T}`,maxHeight:"min(320px, 50dvh)",children:u("div",{className:"space-y-0.5 py-1",children:L.map(_=>u(zz,{entry:_,...A},Gs(_)))})})]}):u(Sw,{entry:y})}):null]})})});Y();function ww(){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,i)=>e.notify(r,a,i);return{error:(r,a,i)=>{let s=i?.description??t(a);o(n(r,s),"error",s)},warning:(r,a,i)=>{let s=i?.description??t(a);o(n(r,s),"warning",s)},success:(r,a,i)=>{let s=a??i?.description;o(n(r,s),"success",s)}}}function Wf(e){let t=e.match(/^\s{0,3}#{1,6}\s+(.+)$/m)?.[1]?.trim();return t&&t.length>0?t:null}function Ph(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(`
|
|
3818
3821
|
`)}function Tw(e,t,n){let o=n?.maxLines??8,r=Ph(e).trimEnd().split(/\r?\n/).map(l=>l.trimEnd()),a=[],i=0,s=!1;for(let l of r){let d=l.trim().length>0;if(d&&i>=o){s=!0;break}a.push(l),d&&(i+=1)}for(;a.length>0&&a.at(-1)?.trim().length===0;)a.pop();return a.length===0?Wf(e)??t("proposedPlan.previewUnavailable"):(s&&a.push("","..."),a.join(`
|
|
3819
3822
|
`))}function Kz(e){let t=e.toLowerCase().replace(/[`'".,!?()[\]{}]+/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return t.length>0?t:"plan"}function Pw(e){let t=Wf(e);return`${Kz(t??"plan")}.md`}function kw(e){return`${e.trimEnd()}
|
|
3820
3823
|
`}function Lw(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 tc(e,t,n="duration"){let o=`<${n}></${n}>`,r=`<${n}/>`,a=s=>{let l=e.indexOf(s);return l<0?null:[e.slice(0,l),e.slice(l+s.length)]},i=a(o)??a(r);return i===null?S(xe,{children:[e,t]}):S(xe,{children:[i[0],t,i[1]]})}var Gf=1024,Aw=pe(function({planMarkdown:t,threadKey:n,rowId:o,environmentId:r,threadRef:a,cwd:i,workspaceRoot:s,onSavePlanToWorkspace:l}){let{t:d}=Ye(),c=ww(),[f,p]=lo(n,`proposed-plan:${o}:expanded`,!1),[m,h]=j(!1),[g,v]=lo(n,`proposed-plan:${o}:save-path`,""),[y,C]=j(!1);$u(o,m||y);let x=N(!1),b=N(!1);he(()=>(x.current=!0,()=>{x.current=!1}),[]);let{copyToClipboard:w,isCopied:I}=Pf({target:"plan",onError:D=>{c.error(d("proposedPlan.couldNotCopy"),D,{description:d("proposedPlan.copyErrorDescription")})}}),k=Ro(),T=Wf(t)??d("proposedPlan.defaultTitle"),P=t.split(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/plugin-conversation",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2934",
|
|
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,9 +42,9 @@
|
|
|
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.2926",
|
|
46
45
|
"ycodium-composer-tokens": "0.0.0",
|
|
47
|
-
"ycodium-workspace-path": "0.0.0"
|
|
46
|
+
"ycodium-workspace-path": "0.0.0",
|
|
47
|
+
"@ycodium-ai/plugin-api": "0.2.2934"
|
|
48
48
|
},
|
|
49
49
|
"ycodium": {
|
|
50
50
|
"plugin": "./dist/index.js",
|