@ycodium-ai/plugin-conversation 0.2.4160 → 0.2.4162
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 +1 -1
- package/dist/index.js +1 -1
- package/locales/en.json +2 -1
- package/locales/zh-CN.json +2 -1
- package/package.json +3 -3
package/assets/ui.js
CHANGED
|
@@ -3857,7 +3857,7 @@ ${zT}`,f5=new RegExp(`^${zf}\\n<preset-prefix id="([^"]*)">\\n([\\s\\S]*?)\\n</p
|
|
|
3857
3857
|
|
|
3858
3858
|
`):[r,...i].filter(Boolean).join(`
|
|
3859
3859
|
|
|
3860
|
-
`);return l.length===0?null:c("pre",{className:ny,children:l})}function Vk({row:e}){let{t}=q(),n=e.communication?.to;if(e.communication===void 0)return c("span",{className:"break-words",children:e.summary});let o=n==null?t("trajectory.communication.unknownRecipient"):n.kind==="thread"?n.title??t("trajectory.communication.untitledThread"):n.displayName;return c("span",{className:"break-words",children:t("trajectory.communication.sentTo",{name:o})})}var L3={replied:"trajectory.communication.phase.replied","picked-up":"trajectory.communication.phase.pickedUp",waiting:"trajectory.communication.phase.waiting",unknown:"trajectory.communication.phase.unknown",recorded:"trajectory.communication.phase.recorded",withdrawn:"trajectory.communication.phase.withdrawn",deleted:"trajectory.communication.phase.deleted"},$k={withdrawn:"trajectory.communication.body.withdrawn",deleted:"trajectory.communication.body.deleted",unavailable:"trajectory.communication.body.unavailable"};function Wk({useCommunicationRecord:e,recordId:t,fallback:n,timestampFormat:o}){let{t:r}=q(),a=e===void 0?null:e(t);if(a===null)return n===void 0?null:c("pre",{className:ny,children:n});if(typeof a=="string")return c("span",{className:"px-1 text-xs text-muted-foreground","data-trajectory-communication":a,children:r(a==="unreadable"?$k.unavailable:a==="environment-outdated"?"trajectory.communication.environmentOutdated":a==="client-outdated"?"trajectory.communication.updateRequired":"trajectory.communication.notReceived")});let s=r(L3[a.phase]);return b("div",{className:"flex flex-col gap-1.5","data-trajectory-communication":a.recordId,children:[a.incomplete?c("span",{className:"px-1 text-xs text-muted-foreground",children:r("trajectory.communication.incomplete")}):null,a.bodyState==="present"?c("pre",{className:ny,children:a.text}):c("span",{className:"px-1 text-xs text-muted-foreground",children:r($k[a.bodyState])}),c("span",{className:"px-1 text-xs text-muted-foreground",children:a.phaseAt===null?s:`${s} ${da(a.phaseAt,o,r)}`})]})}V();var Gk=de(function({group:t,expanded:n,onToggle:o,disabled:r,highlighted:a,callCounts:s,sourceFiltered:i=!1,...l}){let{t:d}=q(),u=t.items.flatMap(f=>f.kind==="step"?[f.row]:f.rows).find(f=>f.kind==="user-message"),p=t.summary?.state;return c(Ja,{value:t.id,children:c(ns,{"data-trajectory-row-id":t.id,"data-timeline-row-id":t.id,"data-turn-group-header":t.turnId??"unassigned",tabIndex:-1,className:Q("bg-muted/25 hover:bg-muted/25",a&&"outline-2 outline-primary"),children:b(hr,{colSpan:6,className:"whitespace-normal px-2 py-2",children:[b("div",{className:"flex min-w-0 items-start gap-2",children:[b(X,{variant:"ghost",size:"sm",className:"h-auto min-w-0 flex-1 justify-start px-1 py-1 text-left whitespace-normal",disabled:r,"aria-expanded":n,onClick:()=>o(t.id),title:d(n?"turnOverview.collapseTurn":"turnOverview.expandTurn"),children:[n?c(jt,{className:"size-4 shrink-0","aria-hidden":!0}):c(bn,{className:"size-4 shrink-0","aria-hidden":!0}),c("span",{className:"min-w-0",children:u?.summary||d(t.turnId===null?"turnOverview.unassigned":"turnOverview.turn")})]}),t.summary?c(uf,{summary:t.summary}):null,p==="error"||p==="interrupted"?c("span",{className:"shrink-0 py-1 text-xs text-destructive-foreground",children:d(p==="error"?"trajectory.status.failed":"trajectory.status.stopped")}):null]}),b("div",{className:"flex flex-wrap gap-x-3 gap-y-1 pl-5 text-xs text-muted-foreground","data-trajectory-call-counts":!0,children:[s?b(ue,{children:[c("span",{children:i?d("trajectory.sourceFilter.matchedCalls",{matched:s.matchedCalls,total:s.totalCalls}):d("trajectory.sourceFilter.totalCalls",{count:s.totalCalls})}),c("span",{children:i?d("trajectory.sourceFilter.matchedFailedCalls",{count:s.matchedFailedCalls}):d("trajectory.sourceFilter.failedCalls",{count:s.failedCalls})})]}):null,i?c("span",{children:d("trajectory.sourceFilter.hiddenSteps")}):null]}),t.summary?c("div",{className:"pl-5",children:c(cf,{summary:t.summary,...l})}):null]})})})});function jk({id:e,count:t,expanded:n,onToggle:o,disabled:r}){let{t:a}=q();return c(ns,{"data-trajectory-row-id":e,"data-timeline-row-id":e,tabIndex:-1,"data-routine-group":e,children:c(hr,{colSpan:6,className:"px-3 py-1",children:b(X,{variant:"ghost",size:"xs","aria-expanded":n,disabled:r,onClick:o,children:[n?c(jt,{"aria-hidden":!0}):c(bn,{"aria-hidden":!0}),a("turnOverview.routineSteps",{count:t})]})})})}V();var Qk=de(function({row:t,inputKey:n,expanded:o,highlighted:r,toggleExpanded:a,resolveChatAnchorMessageId:s,onOpenInChat:i,timestampFormat:l,threadRef:d,useToolCallDetail:u,useCommunicationRecord:p}){let{t:f}=q(),{formatDuration:m}=xo(),h=t.detail!==void 0||t.toolCallId!==void 0,g=s(t);return c(Ja,{value:t.id,children:[b(ns,{"data-trajectory-row-id":t.id,"data-timeline-row-id":t.id,tabIndex:-1,className:Q(h&&"cursor-pointer",r&&"outline-2 outline-primary"),onClick:h?()=>a(t.id):void 0,children:[c(hr,{className:"whitespace-nowrap text-muted-foreground",title:Hr(t.createdAt,l,f),children:da(t.createdAt,l,f)}),c(hr,{className:"whitespace-nowrap",children:f(`trajectory.kinds.${t.kind}`)}),b(hr,{className:"max-w-0 whitespace-normal",children:[b("span",{className:"inline-flex items-start gap-1",children:[h?c(X,{size:"xs",variant:"ghost",className:"mt-0.5 size-4 min-w-4 shrink-0 px-0","aria-label":f(o?"trajectory.collapseRow":"trajectory.expandRow"),"aria-expanded":o,onClick:v=>{v.stopPropagation(),a(t.id)},children:o?c(jt,{"aria-hidden":!0}):c(bn,{"aria-hidden":!0})}):null,c(Vk,{row:t})]}),t.kind==="tool-call"?b("span",{className:"ml-2 inline-flex flex-wrap gap-x-2 text-xs text-muted-foreground","data-trajectory-source":!0,children:[c("span",{children:f(`trajectory.sources.${t.source??"unknown"}`)}),t.source==="plugin"&&t.pluginId?c("span",{children:t.pluginId}):null,t.source==="mcp"&&t.mcpServer?c("span",{children:t.mcpServer}):null,t.action==="skill-read"?c("span",{children:t.skillName?f("trajectory.sourceFilter.skillReadNamed",{name:t.skillName}):f("trajectory.sourceFilter.skillRead")}):null]}):null]}),c(hr,{className:"whitespace-nowrap",children:f(`trajectory.status.${t.status}`)}),c(hr,{className:"whitespace-nowrap text-muted-foreground",children:t.durationMs!==void 0?m(t.durationMs):f("trajectory.valueUnknown")}),c(hr,{className:"whitespace-nowrap",children:g!==null?b(_e,{children:[c(Oe,{render:c(X,{size:"xs",variant:"ghost","aria-label":f("trajectory.openInChat"),onClick:v=>{v.stopPropagation(),i(g)}}),children:c(Vs,{"aria-hidden":!0})}),c(De,{side:"top",children:f("trajectory.openInChat")})]}):null})]},`${n}:${t.id}`),o&&h?c(ns,{className:"hover:bg-transparent","data-trajectory-detail-row":t.id,"data-timeline-row-id":t.id,children:b(hr,{colSpan:6,className:"whitespace-normal",children:[c("div",{className:"px-2 py-1 text-xs font-medium text-muted-foreground",children:f("trajectory.detailTitle")}),t.kind==="tool-call"&&t.toolCallId!==void 0?c(qk,{threadRef:d,useToolCallDetail:u,toolCallId:t.toolCallId,turnId:t.turnId,fallback:t.detail,revision:`${t.status}:${t.updatedActivityId??t.activityId??t.id}`}):t.communication!==void 0?c(Wk,{useCommunicationRecord:p,recordId:t.communication.recordId,fallback:t.detail,timestampFormat:l}):t.detail!==void 0?c("pre",{className:"max-h-80 overflow-auto rounded-md bg-muted/40 p-3 font-mono text-xs break-words whitespace-pre-wrap",children:t.detail}):null]})},`${n}:${t.id}:detail`):null]},`${n}:${t.id}:owner`)});var Yk=["user-message","assistant-message","reasoning","tool-call","approval","user-input","compaction","retry","session","turn-intent","scheduled-wake","communication","delegation","task","event"];V();var Jf=class extends na{getSnapshotBeforeUpdate(t){return(t.inputKey!==this.props.inputKey||t.rows!==this.props.rows||t.expandedRows!==this.props.expandedRows||t.visible&&!this.props.visible)&&t.capture(),null}componentDidUpdate(){}componentWillUnmount(){this.props.capture()}render(){return this.props.children}};function oy(e){let t=e.getBoundingClientRect();if(e.clientHeight<=0||t.height<=0)return[];let n=e.querySelector("thead"),o=t.top+(n?.getBoundingClientRect().height??0),r=e.querySelectorAll("[data-trajectory-chunk]"),a=ei(r,o),s=[];if(a<0)return s;for(let i=a;i<r.length;i+=1){let l=r[i];if(l.getBoundingClientRect().top>=t.bottom)break;let d=l.querySelectorAll("[data-timeline-row-id]"),u=ei(d,o);if(!(u<0))for(let p=u;p<d.length;p++){let f=d[p];if(f.getBoundingClientRect().top>=t.bottom)break;s.push(f)}}return s}function Zf(e){return e?.source!==void 0||e?.pluginId!==void 0||e?.mcpServer!==void 0}function Xk(e,t){if(t==="all")return e;let n=new Set(e.filter(o=>o.kind===t).map(o=>o.turnId??null));return e.filter(o=>o.kind===t||n.has(o.turnId??null)&&(o.kind==="user-message"||o.kind==="assistant-message"))}var E3=["native","ycodium","plugin","mcp","unknown"];function Jk({filter:e,query:t,onChange:n}){let{t:o}=q(),r=Zf(e),a=e?.source,s=a==="plugin"?"pluginId":a==="mcp"?"mcpServer":null,i=s===null?void 0:e?.[s],l=s===null?[]:[...new Set(t.sources.flatMap(d=>d.source===a&&d[s]!==void 0?[d[s]]:[]))];return i!==void 0&&!l.includes(i)&&l.push(i),b("div",{className:"flex flex-wrap items-center gap-1 border-b border-border px-3 py-1.5",children:[b("div",{role:"group","aria-label":o("trajectory.sourceFilter.label"),className:"flex flex-wrap items-center gap-1",children:[c(X,{size:"xs",variant:r?"ghost":"secondary","aria-pressed":!r,onClick:()=>n({}),children:o("trajectory.sourceFilter.all")}),E3.filter(d=>d===a||t.sources.some(u=>u.source===d)).map(d=>c(X,{size:"xs",variant:a===d?"secondary":"ghost","aria-pressed":a===d,onClick:()=>n({source:d}),children:o(`trajectory.sources.${d}`)},d))]}),s!==null?b(pl,{value:i===void 0?"all":`detail:${i}`,onValueChange:d=>{d===null||a===void 0||n(d==="all"?{source:a}:{source:a,[s]:d.slice(7)})},children:[c(Zp,{size:"xs",className:"max-w-full","aria-label":o(a==="plugin"?"trajectory.sourceFilter.plugin":"trajectory.sourceFilter.mcp"),children:i??o(a==="plugin"?"trajectory.sourceFilter.allPlugins":"trajectory.sourceFilter.allMcp")}),b(fl,{children:[c(Js,{value:"all",children:o(a==="plugin"?"trajectory.sourceFilter.allPlugins":"trajectory.sourceFilter.allMcp")}),l.map(d=>c(Js,{value:`detail:${d}`,children:d},d))]})]}):null,r?c(X,{size:"xs",variant:"ghost",onClick:()=>n({}),children:o("trajectory.sourceFilter.clear")}):null,t.loading?c("span",{role:"status",className:"text-xs text-muted-foreground",children:o("trajectory.sourceFilter.loading")}):null,t.error!==null?b("div",{role:"alert",className:"flex flex-wrap items-center gap-1 text-xs text-destructive-foreground",children:[c("span",{children:o("trajectory.sourceFilter.error",{error:t.error})}),c(X,{size:"xs",variant:"outline",disabled:t.loading,onClick:()=>t.retry(),children:o("trajectory.sourceFilter.retry")})]}):null]})}var Zk=50,M3=32;function A3(e){let t=[];for(let n=0;n<e.length;n+=Zk)t.push(e.slice(n,n+Zk));return t}var eP=de(function({inputKey:t,rows:n,groupRows:o,sourceQuery:r,toolFilter:a,onToolFilterChange:s,onOpenFileDiff:i,loadEarlier:l,loadLater:d=null,pagingBlockedByInteraction:u=!1,onReturnToLatest:p=null,onVisibleTurnRangeChange:f=null,timestampFormat:m,paneVisible:h,useToolCallDetail:g,useCommunicationRecord:v,threadRef:C,resolveChatAnchorMessageId:y,onOpenInChat:x}){let{t:T}=q(),I=Zf(a),S=I?JSON.stringify([t,a?.source,a?.pluginId,a?.mcpServer]):t,[k,P]=bt("trajectory-kind-filter",t,"all"),[w,R]=bt("trajectory-expanded-rows",t,()=>new Set),[E,A]=bt("trajectory-follow-latest",t,!0),L=U(()=>{let ie=new Set(n.map(Te=>Te.kind));return Yk.filter(Te=>ie.has(Te))},[n]),O=U(()=>Xk(n,k),[n,k]),H=N(null),F=N(!1);ge(()=>{F.current=!1},[S]);let D=M(()=>{P("all"),I&&s?.({})},[P,I,s]),G=yw({inputKey:t,rows:O,groupRows:o,paneVisible:h,resetFilter:D}),$=G.rows,_=U(()=>A3($),[$]),ee=ie=>R(Te=>{let Le=new Set(Te);return Le.has(ie)?Le.delete(ie):Le.add(ie),Le}),z=N(null),Z=M(ie=>{H.current=ie,ie&&(z.current=ie)},[]),W=dt("trajectory-at-end",S,!0),ne=dt("trajectory-scroll-top",S,0),Y=dt("trajectory-row-anchor",S,null),se=N({viewportKey:S,paneVisible:h,pagingBlockedByInteraction:u});se.current={viewportKey:S,paneVisible:h,pagingBlockedByInteraction:u};let ce=N(null);ge(()=>{if(ce.current=null,!!h)return()=>{ce.current=null,f?.(null)}},[S,h,f]);let J=U(()=>({inputKey:t,store:Bc()}),[t]),oe=N(J);oe.current=J;let Ie=N(()=>{}),ve=M(ie=>{let Te=oe.current;return Te.store.acquire(ie,()=>{oe.current===Te&&Ie.current()})},[]),Ce=U(()=>{let ie=$.map((Te,Le)=>({key:Te.id,turnId:Te.turnId??null,firstRowIndex:Le,endRowIndex:Le+1}));return{sections:ie,bySectionKey:new Map(ie.map(Te=>[Te.key,Te])),byRowId:new Map(ie.map(Te=>[Te.key,{turnId:Te.turnId,index:Te.firstRowIndex}]))}},[$]),Ee=M((ie,Te)=>Array.from(ie.querySelectorAll("[data-trajectory-row-id]")).find(Le=>Le.dataset.trajectoryRowId===Te),[]),pe=M((ie,Te)=>{let Le=Te[0]?.dataset.timelineRowId,We=Le===void 0?void 0:Ee(ie,Le);We&&Le!==void 0&&(Y.current={rowId:Le,offset:ie.getBoundingClientRect().top-We.getBoundingClientRect().top})},[Ee,Y]),Pe=M(()=>{if(!h)return;let ie=H.current??z.current;ie&&(ne.current=ie.scrollTop,W.current=ie.scrollHeight-ie.scrollTop-ie.clientHeight<=M3,$.length>0&&pe(ie,oy(ie)))},[W,$.length,h,pe,ne]),re=M(()=>se.current.viewportKey===S&&se.current.paneVisible,[S]),xe=M(()=>{if(!re()||f===null)return;let ie=H.current;if(!ie||ie.clientHeight<=0)return;let Te=oy(ie);pe(ie,Te);let Le=J.store.rows(),We=ie.ownerDocument.activeElement;if(Il(We)){let vt=Sl(We,ie);vt&&Le.push(vt)}let lt=hf({index:Ce,visibleSectionKeys:Te.flatMap(vt=>{let ae=vt.dataset.timelineRowId;return ae===void 0?[]:[ae]}),protectedRowIds:Le,selectionRows:vf(ie)}),kt=JSON.stringify(lt);ce.current!==kt&&(ce.current=kt,f(lt))},[J,re,f,Ce,pe]),fe=os(h),me=M(()=>{re()&&f!==null&&fe.request(xe)},[re,f,fe,xe]);Ie.current=me;let Ue=M(ie=>{let Te=Y.current,Le=Te===null?void 0:Ee(ie,Te.rowId),We=Le?.closest("[data-trajectory-chunk]"),lt=We?.style.contentVisibility;We&&(We.style.contentVisibility="visible");try{ie.scrollTop=Le===void 0?I?0:ne.current:ie.scrollTop+Le.getBoundingClientRect().top-ie.getBoundingClientRect().top+Te.offset}finally{We&&(We.style.contentVisibility=lt??"")}},[Ee,Y,ne,I]),ht=M(()=>{re()&&(Pe(),me())},[Pe,re,me]),le=M(()=>{!re()||se.current.pagingBlockedByInteraction||l?.loading||(Pe(),I&&(F.current=!0),l?.onLoadEarlier())},[Pe,re,l,I]),Ne=M(()=>{!re()||se.current.pagingBlockedByInteraction||d?.loading||(Pe(),I&&(F.current=!0),d?.onLoadLater())},[Pe,re,d,I]),rt=M(()=>{re()&&p?.(()=>{if(!re())return;W.current=!0,A(!0);let ie=H.current;ie&&(ie.scrollTop=ie.scrollHeight)})},[re,p,W,A]),je=ie=>{if(!(!re()||I)){if(ie&&d!==null){rt();return}ie&&(W.current=!0),A(ie)}},nt=M(ie=>{if(I&&F.current){ie.scrollTop=0,ne.current=0,Y.current=null,r?.loading||(F.current=!1);return}let Te=G.request;if(Te!==null){W.current=!1,A(!1);let Le=$.some(We=>We.id===Te.rowId)?Ee(ie,Te.rowId):void 0;if(!Le)return;Le.scrollIntoView({block:"center"}),Le.focus({preventScroll:!0}),ne.current=ie.scrollTop,pe(ie,[Le]),G.completeReveal(Te);return}!I&&E&&W.current&&d===null?ie.scrollTop=ie.scrollHeight:Ue(ie)},[G.request,G.completeReveal,W,A,$,Ee,ne,pe,E,I,r?.loading,Y,d,Ue]);return ge(()=>{if(!re())return;let ie=H.current;ie&&(nt(ie),me())},[nt,W,w,$,E,t,re,d,h,me,Ue]),ge(()=>{let ie=H.current;if(!re()||f===null||!ie)return;let Te=!0,Le=()=>{Te&&re()&&me()},We=()=>{!Te||!re()||(nt(ie),Le())},lt=typeof ResizeObserver>"u"?null:new ResizeObserver(We);lt?.observe(ie);let kt=ie.querySelector("table");return kt&<?.observe(kt),ie.addEventListener("focusin",Le),ie.addEventListener("focusout",Le),ie.ownerDocument.addEventListener("selectionchange",Le),Le(),()=>{Te=!1,fe.cancel(),lt?.disconnect(),ie.removeEventListener("focusin",Le),ie.removeEventListener("focusout",Le),ie.ownerDocument.removeEventListener("selectionchange",Le)}},[t,re,f,h,fe,me,nt]),c(Jf,{inputKey:S,visible:h,rows:$,expandedRows:w,capture:Pe,children:c(Fc,{value:ve,children:b("div",{className:"flex min-h-0 flex-1 flex-col","data-trajectory-view":!0,children:[b("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 border-b border-border px-3 py-1.5",children:[b("div",{role:"group","aria-label":T("trajectory.filterLabel"),className:"flex flex-wrap items-center gap-1",children:[c(X,{size:"xs",variant:k==="all"?"secondary":"ghost","aria-pressed":k==="all",onClick:()=>P("all"),children:T("trajectory.filterAll")}),L.map(ie=>c(X,{size:"xs",variant:k===ie?"secondary":"ghost","aria-pressed":k===ie,onClick:()=>P(ie),children:T(`trajectory.kinds.${ie}`)},ie))]}),o?c(zc,{size:"xs",variant:"outline",pressed:G.expandAll,disabled:u,onPressedChange:G.setExpandAll,children:T("turnOverview.expandAll")}):null,c(zc,{className:"ml-auto",size:"xs",variant:"outline",pressed:!I&&E,disabled:I,onPressedChange:je,"aria-label":T("trajectory.followLatest"),children:T("trajectory.followLatest")})]}),r&&s?c(Jk,{filter:a,query:r,onChange:s}):null,b("div",{ref:Z,className:"min-h-0 flex-1 overflow-auto",onScroll:ht,"data-trajectory-scroll":!0,children:[l!==null?b("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2 text-xs text-muted-foreground",children:[c("span",{children:T("trajectory.loadEarlier")}),c(X,{size:"xs",variant:"outline",disabled:l.loading||u,onClick:le,children:l.loading?T("trajectory.loadingEarlier"):T("trajectory.loadEarlierAction")})]}):null,$.length===0?c("div",{className:"flex h-full items-center justify-center p-6 text-sm text-muted-foreground",children:r?.loading?T("trajectory.sourceFilter.loading"):r?.error?T("trajectory.sourceFilter.unavailable"):T(I||k!=="all"?"trajectory.sourceFilter.empty":"trajectory.empty")}):b(VI,{children:[c(GI,{className:"sticky top-0 z-10 bg-background",children:b(ns,{className:"hover:bg-transparent",children:[c(Zs,{className:"w-px whitespace-nowrap",children:T("trajectory.columnTime")}),c(Zs,{className:"w-px whitespace-nowrap",children:T("trajectory.columnType")}),c(Zs,{children:T("trajectory.columnSummary")}),c(Zs,{className:"w-px whitespace-nowrap",children:T("trajectory.columnStatus")}),c(Zs,{className:"w-px whitespace-nowrap",children:T("trajectory.columnDuration")}),c(Zs,{className:"w-px",children:c("span",{className:"sr-only",children:T("trajectory.openInChat")})})]})}),_.map((ie,Te)=>c(WI,{className:"trajectory-chunk [&_tr:last-child]:border-b","data-trajectory-chunk":ie[0]?.id??Te,children:ie.map(Le=>{let We=G.headers.get(Le.id);if(We)return c(Gk,{...We,callCounts:r?.turnCounts.get(We.group.turnId),sourceFiltered:I,disabled:u,highlighted:G.highlighted===Le.id,onToggle:G.toggleTurn,onLocate:G.locate,onOpenFileDiff:i},Le.id);let lt=G.routines.get(Le.id);return lt?c(jk,{id:Le.id,...lt,disabled:u,onToggle:()=>G.toggleRoutine(Le.id)},Le.id):c(Qk,{row:Le,inputKey:t,expanded:w.has(Le.id),highlighted:G.highlighted===Le.id,toggleExpanded:ee,resolveChatAnchorMessageId:y,onOpenInChat:x,timestampFormat:m,threadRef:C,useToolCallDetail:g,useCommunicationRecord:v},`${t}:${Le.id}`)})},`${t}:${ie[0]?.id??Te}`))]}),d!==null?b("div",{className:"flex justify-center gap-2 px-3 py-2",children:[c(X,{size:"xs",variant:"outline",disabled:d.loading||u,onClick:Ne,children:d.loading?T("timeline.loadingLater"):T("timeline.loadLater")}),p===null?null:c(X,{size:"xs",variant:"ghost",onClick:rt,children:T("timeline.returnToLatest")})]}):null]})]})})})});function tP({data:e,target:t,inputKey:n,paneVisible:o,timestampFormat:r,onOpenInChat:a,onOpenFileDiff:s}){let[i,l]=bt("trajectory-source-filter",n,{}),d=e.useTrajectory({target:t,threadKey:n,visible:o,toolFilter:i}),u=M(f=>e.useToolCallDetail(t,{toolCallId:f.toolCallId,turnId:f.turnId,revision:f.revision}),[e,t]),p=M(f=>e.useCommunicationRecord(t,f),[e,t]);return c(eP,{inputKey:n,rows:d.rows,groupRows:d.groupRows,toolFilter:i,onToolFilterChange:l,sourceQuery:d.sourceQuery,onOpenFileDiff:s,loadEarlier:d.loadEarlier,loadLater:d.loadLater,pagingBlockedByInteraction:d.pagingBlockedByInteraction,onReturnToLatest:d.onReturnToLatest,onVisibleTurnRangeChange:d.onVisibleTurnRangeChange,timestampFormat:r,paneVisible:o,threadRef:t,useToolCallDetail:u,useCommunicationRecord:p,resolveChatAnchorMessageId:d.resolveChatAnchorMessageId,onOpenInChat:a})}V();V();var ry=ct(null),em=ry.Provider;function wo(){let e=_t(ry);if(e===null)throw new Error("Composer thread data has not been provided.");return e}function ro(){return _t(ry)}V();var di=Qd(ru());V();function iP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return U(()=>o=>{t.forEach(r=>r(o))},t)}var au=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ri(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function nm(e){return"nodeType"in e}function io(e){var t,n;return e?ri(e)?e:nm(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function om(e){let{Document:t}=io(e);return e instanceof t}function Fl(e){return ri(e)?!1:e instanceof io(e).HTMLElement}function sy(e){return e instanceof io(e).SVGElement}function ai(e){return e?ri(e)?e.document:nm(e)?om(e)?e:Fl(e)||sy(e)?e.ownerDocument:document:document:document}var tr=au?ge:K;function rm(e){let t=N(e);return tr(()=>{t.current=e}),M(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function lP(){let e=N(null),t=M((o,r)=>{e.current=setInterval(o,r)},[]),n=M(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Bl(e,t){t===void 0&&(t=[e]);let n=N(e);return tr(()=>{n.current!==e&&(n.current=e)},t),n}function zl(e,t){let n=N();return U(()=>{let o=e(n.current);return n.current=o,o},[...t])}function su(e){let t=rm(e),n=N(null),o=M(r=>{r!==n.current&&t?.(r,n.current),n.current=r},[]);return[n,o]}function am(e){let t=N();return K(()=>{t.current=e},[e]),t.current}var ay={};function si(e,t){return U(()=>{if(t)return t;let n=ay[e]==null?0:ay[e]+1;return ay[e]=n,e+"-"+n},[e,t])}function dP(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((a,s)=>{let i=Object.entries(s);for(let[l,d]of i){let u=a[l];u!=null&&(a[l]=u+e*d)}return a},{...t})}}var ii=dP(1),li=dP(-1);function O3(e){return"clientX"in e&&"clientY"in e}function iu(e){if(!e)return!1;let{KeyboardEvent:t}=io(e.target);return t&&e instanceof t}function F3(e){if(!e)return!1;let{TouchEvent:t}=io(e.target);return t&&e instanceof t}function lu(e){if(F3(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return O3(e)?{x:e.clientX,y:e.clientY}:null}var ds=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[ds.Translate.toString(e),ds.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),sP="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function cP(e){return e.matches(sP)?e:e.querySelector(sP)}V();var B3={display:"none"};function uP(e){let{id:t,value:n}=e;return Pn.createElement("div",{id:t,style:B3},n)}function pP(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e,r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Pn.createElement("div",{id:t,style:r,role:"status","aria-live":o,"aria-atomic":!0},n)}function fP(){let[e,t]=j("");return{announce:M(o=>{o!=null&&t(o)},[]),announcement:e}}var kP=ct(null);function z3(e){let t=_t(kP);K(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function H3(){let[e]=j(()=>new Set),t=M(o=>(e.add(o),()=>e.delete(o)),[e]);return[M(o=>{let{type:r,event:a}=o;e.forEach(s=>{var i;return(i=s[r])==null?void 0:i.call(s,a)})},[e]),t]}var U3={draggable:`
|
|
3860
|
+
`);return l.length===0?null:c("pre",{className:ny,children:l})}function Vk({row:e}){let{t}=q(),n=e.communication?.to;if(e.communication===void 0)return c("span",{className:"break-words",children:e.summary});let o=n==null?t("trajectory.communication.unknownRecipient"):n.kind==="thread"?n.title??t("trajectory.communication.untitledThread"):n.displayName;return c("span",{className:"break-words",children:t("trajectory.communication.sentTo",{name:o})})}var L3={replied:"trajectory.communication.phase.replied","picked-up":"trajectory.communication.phase.pickedUp",processed:"trajectory.communication.phase.processed",waiting:"trajectory.communication.phase.waiting",unknown:"trajectory.communication.phase.unknown",recorded:"trajectory.communication.phase.recorded",withdrawn:"trajectory.communication.phase.withdrawn",deleted:"trajectory.communication.phase.deleted"},$k={withdrawn:"trajectory.communication.body.withdrawn",deleted:"trajectory.communication.body.deleted",unavailable:"trajectory.communication.body.unavailable"};function Wk({useCommunicationRecord:e,recordId:t,fallback:n,timestampFormat:o}){let{t:r}=q(),a=e===void 0?null:e(t);if(a===null)return n===void 0?null:c("pre",{className:ny,children:n});if(typeof a=="string")return c("span",{className:"px-1 text-xs text-muted-foreground","data-trajectory-communication":a,children:r(a==="unreadable"?$k.unavailable:a==="environment-outdated"?"trajectory.communication.environmentOutdated":a==="client-outdated"?"trajectory.communication.updateRequired":"trajectory.communication.notReceived")});let s=r(L3[a.phase]);return b("div",{className:"flex flex-col gap-1.5","data-trajectory-communication":a.recordId,children:[a.incomplete?c("span",{className:"px-1 text-xs text-muted-foreground",children:r("trajectory.communication.incomplete")}):null,a.bodyState==="present"?c("pre",{className:ny,children:a.text}):c("span",{className:"px-1 text-xs text-muted-foreground",children:r($k[a.bodyState])}),c("span",{className:"px-1 text-xs text-muted-foreground",children:a.phaseAt===null?s:`${s} ${da(a.phaseAt,o,r)}`})]})}V();var Gk=de(function({group:t,expanded:n,onToggle:o,disabled:r,highlighted:a,callCounts:s,sourceFiltered:i=!1,...l}){let{t:d}=q(),u=t.items.flatMap(f=>f.kind==="step"?[f.row]:f.rows).find(f=>f.kind==="user-message"),p=t.summary?.state;return c(Ja,{value:t.id,children:c(ns,{"data-trajectory-row-id":t.id,"data-timeline-row-id":t.id,"data-turn-group-header":t.turnId??"unassigned",tabIndex:-1,className:Q("bg-muted/25 hover:bg-muted/25",a&&"outline-2 outline-primary"),children:b(hr,{colSpan:6,className:"whitespace-normal px-2 py-2",children:[b("div",{className:"flex min-w-0 items-start gap-2",children:[b(X,{variant:"ghost",size:"sm",className:"h-auto min-w-0 flex-1 justify-start px-1 py-1 text-left whitespace-normal",disabled:r,"aria-expanded":n,onClick:()=>o(t.id),title:d(n?"turnOverview.collapseTurn":"turnOverview.expandTurn"),children:[n?c(jt,{className:"size-4 shrink-0","aria-hidden":!0}):c(bn,{className:"size-4 shrink-0","aria-hidden":!0}),c("span",{className:"min-w-0",children:u?.summary||d(t.turnId===null?"turnOverview.unassigned":"turnOverview.turn")})]}),t.summary?c(uf,{summary:t.summary}):null,p==="error"||p==="interrupted"?c("span",{className:"shrink-0 py-1 text-xs text-destructive-foreground",children:d(p==="error"?"trajectory.status.failed":"trajectory.status.stopped")}):null]}),b("div",{className:"flex flex-wrap gap-x-3 gap-y-1 pl-5 text-xs text-muted-foreground","data-trajectory-call-counts":!0,children:[s?b(ue,{children:[c("span",{children:i?d("trajectory.sourceFilter.matchedCalls",{matched:s.matchedCalls,total:s.totalCalls}):d("trajectory.sourceFilter.totalCalls",{count:s.totalCalls})}),c("span",{children:i?d("trajectory.sourceFilter.matchedFailedCalls",{count:s.matchedFailedCalls}):d("trajectory.sourceFilter.failedCalls",{count:s.failedCalls})})]}):null,i?c("span",{children:d("trajectory.sourceFilter.hiddenSteps")}):null]}),t.summary?c("div",{className:"pl-5",children:c(cf,{summary:t.summary,...l})}):null]})})})});function jk({id:e,count:t,expanded:n,onToggle:o,disabled:r}){let{t:a}=q();return c(ns,{"data-trajectory-row-id":e,"data-timeline-row-id":e,tabIndex:-1,"data-routine-group":e,children:c(hr,{colSpan:6,className:"px-3 py-1",children:b(X,{variant:"ghost",size:"xs","aria-expanded":n,disabled:r,onClick:o,children:[n?c(jt,{"aria-hidden":!0}):c(bn,{"aria-hidden":!0}),a("turnOverview.routineSteps",{count:t})]})})})}V();var Qk=de(function({row:t,inputKey:n,expanded:o,highlighted:r,toggleExpanded:a,resolveChatAnchorMessageId:s,onOpenInChat:i,timestampFormat:l,threadRef:d,useToolCallDetail:u,useCommunicationRecord:p}){let{t:f}=q(),{formatDuration:m}=xo(),h=t.detail!==void 0||t.toolCallId!==void 0,g=s(t);return c(Ja,{value:t.id,children:[b(ns,{"data-trajectory-row-id":t.id,"data-timeline-row-id":t.id,tabIndex:-1,className:Q(h&&"cursor-pointer",r&&"outline-2 outline-primary"),onClick:h?()=>a(t.id):void 0,children:[c(hr,{className:"whitespace-nowrap text-muted-foreground",title:Hr(t.createdAt,l,f),children:da(t.createdAt,l,f)}),c(hr,{className:"whitespace-nowrap",children:f(`trajectory.kinds.${t.kind}`)}),b(hr,{className:"max-w-0 whitespace-normal",children:[b("span",{className:"inline-flex items-start gap-1",children:[h?c(X,{size:"xs",variant:"ghost",className:"mt-0.5 size-4 min-w-4 shrink-0 px-0","aria-label":f(o?"trajectory.collapseRow":"trajectory.expandRow"),"aria-expanded":o,onClick:v=>{v.stopPropagation(),a(t.id)},children:o?c(jt,{"aria-hidden":!0}):c(bn,{"aria-hidden":!0})}):null,c(Vk,{row:t})]}),t.kind==="tool-call"?b("span",{className:"ml-2 inline-flex flex-wrap gap-x-2 text-xs text-muted-foreground","data-trajectory-source":!0,children:[c("span",{children:f(`trajectory.sources.${t.source??"unknown"}`)}),t.source==="plugin"&&t.pluginId?c("span",{children:t.pluginId}):null,t.source==="mcp"&&t.mcpServer?c("span",{children:t.mcpServer}):null,t.action==="skill-read"?c("span",{children:t.skillName?f("trajectory.sourceFilter.skillReadNamed",{name:t.skillName}):f("trajectory.sourceFilter.skillRead")}):null]}):null]}),c(hr,{className:"whitespace-nowrap",children:f(`trajectory.status.${t.status}`)}),c(hr,{className:"whitespace-nowrap text-muted-foreground",children:t.durationMs!==void 0?m(t.durationMs):f("trajectory.valueUnknown")}),c(hr,{className:"whitespace-nowrap",children:g!==null?b(_e,{children:[c(Oe,{render:c(X,{size:"xs",variant:"ghost","aria-label":f("trajectory.openInChat"),onClick:v=>{v.stopPropagation(),i(g)}}),children:c(Vs,{"aria-hidden":!0})}),c(De,{side:"top",children:f("trajectory.openInChat")})]}):null})]},`${n}:${t.id}`),o&&h?c(ns,{className:"hover:bg-transparent","data-trajectory-detail-row":t.id,"data-timeline-row-id":t.id,children:b(hr,{colSpan:6,className:"whitespace-normal",children:[c("div",{className:"px-2 py-1 text-xs font-medium text-muted-foreground",children:f("trajectory.detailTitle")}),t.kind==="tool-call"&&t.toolCallId!==void 0?c(qk,{threadRef:d,useToolCallDetail:u,toolCallId:t.toolCallId,turnId:t.turnId,fallback:t.detail,revision:`${t.status}:${t.updatedActivityId??t.activityId??t.id}`}):t.communication!==void 0?c(Wk,{useCommunicationRecord:p,recordId:t.communication.recordId,fallback:t.detail,timestampFormat:l}):t.detail!==void 0?c("pre",{className:"max-h-80 overflow-auto rounded-md bg-muted/40 p-3 font-mono text-xs break-words whitespace-pre-wrap",children:t.detail}):null]})},`${n}:${t.id}:detail`):null]},`${n}:${t.id}:owner`)});var Yk=["user-message","assistant-message","reasoning","tool-call","approval","user-input","compaction","retry","session","turn-intent","scheduled-wake","communication","delegation","task","event"];V();var Jf=class extends na{getSnapshotBeforeUpdate(t){return(t.inputKey!==this.props.inputKey||t.rows!==this.props.rows||t.expandedRows!==this.props.expandedRows||t.visible&&!this.props.visible)&&t.capture(),null}componentDidUpdate(){}componentWillUnmount(){this.props.capture()}render(){return this.props.children}};function oy(e){let t=e.getBoundingClientRect();if(e.clientHeight<=0||t.height<=0)return[];let n=e.querySelector("thead"),o=t.top+(n?.getBoundingClientRect().height??0),r=e.querySelectorAll("[data-trajectory-chunk]"),a=ei(r,o),s=[];if(a<0)return s;for(let i=a;i<r.length;i+=1){let l=r[i];if(l.getBoundingClientRect().top>=t.bottom)break;let d=l.querySelectorAll("[data-timeline-row-id]"),u=ei(d,o);if(!(u<0))for(let p=u;p<d.length;p++){let f=d[p];if(f.getBoundingClientRect().top>=t.bottom)break;s.push(f)}}return s}function Zf(e){return e?.source!==void 0||e?.pluginId!==void 0||e?.mcpServer!==void 0}function Xk(e,t){if(t==="all")return e;let n=new Set(e.filter(o=>o.kind===t).map(o=>o.turnId??null));return e.filter(o=>o.kind===t||n.has(o.turnId??null)&&(o.kind==="user-message"||o.kind==="assistant-message"))}var E3=["native","ycodium","plugin","mcp","unknown"];function Jk({filter:e,query:t,onChange:n}){let{t:o}=q(),r=Zf(e),a=e?.source,s=a==="plugin"?"pluginId":a==="mcp"?"mcpServer":null,i=s===null?void 0:e?.[s],l=s===null?[]:[...new Set(t.sources.flatMap(d=>d.source===a&&d[s]!==void 0?[d[s]]:[]))];return i!==void 0&&!l.includes(i)&&l.push(i),b("div",{className:"flex flex-wrap items-center gap-1 border-b border-border px-3 py-1.5",children:[b("div",{role:"group","aria-label":o("trajectory.sourceFilter.label"),className:"flex flex-wrap items-center gap-1",children:[c(X,{size:"xs",variant:r?"ghost":"secondary","aria-pressed":!r,onClick:()=>n({}),children:o("trajectory.sourceFilter.all")}),E3.filter(d=>d===a||t.sources.some(u=>u.source===d)).map(d=>c(X,{size:"xs",variant:a===d?"secondary":"ghost","aria-pressed":a===d,onClick:()=>n({source:d}),children:o(`trajectory.sources.${d}`)},d))]}),s!==null?b(pl,{value:i===void 0?"all":`detail:${i}`,onValueChange:d=>{d===null||a===void 0||n(d==="all"?{source:a}:{source:a,[s]:d.slice(7)})},children:[c(Zp,{size:"xs",className:"max-w-full","aria-label":o(a==="plugin"?"trajectory.sourceFilter.plugin":"trajectory.sourceFilter.mcp"),children:i??o(a==="plugin"?"trajectory.sourceFilter.allPlugins":"trajectory.sourceFilter.allMcp")}),b(fl,{children:[c(Js,{value:"all",children:o(a==="plugin"?"trajectory.sourceFilter.allPlugins":"trajectory.sourceFilter.allMcp")}),l.map(d=>c(Js,{value:`detail:${d}`,children:d},d))]})]}):null,r?c(X,{size:"xs",variant:"ghost",onClick:()=>n({}),children:o("trajectory.sourceFilter.clear")}):null,t.loading?c("span",{role:"status",className:"text-xs text-muted-foreground",children:o("trajectory.sourceFilter.loading")}):null,t.error!==null?b("div",{role:"alert",className:"flex flex-wrap items-center gap-1 text-xs text-destructive-foreground",children:[c("span",{children:o("trajectory.sourceFilter.error",{error:t.error})}),c(X,{size:"xs",variant:"outline",disabled:t.loading,onClick:()=>t.retry(),children:o("trajectory.sourceFilter.retry")})]}):null]})}var Zk=50,M3=32;function A3(e){let t=[];for(let n=0;n<e.length;n+=Zk)t.push(e.slice(n,n+Zk));return t}var eP=de(function({inputKey:t,rows:n,groupRows:o,sourceQuery:r,toolFilter:a,onToolFilterChange:s,onOpenFileDiff:i,loadEarlier:l,loadLater:d=null,pagingBlockedByInteraction:u=!1,onReturnToLatest:p=null,onVisibleTurnRangeChange:f=null,timestampFormat:m,paneVisible:h,useToolCallDetail:g,useCommunicationRecord:v,threadRef:C,resolveChatAnchorMessageId:y,onOpenInChat:x}){let{t:T}=q(),I=Zf(a),S=I?JSON.stringify([t,a?.source,a?.pluginId,a?.mcpServer]):t,[k,P]=bt("trajectory-kind-filter",t,"all"),[w,R]=bt("trajectory-expanded-rows",t,()=>new Set),[E,A]=bt("trajectory-follow-latest",t,!0),L=U(()=>{let ie=new Set(n.map(Te=>Te.kind));return Yk.filter(Te=>ie.has(Te))},[n]),O=U(()=>Xk(n,k),[n,k]),H=N(null),F=N(!1);ge(()=>{F.current=!1},[S]);let D=M(()=>{P("all"),I&&s?.({})},[P,I,s]),G=yw({inputKey:t,rows:O,groupRows:o,paneVisible:h,resetFilter:D}),$=G.rows,_=U(()=>A3($),[$]),ee=ie=>R(Te=>{let Le=new Set(Te);return Le.has(ie)?Le.delete(ie):Le.add(ie),Le}),z=N(null),Z=M(ie=>{H.current=ie,ie&&(z.current=ie)},[]),W=dt("trajectory-at-end",S,!0),ne=dt("trajectory-scroll-top",S,0),Y=dt("trajectory-row-anchor",S,null),se=N({viewportKey:S,paneVisible:h,pagingBlockedByInteraction:u});se.current={viewportKey:S,paneVisible:h,pagingBlockedByInteraction:u};let ce=N(null);ge(()=>{if(ce.current=null,!!h)return()=>{ce.current=null,f?.(null)}},[S,h,f]);let J=U(()=>({inputKey:t,store:Bc()}),[t]),oe=N(J);oe.current=J;let Ie=N(()=>{}),ve=M(ie=>{let Te=oe.current;return Te.store.acquire(ie,()=>{oe.current===Te&&Ie.current()})},[]),Ce=U(()=>{let ie=$.map((Te,Le)=>({key:Te.id,turnId:Te.turnId??null,firstRowIndex:Le,endRowIndex:Le+1}));return{sections:ie,bySectionKey:new Map(ie.map(Te=>[Te.key,Te])),byRowId:new Map(ie.map(Te=>[Te.key,{turnId:Te.turnId,index:Te.firstRowIndex}]))}},[$]),Ee=M((ie,Te)=>Array.from(ie.querySelectorAll("[data-trajectory-row-id]")).find(Le=>Le.dataset.trajectoryRowId===Te),[]),pe=M((ie,Te)=>{let Le=Te[0]?.dataset.timelineRowId,We=Le===void 0?void 0:Ee(ie,Le);We&&Le!==void 0&&(Y.current={rowId:Le,offset:ie.getBoundingClientRect().top-We.getBoundingClientRect().top})},[Ee,Y]),Pe=M(()=>{if(!h)return;let ie=H.current??z.current;ie&&(ne.current=ie.scrollTop,W.current=ie.scrollHeight-ie.scrollTop-ie.clientHeight<=M3,$.length>0&&pe(ie,oy(ie)))},[W,$.length,h,pe,ne]),re=M(()=>se.current.viewportKey===S&&se.current.paneVisible,[S]),xe=M(()=>{if(!re()||f===null)return;let ie=H.current;if(!ie||ie.clientHeight<=0)return;let Te=oy(ie);pe(ie,Te);let Le=J.store.rows(),We=ie.ownerDocument.activeElement;if(Il(We)){let vt=Sl(We,ie);vt&&Le.push(vt)}let lt=hf({index:Ce,visibleSectionKeys:Te.flatMap(vt=>{let ae=vt.dataset.timelineRowId;return ae===void 0?[]:[ae]}),protectedRowIds:Le,selectionRows:vf(ie)}),kt=JSON.stringify(lt);ce.current!==kt&&(ce.current=kt,f(lt))},[J,re,f,Ce,pe]),fe=os(h),me=M(()=>{re()&&f!==null&&fe.request(xe)},[re,f,fe,xe]);Ie.current=me;let Ue=M(ie=>{let Te=Y.current,Le=Te===null?void 0:Ee(ie,Te.rowId),We=Le?.closest("[data-trajectory-chunk]"),lt=We?.style.contentVisibility;We&&(We.style.contentVisibility="visible");try{ie.scrollTop=Le===void 0?I?0:ne.current:ie.scrollTop+Le.getBoundingClientRect().top-ie.getBoundingClientRect().top+Te.offset}finally{We&&(We.style.contentVisibility=lt??"")}},[Ee,Y,ne,I]),ht=M(()=>{re()&&(Pe(),me())},[Pe,re,me]),le=M(()=>{!re()||se.current.pagingBlockedByInteraction||l?.loading||(Pe(),I&&(F.current=!0),l?.onLoadEarlier())},[Pe,re,l,I]),Ne=M(()=>{!re()||se.current.pagingBlockedByInteraction||d?.loading||(Pe(),I&&(F.current=!0),d?.onLoadLater())},[Pe,re,d,I]),rt=M(()=>{re()&&p?.(()=>{if(!re())return;W.current=!0,A(!0);let ie=H.current;ie&&(ie.scrollTop=ie.scrollHeight)})},[re,p,W,A]),je=ie=>{if(!(!re()||I)){if(ie&&d!==null){rt();return}ie&&(W.current=!0),A(ie)}},nt=M(ie=>{if(I&&F.current){ie.scrollTop=0,ne.current=0,Y.current=null,r?.loading||(F.current=!1);return}let Te=G.request;if(Te!==null){W.current=!1,A(!1);let Le=$.some(We=>We.id===Te.rowId)?Ee(ie,Te.rowId):void 0;if(!Le)return;Le.scrollIntoView({block:"center"}),Le.focus({preventScroll:!0}),ne.current=ie.scrollTop,pe(ie,[Le]),G.completeReveal(Te);return}!I&&E&&W.current&&d===null?ie.scrollTop=ie.scrollHeight:Ue(ie)},[G.request,G.completeReveal,W,A,$,Ee,ne,pe,E,I,r?.loading,Y,d,Ue]);return ge(()=>{if(!re())return;let ie=H.current;ie&&(nt(ie),me())},[nt,W,w,$,E,t,re,d,h,me,Ue]),ge(()=>{let ie=H.current;if(!re()||f===null||!ie)return;let Te=!0,Le=()=>{Te&&re()&&me()},We=()=>{!Te||!re()||(nt(ie),Le())},lt=typeof ResizeObserver>"u"?null:new ResizeObserver(We);lt?.observe(ie);let kt=ie.querySelector("table");return kt&<?.observe(kt),ie.addEventListener("focusin",Le),ie.addEventListener("focusout",Le),ie.ownerDocument.addEventListener("selectionchange",Le),Le(),()=>{Te=!1,fe.cancel(),lt?.disconnect(),ie.removeEventListener("focusin",Le),ie.removeEventListener("focusout",Le),ie.ownerDocument.removeEventListener("selectionchange",Le)}},[t,re,f,h,fe,me,nt]),c(Jf,{inputKey:S,visible:h,rows:$,expandedRows:w,capture:Pe,children:c(Fc,{value:ve,children:b("div",{className:"flex min-h-0 flex-1 flex-col","data-trajectory-view":!0,children:[b("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 border-b border-border px-3 py-1.5",children:[b("div",{role:"group","aria-label":T("trajectory.filterLabel"),className:"flex flex-wrap items-center gap-1",children:[c(X,{size:"xs",variant:k==="all"?"secondary":"ghost","aria-pressed":k==="all",onClick:()=>P("all"),children:T("trajectory.filterAll")}),L.map(ie=>c(X,{size:"xs",variant:k===ie?"secondary":"ghost","aria-pressed":k===ie,onClick:()=>P(ie),children:T(`trajectory.kinds.${ie}`)},ie))]}),o?c(zc,{size:"xs",variant:"outline",pressed:G.expandAll,disabled:u,onPressedChange:G.setExpandAll,children:T("turnOverview.expandAll")}):null,c(zc,{className:"ml-auto",size:"xs",variant:"outline",pressed:!I&&E,disabled:I,onPressedChange:je,"aria-label":T("trajectory.followLatest"),children:T("trajectory.followLatest")})]}),r&&s?c(Jk,{filter:a,query:r,onChange:s}):null,b("div",{ref:Z,className:"min-h-0 flex-1 overflow-auto",onScroll:ht,"data-trajectory-scroll":!0,children:[l!==null?b("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2 text-xs text-muted-foreground",children:[c("span",{children:T("trajectory.loadEarlier")}),c(X,{size:"xs",variant:"outline",disabled:l.loading||u,onClick:le,children:l.loading?T("trajectory.loadingEarlier"):T("trajectory.loadEarlierAction")})]}):null,$.length===0?c("div",{className:"flex h-full items-center justify-center p-6 text-sm text-muted-foreground",children:r?.loading?T("trajectory.sourceFilter.loading"):r?.error?T("trajectory.sourceFilter.unavailable"):T(I||k!=="all"?"trajectory.sourceFilter.empty":"trajectory.empty")}):b(VI,{children:[c(GI,{className:"sticky top-0 z-10 bg-background",children:b(ns,{className:"hover:bg-transparent",children:[c(Zs,{className:"w-px whitespace-nowrap",children:T("trajectory.columnTime")}),c(Zs,{className:"w-px whitespace-nowrap",children:T("trajectory.columnType")}),c(Zs,{children:T("trajectory.columnSummary")}),c(Zs,{className:"w-px whitespace-nowrap",children:T("trajectory.columnStatus")}),c(Zs,{className:"w-px whitespace-nowrap",children:T("trajectory.columnDuration")}),c(Zs,{className:"w-px",children:c("span",{className:"sr-only",children:T("trajectory.openInChat")})})]})}),_.map((ie,Te)=>c(WI,{className:"trajectory-chunk [&_tr:last-child]:border-b","data-trajectory-chunk":ie[0]?.id??Te,children:ie.map(Le=>{let We=G.headers.get(Le.id);if(We)return c(Gk,{...We,callCounts:r?.turnCounts.get(We.group.turnId),sourceFiltered:I,disabled:u,highlighted:G.highlighted===Le.id,onToggle:G.toggleTurn,onLocate:G.locate,onOpenFileDiff:i},Le.id);let lt=G.routines.get(Le.id);return lt?c(jk,{id:Le.id,...lt,disabled:u,onToggle:()=>G.toggleRoutine(Le.id)},Le.id):c(Qk,{row:Le,inputKey:t,expanded:w.has(Le.id),highlighted:G.highlighted===Le.id,toggleExpanded:ee,resolveChatAnchorMessageId:y,onOpenInChat:x,timestampFormat:m,threadRef:C,useToolCallDetail:g,useCommunicationRecord:v},`${t}:${Le.id}`)})},`${t}:${ie[0]?.id??Te}`))]}),d!==null?b("div",{className:"flex justify-center gap-2 px-3 py-2",children:[c(X,{size:"xs",variant:"outline",disabled:d.loading||u,onClick:Ne,children:d.loading?T("timeline.loadingLater"):T("timeline.loadLater")}),p===null?null:c(X,{size:"xs",variant:"ghost",onClick:rt,children:T("timeline.returnToLatest")})]}):null]})]})})})});function tP({data:e,target:t,inputKey:n,paneVisible:o,timestampFormat:r,onOpenInChat:a,onOpenFileDiff:s}){let[i,l]=bt("trajectory-source-filter",n,{}),d=e.useTrajectory({target:t,threadKey:n,visible:o,toolFilter:i}),u=M(f=>e.useToolCallDetail(t,{toolCallId:f.toolCallId,turnId:f.turnId,revision:f.revision}),[e,t]),p=M(f=>e.useCommunicationRecord(t,f),[e,t]);return c(eP,{inputKey:n,rows:d.rows,groupRows:d.groupRows,toolFilter:i,onToolFilterChange:l,sourceQuery:d.sourceQuery,onOpenFileDiff:s,loadEarlier:d.loadEarlier,loadLater:d.loadLater,pagingBlockedByInteraction:d.pagingBlockedByInteraction,onReturnToLatest:d.onReturnToLatest,onVisibleTurnRangeChange:d.onVisibleTurnRangeChange,timestampFormat:r,paneVisible:o,threadRef:t,useToolCallDetail:u,useCommunicationRecord:p,resolveChatAnchorMessageId:d.resolveChatAnchorMessageId,onOpenInChat:a})}V();V();var ry=ct(null),em=ry.Provider;function wo(){let e=_t(ry);if(e===null)throw new Error("Composer thread data has not been provided.");return e}function ro(){return _t(ry)}V();var di=Qd(ru());V();function iP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return U(()=>o=>{t.forEach(r=>r(o))},t)}var au=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ri(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function nm(e){return"nodeType"in e}function io(e){var t,n;return e?ri(e)?e:nm(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function om(e){let{Document:t}=io(e);return e instanceof t}function Fl(e){return ri(e)?!1:e instanceof io(e).HTMLElement}function sy(e){return e instanceof io(e).SVGElement}function ai(e){return e?ri(e)?e.document:nm(e)?om(e)?e:Fl(e)||sy(e)?e.ownerDocument:document:document:document}var tr=au?ge:K;function rm(e){let t=N(e);return tr(()=>{t.current=e}),M(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function lP(){let e=N(null),t=M((o,r)=>{e.current=setInterval(o,r)},[]),n=M(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Bl(e,t){t===void 0&&(t=[e]);let n=N(e);return tr(()=>{n.current!==e&&(n.current=e)},t),n}function zl(e,t){let n=N();return U(()=>{let o=e(n.current);return n.current=o,o},[...t])}function su(e){let t=rm(e),n=N(null),o=M(r=>{r!==n.current&&t?.(r,n.current),n.current=r},[]);return[n,o]}function am(e){let t=N();return K(()=>{t.current=e},[e]),t.current}var ay={};function si(e,t){return U(()=>{if(t)return t;let n=ay[e]==null?0:ay[e]+1;return ay[e]=n,e+"-"+n},[e,t])}function dP(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((a,s)=>{let i=Object.entries(s);for(let[l,d]of i){let u=a[l];u!=null&&(a[l]=u+e*d)}return a},{...t})}}var ii=dP(1),li=dP(-1);function O3(e){return"clientX"in e&&"clientY"in e}function iu(e){if(!e)return!1;let{KeyboardEvent:t}=io(e.target);return t&&e instanceof t}function F3(e){if(!e)return!1;let{TouchEvent:t}=io(e.target);return t&&e instanceof t}function lu(e){if(F3(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return O3(e)?{x:e.clientX,y:e.clientY}:null}var ds=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[ds.Translate.toString(e),ds.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),sP="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function cP(e){return e.matches(sP)?e:e.querySelector(sP)}V();var B3={display:"none"};function uP(e){let{id:t,value:n}=e;return Pn.createElement("div",{id:t,style:B3},n)}function pP(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e,r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Pn.createElement("div",{id:t,style:r,role:"status","aria-live":o,"aria-atomic":!0},n)}function fP(){let[e,t]=j("");return{announce:M(o=>{o!=null&&t(o)},[]),announcement:e}}var kP=ct(null);function z3(e){let t=_t(kP);K(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function H3(){let[e]=j(()=>new Set),t=M(o=>(e.add(o),()=>e.delete(o)),[e]);return[M(o=>{let{type:r,event:a}=o;e.forEach(s=>{var i;return(i=s[r])==null?void 0:i.call(s,a)})},[e]),t]}var U3={draggable:`
|
|
3861
3861
|
To pick up a draggable item, press the space bar.
|
|
3862
3862
|
While dragging, use the arrow keys to move the item.
|
|
3863
3863
|
Press space again to drop the item in its new position, or press escape to cancel.
|
package/dist/index.js
CHANGED
package/locales/en.json
CHANGED
package/locales/zh-CN.json
CHANGED
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.4162",
|
|
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,11 +41,11 @@
|
|
|
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.
|
|
44
|
+
"@ycodium-ai/plugin-api": "0.2.4162",
|
|
45
|
+
"ycodium-day-format": "0.0.0",
|
|
45
46
|
"ycodium-composer-tokens": "0.0.0",
|
|
46
47
|
"ycodium-duration-format": "0.0.0",
|
|
47
48
|
"ycodium-system-text": "0.0.0",
|
|
48
|
-
"ycodium-day-format": "0.0.0",
|
|
49
49
|
"ycodium-workspace-path": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"ycodium": {
|