@ycodium-ai/plugin-conversation 0.2.4250 → 0.2.4256

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 CHANGED
@@ -3848,7 +3848,7 @@ ${t.context.body}`:t.context.header;return b(_e,{children:[b(Oe,{render:c("span"
3848
3848
  `)){let r=o.trim();if(!m5.test(r)){n.push(t?Hf(o):o);continue}t=!r.startsWith("</")&&h5.test(r)}return n.join(`
3849
3849
  `).replace(f5,"")};var GT=`
3850
3850
  </preset-prefix>
3851
- ${$T}`,v5=new RegExp(`^${Uf}\\n<preset-prefix id="([^"]*)">\\n([\\s\\S]*?)\\n</preset-prefix>\\n${$T}(?:\\n\\n([\\s\\S]*))?$`),jT=e=>{if(e.split(GT).length!==2)return null;let t=v5.exec(e);if(t===null)return null;let[,n,o,r]=t;return n?{presetId:n,prefix:o??"",body:r??""}:null},QT=e=>ni(e)?jT(e)?.body||null:e,y5=["work","check-in","instructions","notice"];var C5=new RegExp(`${Hv}<plugin-wake plugin="([^"]+)" reason="([^"]+)"(?: item="([^"]+)")? ${WT}>\\n[\\s\\S]*?\\n</plugin-wake>`),YT=e=>{let t=C5.exec(e);if(t===null)return null;let[,n,o,r]=t;if(!n||!o)return null;let a=y5.find(s=>s===Hf(o));return{pluginId:Hf(n),reason:a??"notice",...r?{item:Hf(r)}:{}}},XT=e=>{switch(e.reason){case"work":return e.item===void 0?{key:"work"}:{key:"workItem",item:e.item};case"check-in":return{key:"checkIn"};case"instructions":return{key:"instructions"};case"notice":return{key:"notice"}}};var x5=new RegExp(`${Hv}<plugin-instruction>\\n([\\s\\S]*?)\\n<\\/plugin-instruction>`);function JT(e){let t=e.match(x5)?.[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 Uv({row:e}){let t=Ke(ut).derive;if(ni(e.message.text)){let n=t.parsePresetPrefixText(e.message.text);return n?b(ue,{children:[c(I5,{parsed:n}),n.body.length>0||(e.message.attachments?.length??0)>0?c(Uv,{row:{...e,message:{...e.message,text:n.body}}}):null]}):c(T5,{row:e})}return c(KT,{row:e,text:e.message.text})}var b5={"child.settled":{tone:"success",label:"childThread.state.settled"},"child.failed":{tone:"error",label:"childThread.state.failed"},"child.approval":{tone:"attention",label:"childThread.state.approval"},"child.question":{tone:"attention",label:"childThread.state.question"},"child.stopped":{tone:"neutral",label:"childThread.state.stopped"},"child.resolved":{tone:"success",label:"childThread.state.resolved"}};function Kf({children:e}){return c("div",{className:"flex justify-center py-1",children:c("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 S5({wake:e}){let{t}=Je(),n=XT(e),o=t(`pluginWake.${n.key}`,{item:n.item});return c("div",{className:"flex justify-center py-1","data-plugin-wake":e.pluginId,children:c("p",{className:"max-w-[80%] text-center text-chat-row text-muted-foreground",children:o})})}function I5({parsed:e}){let{t}=Je();return b(Kf,{children:[c("p",{className:"font-medium text-foreground/80",children:t("preset.systemBlockTitle",{name:e.presetId})}),e.prefix.trim().length>0?c("p",{className:"mt-1 whitespace-pre-wrap",children:e.prefix}):null]})}var w5={"child.settled":"childThread.notification.settled","child.failed":"childThread.notification.failed","child.approval":"childThread.notification.approval","child.question":"childThread.notification.question","child.stopped":"childThread.notification.stopped","child.resolved":"childThread.notification.resolved","plugin.notice":"childThread.notification.pluginNotice","selfdev.resolved":"childThread.notification.selfdevResolved","cookie-import.resolved":"childThread.notification.cookieImportResolved"};function T5({row:e}){let{t}=Je(),n=Ln(),{derive:o,activeThreadEnvironmentId:r}=Ke(ut),a=Ke(ut).SessionMessageCard,s=e.message.attachments??[],i=s.filter(p=>ca(p)),l=s.filter(p=>!ca(p)),d=p=>{let f=YT(p);if(f)return c(S5,{wake:f});let m=JT(p);if(m)return b(Kf,{children:[c("p",{className:"font-medium text-foreground/80",children:m.title}),m.body.length>0?c("p",{className:"mt-1 whitespace-pre-wrap",children:m.body}):null]});let h=o.parseThreadHandoverText(p);if(h)return b(Kf,{children:[c("p",{className:"font-medium text-foreground/80",children:t("continuation.systemBlockTitle")}),c("p",{className:"mt-1",children:t("continuation.systemBlockTurns",{count:h.includedTurns})}),c("p",{className:"mt-1 whitespace-pre-wrap",children:h.body})]});let g=o.parseSystemNotificationText(p);if(!g)return null;let v=g.childThreadId&&o.notificationOpensChildThread(g.kind),C=()=>n.openThread({environmentId:r,threadId:g.childThreadId}),y=b5[g.kind];if(a!==void 0&&y!==void 0&&g.childThreadId){let T=[g.kind==="child.resolved"&&g.resolution!==void 0?t(`childThread.resolution.${g.resolution}`):null,g.summary.trim()].filter(I=>I).join(`
3851
+ ${$T}`,v5=new RegExp(`^${Uf}\\n<preset-prefix id="([^"]*)">\\n([\\s\\S]*?)\\n</preset-prefix>\\n${$T}(?:\\n\\n([\\s\\S]*))?$`),jT=e=>{if(e.split(GT).length!==2)return null;let t=v5.exec(e);if(t===null)return null;let[,n,o,r]=t;return n?{presetId:n,prefix:o??"",body:r??""}:null},QT=e=>ni(e)?jT(e)?.body||null:e,y5=["work","check-in","instructions","notice"];var C5=new RegExp(`${Hv}<plugin-wake plugin="([^"]+)" reason="([^"]+)"(?: item="([^"]+)")? ${WT}>\\n[\\s\\S]*?\\n</plugin-wake>`),YT=e=>{let t=C5.exec(e);if(t===null)return null;let[,n,o,r]=t;if(!n||!o)return null;let a=y5.find(s=>s===Hf(o));return{pluginId:Hf(n),reason:a??"notice",...r?{item:Hf(r)}:{}}},XT=e=>{switch(e.reason){case"work":return e.item===void 0?{key:"work"}:{key:"workItem",item:e.item};case"check-in":return{key:"checkIn"};case"instructions":return{key:"instructions"};case"notice":return{key:"notice"}}};var x5=new RegExp(`${Hv}<plugin-instruction>\\n([\\s\\S]*?)\\n<\\/plugin-instruction>`);function JT(e){let t=e.match(x5)?.[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 Uv({row:e}){let t=Ke(ut).derive;if(ni(e.message.text)){let n=t.parsePresetPrefixText(e.message.text);return n?b(ue,{children:[c(I5,{parsed:n}),n.body.length>0||(e.message.attachments?.length??0)>0?c(Uv,{row:{...e,message:{...e.message,text:n.body}}}):null]}):c(T5,{row:e})}return c(KT,{row:e,text:e.message.text})}var b5={"child.settled":{tone:"success",label:"childThread.state.settled"},"child.failed":{tone:"error",label:"childThread.state.failed"},"child.approval":{tone:"attention",label:"childThread.state.approval"},"child.question":{tone:"attention",label:"childThread.state.question"},"child.stopped":{tone:"neutral",label:"childThread.state.stopped"},"child.resolved":{tone:"success",label:"childThread.state.resolved"}};function Kf({children:e}){return c("div",{className:"flex justify-center py-1",children:c("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 S5({wake:e}){let{t}=Je(),n=XT(e),o=t(`pluginWake.${n.key}`,{item:n.item});return c("div",{className:"flex justify-center py-1","data-plugin-wake":e.pluginId,children:c("p",{className:"max-w-[80%] text-center text-chat-row text-muted-foreground",children:o})})}function I5({parsed:e}){let{t}=Je();return b(Kf,{children:[c("p",{className:"font-medium text-foreground/80",children:t("preset.systemBlockTitle",{name:e.presetId})}),e.prefix.trim().length>0?c("p",{className:"mt-1 whitespace-pre-wrap",children:e.prefix}):null]})}var w5={"child.settled":"childThread.notification.settled","child.failed":"childThread.notification.failed","child.approval":"childThread.notification.approval","child.question":"childThread.notification.question","child.stopped":"childThread.notification.stopped","child.resolved":"childThread.notification.resolved","plugin.notice":"childThread.notification.pluginNotice","selfdev.resolved":"childThread.notification.selfdevResolved","cookie-import.resolved":"childThread.notification.cookieImportResolved"};function T5({row:e}){let{t}=Je(),n=Ln(),{derive:o,activeThreadEnvironmentId:r}=Ke(ut),a=Ke(ut).SessionMessageCard,s=e.message.attachments??[],i=s.filter(p=>ca(p)),l=s.filter(p=>!ca(p)),d=p=>{let f=YT(p);if(f)return c(S5,{wake:f});let m=JT(p);if(m)return b(Kf,{children:[c("p",{className:"font-medium text-foreground/80",children:m.title}),m.body.length>0?c("p",{className:"mt-1 whitespace-pre-wrap",children:m.body}):null]});let h=o.parseThreadHandoverText(p);if(h)return b(Kf,{children:[c("p",{className:"font-medium text-foreground/80",children:t("continuation.systemBlockTitle")}),c("p",{className:"mt-1",children:t("continuation.systemBlockTurns",{count:h.includedTurns})}),c("p",{className:"mt-1 whitespace-pre-wrap",children:h.body})]});let g=o.parseSystemNotificationText(p);if(!g||g.recordId!==void 0)return null;let v=g.childThreadId&&o.notificationOpensChildThread(g.kind),C=()=>n.openThread({environmentId:r,threadId:g.childThreadId}),y=b5[g.kind];if(a!==void 0&&y!==void 0&&g.childThreadId){let T=[g.kind==="child.resolved"&&g.resolution!==void 0?t(`childThread.resolution.${g.resolution}`):null,g.summary.trim()].filter(I=>I).join(`
3852
3852
  `);return c(a,{environmentId:r,threadId:g.childThreadId,fallbackName:g.title,status:{tone:y.tone,label:t(y.label)},text:T.length>0?T:t(y.label),action:v?{label:t("childThread.open"),onPress:C}:void 0})}return b(Kf,{children:[c("p",{className:"font-medium text-foreground/80",children:t(w5[g.kind],{title:g.title})}),g.kind==="child.resolved"&&g.resolution!==void 0?c("p",{className:"mt-1",children:t(`childThread.resolution.${g.resolution}`)}):null,g.summary.trim().length>0?c("p",{className:"mt-1 whitespace-pre-wrap",children:g.summary}):null,v?c(X,{type:"button",size:"xs",variant:"outline",className:"relative mt-2 pointer-coarse:after:absolute pointer-coarse:after:inset-0 pointer-coarse:after:min-h-11",onClick:C,children:t("childThread.open")}):null]})},u=VT(e.message.text).map(d).filter(p=>p!==null);return u.length===0&&s.length===0?null:b(ue,{children:[u.map((p,f)=>c(Fs,{children:p},f)),s.length>0?b("div",{className:"min-w-0 px-3 py-2",children:[c(Yc,{images:i}),l.map(p=>c(Xc,{attachment:p},p.id))]}):null]})}function ZT(e,t){let n=t.parsePresetPrefixText(e??"")?.body??null;if(n===null&&ni(e??""))return null;let r=Al(n??e??"").visibleText;for(;;){let i=Nl(r);if(!i.annotation)break;r=i.promptText}let a=as(r).promptText,s=Ll(a).map(i=>i.kind==="text"?t.messageLinksToPreviewText(i.text):i.comment.text).join(" ").replace(/\s+/g," ").trim();return s.length>0?s:null}var e0=30,t0=8,Kv=e0+t0,n0=ce(function({ref:t,textRef:n,initialText:o,onJump:r}){let{t:a}=Je(),s=a("timeline.pinnedTurnHeaderJump");return c("div",{ref:t,className:"pointer-events-none absolute inset-x-0 top-0 z-10 px-3 data-[visible=false]:hidden sm:px-5","data-timeline-turn-header":"true","data-visible":"false",children:c("div",{className:"transcript-col-wide",style:{paddingTop:t0},children:c("div",{className:"rounded-control-3 bg-background",children:b(X,{type:"button",variant:"outline",size:"sm",title:s,onClick:r,className:"pointer-events-auto w-full min-w-0 justify-start gap-2 bg-background px-2.5 text-xs font-normal text-muted-foreground shadow-xs hover:text-foreground",style:{height:e0},children:[c(ec,{"aria-hidden":!0,className:"size-icon-2 shrink-0"}),c("span",{className:"sr-only",children:s}),c("span",{ref:n,className:"min-w-0 flex-1 truncate text-left",children:o})]})})})})});function o0({row:e}){let t=Ke(ut),{t:n}=Je(),[o,r]=En(t.threadKey,`message:${e.message.id}`,!1);if(e.message.text.trim().length===0&&(e.message.attachments?.length??0)>0)return c(Dv,{rowId:e.id,messageId:e.message.id,attachments:e.message.attachments},e.message.id);if(e.presentation==="compact"&&!o)return c(Pf,{state:"idle",children:b("button",{type:"button",className:G(kf,"chat-process-text cursor-[var(--control-cursor)] text-secondary-label hover:bg-accent/20"),"aria-expanded":!1,"aria-label":n("timeline.expandMessage"),onClick:()=>{t.onProcessDisclosureChange?.(e.id),r(!0)},children:[c(Qc,{status:null}),c(jc,{children:c(sa,{className:"size-icon-1","aria-hidden":!0})}),c("span",{className:"min-w-0 flex-1 truncate",children:t.derive.reasoningPreviewText(e.message.text)}),c(jt,{className:"size-icon-1 shrink-0 -rotate-90","aria-hidden":!0})]})});let s=e.message.attachments??[],i=e.message.text||(e.message.streaming||s.length>0?"":n("timeline.emptyResponse"));return c(ue,{children:b("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"?b("div",{className:"mb-1 flex items-center gap-2",children:[c("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:c(rs,{text:e.message.text,variant:"ghost"})]}):null,e.modelBadge?c(P5,{badge:e.modelBadge,createdAt:e.message.createdAt}):null,i.trim().length>0?c("div",{"data-assistant-quote-body":"",children:c(oo,{disclosureKey:`message:${e.message.id}:assistant`,text:i,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(i),skills:t.skills,onImageExpand:t.onImageExpand,artifactTurnId:e.message.turnId})}):null,c(Dv,{rowId:e.id,messageId:e.message.id,attachments:s},e.message.id),e.showAssistantMeta||e.showAssistantCopyButton&&!e.assistantCopyStreaming&&e.message.text.trim().length>0?b("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:[c(k5,{row:e}),e.showAssistantMeta&&!e.message.streaming&&e.modelBadge===null&&b(_e,{children:[c(Oe,{render:c("p",{className:"text-muted-foreground text-chat-row tabular-nums"}),children:da(e.message.updatedAt,t.timestampFormat,n)}),c(De,{children:Hr(e.message.updatedAt,t.timestampFormat,n)})]})]}):null]})})}function k5({row:e}){let n=Ke(ut).derive.resolveAssistantMessageCopyState({text:e.message.text??null,showCopyButton:e.showAssistantCopyButton,streaming:e.assistantCopyStreaming});return n.visible?c(rs,{text:n.text??"",variant:"ghost"}):null}function tu({badge:e,compact:t=!1}){let{t:n}=Je(),o=Nv(n,e);return b(ue,{children:[e.driverKind?c("span",{className:t?"flex size-5 shrink-0 items-center justify-center":"flex size-7 shrink-0 items-center justify-center rounded-lg border border-border/60 bg-card","aria-label":e.providerDisplayName??void 0,children:c(Zo,{driver:e.driverKind,displayName:e.providerDisplayName,accentColor:e.accentColor,className:"size-5",iconClassName:"size-4"})}):null,b("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[e.driverKind?c("span",{className:"font-medium text-foreground",children:e.providerDisplayName}):null,t?c("span",{className:"min-w-0 truncate text-muted-foreground",children:e.modelLabel}):c(Lf,{text:e.modelLabel,label:n("copyButton.copyModelName"),children:c("span",{className:"min-w-0 truncate text-muted-foreground",children:e.modelLabel})}),o?b(ue,{children:[" ",c("span",{children:o})]}):null]})]})}function P5({badge:e,createdAt:t}){let n=Ke(ut),{t:o}=Je();return b("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:[c(tu,{badge:e})," ",b(_e,{children:[c(Oe,{render:c("span",{className:"shrink-0 tabular-nums"}),children:da(t,n.timestampFormat,o)}),c(De,{children:Hr(t,n.timestampFormat,o)})]})]})}function r0({row:e}){let{t}=Je(),n=Nv(t,e.badge),o=n?`${e.badge.modelLabel} (${n})`:e.badge.modelLabel,r=[e.badge.providerDisplayName,o].filter(s=>typeof s=="string"&&s.length>0).join(" "),a=e.pending?t("timeline.modelSwitchPending",{model:r}):t("timeline.modelSwitched",{model:r});return b("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:[c("span",{"aria-hidden":!0,className:"h-px min-w-4 flex-1 bg-border/60"}),b("span",{className:"flex min-w-0 shrink items-center gap-1.5",children:[e.badge.driverKind?c(Zo,{driver:e.badge.driverKind,displayName:e.badge.providerDisplayName,accentColor:e.badge.accentColor,className:"size-icon-1",iconClassName:"size-icon-1"}):null,c("span",{className:"truncate",children:a})]}),c("span",{"aria-hidden":!0,className:"h-px min-w-4 flex-1 bg-border/60"})]})}var $v=240,R5=/\s/u;function a0(e){if(!e)return null;let t=[],n=0,o=!1,r=()=>{for(;n>$v-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(R5.test(a)){o=t.length>0;continue}if(o&&(t.push(" "),n+=1,o=!1,n>$v)||(t.push(a),n+=a.length,n>$v))return r()}return t.length>0?t.join(""):null}function L5(e,t,n){let o=t.find(p=>p.kind==="message"&&p.message.role==="user"),r=o?.kind==="message"?o.message:null,a=null;for(let p of t)p.kind==="message"&&p.message.role==="assistant"&&(a=p.message.text.trim()?p.message.text:(p.message.attachments??[]).map(f=>f.source?._tag==="agent-artifact"&&f.source.title?`${f.name} \u2014 ${f.source.title}`:f.name).join(", "));let s=r?.attachments??[],i=r!==null&&!r.text.trim()&&s[0]?{name:s[0].name,count:s.length}:void 0,l=r!==null&&ni(r.text)&&n.parsePresetPrefixText(r.text)===null,d=r===null?null:ZT(r.text,n),u=d===null&&!l&&s[0]?{name:s[0].name,count:s.length}:void 0;return{...i===void 0?{}:{attachmentPreview:i},...u===void 0?{}:{headerAttachment:u},...l?{isSystemMessage:!0}:{},id:e,sectionKey:e,anchorRowId:o?.id??t[0]?.id??e,userText:r===null?null:a0(n.parseSystemNotificationText(r.text)?.summary??n.parseThreadHandoverText(r.text)?.body??n.messageLinksToPreviewText(n.parsePresetPrefixText(r.text)?.body??r.text))??(i===void 0?null:""),assistantText:a0(a),headerText:d}}function E5(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 M5(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&&e.isSystemMessage===t.isSystemMessage&&e.attachmentPreview?.name===t.attachmentPreview?.name&&e.attachmentPreview?.count===t.attachmentPreview?.count}function A5(e,t,n){for(let o=0;o<e.length;o+=1)if(e[o]!==n[t.firstRowIndex+o])return!1;return!0}function N5(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 _5(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 u=t.get(d.key);if(u!==void 0&&u.rowIds===d.rowIds&&A5(u.rows,d,i)){a.set(d.key,u),s.push(u.entry);continue}let p=i.slice(d.firstRowIndex,d.firstRowIndex+d.rowIds.length),f=L5(d.key,p,e),{headerAttachment:m,...h}=f,g={...h,turnId:E5(p)},v=u?.entry.summary.headerAttachment,C=u!==void 0&&M5(u.entry.item,g)&&v?.name===m?.name&&v?.count===m?.count?u.entry:{summary:f,item:g};a.set(d.key,{rowIds:d.rowIds,rows:p,entry:C}),s.push(C)}t=a;let l=n!==null&&N5(n.entries,s)?n.entries:s;return n={store:o,version:r,entries:l},l}}var s0=new WeakMap;function d0(e,t){let n=s0.get(e);return(n===void 0||n.derive!==t)&&(n={derive:t,read:_5(t)},s0.set(e,n)),n.read(e)}var i0=new WeakMap;function c0(e,t){let n=d0(e,t),o=i0.get(n);if(o===void 0){let r=null;o=n.flatMap(({summary:a})=>{if(a.isSystemMessage===!0)return r===null?[]:[{...r,sectionKey:a.sectionKey,inherited:!0}];let s=a.headerAttachment;return a.headerText===null&&s===void 0?(r=null,[]):(r={sectionKey:a.sectionKey,text:a.headerText??"",...s===void 0?{}:{attachment:s},anchorRowId:a.anchorRowId,inherited:!1},[r])}),i0.set(n,o)}return o}function u0(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,o)=>{let r=t[o];return n.sectionKey===r.sectionKey&&n.text===r.text&&n.anchorRowId===r.anchorRowId&&n.attachment?.name===r.attachment?.name&&n.attachment?.count===r.attachment?.count&&n.inherited===r.inherited})}var l0=new WeakMap;function p0(e,t){let n=d0(e,t),o=l0.get(n);return o===void 0&&(o=n.filter(({summary:r})=>r.userText!==null).map(({item:r})=>r),l0.set(n,o)),o}function f0(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,o)=>n===t[o])}var D5=[],O5=e=>e.getMeta().usageByTurnId,F5=e=>e.getMeta().exportApi,B5=e=>e.getMeta().status.totalTurnCount??null,m0=ce(function({rowsStore:t,derive:n,paneVisible:o,bottomInset:r,onSelect:a,onTurnNavigatorChange:s}){let i=M(m=>o?p0(m,n):D5,[n,o]),l=Sn(t,i,f0),d=Sn(t,O5),u=Sn(t,F5),p=Sn(t,B5),f=H(()=>o?{items:l,totalTurnCount:p,bottomInset:r,usageByTurnId:d,onSelect:a,exportMarkdown:u.markdown,onDownload:u.download}:null,[r,u,l,a,o,p,d]);return K(()=>{f!==null&&s(f)},[s,f]),K(()=>{if(o)return()=>s(null)},[s,o]),null});function h0({timeline:e,previousOverlayHeight:t,overlayHeight:n,followingEnd:o}){e&&o&&n>t&&e.scrollToEnd({animated:!1})}function v0(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 y0({measurement:e,followingEnd:t}){return t?null:e.rowAtScroll()}var g0="--chat-frozen-block-visibility";function $f(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",a.style.setProperty(g0,"visible");e.offsetHeight,requestAnimationFrame(()=>{for(let a of r)a.style.removeProperty("content-visibility"),a.style.removeProperty(g0)})}V();var z5=e=>e.getMeta().status.workingStepLabel??null,H5=e=>e.getMeta().status.waitingFor??null,U5=e=>e.getMeta().status.liveOutputTokens??null,K5=e=>e.getMeta().status.stall??null,$5=e=>e.getMeta().status.retry??null,C0=ce(function({rowsStore:t,historyWindow:n,children:o}){let r=Sn(t,z5),a=Sn(t,H5),s=Sn(t,U5),i=Sn(t,K5),l=Sn(t,$5),d=H(()=>n?{workingStepLabel:null,waitingFor:null,liveOutputTokens:null,stall:null,retry:null}:{workingStepLabel:r,waitingFor:a,liveOutputTokens:s,stall:i,retry:l},[n,s,l,i,a,r]);return c(Sf,{value:d,children:o})});V();function qf(e){return e==="loading"?"threadSync.loading":"threadSync.syncing"}var q5=1e3,Vf=150;function Wf(e,t=q5){let[n,o]=W(null);return K(()=>{if(e===null){o(null);return}let r=globalThis.setTimeout(()=>{o(e)},t);return()=>{globalThis.clearTimeout(r)}},[e,t]),n}var V5=5;function x0(e){let t=e.data.useThreadSyncPhase(e.target);return Wf(t,Vf)==="loading"?c(qv,{}):null}function qv(){let{t:e}=$();return b("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:[c("span",{className:"sr-only",children:e(qf("loading"))}),c("div",{className:"transcript-col flex flex-col gap-6",children:Array.from({length:V5},(t,n)=>b("div",{"aria-hidden":"true",className:"flex flex-col gap-3",children:[c("div",{className:"h-9 self-end rounded-[18px] bg-muted-foreground/15",style:{width:`${44-n%2*14}%`}}),[92,84,61].map((o,r)=>c("div",{className:"h-3 rounded-control-1 bg-muted-foreground/15",style:{width:`${o-n%3*6}%`}},r))]},n))})]})}var b0=c("div",{className:"h-3 sm:h-4"}),S0=c("div",{className:"h-10 sm:h-12"});function I0({loading:e,blocked:t,onLoadEarlier:n,fade:o}){let{t:r}=Je();return c("div",{className:o?"pt-10 sm:pt-12":"pt-3 sm:pt-4",children:c("div",{className:"transcript-col pb-2",children:c("button",{type:"button","data-timeline-load-earlier":"",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 w0({loading:e,blocked:t,onLoadLater:n,onReturnToLatest:o}){let{t:r}=Je();return b("div",{className:"transcript-col flex items-center justify-center gap-2 py-2",children:[c(X,{variant:"ghost",size:"sm",onClick:n,disabled:e||t,children:r(e?"timeline.loadingLater":"timeline.loadLater")}),o?c(X,{variant:"ghost",size:"sm",onClick:o,children:r("timeline.returnToLatest")}):null]})}function T0({onReveal:e,fade:t}){let{t:n}=Je();return c("div",{className:t?"pt-10 sm:pt-12":"pt-3 sm:pt-4",children:c("div",{className:"transcript-col pb-2",children:c("button",{type:"button","data-timeline-load-earlier":"",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 k0=c("div",{className:"h-3 sm:h-4"});V();var W5=Object.freeze([]),P0=e=>e.getMeta().status.scheduledWakes??W5;function R0(e,t){let n=_(e);return t&&(n.current=e),n.current}V();function Gf(e){return JSON.stringify([e.turnId??null,e.toolCallId?"tool":"entry",e.toolCallId||e.id])}V();function jf(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 L0({badge:e,startedAt:t,completedAt:n,waitingLabel:o,timestampFormat:r}){let{t:a}=Je();if(e===null&&t===void 0)return null;let s=a("timeline.turnInfo");return b(vo,{children:[c(Co,{openOnHover:!0,delay:250,render:c(X,{type:"button",size:"icon-xs",variant:"ghost","data-turn-info":"","aria-label":s,className:"shrink-0 text-muted-foreground"}),children:c(Sc,{className:"size-3.5","aria-hidden":!0})}),c(yo,{side:"top",align:"start",className:"max-w-80",children:b("div",{className:"flex flex-col gap-2 text-chat-dense",children:[e!==null?c("div",{className:"flex min-w-0 items-center gap-2",children:c(tu,{badge:e})}):null,t!==void 0?c("div",{className:"text-muted-foreground tabular-nums",children:a("timeline.turnStarted",{time:Hr(t,r,a)})}):null,n!==void 0?c("div",{className:"text-muted-foreground tabular-nums",children:a("timeline.turnFinished",{time:Hr(n,r,a)})}):null,o!==void 0?c("div",{className:"text-muted-foreground tabular-nums",children:o}):null]})})]})}function G5(e,t,n,o){if(n===void 0||n<=0)return null;let r=t(n);return o!==void 0&&o>0?e("timeline.waitingWithApprovals",{waiting:r,approvals:t(o)}):e("timeline.waiting",{waiting:r})}function Qf({label:e,children:t}){let[n,o]=W(!1);return b(_e,{open:n,onOpenChange:o,children:[c(Oe,{render:c("button",{type:"button",className:"inline-flex items-center gap-1 rounded-sm"}),"aria-label":e,onClick:()=>o(r=>!r),children:t}),c(De,{children:e})]})}var E0=ce(function({footer:t,timestampFormat:n,copyText:o,identity:r}){let{t:a}=Je(),{formatCountedDuration:s}=xo(),i=G5(a,s,t.waitingForYouMs,t.approvalWaitMs),l=t.state,d=l==="error"?a("timeline.error"):l==="interrupted"?a("timeline.interrupted"):null;return b("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:[b("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[d!==null?b(Qf,{label:d,children:[l==="error"?c(Dt,{className:"size-icon-1 text-destructive-foreground","aria-hidden":!0}):c(_c,{className:"size-3","aria-hidden":!0}),c("span",{className:"sr-only",children:d})]}):null,t.workingElapsedMs!==void 0?c(Qf,{label:a("timeline.workingTime",{duration:s(t.workingElapsedMs)}),children:s(t.workingElapsedMs)}):null,i!==null?b(ue,{children:[" ",c(Qf,{label:i,children:i})]}):null,(t.workingElapsedMs!==void 0||i!==null)&&t.outputTokens!==void 0?" ":null,t.outputTokens!==void 0?c(Lf,{text:String(t.outputTokens),label:a("copyButton.copyTokenCount"),children:c(Qf,{label:`${a("timeline.outputTokens")}: ${t.outputTokens.toLocaleString()}`,children:a("timeline.outputTokenCount",{count:t.outputTokens,value:jf(t.outputTokens)})})}):null]}),c(L0,{badge:r?.badge??null,startedAt:r?.createdAt,completedAt:t.completedAt,waitingLabel:i??void 0,timestampFormat:n}),o?c(rs,{text:o,variant:"ghost",size:"icon-xs",className:"shrink-0",toastAnchor:"below"}):null]})});V();function j5(e){return e.toolLifecycleStatus==="interrupted"}function Q5(e){let t=e?.stoppedByUser===!0;return e?.continuedAfterStop===!0?t?"toolGroup.interruptedByYouKeptRunning":"toolGroup.interruptedKeptRunning":e?.terminationConfirmed===!0?t?"toolGroup.interruptedByYou":"toolGroup.interrupted":t?"toolGroup.interruptedByYouMayStillRun":"toolGroup.interruptedMayStillRun"}function Vv(e,t,n){if(!j5(e))return null;let o=e.toolInterrupt,r=t(Q5(o)),a=[o?.durationMs===void 0?null:n(o.durationMs),e.toolIo?.exitCode===void 0?null:t("toolGroup.exitCode",{code:e.toolIo.exitCode})].filter(s=>s!==null);return a.length===0?r:`${r}, ${a.join(", ")}`}V();function M0(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 A0=ce(function(t){let{additions:n,deletions:o,className:r,showParentheses:a=!1,layout:s="aligned"}=t,{t:i}=Je(),l=new Intl.ListFormat(void 0,{type:"unit"}).format([i("changedFiles.additions",{count:n}),i("changedFiles.deletions",{count:o})]);return b(ue,{children:[a&&c("span",{className:"text-muted-foreground/70",children:"("}),b("span",{role:"group","aria-label":l,className:G(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:[b("span",{"aria-hidden":"true",className:"font-mono text-diff-addition",children:["+",M0(n)]}),b("span",{"aria-hidden":"true",className:"font-mono text-diff-deletion",children:["-",M0(o)]})]}),a&&c("span",{className:"text-muted-foreground/70",children:")"})]})});function _l({name:e,className:t}){switch(e){case"bot":return c(Us,{className:t,"aria-hidden":!0});case"check":return c(no,{className:t,"aria-hidden":!0});case"circle-alert":return c(on,{className:t,"aria-hidden":!0});case"eye":return c(cc,{className:t,"aria-hidden":!0});case"globe":return c(yc,{className:t,"aria-hidden":!0});case"hammer":return c(xc,{className:t,"aria-hidden":!0});case"message-circle":return c(qs,{className:t,"aria-hidden":!0});case"search":return c(Qs,{className:t,"aria-hidden":!0});case"square-pen":return c(ho,{className:t,"aria-hidden":!0});case"terminal":return c(Bo,{className:t,"aria-hidden":!0});case"wrench":return c(Oc,{className:t,"aria-hidden":!0});case"x":return c(Dt,{className:t,"aria-hidden":!0});case"zap":return c(Xs,{className:t,"aria-hidden":!0})}}function Y5(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 Wv(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:Y5(o),count:r}))}function Gv(e,t){let n;for(let o of Wv(e,t))(!n||o.count>n.count)&&(n=o);return n?.icon??"wrench"}V();function N0({entries:e,failed:t,derive:n}){let{t:o}=Je(),r=H(()=>Wv(e,n.toolGroupAction),[e,n]),a=r.length===1;return a&&r[0].count<2?null:c("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})=>b("span",{"aria-hidden":!0,className:"flex items-center gap-1",children:[a?null:c(_l,{name:i,className:G("size-icon-1 shrink-0 stroke-[1.8] opacity-70",t?"text-destructive-foreground":"text-icon-muted")}),l]},s))})}function X5(e){switch(e){case"command":return"command";case"edit":return"edit";case"read":return"read";case"search":case"code-search":return"search";default:return"other"}}function J5(e){return e.changedFiles&&e.changedFiles.length>0?e.changedFiles:e.toolLabel?.path?[e.toolLabel.path]:[]}function _0(e,t){let n=[],o=new Map,r=new Map,a=new Map;for(let f of e){let m=X5(t(f));if(n.includes(m)||n.push(m),o.set(m,(o.get(m)??0)+1),m!=="edit"&&m!=="read")continue;let h=J5(f);if(h.length===0){a.set(m,(a.get(m)??0)+1);continue}let g=r.get(m)??new Set;for(let v of h)g.add(v);r.set(m,g)}let i=n.map(f=>({kind:f,count:f==="edit"||f==="read"?(r.get(f)?.size??0)+(a.get(f)??0):o.get(f)??0})).filter(f=>f.count>0).slice().sort((f,m)=>m.count-f.count||n.indexOf(f.kind)-n.indexOf(m.kind)),l=i.slice(0,2),d=i.slice(2);if(d.length===0)return l;let u=d.reduce((f,m)=>f+(o.get(m.kind)??0),0),p=l.map(f=>f.kind==="other"?{kind:"other",count:f.count+u}:f);return l.some(f=>f.kind==="other")||p.push({kind:"other",count:u}),p}function D0(e){return typeof e.toolData=="object"&&e.toolData!==null&&!Array.isArray(e.toolData)?e.toolData:null}function O0(e,t,n,o){if(t===void 0||n===void 0||n.length===0)return e;let r=e.trim();for(let a of[`mcp__ycodium__${t}`,`ycodium_${t}`,`ycodium ${t}`,t]){if(r===a)return n;if(!r.startsWith(`${a} `))continue;let s=r.slice(a.length).trim();return s.length===0?n:o!==void 0&&s.toLowerCase()==="started"?o(n):`${n} ${s}`}return e}function ss(e){return Gf(e)}function Yf(e,t,n,o,r,a){let s=e.toolLabel,i=n.resolveToolCommand(e);if(i&&s?.descriptive&&!s.path&&s.detail?.trim())return s.detail.replace(/\s+/g," ").trim();for(let v of[e.rawCommand,e.command]){let C=n.parseToolCommandInput(v)?.description;if(C)return C.replace(/\s+/g," ").trim()}if(i)return i.replace(/\s+/g," ").trim();let l=D0(e),d=typeof l?.toolName=="string"?l.toolName:typeof l?.name=="string"?l.name:void 0,u=e.builtinMcpTool||void 0,p=a??O0(s?.name??d??e.toolTitle??e.label,u,u===void 0?void 0:o?.get(u),r),f=s?.path??e.changedFiles?.[0],m=f?Nf(f,t):void 0,h=[p.trim().toLowerCase()==="tool"?void 0:p,m,e.toolMetadata?.source==="ycodium"?void 0:s?.detail??e.detail],g=[];for(let v of h){let C=v?.replace(/\s+/g," ").trim();C&&!g.some(y=>y.toLowerCase()===C.toLowerCase())&&g.push(C)}return g.join(" ")||null}V();function nu(e){let t=Ke(ut)?.toolPresentation;return e===void 0||t===void 0?null:t(e)}function F0(e){let t=Ke(ut)?.toolPresentation;return H(()=>{if(t===void 0||e.length===0)return null;let n=t(e[0]);if(n===null)return null;let o=e.map(r=>t(r));return o.every(r=>r?.groupKey===n.groupKey)?n:o.every(r=>r?.familyKey===n.familyKey)?{...n,groupName:n.familyName,origin:n.origin.kind==="ycodium"?{kind:"ycodium",area:"general"}:n.origin}:null},[e,t])}function jv({presentation:e,className:t}){let n=Ke(ut),o=n.ToolSourceIcon;return o===void 0?null:c(o,{environmentId:n.activeThreadEnvironmentId,origin:e.origin,className:t})}function ou({presentation:e,fallback:t,environmentId:n}){return b(ue,{children:[e.sourceName!==null?b(ue,{children:[c("span",{className:"font-medium text-foreground","data-tool-source-name":"",children:e.sourceName}),c("span",{"aria-hidden":!0,className:"px-1 text-muted-foreground",children:"\xB7"})]}):null,e.declared?c("span",{children:e.title}):t,e.declared&&e.summary!==null?c(B0,{text:e.summary}):null,e.declared&&e.summary===null&&e.entity?c(Z5,{entity:e.entity,environmentId:n}):null,e.declared&&e.experienceId?c(e3,{experienceId:e.experienceId}):null]})}function Z5({entity:e,environmentId:t}){let n=Ke(ut),o=t??n?.activeThreadEnvironmentId??"",r=e.kind==="machine"?e.environmentId:e.environmentId??o;return b(ue,{children:[c("span",{"aria-hidden":!0,className:"px-1 text-muted-foreground",children:"\xB7"}),c("span",{className:"inline-flex min-w-0 tabular-nums","data-tool-entity":e.kind,children:e.kind==="thread"?c(zc,{threadRef:{environmentId:r,threadId:e.threadId},fallbackName:e.fallbackName,showStatus:!1}):e.kind==="machine"?c(HI,{environmentId:r,fallbackName:e.fallbackName}):e.kind==="project"?c(UI,{projectRef:{environmentId:r,projectId:e.projectId},fallbackName:e.fallbackName}):c(KI,{environmentId:r,instanceId:e.instanceId,fallbackName:e.fallbackName})})]})}function B0({text:e}){return b(ue,{children:[c("span",{"aria-hidden":!0,className:"px-1 text-muted-foreground",children:"\xB7"}),c("span",{className:"tabular-nums",children:e})]})}function e3({experienceId:e}){let t=Rl(),n=t?.data.useMemoryExperience;return!t||!n?null:c(t3,{readExperience:n,target:t.target,experienceId:e})}function t3({readExperience:e,target:t,experienceId:n}){let{title:o}=e(t,n);return o===null?null:c(B0,{text:o})}var Dl=20,n3={failed:"toolGroup.showFailure",declined:"toolGroup.showDeclined",stopped:"toolGroup.showCancelled"},o3={command:"toolGroup.semanticCommands",edit:"toolGroup.semanticEdits",read:"toolGroup.semanticReads",search:"toolGroup.semanticSearches",other:"toolGroup.semanticOther"};function z0({entry:e,presentation:t}){let n=e.toolLabel?.diffStat;return!n||t==="failed"||t==="declined"||t==="stopped"?null:c(A0,{...n,layout:"inline",className:"chat-process-meta ms-2 shrink-0"})}function H0({toolIcon:e,glyphClassName:t}){let n=Ke(ut),o=n.SiteIcon;return e.pageUrl!==void 0&&o!==void 0?c(o,{threadRef:n.threadRef,pageUrl:e.pageUrl,className:"size-3.5 shrink-0 rounded-sm object-contain"}):c(_l,{name:"globe",className:t})}function r3({entry:e,failed:t=!1,derive:n}){let o=Ke(ut),r=nu(e);return t?c(on,{"aria-hidden":!0,className:"size-icon-1 shrink-0 text-destructive-foreground"}):e.toolIcon!==void 0?c(H0,{toolIcon:e.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"}):r!==null&&o.ToolSourceIcon!==void 0?c(jv,{presentation:r,className:"size-icon-1"}):c(_l,{name:Gv([e],n.toolGroupAction),className:"size-icon-1 shrink-0 stroke-[1.8] text-muted-foreground opacity-70"})}function U0({entry:e}){let t=Ke(ut),n=e.detail??e.command??e.rawCommand??e.toolLabel?.detail,o=JSON.stringify([e.id,e.sourceActivityKind,e.toolLifecycleStatus]),r=nu(e),a=t.renderToolCallDetail?.({entry:e,threadRef:t.threadRef,threadKey:t.threadKey,workspaceRoot:t.workspaceRoot,revision:o,onOpenFileDiff:t.onOpenFileDiff});return b("div",{className:"min-w-0 space-y-2 p-3",children:[r!==null?c("p",{className:"chat-process-meta text-muted-foreground","data-tool-source-line":"",children:r.sourceLine}):null,a!==void 0?c(ue,{children:a}):c("pre",{className:"chat-tool-body overflow-x-auto rounded-md bg-muted/40 p-2",children:n??""})]})}var a3=ce(function(t){let{entry:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}=t,s=Ke(ut),i=s.derive,{t:l}=Je(),{formatDuration:d}=xo(),[u,p]=En(o,`call:${ss(n)}`,!1),f=i.toolPresentationStatus(n),m=nu(n),h=m?.declared===!0?null:Yf(n,r,i,s.declaredToolTitles,S=>l("toolGroup.declaredStarted",{title:S}),m?.title)??l("toolGroup.calls",{count:1}),g=f==="failed",v=f==="declined",C=f==="stopped",y=C?Vv(n,l,d):null,x=i.resolveWorkEntryStatus(n),T=x==="failed"||x==="running"?x:null,I=mn();return b("div",{"data-tool-call-id":n.toolCallId??n.id,"data-tool-identity":ss(n),className:"border-b border-border/50 last:border-b-0",children:[b("button",{type:"button","aria-expanded":u,"aria-controls":I,onClick:()=>{a?.(),p(!u)},className:G("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",g?"text-destructive-foreground":"text-muted-foreground"),children:[c(Qc,{status:T}),c(jc,{children:c(r3,{entry:n,failed:g,derive:i})}),b("span",{className:"flex min-w-0 flex-1 items-center",children:[c("span",{className:"truncate",children:m!==null?c(ou,{presentation:m,fallback:h}):h}),c(z0,{entry:n,presentation:f})]}),g||v||C||n.statusInferred?c("span",{className:"chat-process-meta shrink-0",children:n.statusInferred?l("toolGroup.statusUnknown"):g?l("toolGroup.failed",{count:1}):v?l("toolGroup.declined",{count:1}):y??l("toolGroup.cancelled",{count:1})}):null,c(jt,{"aria-hidden":!0,className:G("size-icon-1 shrink-0",!u&&"-rotate-90")})]}),u?c("div",{id:I,children:c(U0,{entry:n})}):null]})});function s3({threadKey:e,stateKey:t,maxHeight:n,children:o}){let r=_(null);return fe(()=>{let a=r.current;if(!a)return;a.scrollTop=Av(e,`${t}:scroll`,0);let s=()=>{Gc(e,`${t}:scroll`,a.scrollTop,!1)};return a.addEventListener("scroll",s,{passive:!0}),()=>a.removeEventListener("scroll",s)},[e,t]),c("div",{ref:r,"data-slot":"scroll-area-viewport",className:"min-w-0 overflow-y-auto overscroll-y-contain",style:{maxHeight:n},children:o})}var K0=ce(function({entries:t,groupId:n,threadKey:o,workspaceRoot:r,onDisclosureChange:a}){let s=Ke(ut),i=s.derive,{t:l}=Je(),{formatDuration:d}=xo(),[u,p]=En(o,`group:${n}`,!1),[f,m]=En(o,`group-page:${n}`,0),h=mn(),g=_(null),[v,C]=W(null),y=t.at(-1),{failedCount:x,declinedCount:T,stoppedCount:I,issue:S,runningCount:k,unknownCount:P}=H(()=>({...i.summarizeToolGroup(t),unknownCount:t.filter(Y=>Y.statusInferred).length,runningCount:t.filter(Y=>i.toolPresentationStatus(Y)==="running").length}),[t,i]),w=S?.entry??y,R=Math.max(0,Math.ceil(t.length/Dl)-1),E=Math.min(f,R),A=E*Dl,L=t.slice(A,A+Dl),O=t.length>1,U=t.every(Y=>i.toolPresentationStatus(Y)==="completed"),D=H(()=>O&&U&&S===null?_0(t,i.toolGroupAction):null,[t,i,O,U,S])?.map(Y=>l(o3[Y.kind],{count:Y.count})).join(" \xB7 ")??null,J=F0(O?t:[]),q=nu(O?void 0:y),N=O?J:q;if(fe(()=>{if(!v)return;let Y=g.current,ne=Array.from(Y?.querySelectorAll("[data-tool-identity]")??[]).find(ve=>ve.dataset.toolIdentity===v.id);if(!ne)return;let Ie=ne.closest('[data-slot="scroll-area-viewport"]');Ie&&(Ie.scrollTop+=ne.getBoundingClientRect().top-Ie.getBoundingClientRect().top),ne.querySelector("button")?.focus({preventScroll:!0})},[v]),!y||!w)return null;let Z=k>0&&S===null?t.find(Y=>i.toolPresentationStatus(Y)==="running")??w:w,z=D??Yf(Z,r,i,s.declaredToolTitles,Y=>l("toolGroup.declaredStarted",{title:Y}),q?.title)??l("toolGroup.calls",{count:1}),ee=Y=>{a?.(),m(Y)},j={threadKey:o,workspaceRoot:r,onDisclosureChange:a},oe=dT(t.map(Y=>lT(i.resolveWorkEntryStatus(Y)))),Q=Gv(t,i.toolGroupAction),ae=O?null:Vv(y,l,d),de=oe==="failed"?"failed":oe==="running"?"running":T+I===t.length?null:"success";return c(Pf,{state:oe,variant:"tool",children:b("section",{ref:g,"data-tool-group-id":n,className:"min-w-0",children:[b("div",{className:"flex min-w-0 items-center",children:[b("button",{type:"button","aria-expanded":u,"aria-controls":h,onClick:()=>{a?.(),p(!u),!O&&!u&&Gc(o,`call:${ss(y)}`,!0)},className:G(kf,"flex-1",x>0?"text-destructive-foreground":"text-muted-foreground"),children:[c(Qc,{status:de}),c(jc,{children:N!==null&&s.ToolSourceIcon!==void 0&&x===0&&(O||y.toolIcon===void 0)?c(jv,{presentation:N,className:"size-icon-1"}):!O&&y.toolIcon!==void 0&&x===0?c(H0,{toolIcon:y.toolIcon,glyphClassName:"size-icon-1 shrink-0 stroke-[1.8] opacity-70 text-icon-muted"}):c(_l,{name:Q,className:G("size-icon-1 shrink-0 stroke-[1.8] opacity-70",x>0?"text-destructive-foreground":"text-icon-muted")})}),b("span",{className:G("flex min-w-0 flex-1 items-center",u&&O?"chat-process-text":"chat-tool-summary"),children:[c("span",{className:"truncate",children:J!==null?l("toolGroup.namedCalls",{name:J.groupName,count:t.length}):u&&O?l("toolGroup.calls",{count:t.length}):q!==null?c(ou,{presentation:q,fallback:z}):z}),u&&O?null:D===null?c(z0,{entry:w,presentation:i.toolPresentationStatus(w)}):null]}),P>0?c("span",{className:"chat-process-meta shrink-0",children:l("toolGroup.statusUnknown")}):null,k>0?c("span",{className:"chat-process-meta shrink-0 tabular-nums text-info-foreground",children:l("toolGroup.running",{count:k})}):null,x>0?c("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.failed",{count:x})}):null,T>0?c("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.declined",{count:T})}):null,I>0?c("span",{className:"chat-process-meta shrink-0 tabular-nums",children:l("toolGroup.cancelled",{count:I})}):null,u&&O?null:D===null&&J===null?c(N0,{entries:t,failed:x>0,derive:i}):null,c(jt,{"aria-hidden":!0,className:G("size-icon-1 shrink-0",!u&&"-rotate-90")})]}),S&&O?c("button",{type:"button",className:G("chat-process-meta me-2 min-h-8 shrink-0 rounded-control-4 px-1 underline [@media(pointer:coarse)]:min-h-11",S.kind==="failed"?"text-destructive-foreground":"text-muted-foreground"),onClick:()=>{a?.(),p(!0),m(Math.floor(t.indexOf(S.entry)/Dl)),Gc(o,`call:${ss(S.entry)}`,!0),C({id:ss(S.entry)})},children:l(n3[S.kind])}):null]}),u?c("div",{id:h,className:"border-t border-border/50",children:O?b(ue,{children:[t.length>Dl?b("div",{className:"chat-process-meta flex items-center gap-1 border-b border-border/40 px-2 py-1 text-muted-foreground",children:[c("span",{className:"min-w-0 flex-1 tabular-nums",children:l("toolGroup.pageRange",{from:A+1,to:Math.min(A+Dl,t.length),count:t.length})}),[{label:l("toolGroup.firstPage"),target:0,disabled:E===0,Icon:sc},{label:l("toolGroup.previousPage"),target:E-1,disabled:E===0,Icon:ac},{label:l("toolGroup.nextPage"),target:E+1,disabled:E===R,Icon:bn},{label:l("toolGroup.lastPage"),target:R,disabled:E===R,Icon:ic}].map(({label:Y,target:ne,disabled:Ie,Icon:ve})=>c("button",{type:"button","aria-label":Y,disabled:Ie,onClick:()=>ee(ne),className:"flex size-7 items-center justify-center rounded-control-3 disabled:opacity-64 [@media(pointer:coarse)]:size-11",children:c(ve,{"aria-hidden":!0,className:"size-icon-1"})},Y))]}):null,c(s3,{threadKey:o,stateKey:`group-scroll:${n}:${E}`,maxHeight:"min(320px, 50dvh)",children:c("div",{className:"space-y-0.5 py-1",children:L.map(Y=>c(a3,{entry:Y,...j},ss(Y)))})})]}):b(ue,{children:[ae?c("p",{className:"chat-process-meta px-3 pt-3 text-muted-foreground",children:c("span",{children:ae})}):null,c(U0,{entry:y})]})}):null]})})});V();function $0(){let e=Ln(),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 Xf(e){let t=e.match(/^\s{0,3}#{1,6}\s+(.+)$/m)?.[1]?.trim();return t&&t.length>0?t:null}function Qv(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(`
3853
3853
  `)}function q0(e,t,n){let o=n?.maxLines??8,r=Qv(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?Xf(e)??t("proposedPlan.previewUnavailable"):(i&&a.push("","..."),a.join(`
3854
3854
  `))}function i3(e){let t=e.toLowerCase().replace(/[`'".,!?()[\]{}]+/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return t.length>0?t:"plan"}function V0(e){let t=Xf(e);return`${i3(t??"plan")}.md`}function W0(e){return`${e.trimEnd()}
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { definePlugin } from "@ycodium-ai/plugin-api";
3
3
 
4
4
  // ../../packages/plugin-api/src/version.ts
5
- var PLUGIN_API_VERSION = 103;
5
+ var PLUGIN_API_VERSION = 106;
6
6
 
7
7
  // src/sessionMap/activate.ts
8
8
  import * as NodeCrypto from "node:crypto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-conversation",
3
- "version": "0.2.4250",
3
+ "version": "0.2.4256",
4
4
  "description": "The conversation surface: chat, trajectory, and session map, the input card, the queue, and turn navigation.",
5
5
  "keywords": [
6
6
  "chat",
@@ -41,12 +41,12 @@
41
41
  "tailwindcss": "^4.0.0",
42
42
  "typescript": "~6.0.3",
43
43
  "vite-plus": "0.2.2",
44
- "@ycodium-ai/plugin-api": "0.2.4250",
45
- "ycodium-duration-format": "0.0.0",
44
+ "@ycodium-ai/plugin-api": "0.2.4256",
46
45
  "ycodium-composer-tokens": "0.0.0",
47
- "ycodium-system-text": "0.0.0",
48
46
  "ycodium-day-format": "0.0.0",
49
- "ycodium-workspace-path": "0.0.0"
47
+ "ycodium-duration-format": "0.0.0",
48
+ "ycodium-workspace-path": "0.0.0",
49
+ "ycodium-system-text": "0.0.0"
50
50
  },
51
51
  "ycodium": {
52
52
  "plugin": "./dist/index.js",