@farero-ai/ui 0.4.0 → 0.4.1
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/dist/transcript.d.ts +18 -0
- package/dist/transcript.js +1 -1
- package/package.json +1 -1
package/dist/transcript.d.ts
CHANGED
|
@@ -369,6 +369,24 @@ interface TranscriptEntry {
|
|
|
369
369
|
* through MCP send_prompt and must never read as the person.
|
|
370
370
|
*/
|
|
371
371
|
origin?: 'human' | 'agent';
|
|
372
|
+
/** Who sent this prompt for an agent. The host records it at acceptance and names a chat at read time. */
|
|
373
|
+
sender?: PromptSender;
|
|
374
|
+
}
|
|
375
|
+
interface PromptSender {
|
|
376
|
+
/** The chat on this computer whose agent sent it. */
|
|
377
|
+
chat?: PromptSenderChat;
|
|
378
|
+
/** The name a local MCP client outside this computer's chats gave itself. */
|
|
379
|
+
client?: string;
|
|
380
|
+
/** The sender's own link back to the conversation it sent from. */
|
|
381
|
+
link?: string;
|
|
382
|
+
}
|
|
383
|
+
/** A chat that sent a prompt. A chat that no longer exists keeps only its id. */
|
|
384
|
+
interface PromptSenderChat {
|
|
385
|
+
sessionId: string;
|
|
386
|
+
workspaceId?: string;
|
|
387
|
+
title?: string;
|
|
388
|
+
provider?: string;
|
|
389
|
+
model?: string;
|
|
372
390
|
}
|
|
373
391
|
|
|
374
392
|
type ClockFormat = '12h' | '24h';
|
package/dist/transcript.js
CHANGED
|
@@ -14,4 +14,4 @@ import{g as $e,q as _,r as Ge}from"./chunks/chunk-E7KN7CHM.js";import"./chunks/c
|
|
|
14
14
|
`)),l=a.length?e.join(`
|
|
15
15
|
`).slice(a[0].start,a[0].end):void 0,p=t.slice(2).replace(/\s*Report:\s*\S.*$/,"").trim(),u=It(n.filter(w=>!Ve.test(w.trim())&&!w.trim().startsWith(ae)));return{label:r,id:o,outcome:s==="failed"?"failed":"completed",line:p,...u?{preview:u}:{},...l?{attachmentToken:l}:{}}}i(Nt,"attachedReport");function It(e){let t=e.filter(r=>r.trim()).map(r=>/^ */.exec(r)?.[0].length??0),n=t.length?Math.min(...t):0;return e.map(r=>r.slice(Math.min(n,/^ */.exec(r)?.[0].length??0))).join(`
|
|
16
16
|
`).trim()}i(It,"dedent");function Et(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.role==="assistant")return n;if(A(n))return t+1<e.length?e[e.length-1]:null}return null}i(Et,"latestTurnActionEnd");function ce(e,t,n){return Ye(e,[t],n).get(t)??null}i(ce,"turnOrigin");function Ye(e,t,n){let r=new Map;if(t.length===0)return r;let o=n?R(n):Number.NaN,s=new Set(t),a=i((u,w,m)=>n&&o<m&&!w?n:u,"originAt"),l=null,p=!1;for(let u of e)s.has(u)&&r.set(u,a(l,p,R(u.ts))),A(u)?(l=u.ts,p=!1):h(u)&&(p=!0);if(r.size===s.size)return r;for(let u of s)r.has(u)||r.set(u,a(l,p,R(u.ts)));return r}i(Ye,"turnOrigins");import{jsx as At}from"react/jsx-runtime";var V=i(({children:e,className:t})=>At("div",{className:I("min-w-0 rounded-2xl px-3.5 py-2.5 text-[14px] leading-relaxed [overflow-wrap:anywhere]",t),children:e}),"Bubble"),vt=["-top-3","top-5","top-13"];var pe="browser_sign_in";function Je(e){let t=i((n,r)=>{if(r>6)return;if(typeof n=="string")try{return t(JSON.parse(n),r+1)}catch{return}if(Array.isArray(n)){for(let a of n){let l=t(a,r+1);if(l)return l}return}if(!n||typeof n!="object")return;let o=n;if(o.isError)return;let s=o.signIn;return s&&typeof s.id=="string"&&/^bsi_[a-f\d]{64}$/.test(s.id)?s.id:t(o.structuredContent??o.content??o.text,r+1)},"read");return t(e,0)}i(Je,"browserSignInReceipt");var ue="handoff_request";function Xe(e){let t=i((n,r)=>{if(r>6)return;if(typeof n=="string")try{return t(JSON.parse(n),r+1)}catch{return}if(Array.isArray(n)){for(let l of n){let p=t(l,r+1);if(p)return p}return}if(!n||typeof n!="object")return;let o=n;if(o.isError)return;let s=o.handoff,a=s?.id;if(typeof a=="string"){if(s?.kind==="sign_in"&&/^bsi_[a-f\d]{64}$/.test(a))return{kind:"sign_in",id:a};if(s?.kind==="saved_sign_in"&&/^psi_[a-f\d]{64}$/.test(a))return{kind:"saved_sign_in",id:a};if(s?.kind!=="sign_in"&&s?.kind!=="saved_sign_in"&&/^hr_[a-f\d]{64}$/.test(a))return{kind:"request",id:a}}return t(o.structuredContent??o.content??o.text,r+1)},"read");return t(e,0)}i(Xe,"handoffRequestReceipt");var Ct="request_mcp_sign_in";function fe(e,t=""){return x(e,t).name===`mcp__farero_host__${Ct}`}i(fe,"isMcpSignInTool");function Ze(e){let t=i((n,r)=>{if(r>6)return;if(typeof n=="string")try{return t(JSON.parse(n),r+1)}catch{return}if(Array.isArray(n)){for(let s of n){let a=t(s,r+1);if(a)return a}return}if(!n||typeof n!="object")return;let o=n;if(!o.isError)return typeof o.server=="string"&&o.server&&typeof o.status=="string"&&typeof o.next=="string"?{server:o.server,status:o.status}:t(o.structuredContent??o.content??o.text,r+1)},"read");return t(e,0)}i(Ze,"readSignInReceipt");function _t(e){let t=Ze(e);return t?{servers:[t.server]}:void 0}i(_t,"mcpSignInToolResult");var Bt=["needs-sign-in","connecting","connected","failed","disabled","unknown"];function et(e){let t=Ze(e)?.status;return Bt.find(n=>n===t)}i(et,"mcpSignInToolStatus");function tt(e){return fe(e.tool??"",e.text)?e.error?void 0:_t(e.output):e.mcpSignIn}i(tt,"mcpSignInCard");var nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,st=new WeakMap,it=new WeakMap;function z(e){let t=nt.get(e);if(t!==void 0)return t??void 0;let n=tt(e)??null;return nt.set(e,n),n??void 0}i(z,"mcpSignInOf");function K(e){let t=rt.get(e);if(t!==void 0)return t??void 0;let n=Ot(e)??null;return rt.set(e,n),n??void 0}i(K,"browserSignInOf");function at(e){let t=ot.get(e);if(t!==void 0)return t??void 0;let n=ge(e),r=n?.kind==="saved_sign_in"?n.id:null;return ot.set(e,r),r??void 0}i(at,"savedSignInOf");function lt(e){let t=ge(e);return t?.kind==="request"?t.id:void 0}i(lt,"handoffRequestOf");function me(e){let t=x(e.tool??"",e.text);return(t.server??"farero_host")==="farero_host"?t.label:void 0}i(me,"hostTool");function ge(e){let t=st.get(e);if(t!==void 0)return t??void 0;let n=!e.error&&me(e)===ue&&Xe(e.output)||null;return st.set(e,n),n??void 0}i(ge,"handoffOf");function Ot(e){if(e.error)return;let t=ge(e);return t?.kind==="sign_in"?t.id:me(e)===pe?Je(e.output):void 0}i(Ot,"browserSignInReceiptOf");function Mt(e){if(!e.error)return!1;if(fe(e.tool??"",e.text))return!0;let t=me(e);return t===pe||t===ue}i(Mt,"failedCardRow");function Y(e){let t=it.get(e);if(t!==void 0)return t;let n=Pt(e);return it.set(e,n),n}i(Y,"personCard");function Pt(e){if(Mt(e))return!0;if(!z(e)&&!K(e)&&!at(e)&&!lt(e))return!1;let t=et(e.output);return t!=="connected"&&t!=="disabled"}i(Pt,"personCardUncached");function xe(e){return e==="24h"?{hourCycle:"h23"}:e==="12h"?{hour12:!0}:{}}i(xe,"hourCycle");function dt(e){return{hour:e==="12h"?"numeric":"2-digit",minute:"2-digit",...xe(e)}}i(dt,"clockFields");function J(e,t=null){return new Date(e).toLocaleTimeString(void 0,dt(t))}i(J,"clockTime");function Ft(e,t=null){return new Date(e).toLocaleTimeString(void 0,xe(t))}i(Ft,"clockSeconds");function Lt(e,t=null){return new Date(e).toLocaleString(void 0,xe(t))}i(Lt,"dateTime");function Dt(e){let t="";for(let n of e.split(`
|
|
17
|
-
`)){let r="",o="",s=0;for(let l of F(n)){let p=n.slice(s,l.start);r+=p+l.name,o+=p,s=l.end}let a=n.slice(s);if((o+a).trim())return r+a;t||=r.trim()}return t}i(Dt,"firstWords");function X(e,t=120){let n=Dt(Pe(e).text).replace(/^[\s>#*\-+]+/,"").replace(/`/g,"").replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t-1)}\u2026`:n}i(X,"messagePreview");function ye(e){let t=Math.max(0,Math.floor(e/1e3)),n=t%60,r=Math.floor(t/60)%60,o=Math.floor(t/3600),s=i(a=>String(a).padStart(2,"0"),"pad");return o?`${o}h ${s(r)}m ${s(n)}s`:r?`${r}m ${s(n)}s`:`${n}s`}i(ye,"elapsed");function ct(e,t,n){return`${e.toLocaleDateString(void 0,{month:"short",day:"numeric",...e.getFullYear()===t.getFullYear()?{}:{year:"numeric"}})}, ${J(e,n)}`}i(ct,"dateStamp");function Z(e,t=null){let n=new Date(R(e));if(!Number.isFinite(n.getTime()))return"";let r=new Date;return n.toDateString()===r.toDateString()?J(n,t):ct(n,r,t)}i(Z,"messageTime");var Ut="render_ui";function we(e,t=""){return x(e,t).name===`mcp__farero_host__${Ut}`}i(we,"isGeneratedUiTool");function Wt(e){if(/[$`\r\n<>]/.test(e))return null;let t=[],n="",r=!1,o="",s=i(()=>{r&&t.push({word:n}),n="",r=!1},"flush");for(let a=0;a<e.length;a++){let l=e[a];if(l==="\\"&&o!=="'"){let p=e[++a];if(p===void 0)return null;n+=o==='"'&&p!=='"'&&p!=="\\"?`\\${p}`:p,r=!0}else if(o)l===o?o="":n+=l;else if(l==="'"||l==='"')o=l,r=!0;else if(/\s/.test(l))s();else if(l==="|"||l===";"||l==="&")if(s(),l==="&"){if(e[++a]!=="&")return null;t.push({operator:"&&"})}else t.push({operator:l});else{if(/[(){}#]/.test(l))return null;n+=l,r=!0}}return o?null:(s(),t)}i(Wt,"tokenize");function qt(e){let[t,...n]=e;switch(t){case"rg":return n.some(r=>/^--(?:pre|hostname-bin)(?:=|$)/.test(r))?null:n.includes("--files")?"Glob":"Grep";case"grep":return"Grep";case"ls":return"LS";case"cat":case"head":case"tail":case"nl":case"wc":return"Read";case"sed":{if(n[0]!=="-n")return null;let r=n[1]==="-e"?2:1;return/^\d+(?:,\d+)?p$/.test(n[r]??"")?n.slice(r+1).some(o=>o.startsWith("-"))?null:"Read":null}default:return null}}i(qt,"lookupCommand");function be(e){let t=Wt(Fe(e));if(!t?.length)return null;let n=[],r=null,o=null;for(let s=0;s<=t.length;s++){let a=t[s];if(a&&"word"in a){n.push(a.word);continue}if(n[0]==="cd"&&n.length===2&&a?.operator==="&&"&&!r&&!o){n=[];continue}let l=qt(n);if(!l)return null;if(r??=l,n=[],a?.operator!=="|"){if(o&&o!==r)return null;o=r,r=null}}return o}i(be,"shellLookup");var $t=[{id:"off",label:"Inline"},{id:"tools",label:"Group tools"},{id:"all",label:"Group tools + thinking"}],Gt=[{id:"all",label:"All messages"},{id:"final",label:"Final reply"}],E=i(e=>`${e.rowid}-${e.id}`,"rowKey");function he(e,t,n){if(!t||n?.has(t.id)||e.role!==t.role||!["user","assistant","thinking"].includes(e.role)||e.questionAnswer||t.questionAnswer||e.subagentLabel||t.subagentLabel||h(e)||h(t)||(e.origin??"human")!==(t.origin??"human"))return!1;let r=Math.floor(R(e.ts)/6e4);return Number.isFinite(r)&&r===Math.floor(R(t.ts)/6e4)}i(he,"continuesMessageMinute");var Ht=[{id:"all",label:"All steps"},{id:"latest",label:"Latest step"},{id:"latest-thinking",label:"Latest thinking"}],jt=i((e,t)=>e!=="latest-thinking"||t==="all","groupPreviewAvailable"),Qt=i(e=>e.role==="thinking"?"Thinking":U(e).title,"stepLabel");function ee(e,t="all"){if(t==="all")return[...new Set(e.map(({e:r})=>Qt(r)))].join(", ");if(t==="latest-thinking"){for(let r=e.length-1;r>=0;r--)if(e[r].e.role==="thinking")return e[r].e.text}let n=e[e.length-1];return n?n.e.role==="tool"?U(n.e).title:n.e.text:""}i(ee,"stepSummary");var Vt=new Set(["Read","Grep","Glob","LS"]);function pt(e){if(e.role!=="tool"||!e.tool||e.subagentLabel||ie(e))return null;let{name:t}=x(e.tool);return Vt.has(t)?t:t==="Bash"?be(e.detail??""):null}i(pt,"lookupKind");function U(e){if(e.role!=="tool"||!e.tool)return{title:e.text,server:null};let t=x(e.tool,e.text);return{title:ut(e)??pt(e)??t.label,server:t.server}}i(U,"stepTitle");function ut(e){if(!e.text||!e.tool||e.text===e.tool)return;let t=x(e.tool,e.text);if(x(e.text).name!==t.name&&!(t.name==="Bash"&&e.text==="Run command")&&!(t.name==="Edit"&&e.text==="Edit files"))return e.text===t.label?void 0:e.text}i(ut,"ownTitle");function te(e,t=!1){let n=ut(e);if(n)return n;let r=e.detail??"";return e.tool&&x(e.tool).name==="Bash"?r:!t&&r.startsWith("/")?r.slice(r.lastIndexOf("/")+1):r||e.text}i(te,"lookupLabel");function D(e){let t=[],n=[],r=null,o=i(()=>{if(n.length>1)t.push({kind:"batch",key:`batch-${E(n[0].e)}`,tool:r,nodes:n});else for(let s of n)t.push({kind:"entry",key:E(s.e),node:s});n=[],r=null},"flush");for(let s of e){let a=pt(s.e);if(a){n.length&&r!==a&&o(),r=a,n.push(s);continue}o(),t.push({kind:"entry",key:E(s.e),node:s})}return o(),t}i(D,"batchLookups");function B(e,t="all"){if(t==="off")return D(e);let n=t==="tools",r=[],o=[],s=i(()=>{let l=D(o);l.length===1?r.push(l[0]):l.length&&r.push({kind:"steps",key:`steps-${E(o[0].e)}`,nodes:o}),o=[]},"flush"),a=i(l=>!l.e.subagentLabel&&!ie(l.e)&&!Y(l.e)&&!l.e.app&&!l.e.generatedUi&&!we(l.e.tool??"",l.e.text)&&(l.e.role==="tool"||l.e.role==="thinking"&&!n),"joinsRun");for(let l of e){if(a(l)){o.push(l);continue}s(),r.push({kind:"entry",key:E(l.e),node:l})}return s(),r}i(B,"groupSteps");var ft=i(e=>e.role==="system"&&(!!e.backgroundResult||Ue(e.text)),"isBackgroundEnd"),P=i(e=>e.role==="system"&&!ft(e)||!!e.questionAnswer||!!e.sideQuestion||Y(e)||!!e.app?.call||!!e.generatedUi||e.role==="assistant"&&(!!e.generatedUiStreams||e.text.includes("```farero-ui "))||e.role==="tool"&&we(e.tool??"",e.text),"staysVisible"),mt=i(e=>!P(e)&&(e.role==="thinking"||e.role==="tool"||e.role==="assistant"),"agentWork"),gt=i(e=>e.role==="assistant"&&!P(e)&&!!e.text.trim(),"isReply"),zt=i(e=>!e.queued&&h(e)||ft(e),"isWake");function ke(e){let t=new Set,n=null;for(let{e:r}of e)zt(r)?(n&&t.add(n),n=null):mt(r)&&(n=gt(r)?r:null);return t}i(ke,"repliesBeforeWakes");function Te(e,t,n){let r=ke(e),o=t?R(n)-R(t):Number.NaN,s=le(e.map(a=>a.e));return{label:[o>0?`Worked for ${ye(o)}`:null,s?`${s} delegation${s===1?"":"s"}`:null].filter(Boolean).join(" \xB7 ")||"Show work",aborted:e.filter(a=>!P(a.e)&&a.e.aborted).length,kept:e.filter(a=>P(a.e)||r.has(a.e))}}i(Te,"turnWorkLine");var Kt=5;function Yt(e,t){let n=ke(e),r=i(o=>!P(o)&&!n.has(o),"hidden");return B(e,t).filter(o=>o.kind==="entry"?r(o.node.e):o.nodes.some(({e:s})=>r(s))).length}i(Yt,"hiddenRows");function Re(e,t="all",{completedTurns:n="final",live:r=!1,dispatched:o}={}){if(n==="all")return B(e,t);let s=[],a=r&&o?R(o):Number.NaN,l=0;for(;l<e.length;){let p=l+1;for(;p<e.length&&!A(e[p].e);)p++;let u=e.slice(l,p),w=p===e.length;l=p;let m=u.length-1;for(;m>0&&!gt(u[m].e);)m--;let S=u[0].e,k=u[m].e,T=u.slice(1,m);if(!(A(S)&&m>0&&!u.slice(m+1).some(({e:C})=>mt(C))&&!(r&&(w||R(k.ts)>=a))&&(T.some(({e:C})=>h(C))||Yt(T,t)>=Kt))){s.push(...B(u,t));continue}s.push({kind:"entry",key:E(S),node:u[0]}),s.push({kind:"work",key:`work-${E(T[0].e)}`,nodes:T,reply:k,startedAt:ce(u.map(({e:C})=>C),k,o)}),s.push(...B(u.slice(m),t))}return s}i(Re,"foldTurns");import{ChevronRight as Jt}from"lucide-react";import{jsx as y,jsxs as v}from"react/jsx-runtime";var ne=i(({children:e})=>y("div",{className:"flex flex-col items-start",children:y(V,{className:"max-w-[92%] px-0.5",children:e})}),"AssistantBody"),Se=i(({children:e,queued:t})=>v(V,{className:I("max-w-[85%] bg-accent-soft text-text",t&&"opacity-60"),children:[t?y(L,{as:"div",className:"mb-1",children:"queued"}):null,e]}),"UserBody"),Ne=i(({id:e,state:t,children:n})=>v("div",{className:"flex flex-col items-end gap-0.5","data-automatic-resend":e,children:[y("span",{className:"pr-1 text-[11px] text-muted",children:t==="queued"?"Message queued to send again":t==="sending"?"Sending your message again\u2026":t==="failed"?"Couldn\u2019t send your message again":t==="uncertain"?"Resend delivery unconfirmed":"Sent your message again"}),n]}),"AutomaticResend"),Ie=i(({label:e,children:t})=>v("div",{className:"max-w-[92%] rounded-xl border border-border-soft bg-surface/40 px-3 py-2 text-left",children:[y(L,{as:"div",className:"mb-1",children:e}),t]}),"AutomationCard"),Ee=i(({children:e})=>y("div",{className:"px-2 text-center text-[11px] text-faint",children:e}),"SystemLine"),ve=i(({notice:e,markdown:t,report:n,time:r})=>v("div",{className:"flex flex-col items-end gap-0.5","data-delegation-return":e.title,children:[v("div",{className:"max-w-[92%] rounded-xl border border-border-soft bg-surface/40 px-3 py-2 text-left",children:[y("p",{className:"text-center font-medium text-[12.5px] text-muted",children:e.title}),e.lead?y("div",{className:"mt-1 text-[13px] text-muted",children:t(e.lead)}):null,e.report?y("div",{className:"mt-1 text-[12px]",children:n}):null,e.rest?v("details",{className:"mt-1",children:[y("summary",{className:"cursor-pointer text-[11px] text-faint",children:"Show full preview"}),y("div",{className:"mt-1 text-[13px] text-muted",children:t(e.rest)})]}):null,e.machine?v("details",{className:"mt-1",children:[y("summary",{className:"cursor-pointer text-[11px] text-faint",children:"Investigation details"}),y("p",{className:"mt-1 whitespace-pre-wrap font-mono text-[11px] text-faint",children:e.machine})]}):null]}),r]}),"DelegationReturnBody"),Ae=i(({label:e,aborted:t,open:n,onToggle:r,work:o,kept:s})=>v("div",{className:"flex min-w-0 flex-col gap-2.5 border-border-soft border-b pb-2.5",children:[v("details",{open:n,onToggle:r,className:"group/work min-w-0",children:[v("summary",{className:"flex w-fit max-w-full cursor-pointer select-none list-none items-center gap-1.5 px-0.5 py-1 text-[12.5px] text-muted transition-colors hover:text-text [&::-webkit-details-marker]:hidden",children:[y("span",{className:"tabular-nums",children:e}),t?v("span",{className:"text-faint",children:["\xB7 ",t," aborted"]}):null,y(Jt,{size:14,"aria-hidden":!0,className:"shrink-0 text-faint transition-transform group-open/work:rotate-90 motion-reduce:transition-none"})]}),n?y("div",{className:"mt-2 flex min-w-0 flex-col gap-2.5",children:o()}):null]}),n?null:s()]}),"TurnWorkFold");import{useContext as an,useState as ln}from"react";import{createContext as Xt,useContext as xt,useState as yt}from"react";import Zt from"react-markdown";import en from"remark-breaks";import tn from"remark-gfm";import{jsx as O,jsxs as Ce}from"react/jsx-runtime";var W=Xt({link:i(({children:e})=>O("span",{children:e}),"link"),original:i(e=>O("pre",{className:"whitespace-pre-wrap break-words font-mono text-xs",children:e}),"original")}),nn=[tn,en],rn=i(({node:e,children:t,className:n,...r})=>{let[o,s]=yt(null);return Ce("div",{className:"relative my-2 min-w-0",children:[O("pre",{...r,className:I("m-0 cursor-text select-text pr-10",n),children:t}),e?O(We,{text:$e(e),label:"code",title:"Copy code",size:12,className:"absolute top-1.5 right-1.5 size-6 select-none rounded-md border border-border-soft bg-bg/90 hover:text-text focus-visible:outline-2 focus-visible:outline-accent",onCopyError:()=>s("Could not copy to the clipboard. Try again.")}):null,O(qe,{error:o,onDismiss:()=>s(null)})]})},"QuestionPre"),on=i(e=>xt(W).link(e),"QuestionLink"),sn={a:on,pre:rn},_e=i(({text:e})=>{let[t,n]=yt(!1),r=xt(W);return Ce("div",{className:"md min-w-0 select-text whitespace-normal break-words [&_pre]:max-h-40 [&_pre]:overflow-auto [&_pre]:overscroll-contain",children:[t?r.original(e):O(Zt,{remarkPlugins:nn,allowedElements:["p","em","strong","del","code","pre","a","br","ul","ol","li","blockquote"],unwrapDisallowed:!0,components:sn,children:e.length<=32768?e:e.slice(0,32768)}),e.length>32768?Ce("span",{className:"block text-muted",children:["Preview limited to 32,768 characters."," ",O("button",{type:"button",className:"text-accent underline",onClick:()=>n(!t),children:t?"Formatted preview":"Full original text"})]}):null]})},"QuestionMarkdown");import{jsx as q,jsxs as $}from"react/jsx-runtime";var dn=i(({text:e})=>{let[t,n]=ln(!1),r=an(W);return e.length<=1e3?q("span",{className:"whitespace-pre-wrap break-words text-text",children:e}):$("details",{open:t,onToggle:o=>n(o.currentTarget.open),className:"min-w-0",children:[$("summary",{className:"cursor-pointer whitespace-pre-wrap break-words",children:[e.slice(0,500),"\u2026 (full submitted answer)"]}),t?r.original(e):null]})},"AnswerValue"),Be=i(({record:e})=>$("div",{className:"min-w-0 rounded-lg border border-border-soft px-3 py-2 text-xs",children:[$("p",{className:"mb-1 text-muted",children:[e.provider," \xB7"," ",e.decision==="cancel"?"question cancelled":`answer submitted${e.decision?` \xB7 ${e.decision}`:""}`]}),e.questions.map(t=>$("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1 py-1",children:[q("div",{className:"min-w-0 text-muted",children:q(_e,{text:t.question})}),q("span",{"aria-hidden":"true",children:"\u2192"}),q(dn,{text:t.redacted?"[redacted]":t.values.length?(t.labels??t.values).join(", "):e.decision??"No answer supplied"})]},t.id))]}),"QuestionAnswerRecord");import{Waypoints as cn}from"lucide-react";import{Fragment as oe,useMemo as re,useState as pn}from"react";function wt(e,t){return e.startsWith(`${t.slice(0,80)||"prompt"}-retry`)}i(wt,"isRetryOf");function Oe(e){let t=new Set,n=new Map,r=new Set;for(let o of e){if(o.role!=="user"||t.has(o.id))continue;let s=n.get(o.text)??[];s.some(a=>wt(o.id,a))&&r.add(o.id),s.push(o.id),n.set(o.text,s),t.add(o.id)}return r}i(Oe,"automaticResendIds");import{Fragment as gn,jsx as d,jsxs as f}from"react/jsx-runtime";var Me=i(({ts:e,clock:t,align:n})=>d("span",{className:I("text-[11px] text-faint",n==="right"?"pr-1 text-right":"pl-1"),children:Z(e,t)}),"RowTime"),un=i(({e})=>{if(e.error&&!e.tool)return f("details",{className:"overflow-hidden rounded-xl border border-del/30 bg-del/5 px-3 py-2",children:[d("summary",{className:"cursor-pointer text-del text-xs",children:"Failed tool output"}),d("pre",{className:"mt-2 whitespace-pre-wrap font-mono text-[11.5px] leading-relaxed [overflow-wrap:anywhere]",children:e.text})]});let t=e.detail!==e.text?e.detail:void 0,n=z(e),r=K(e),{title:o,server:s}=U(e),a=e.error?d("span",{className:"ml-auto shrink-0 text-[11px] text-del",children:"failed"}):e.aborted?d("span",{className:"ml-auto shrink-0 text-[11px] text-faint",children:"aborted"}):null;return!t&&!e.output&&!e.images?.length&&!e.outputTruncated?f("div",{className:"flex min-w-0 items-baseline gap-2 overflow-hidden whitespace-nowrap rounded-xl border border-border-soft bg-surface/60 px-3 py-1.5",children:[d("span",{className:"shrink-0 font-mono text-[11px] text-faint",children:"\xB7"}),d("span",{title:o,className:"max-w-full truncate text-[12.5px] text-muted",children:o}),s?f("span",{className:"shrink-0 text-[11px] text-faint",children:["\xB7 ",s]}):null,a]}):f("details",{className:I("min-w-0 overflow-clip rounded-xl border",e.error?"border-del/30 bg-del/5":"border-border-soft bg-surface/60"),children:[f("summary",{className:"flex cursor-pointer select-none list-none items-baseline gap-2 overflow-hidden whitespace-nowrap px-3 py-1.5 [&::-webkit-details-marker]:hidden",children:[d("span",{className:"shrink-0 font-mono text-[11px] text-faint",children:"\u25B8"}),d("span",{title:o,className:"max-w-full truncate text-[12.5px] text-muted",children:o}),s?f("span",{className:"shrink-0 text-[11px] text-faint",children:["\xB7 ",s]}):null,t?d("span",{title:t,className:"min-w-0 flex-1 truncate font-mono text-[11px] text-faint",children:t}):null,a]}),f("div",{className:"flex min-w-0 flex-col gap-2 px-3 py-2",children:[t?d("pre",{className:"whitespace-pre-wrap font-mono text-[11.5px] text-muted leading-relaxed [overflow-wrap:anywhere]",children:t}):null,e.output?f("div",{className:I("min-w-0",t&&"border-border-soft border-t pt-2"),children:[d(L,{as:"div",className:"mb-1",children:e.error?"error":e.aborted?"aborted":e.diff?"changes":"output"}),d("pre",{className:"whitespace-pre-wrap font-mono text-[11.5px] leading-relaxed [overflow-wrap:anywhere]",children:e.output})]}):null,n?f("p",{className:"text-[11px] text-faint",children:["Sign-in required for ",n.servers.join(", "),"."]}):null,r?d("p",{className:"text-[11px] text-faint",children:"Browser sign-in requested."}):null,e.outputTruncated?f("p",{className:"text-[11px] text-faint tabular-nums",children:["Output truncated.",e.outputOriginalBytes?` Original size: ${e.outputOriginalBytes.toLocaleString()} bytes.`:null]}):null,e.images?.length?f("p",{className:"text-[11px] text-faint",children:[e.images.length," image",e.images.length===1?"":"s"," (not shown in preview)"]}):null]})]})},"ReadonlyToolRow"),bt=i(({tool:e,nodes:t,renderNode:n})=>{let r=t.map(({e:s})=>te(s)).join(", "),o=x(e).label;return f("details",{className:"min-w-0 overflow-clip rounded-xl border border-border-soft bg-surface/40",children:[f("summary",{className:"flex cursor-pointer select-none list-none items-baseline gap-2 overflow-hidden whitespace-nowrap px-3 py-1.5 [&::-webkit-details-marker]:hidden",children:[d("span",{className:"shrink-0 font-mono text-[11px] text-faint",children:"\u25B8"}),f("span",{className:"shrink-0 text-[12.5px] text-muted",children:[o," \xD7",t.length]}),d("span",{title:t.map(({e:s})=>te(s,!0)).join(", "),className:"min-w-0 flex-1 truncate font-mono text-[11px] text-faint",children:r})]}),d("div",{className:"flex min-w-0 flex-col gap-2.5 px-2 py-2.5",children:t.map(s=>d(oe,{children:n(s)},E(s.e)))})]})},"ReadonlyBatch"),fn=i(({row:e,grouping:t,renderRows:n,renderNode:r})=>{let[o,s]=pn(!1),{label:a,aborted:l,kept:p}=Te(e.nodes,e.startedAt,e.reply.ts);return d(Ae,{label:a,aborted:l,open:o,onToggle:u=>s(u.currentTarget.open),work:()=>n(B(e.nodes,t)),kept:()=>p.map(u=>d(oe,{children:r(u)},E(u.e)))})},"ReadonlyTurnWork"),mn=i(({entries:e,grouping:t="all",completedTurns:n="final",stepsSummary:r="all",clock:o=null,onOpenFile:s,filePaths:a,images:l,onSelectSubagent:p,className:u})=>{let w=re(()=>Ge({onOpenFile:s,filePaths:a,images:l}),[s,a,l]),m=re(()=>j(e),[e]),S=re(()=>Re(m,t,{completedTurns:n}),[m,t,n]),k=t==="tools",T=re(()=>Oe(e),[e]),N=i((g,se)=>{let{e:c}=g,M=he(c,se?.e,T);if(c.subagentLabel){let b=f(gn,{children:[d(cn,{size:14,strokeWidth:1.7,className:"shrink-0 text-faint","aria-hidden":!0}),d("span",{className:"shrink-0 font-medium text-text",children:"Agent"}),d("span",{title:c.subagentLabel,className:"min-w-0 flex-1 truncate text-[11.5px] text-muted",children:c.subagentLabel}),c.error?d("span",{className:"shrink-0 text-[11px] text-del",children:"failed"}):null,c.toolUseId&&p?d("span",{className:"shrink-0 text-[11px] text-faint",children:"Open"}):null]});return d("section",{className:"min-w-0 px-0.5","data-subagent":c.subagentLabel,children:c.toolUseId&&p?d("button",{type:"button",onClick:()=>p(c.toolUseId??null),"aria-label":`Open agent ${c.subagentLabel}`,className:"flex w-full min-w-0 items-center gap-2 rounded-lg py-1 text-left text-[12.5px] transition active:bg-surface-2",children:b}):d("div",{className:"flex min-w-0 items-center gap-2 py-1 text-[12.5px]",children:b})})}if(c.questionAnswer?.evidence==="submitted")return d(Be,{record:c.questionAnswer});if(c.role==="user"){if(T.has(c.id))return d(Ne,{id:c.id,state:c.queued?"queued":void 0});if(h(c)){let b=de(c.text);return d(ve,{notice:b,markdown:ht=>d(_,{components:w,children:ht}),report:b.report?d(_,{components:w,children:b.report}):null,time:d("span",{className:"pr-1 text-[11px] text-faint",children:Z(c.ts,o)})})}return c.origin==="agent"||H(c)?f("div",{className:"flex flex-col items-end gap-0.5","data-automation":c.id,children:[d(Ie,{label:"Automation",children:d("div",{className:"text-[13px] text-muted leading-relaxed",children:d(_,{components:w,children:c.text})})}),M?null:d(Me,{ts:c.ts,clock:o,align:"right"})]}):f("div",{className:"flex flex-col items-end gap-0.5","data-user-msg":X(c.text),"data-msg-ts":c.ts,children:[d(Se,{queued:c.queued,children:d(_,{components:w,children:c.text})}),M?null:d(Me,{ts:c.ts,clock:o,align:"right"})]})}return c.role==="tool"?d(un,{e:c}):c.role==="thinking"&&!k?f("details",{className:"min-w-0 overflow-clip rounded-xl border border-border-soft bg-surface/60",children:[f("summary",{className:"flex cursor-pointer select-none list-none items-baseline gap-2 overflow-hidden whitespace-nowrap px-3 py-1.5 [&::-webkit-details-marker]:hidden",children:[d("span",{className:"shrink-0 font-mono text-[11px] text-faint",children:"\u25B8"}),d("span",{className:"shrink-0 text-[12.5px] text-muted",children:"Thinking"}),d("span",{title:c.text,className:"min-w-0 flex-1 truncate text-[11px] text-faint",children:X(c.text)})]}),d("div",{className:"px-3 py-2 text-[13px] text-muted italic leading-relaxed",children:d(ne,{children:d(_,{components:w,children:c.text})})})]}):c.role==="system"?d(Ee,{children:c.text}):f("div",{className:"flex flex-col items-start gap-0.5 max-md:items-stretch",children:[d(ne,{children:d(_,{components:w,children:c.text})}),M?null:d(Me,{ts:c.ts,clock:o,align:"left"})]})},"renderNode"),C=i((g,se,c)=>{if(g.kind==="work")return d(fn,{row:g,grouping:t,renderRows:b=>b.map(C),renderNode:N},g.key);if(g.kind==="steps")return f("details",{className:"min-w-0 overflow-clip rounded-xl border border-border-soft bg-surface/40",children:[f("summary",{className:"flex cursor-pointer select-none list-none items-baseline gap-2 overflow-hidden whitespace-nowrap px-3 py-1.5 [&::-webkit-details-marker]:hidden",children:[d("span",{className:"shrink-0 font-mono text-[11px] text-faint",children:"\u25B8"}),f("span",{className:"shrink-0 text-[12.5px] text-muted",children:[g.nodes.length," steps"]}),d("span",{title:ee(g.nodes,r),className:"min-w-0 flex-1 truncate text-[11px] text-faint",children:ee(g.nodes,r)})]}),d("div",{className:"flex min-w-0 flex-col gap-2.5 px-2 py-2.5",children:D(g.nodes).map(b=>b.kind==="batch"?d(bt,{tool:b.tool,nodes:b.nodes,renderNode:N},b.key):d(oe,{children:N(b.node)},b.key))})]},g.key);if(g.kind==="batch")return d(bt,{tool:g.tool,nodes:g.nodes,renderNode:N},g.key);let M=c[se+1];return d(oe,{children:N(g.node,M?.kind==="entry"?M.node:void 0)},g.key)},"renderRow");return d("div",{className:I("farero-ui flex min-w-0 flex-col gap-2.5 text-text",u),children:S.map(C)})},"ReadOnlyTranscript");export{$t as ACTIVITY_LAYOUTS,ze as ATTACHED_REPORTS_HEADER,ne as AssistantBody,Ne as AutomaticResend,Ie as AutomationCard,V as Bubble,Gt as COMPLETED_TURNS,ve as DelegationReturnBody,Ht as GROUP_PREVIEWS,Be as QuestionAnswerRecord,W as QuestionContent,_e as QuestionMarkdown,mn as ReadOnlyTranscript,vt as STICKY_TOP,Ee as SystemLine,Ae as TurnWorkFold,Se as UserBody,Oe as automaticResendIds,D as batchLookups,K as browserSignInOf,dt as clockFields,Ft as clockSeconds,J as clockTime,he as continuesMessageMinute,ct as dateStamp,Lt as dateTime,ye as elapsed,Re as foldTurns,jt as groupPreviewAvailable,B as groupSteps,lt as handoffRequestOf,De as isAgentAuthored,H as isAutomaticRetryEntry,h as isDelegationReturnEntry,wt as isRetryOf,A as isTurnPrompt,Qe as isWorkflowReport,Et as latestTurnActionEnd,te as lookupLabel,z as mcpSignInOf,X as messagePreview,Z as messageTime,de as parseDelegationReturn,Y as personCard,ke as repliesBeforeWakes,E as rowKey,at as savedSignInOf,be as shellLookup,St as splitAttachedReports,P as staysVisible,ee as stepSummary,U as stepTitle,He as transcriptSubagents,j as transcriptTree,je as turnActionEnds,le as turnDelegationCount,ce as turnOrigin,Ye as turnOrigins,Te as turnWorkLine,kt as workflowReportPromptIds};
|
|
17
|
+
`)){let r="",o="",s=0;for(let l of F(n)){let p=n.slice(s,l.start);r+=p+l.name,o+=p,s=l.end}let a=n.slice(s);if((o+a).trim())return r+a;t||=r.trim()}return t}i(Dt,"firstWords");function X(e,t=120){let n=Dt(Pe(e).text).replace(/^[\s>#*\-+]+/,"").replace(/`/g,"").replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t-1)}\u2026`:n}i(X,"messagePreview");function ye(e){let t=Math.max(0,Math.floor(e/1e3)),n=t%60,r=Math.floor(t/60)%60,o=Math.floor(t/3600),s=i(a=>String(a).padStart(2,"0"),"pad");return o?`${o}h ${s(r)}m ${s(n)}s`:r?`${r}m ${s(n)}s`:`${n}s`}i(ye,"elapsed");function ct(e,t,n){return`${e.toLocaleDateString(void 0,{month:"short",day:"numeric",...e.getFullYear()===t.getFullYear()?{}:{year:"numeric"}})}, ${J(e,n)}`}i(ct,"dateStamp");function Z(e,t=null){let n=new Date(R(e));if(!Number.isFinite(n.getTime()))return"";let r=new Date;return n.toDateString()===r.toDateString()?J(n,t):ct(n,r,t)}i(Z,"messageTime");var Ut="render_ui";function we(e,t=""){return x(e,t).name===`mcp__farero_host__${Ut}`}i(we,"isGeneratedUiTool");function Wt(e){if(/[$`\r\n<>]/.test(e))return null;let t=[],n="",r=!1,o="",s=i(()=>{r&&t.push({word:n}),n="",r=!1},"flush");for(let a=0;a<e.length;a++){let l=e[a];if(l==="\\"&&o!=="'"){let p=e[++a];if(p===void 0)return null;n+=o==='"'&&p!=='"'&&p!=="\\"?`\\${p}`:p,r=!0}else if(o)l===o?o="":n+=l;else if(l==="'"||l==='"')o=l,r=!0;else if(/\s/.test(l))s();else if(l==="|"||l===";"||l==="&")if(s(),l==="&"){if(e[++a]!=="&")return null;t.push({operator:"&&"})}else t.push({operator:l});else{if(/[(){}#]/.test(l))return null;n+=l,r=!0}}return o?null:(s(),t)}i(Wt,"tokenize");function qt(e){let[t,...n]=e;switch(t){case"rg":return n.some(r=>/^--(?:pre|hostname-bin)(?:=|$)/.test(r))?null:n.includes("--files")?"Glob":"Grep";case"grep":return"Grep";case"ls":return"LS";case"cat":case"head":case"tail":case"nl":case"wc":return"Read";case"sed":{if(n[0]!=="-n")return null;let r=n[1]==="-e"?2:1;return/^\d+(?:,\d+)?p$/.test(n[r]??"")?n.slice(r+1).some(o=>o.startsWith("-"))?null:"Read":null}default:return null}}i(qt,"lookupCommand");function be(e){let t=Wt(Fe(e));if(!t?.length)return null;let n=[],r=null,o=null;for(let s=0;s<=t.length;s++){let a=t[s];if(a&&"word"in a){n.push(a.word);continue}if(n[0]==="cd"&&n.length===2&&a?.operator==="&&"&&!r&&!o){n=[];continue}let l=qt(n);if(!l)return null;if(r??=l,n=[],a?.operator!=="|"){if(o&&o!==r)return null;o=r,r=null}}return o}i(be,"shellLookup");var $t=[{id:"off",label:"Inline"},{id:"tools",label:"Group tools"},{id:"all",label:"Group tools + thinking"}],Gt=[{id:"all",label:"All messages"},{id:"final",label:"Final reply"}],E=i(e=>`${e.rowid}-${e.id}`,"rowKey");function he(e,t,n){if(!t||n?.has(t.id)||e.role!==t.role||!["user","assistant","thinking"].includes(e.role)||e.questionAnswer||t.questionAnswer||e.subagentLabel||t.subagentLabel||h(e)||h(t)||(e.origin??"human")!==(t.origin??"human"))return!1;let r=Math.floor(R(e.ts)/6e4);return Number.isFinite(r)&&r===Math.floor(R(t.ts)/6e4)}i(he,"continuesMessageMinute");var Ht=[{id:"all",label:"All steps"},{id:"latest",label:"Latest step"},{id:"latest-thinking",label:"Latest thinking"}],jt=i((e,t)=>e!=="latest-thinking"||t==="all","groupPreviewAvailable"),Qt=i(e=>e.role==="thinking"?"Thinking":U(e).title,"stepLabel");function ee(e,t="all"){if(t==="all")return[...new Set(e.map(({e:r})=>Qt(r)))].join(", ");if(t==="latest-thinking"){for(let r=e.length-1;r>=0;r--)if(e[r].e.role==="thinking")return e[r].e.text}let n=e[e.length-1];return n?n.e.role==="tool"?U(n.e).title:n.e.text:""}i(ee,"stepSummary");var Vt=new Set(["Read","Grep","Glob","LS"]);function pt(e){if(e.role!=="tool"||!e.tool||e.subagentLabel||ie(e))return null;let{name:t}=x(e.tool);return Vt.has(t)?t:t==="Bash"?be(e.detail??""):null}i(pt,"lookupKind");function U(e){if(e.role!=="tool"||!e.tool)return{title:e.text,server:null};let t=x(e.tool,e.text);return{title:ut(e)??pt(e)??t.label,server:t.server}}i(U,"stepTitle");function ut(e){if(!e.text||!e.tool||e.text===e.tool)return;let t=x(e.tool,e.text);if(x(e.text).name!==t.name&&!(t.name==="Bash"&&e.text==="Run command")&&!(t.name==="Edit"&&e.text==="Edit files"))return e.text===t.label?void 0:e.text}i(ut,"ownTitle");function te(e,t=!1){let n=ut(e);if(n)return n;let r=e.detail??"";return e.tool&&x(e.tool).name==="Bash"?r:!t&&r.startsWith("/")?r.slice(r.lastIndexOf("/")+1):r||e.text}i(te,"lookupLabel");function D(e){let t=[],n=[],r=null,o=i(()=>{if(n.length>1)t.push({kind:"batch",key:`batch-${E(n[0].e)}`,tool:r,nodes:n});else for(let s of n)t.push({kind:"entry",key:E(s.e),node:s});n=[],r=null},"flush");for(let s of e){let a=pt(s.e);if(a){n.length&&r!==a&&o(),r=a,n.push(s);continue}o(),t.push({kind:"entry",key:E(s.e),node:s})}return o(),t}i(D,"batchLookups");function B(e,t="all"){if(t==="off")return D(e);let n=t==="tools",r=[],o=[],s=i(()=>{let l=D(o);l.length===1?r.push(l[0]):l.length&&r.push({kind:"steps",key:`steps-${E(o[0].e)}`,nodes:o}),o=[]},"flush"),a=i(l=>!l.e.subagentLabel&&!ie(l.e)&&!Y(l.e)&&!l.e.app&&!l.e.generatedUi&&!we(l.e.tool??"",l.e.text)&&(l.e.role==="tool"||l.e.role==="thinking"&&!n),"joinsRun");for(let l of e){if(a(l)){o.push(l);continue}s(),r.push({kind:"entry",key:E(l.e),node:l})}return s(),r}i(B,"groupSteps");var ft=i(e=>e.role==="system"&&(!!e.backgroundResult||Ue(e.text)),"isBackgroundEnd"),P=i(e=>e.role==="system"&&!ft(e)||!!e.questionAnswer||!!e.sideQuestion||Y(e)||!!e.app?.call||!!e.generatedUi||e.role==="assistant"&&(!!e.generatedUiStreams||e.text.includes("```farero-ui "))||e.role==="tool"&&we(e.tool??"",e.text),"staysVisible"),mt=i(e=>!P(e)&&(e.role==="thinking"||e.role==="tool"||e.role==="assistant"),"agentWork"),gt=i(e=>e.role==="assistant"&&!P(e)&&!!e.text.trim(),"isReply"),zt=i(e=>!e.queued&&h(e)||ft(e),"isWake");function ke(e){let t=new Set,n=null;for(let{e:r}of e)zt(r)?(n&&t.add(n),n=null):mt(r)&&(n=gt(r)?r:null);return t}i(ke,"repliesBeforeWakes");function Te(e,t,n){let r=ke(e),o=t?R(n)-R(t):Number.NaN,s=le(e.map(a=>a.e));return{label:[o>0?`Worked for ${ye(o)}`:null,s?`${s} delegation${s===1?"":"s"}`:null].filter(Boolean).join(" \xB7 ")||"Show work",aborted:e.filter(a=>!P(a.e)&&a.e.aborted).length,kept:e.filter(a=>P(a.e)||r.has(a.e))}}i(Te,"turnWorkLine");var Kt=5;function Yt(e,t){let n=ke(e),r=i(o=>!P(o)&&!n.has(o),"hidden");return B(e,t).filter(o=>o.kind==="entry"?r(o.node.e):o.nodes.some(({e:s})=>r(s))).length}i(Yt,"hiddenRows");function Re(e,t="all",{completedTurns:n="final",live:r=!1,dispatched:o}={}){if(n==="all")return B(e,t);let s=[],a=r&&o?R(o):Number.NaN,l=0;for(;l<e.length;){let p=l+1;for(;p<e.length&&!A(e[p].e);)p++;let u=e.slice(l,p),w=p===e.length;l=p;let m=u.length-1;for(;m>0&&!gt(u[m].e);)m--;let S=u[0].e,k=u[m].e,T=u.slice(1,m);if(!(A(S)&&m>0&&!u.slice(m+1).some(({e:C})=>mt(C))&&!(r&&(w||R(k.ts)>=a))&&(T.some(({e:C})=>h(C))||Yt(T,t)>=Kt))){s.push(...B(u,t));continue}s.push({kind:"entry",key:E(S),node:u[0]}),s.push({kind:"work",key:`work-${E(T[0].e)}`,nodes:T,reply:k,startedAt:ce(u.map(({e:C})=>C),k,o)}),s.push(...B(u.slice(m),t))}return s}i(Re,"foldTurns");import{ChevronRight as Jt}from"lucide-react";import{jsx as y,jsxs as v}from"react/jsx-runtime";var ne=i(({children:e})=>y("div",{className:"flex flex-col items-start",children:y(V,{className:"max-w-[92%] px-0.5",children:e})}),"AssistantBody"),Se=i(({children:e,queued:t})=>v(V,{className:I("max-w-[85%] bg-accent-soft text-text",t&&"opacity-60"),children:[t?y(L,{as:"div",className:"mb-1",children:"queued"}):null,e]}),"UserBody"),Ne=i(({id:e,state:t,children:n})=>v("div",{className:"flex flex-col items-end gap-0.5","data-automatic-resend":e,children:[y("span",{className:"pr-1 text-[11px] text-muted",children:t==="queued"?"Message queued to send again":t==="sending"?"Sending your message again\u2026":t==="failed"?"Couldn\u2019t send your message again":t==="uncertain"?"Resend delivery unconfirmed":"Sent your message again"}),n]}),"AutomaticResend"),Ie=i(({label:e,children:t})=>v("div",{className:"max-w-[92%] rounded-xl border border-border-soft bg-surface/40 px-3 py-2 text-left",children:[y(L,{as:"div",className:"mb-1",children:e}),t]}),"AutomationCard"),Ee=i(({children:e})=>y("div",{className:"px-2 text-center text-[11px] text-faint",children:e}),"SystemLine"),ve=i(({notice:e,markdown:t,report:n,time:r})=>v("div",{className:"flex flex-col items-end gap-0.5","data-delegation-return":e.title,children:[v("div",{className:"max-w-[92%] rounded-xl border border-border-soft bg-surface/40 px-3 py-2 text-left",children:[y("p",{className:"text-center font-medium text-[12.5px] text-muted",children:e.title}),e.lead?y("div",{className:"mt-1 text-[13px] text-muted",children:t(e.lead)}):null,e.report?y("div",{className:"mt-1 text-[12px]",children:n}):null,e.rest?v("details",{className:"mt-1",children:[y("summary",{className:"cursor-pointer text-[11px] text-faint",children:"Show full preview"}),y("div",{className:"mt-1 text-[13px] text-muted",children:t(e.rest)})]}):null,e.machine?v("details",{className:"mt-1",children:[y("summary",{className:"cursor-pointer text-[11px] text-faint",children:"Investigation details"}),y("p",{className:"mt-1 whitespace-pre-wrap font-mono text-[11px] text-faint",children:e.machine})]}):null]}),r]}),"DelegationReturnBody"),Ae=i(({label:e,aborted:t,open:n,onToggle:r,work:o,kept:s})=>v("div",{className:"flex min-w-0 flex-col gap-2.5 border-border-soft border-b pb-2.5",children:[v("details",{open:n,onToggle:r,className:"group/work min-w-0",children:[v("summary",{className:"flex w-fit max-w-full cursor-pointer select-none list-none items-center gap-1.5 px-0.5 py-1 text-[12.5px] text-muted transition-colors hover:text-text [&::-webkit-details-marker]:hidden",children:[y("span",{className:"tabular-nums",children:e}),t?v("span",{className:"text-faint",children:["\xB7 ",t," aborted"]}):null,y(Jt,{size:14,"aria-hidden":!0,className:"shrink-0 text-faint transition-transform group-open/work:rotate-90 motion-reduce:transition-none"})]}),n?y("div",{className:"mt-2 flex min-w-0 flex-col gap-2.5",children:o()}):null]}),n?null:s()]}),"TurnWorkFold");import{useContext as an,useState as ln}from"react";import{createContext as Xt,useContext as xt,useState as yt}from"react";import Zt from"react-markdown";import en from"remark-breaks";import tn from"remark-gfm";import{jsx as O,jsxs as Ce}from"react/jsx-runtime";var W=Xt({link:i(({children:e})=>O("span",{children:e}),"link"),original:i(e=>O("pre",{className:"whitespace-pre-wrap break-words font-mono text-xs",children:e}),"original")}),nn=[tn,en],rn=i(({node:e,children:t,className:n,...r})=>{let[o,s]=yt(null);return Ce("div",{className:"relative my-2 min-w-0",children:[O("pre",{...r,className:I("m-0 cursor-text select-text pr-10",n),children:t}),e?O(We,{text:$e(e),label:"code",title:"Copy code",size:12,className:"absolute top-1.5 right-1.5 size-6 select-none rounded-md border border-border-soft bg-bg/90 hover:text-text focus-visible:outline-2 focus-visible:outline-accent",onCopyError:()=>s("Could not copy to the clipboard. Try again.")}):null,O(qe,{error:o,onDismiss:()=>s(null)})]})},"QuestionPre"),on=i(e=>xt(W).link(e),"QuestionLink"),sn={a:on,pre:rn},_e=i(({text:e})=>{let[t,n]=yt(!1),r=xt(W);return Ce("div",{className:"md min-w-0 select-text whitespace-normal break-words [&_pre]:max-h-40 [&_pre]:overflow-auto [&_pre]:overscroll-contain",children:[t?r.original(e):O(Zt,{remarkPlugins:nn,allowedElements:["p","em","strong","del","code","pre","a","br","ul","ol","li","blockquote"],unwrapDisallowed:!0,components:sn,children:e.length<=32768?e:e.slice(0,32768)}),e.length>32768?Ce("span",{className:"block text-muted",children:["Preview limited to 32,768 characters."," ",O("button",{type:"button",className:"text-accent underline",onClick:()=>n(!t),children:t?"Formatted preview":"Full original text"})]}):null]})},"QuestionMarkdown");import{jsx as q,jsxs as $}from"react/jsx-runtime";var dn=i(({text:e})=>{let[t,n]=ln(!1),r=an(W);return e.length<=1e3?q("span",{className:"whitespace-pre-wrap break-words text-text",children:e}):$("details",{open:t,onToggle:o=>n(o.currentTarget.open),className:"min-w-0",children:[$("summary",{className:"cursor-pointer whitespace-pre-wrap break-words",children:[e.slice(0,500),"\u2026 (full submitted answer)"]}),t?r.original(e):null]})},"AnswerValue"),Be=i(({record:e})=>$("div",{className:"min-w-0 rounded-lg border border-border-soft px-3 py-2 text-xs",children:[$("p",{className:"mb-1 text-muted",children:[e.provider," \xB7"," ",e.decision==="cancel"?"question cancelled":`answer submitted${e.decision?` \xB7 ${e.decision}`:""}`]}),e.questions.map(t=>$("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1 py-1",children:[q("div",{className:"min-w-0 text-muted",children:q(_e,{text:t.question})}),q("span",{"aria-hidden":"true",children:"\u2192"}),q(dn,{text:t.redacted?"[redacted]":t.values.length?(t.labels??t.values).join(", "):e.decision??"No answer supplied"})]},t.id))]}),"QuestionAnswerRecord");import{Waypoints as cn}from"lucide-react";import{Fragment as oe,useMemo as re,useState as pn}from"react";function wt(e,t){return e.startsWith(`${t.slice(0,80)||"prompt"}-retry`)}i(wt,"isRetryOf");function Oe(e){let t=new Set,n=new Map,r=new Set;for(let o of e){if(o.role!=="user"||t.has(o.id))continue;let s=n.get(o.text)??[];s.some(a=>wt(o.id,a))&&r.add(o.id),s.push(o.id),n.set(o.text,s),t.add(o.id)}return r}i(Oe,"automaticResendIds");import{Fragment as gn,jsx as d,jsxs as f}from"react/jsx-runtime";var Me=i(({ts:e,clock:t,align:n})=>d("span",{className:I("text-[11px] text-faint",n==="right"?"pr-1 text-right":"pl-1"),children:Z(e,t)}),"RowTime"),un=i(({e})=>{if(e.error&&!e.tool)return f("details",{className:"overflow-hidden rounded-xl border border-del/30 bg-del/5 px-3 py-2",children:[d("summary",{className:"cursor-pointer text-del text-xs",children:"Failed tool output"}),d("pre",{className:"mt-2 whitespace-pre-wrap font-mono text-[11.5px] leading-relaxed [overflow-wrap:anywhere]",children:e.text})]});let t=e.detail!==e.text?e.detail:void 0,n=z(e),r=K(e),{title:o,server:s}=U(e),a=e.error?d("span",{className:"ml-auto shrink-0 text-[11px] text-del",children:"failed"}):e.aborted?d("span",{className:"ml-auto shrink-0 text-[11px] text-faint",children:"aborted"}):null;return!t&&!e.output&&!e.images?.length&&!e.outputTruncated?f("div",{className:"flex min-w-0 items-baseline gap-2 overflow-hidden whitespace-nowrap rounded-xl border border-border-soft bg-surface/60 px-3 py-1.5",children:[d("span",{className:"shrink-0 font-mono text-[11px] text-faint",children:"\xB7"}),d("span",{title:o,className:"max-w-full truncate text-[12.5px] text-muted",children:o}),s?f("span",{className:"shrink-0 text-[11px] text-faint",children:["\xB7 ",s]}):null,a]}):f("details",{className:I("min-w-0 overflow-clip rounded-xl border",e.error?"border-del/30 bg-del/5":"border-border-soft bg-surface/60"),children:[f("summary",{className:"flex cursor-pointer select-none list-none items-baseline gap-2 overflow-hidden whitespace-nowrap px-3 py-1.5 [&::-webkit-details-marker]:hidden",children:[d("span",{className:"shrink-0 font-mono text-[11px] text-faint",children:"\u25B8"}),d("span",{title:o,className:"max-w-full truncate text-[12.5px] text-muted",children:o}),s?f("span",{className:"shrink-0 text-[11px] text-faint",children:["\xB7 ",s]}):null,t?d("span",{title:t,className:"min-w-0 flex-1 truncate font-mono text-[11px] text-faint",children:t}):null,a]}),f("div",{className:"flex min-w-0 flex-col gap-2 px-3 py-2",children:[t?d("pre",{className:"whitespace-pre-wrap font-mono text-[11.5px] text-muted leading-relaxed [overflow-wrap:anywhere]",children:t}):null,e.output?f("div",{className:I("min-w-0",t&&"border-border-soft border-t pt-2"),children:[d(L,{as:"div",className:"mb-1",children:e.error?"error":e.aborted?"aborted":e.diff?"changes":"output"}),d("pre",{className:"whitespace-pre-wrap font-mono text-[11.5px] leading-relaxed [overflow-wrap:anywhere]",children:e.output})]}):null,n?f("p",{className:"text-[11px] text-faint",children:["Sign-in required for ",n.servers.join(", "),"."]}):null,r?d("p",{className:"text-[11px] text-faint",children:"Browser sign-in requested."}):null,e.outputTruncated?f("p",{className:"text-[11px] text-faint tabular-nums",children:["Output truncated.",e.outputOriginalBytes?` Original size: ${e.outputOriginalBytes.toLocaleString()} bytes.`:null]}):null,e.images?.length?f("p",{className:"text-[11px] text-faint",children:[e.images.length," image",e.images.length===1?"":"s"," (not shown in preview)"]}):null]})]})},"ReadonlyToolRow"),bt=i(({tool:e,nodes:t,renderNode:n})=>{let r=t.map(({e:s})=>te(s)).join(", "),o=x(e).label;return f("details",{className:"min-w-0 overflow-clip rounded-xl border border-border-soft bg-surface/40",children:[f("summary",{className:"flex cursor-pointer select-none list-none items-baseline gap-2 overflow-hidden whitespace-nowrap px-3 py-1.5 [&::-webkit-details-marker]:hidden",children:[d("span",{className:"shrink-0 font-mono text-[11px] text-faint",children:"\u25B8"}),f("span",{className:"shrink-0 text-[12.5px] text-muted",children:[o," \xD7",t.length]}),d("span",{title:t.map(({e:s})=>te(s,!0)).join(", "),className:"min-w-0 flex-1 truncate font-mono text-[11px] text-faint",children:r})]}),d("div",{className:"flex min-w-0 flex-col gap-2.5 px-2 py-2.5",children:t.map(s=>d(oe,{children:n(s)},E(s.e)))})]})},"ReadonlyBatch"),fn=i(({row:e,grouping:t,renderRows:n,renderNode:r})=>{let[o,s]=pn(!1),{label:a,aborted:l,kept:p}=Te(e.nodes,e.startedAt,e.reply.ts);return d(Ae,{label:a,aborted:l,open:o,onToggle:u=>s(u.currentTarget.open),work:()=>n(B(e.nodes,t)),kept:()=>p.map(u=>d(oe,{children:r(u)},E(u.e)))})},"ReadonlyTurnWork"),mn=i(({entries:e,grouping:t="all",completedTurns:n="final",stepsSummary:r="all",clock:o=null,onOpenFile:s,filePaths:a,images:l,onSelectSubagent:p,className:u})=>{let w=re(()=>Ge({onOpenFile:s,filePaths:a,images:l}),[s,a,l]),m=re(()=>j(e),[e]),S=re(()=>Re(m,t,{completedTurns:n}),[m,t,n]),k=t==="tools",T=re(()=>Oe(e),[e]),N=i((g,se)=>{let{e:c}=g,M=he(c,se?.e,T);if(c.subagentLabel){let b=f(gn,{children:[d(cn,{size:14,strokeWidth:1.7,className:"shrink-0 text-faint","aria-hidden":!0}),d("span",{className:"shrink-0 font-medium text-text",children:"Agent"}),d("span",{title:c.subagentLabel,className:"min-w-0 flex-1 truncate text-[11.5px] text-muted",children:c.subagentLabel}),c.error?d("span",{className:"shrink-0 text-[11px] text-del",children:"failed"}):null,c.toolUseId&&p?d("span",{className:"shrink-0 text-[11px] text-faint",children:"Open"}):null]});return d("section",{className:"min-w-0 px-0.5","data-subagent":c.subagentLabel,children:c.toolUseId&&p?d("button",{type:"button",onClick:()=>p(c.toolUseId??null),"aria-label":`Open agent ${c.subagentLabel}`,className:"flex w-full min-w-0 items-center gap-2 rounded-lg py-1 text-left text-[12.5px] transition active:bg-surface-2",children:b}):d("div",{className:"flex min-w-0 items-center gap-2 py-1 text-[12.5px]",children:b})})}if(c.questionAnswer?.evidence==="submitted")return d(Be,{record:c.questionAnswer});if(c.role==="user"){if(T.has(c.id))return d(Ne,{id:c.id,state:c.queued?"queued":void 0});if(h(c)){let b=de(c.text);return d(ve,{notice:b,markdown:ht=>d(_,{components:w,children:ht}),report:b.report?d(_,{components:w,children:b.report}):null,time:d("span",{className:"pr-1 text-[11px] text-faint",children:Z(c.ts,o)})})}return c.origin==="agent"||c.parentToolUseId||H(c)?f("div",{className:"flex flex-col items-end gap-0.5","data-automation":c.id,children:[d(Ie,{label:c.parentToolUseId?"Assignment":"Automation",children:d("div",{className:"text-[13px] text-muted leading-relaxed",children:d(_,{components:w,children:c.text})})}),M?null:d(Me,{ts:c.ts,clock:o,align:"right"})]}):f("div",{className:"flex flex-col items-end gap-0.5","data-user-msg":X(c.text),"data-msg-ts":c.ts,children:[d(Se,{queued:c.queued,children:d(_,{components:w,children:c.text})}),M?null:d(Me,{ts:c.ts,clock:o,align:"right"})]})}return c.role==="tool"?d(un,{e:c}):c.role==="thinking"&&!k?f("details",{className:"min-w-0 overflow-clip rounded-xl border border-border-soft bg-surface/60",children:[f("summary",{className:"flex cursor-pointer select-none list-none items-baseline gap-2 overflow-hidden whitespace-nowrap px-3 py-1.5 [&::-webkit-details-marker]:hidden",children:[d("span",{className:"shrink-0 font-mono text-[11px] text-faint",children:"\u25B8"}),d("span",{className:"shrink-0 text-[12.5px] text-muted",children:"Thinking"}),d("span",{title:c.text,className:"min-w-0 flex-1 truncate text-[11px] text-faint",children:X(c.text)})]}),d("div",{className:"px-3 py-2 text-[13px] text-muted italic leading-relaxed",children:d(ne,{children:d(_,{components:w,children:c.text})})})]}):c.role==="system"?d(Ee,{children:c.text}):f("div",{className:"flex flex-col items-start gap-0.5 max-md:items-stretch",children:[d(ne,{children:d(_,{components:w,children:c.text})}),M?null:d(Me,{ts:c.ts,clock:o,align:"left"})]})},"renderNode"),C=i((g,se,c)=>{if(g.kind==="work")return d(fn,{row:g,grouping:t,renderRows:b=>b.map(C),renderNode:N},g.key);if(g.kind==="steps")return f("details",{className:"min-w-0 overflow-clip rounded-xl border border-border-soft bg-surface/40",children:[f("summary",{className:"flex cursor-pointer select-none list-none items-baseline gap-2 overflow-hidden whitespace-nowrap px-3 py-1.5 [&::-webkit-details-marker]:hidden",children:[d("span",{className:"shrink-0 font-mono text-[11px] text-faint",children:"\u25B8"}),f("span",{className:"shrink-0 text-[12.5px] text-muted",children:[g.nodes.length," steps"]}),d("span",{title:ee(g.nodes,r),className:"min-w-0 flex-1 truncate text-[11px] text-faint",children:ee(g.nodes,r)})]}),d("div",{className:"flex min-w-0 flex-col gap-2.5 px-2 py-2.5",children:D(g.nodes).map(b=>b.kind==="batch"?d(bt,{tool:b.tool,nodes:b.nodes,renderNode:N},b.key):d(oe,{children:N(b.node)},b.key))})]},g.key);if(g.kind==="batch")return d(bt,{tool:g.tool,nodes:g.nodes,renderNode:N},g.key);let M=c[se+1];return d(oe,{children:N(g.node,M?.kind==="entry"?M.node:void 0)},g.key)},"renderRow");return d("div",{className:I("farero-ui flex min-w-0 flex-col gap-2.5 text-text",u),children:S.map(C)})},"ReadOnlyTranscript");export{$t as ACTIVITY_LAYOUTS,ze as ATTACHED_REPORTS_HEADER,ne as AssistantBody,Ne as AutomaticResend,Ie as AutomationCard,V as Bubble,Gt as COMPLETED_TURNS,ve as DelegationReturnBody,Ht as GROUP_PREVIEWS,Be as QuestionAnswerRecord,W as QuestionContent,_e as QuestionMarkdown,mn as ReadOnlyTranscript,vt as STICKY_TOP,Ee as SystemLine,Ae as TurnWorkFold,Se as UserBody,Oe as automaticResendIds,D as batchLookups,K as browserSignInOf,dt as clockFields,Ft as clockSeconds,J as clockTime,he as continuesMessageMinute,ct as dateStamp,Lt as dateTime,ye as elapsed,Re as foldTurns,jt as groupPreviewAvailable,B as groupSteps,lt as handoffRequestOf,De as isAgentAuthored,H as isAutomaticRetryEntry,h as isDelegationReturnEntry,wt as isRetryOf,A as isTurnPrompt,Qe as isWorkflowReport,Et as latestTurnActionEnd,te as lookupLabel,z as mcpSignInOf,X as messagePreview,Z as messageTime,de as parseDelegationReturn,Y as personCard,ke as repliesBeforeWakes,E as rowKey,at as savedSignInOf,be as shellLookup,St as splitAttachedReports,P as staysVisible,ee as stepSummary,U as stepTitle,He as transcriptSubagents,j as transcriptTree,je as turnActionEnds,le as turnDelegationCount,ce as turnOrigin,Ye as turnOrigins,Te as turnWorkLine,kt as workflowReportPromptIds};
|