typebulb 0.62.3 → 0.62.4
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/README.md +1 -1
- package/SKILL.md +3 -3
- package/dist/agents/claude/client.js +1 -1
- package/dist/agents/codex/client.js +37 -37
- package/dist/agents/pi/client.js +1 -1
- package/dist/index.js +235 -235
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -324,7 +324,7 @@ The host owns light/dark; you style for both.
|
|
|
324
324
|
- **A bulb's working files land beside it automatically** — relative `tb.fs` paths resolve to the bulb's folder, in `code.tsx` and `server.ts` alike: `tb.fs.write('run.json')`, no path prefix, no mkdir.
|
|
325
325
|
- **Images & media: an `assets/` subfolder of the bulb's folder** (`birds.bulb.md` → `birds/assets/robin.png`) — `<img src="assets/robin.png">` just works (always that relative form, never `/assets/…`), every tier except inline. It holds what the bulb ships in order to run (e.g. images), never results.
|
|
326
326
|
- **See what's already running** — `typebulb logs` with no argument lists every running bulb and mirror; check it before launching anything.
|
|
327
|
-
- **Checking on sub-agents you spawned** — `typebulb status` is your session's overview (what's running, failure streaks, files to check before `git add`), and `typebulb status <id>` one agent's; run it before committing. Arm `typebulb babysit` in the background when you fan out (Claude Code: `run_in_background`; Codex: experimental, may need elevated permissions): it exits with a line when an agent needs you, so handle it and arm it again.
|
|
327
|
+
- **Checking on sub-agents you spawned** — `typebulb status` is your session's overview (what's running, failure streaks, files to check before `git add`), and `typebulb status <id>` one agent's; run it before committing. Arm `typebulb babysit` in the background when you fan out (Claude Code: `run_in_background`; Codex: experimental, may need elevated permissions): it exits with a line when an agent needs you, so handle it and arm it again. Brief their checks unpiped or after `set -o pipefail`: a run piped into `tail` exits with `tail`'s code, so neither can see it fail.
|
|
328
328
|
- **Self-testing a local bulb** — To confirm a bulb works, run it, instrument with `tb.log(...)`, and read it back with `typebulb logs`. That's the loop to verify behaviour without asking the user to copy-paste console output. `tb.fs.write(...)` is handy for dumping large outputs.
|
|
329
329
|
- **Self-testing client code** — gate checks behind `tb.onMessage(m => { if (m === 'selftest') return run() })`, trigger with `typebulb send <file> selftest --wait`, and assert on the JSON reply — see [Interrogating the live page](#interrogating-the-live-page).
|
|
330
330
|
- **Probe handlers go in the first draft** — the selftest, readback, and set handlers you'll want later: adding one is an edit, and that hot reload destroys the very state you meant to inspect.
|
package/SKILL.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: typebulb
|
|
3
3
|
description: "Author and run Typebulb bulbs — single-file markdown apps (TypeScript/TSX) that run locally via `npx typebulb` (full power: filesystem, database, `server.ts`, `tb.ai`) or render live inline in your coding agent's session through Typebulb's agent mirror (sandboxed, client-only). A bulb can be a visual widget (chart, simulation, diagram, calculator, UI), a full-stack tool with a Node backend, or an AI app that calls models at runtime. Covers the bulb format, the `tb.*` API, trust, and the local run/inline workflow. Use when the user wants a bulb, a quick local tool (visual, backend-backed, or AI-powered), or something visual rendered inline in the conversation."
|
|
4
|
-
version: 0.62.
|
|
4
|
+
version: 0.62.4
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
> Generated from typebulb v0.62.
|
|
7
|
+
> Generated from typebulb v0.62.4. `npx typebulb agent` prints the running version alongside the path to its packaged SKILL.md: if that version is newer than this one, replace this file with that one.
|
|
8
8
|
|
|
9
9
|
# typebulb
|
|
10
10
|
|
|
@@ -332,7 +332,7 @@ The host owns light/dark; you style for both.
|
|
|
332
332
|
- **A bulb's working files land beside it automatically** — relative `tb.fs` paths resolve to the bulb's folder, in `code.tsx` and `server.ts` alike: `tb.fs.write('run.json')`, no path prefix, no mkdir.
|
|
333
333
|
- **Images & media: an `assets/` subfolder of the bulb's folder** (`birds.bulb.md` → `birds/assets/robin.png`) — `<img src="assets/robin.png">` just works (always that relative form, never `/assets/…`), every tier except inline. It holds what the bulb ships in order to run (e.g. images), never results.
|
|
334
334
|
- **See what's already running** — `typebulb logs` with no argument lists every running bulb and mirror; check it before launching anything.
|
|
335
|
-
- **Checking on sub-agents you spawned** — `typebulb status` is your session's overview (what's running, failure streaks, files to check before `git add`), and `typebulb status <id>` one agent's; run it before committing. Arm `typebulb babysit` in the background when you fan out (Claude Code: `run_in_background`; Codex: experimental, may need elevated permissions): it exits with a line when an agent needs you, so handle it and arm it again.
|
|
335
|
+
- **Checking on sub-agents you spawned** — `typebulb status` is your session's overview (what's running, failure streaks, files to check before `git add`), and `typebulb status <id>` one agent's; run it before committing. Arm `typebulb babysit` in the background when you fan out (Claude Code: `run_in_background`; Codex: experimental, may need elevated permissions): it exits with a line when an agent needs you, so handle it and arm it again. Brief their checks unpiped or after `set -o pipefail`: a run piped into `tail` exits with `tail`'s code, so neither can see it fail.
|
|
336
336
|
- **Self-testing a local bulb** — To confirm a bulb works, run it, instrument with `tb.log(...)`, and read it back with `typebulb logs`. That's the loop to verify behaviour without asking the user to copy-paste console output. `tb.fs.write(...)` is handy for dumping large outputs.
|
|
337
337
|
- **Self-testing client code** — gate checks behind `tb.onMessage(m => { if (m === 'selftest') return run() })`, trigger with `typebulb send <file> selftest --wait`, and assert on the JSON reply — see [Interrogating the live page](#interrogating-the-live-page).
|
|
338
338
|
- **Probe handlers go in the first draft** — the selftest, readback, and set handlers you'll want later: adding one is an edit, and that hot reload destroys the very state you meant to inspect.
|
|
@@ -2192,7 +2192,7 @@ ${sSt(b)}`};let v=nSt(h.code,{jsxImportSource:p.ts?.jsxImportSource});if(v.error
|
|
|
2192
2192
|
`).map(v=>v.replace(/\r$/,""));if(a.length&&a[a.length-1]===""&&a.pop(),s)return a.map(v=>({kind:"add",text:v}));let h=[],p=!1,b=!1;for(let v of a){if(v.startsWith("@@")){b&&h.push({kind:"gap",text:"\u22EF"}),b=!0,p=!0;continue}if(!p){v.startsWith("Binary file")&&h.push({kind:"ctx",text:v});continue}v.startsWith("\\")||(v.startsWith("+")?h.push({kind:"add",text:v.slice(1)}):v.startsWith("-")?h.push({kind:"del",text:v.slice(1)}):h.push({kind:"ctx",text:v.slice(1)}))}return h}function G5n(o,s,a){let h=q5n(o,s),p=o.length>H5n?"txt":a.split(".").pop()??"",b=[],v=[];for(let P of h)(P.kind==="ctx"||P.kind==="del")&&b.push(P.text),(P.kind==="ctx"||P.kind==="add")&&v.push(P.text);let w=dEe(b.join(`
|
|
2193
2193
|
`),p),S=dEe(v.join(`
|
|
2194
2194
|
`),p),T=0,D=0,B=[];for(let P of h){if(P.kind==="gap"){B.push('<div class="udiff-gap">\u22EF</div>');continue}let F=P.kind==="del"?w[T++]:(P.kind==="add"||T++,S[D++]);B.push(`<div class="udiff-line${P.kind==="add"?" udiff-add":P.kind==="del"?" udiff-del":""}">${F??""}</div>`)}return{kinds:h.map(P=>P.kind),bodyHtml:B.join("")}}var cie=class extends iw{files=[];repo=!0;root="";viewing;#e=0;#t=!1;#n=()=>document.getElementById(bEe);#r=new lte(this.#n);#s=[];#i=-1;keepOpenSelector=".gitdiff-wrap";filterId="gitdiff-filter";listSelector=".gitdiff-list";onActivate(s){let a=this.rows()[s];a&&this.openDiff(a)}onAttached(){this.refreshFiles(),setInterval(()=>this.refreshFiles(),3e3),setInterval(()=>{this.viewing&&this.refreshDiff()},1500)}rows(){let s=this.filter.trim().toLowerCase();return s?this.files.filter(a=>a.path.toLowerCase().includes(s)):this.files}async refreshFiles(){try{let{repo:s,root:a,files:h}=await tb.server.gitChangedFiles(),p=s!==this.repo||h.length!==this.files.length||h.some((b,v)=>{let w=this.files[v];return b.path!==w?.path||b.status!==w.status||b.add!==w.add||b.del!==w.del||b.binary!==w.binary});this.repo=s,this.root=a,this.files=h,p&&(this.update(),this.keepBottom())}catch(s){console.error("[mirror] gitChangedFiles failed",s)}}#o(s,a,h){this.viewing?.path!==s&&(this.#s=[]),this.viewing={path:s,status:a,text:h.text,truncated:!!h.truncated,...G5n(h.text,!!h.untracked,s)},this.#e++,this.update()}async openDiff(s){try{let a=await tb.server.gitDiff(s.path);if(!a.ok){console.error("[mirror] gitDiff failed:",a.error);return}this.#o(s.path,s.status,a),this.#t=!0,this.close()}catch(a){console.error("[mirror] gitDiff failed",a)}}async refreshDiff(){let s=this.viewing;if(s)try{let a=await tb.server.gitDiff(s.path);if(this.viewing!==s||!a.ok||a.text===s.text)return;this.#o(s.path,s.status,a)}catch(a){console.error("[mirror] gitDiff refresh failed",a)}}closeDoc(){this.#r.release(),this.viewing=void 0,this.update()}show(){this.beginOpen(),this.refreshFiles(),this.refreshList(),this.armClose(),this.focusFilter()}view(){let s=this.files.length;return!this.repo||s===0&&!this.viewing&&!this.open?tt({class:"gitdiff-wrap"}):tt({class:"gitdiff-wrap pop-center"},this.viewing?this.viewingPill():Ao({class:["pill","glyph","gitdiff-pill",this.open?"on":""],"data-tip":`${s} changed file${s===1?"":"s"} \u2014 view a diff`,ariaLabel:`${s} changed file${s===1?"":"s"}`,onClick:a=>{a.stopPropagation(),this.open?this.close():this.show()}},rw("diff"),Vt({class:"gitdiff-count"},String(s))),this.open?this.popup():null)}viewingPill(){let s=this.viewing,a=s.kinds.filter(p=>p==="add").length,h=s.kinds.filter(p=>p==="del").length;return Ao({class:["pill","glyph","gitdiff-pill","viewing","on"],"data-tip":`${this.files.length} changed file${this.files.length===1?"":"s"} \u2014 switch file`,onClick:p=>{p.stopPropagation(),this.open?this.close():this.show()}},Vt({class:["gitdiff-status",`s-${s.status}`]},s.status),Vt({class:"gitdiff-doc-path",title:`Open ${s.path}`,onClick:p=>{p.stopPropagation(),tb.server.openFile(`${this.root}/${s.path}`)}},s.path),Vt({class:"gitdiff-counts"},Vt({class:"count-add"},`+${a}`),Vt({class:"count-del"},`\u2212${h}`)),ite(()=>this.closeDoc()))}popup(){let s=this.rows();return tt({class:"servers-pop gitdiff-pop"},s.length===0?this.emptyState("No changes in the working tree."):tt({class:"gitdiff-list",onScroll:()=>this.onListScroll()},s.map((a,h)=>this.row(a,h))),this.filterBox(this.files.length,"file"))}row(s,a){return tt({class:["gitdiff-row",a===this.highlighted?"active":"",this.viewing?.path===s.path?"viewing":""],onMouseEnter:()=>{this.highlighted!==a&&(this.highlighted=a,this.update())},onClick:h=>{h.stopPropagation(),this.openDiff(s)}},Vt({class:["gitdiff-status",`s-${s.status}`]},s.status),Vt({class:"gitdiff-path",title:s.path},s.path),s.add!==void 0||s.del!==void 0?Vt({class:"gitdiff-counts"},Vt({class:"count-add"},`+${s.add??0}`),Vt({class:"count-del"},`\u2212${s.del??0}`)):s.status==="U"?Vt({class:"gitdiff-counts"},Vt({class:"count-add"},"new")):Vt({class:"gitdiff-counts"},Vt({},s.binary?"binary":"\u2014")))}docView(){let s=this.viewing;return tt({class:"diff-doc",onKeyDown:a=>{a.key==="Escape"&&(a.stopPropagation(),this.closeDoc())}},tt({class:"diff-doc-scroll"},tt({class:"diff-doc-body",id:bEe,tabIndex:0,onMounted:a=>a.focus(),onScroll:()=>this.#r.sync()},s.kinds.length===0?tt({class:"diff-doc-empty"},"No changes."):tt({class:"diff-doc-code",key:`diff-code-${this.#e}`,onMounted:a=>{a.innerHTML=s.bodyHtml,this.#c(a),this.#u(a)}},""),s.truncated?tt({class:"diff-doc-trunc"},"Diff truncated \u2014 file too large to show in full."):null),s.kinds.length?this.#r.view(this.#s,{class:"diff-ruler",title:"Jump to a change",label:"Diff scroll position",controls:bEe}):null))}#c(s){if(!this.#t)return;this.#t=!1;let a=s.querySelector(".udiff-add, .udiff-del"),h=this.#n();a&&h&&(h.scrollTop=a.offsetTop-h.clientHeight/3)}#u(s){this.#i!==this.#e&&(this.#i=this.#e,requestAnimationFrame(()=>{this.#f(s),this.update(),this.#r.sync()}))}#f(s){let a=this.viewing,h=this.#n();if(!a||!h?.scrollHeight)return;let p=h.scrollHeight,b=[];for(let v=0;v<a.kinds.length;v++){let w=a.kinds[v];if(w!=="add"&&w!=="del")continue;let S=v;for(;S+1<a.kinds.length&&a.kinds[S+1]===w;)S++;let T=s.children[v],D=s.children[S];T&&D&&b.push({top:T.offsetTop/p,height:(D.offsetTop+D.offsetHeight-T.offsetTop)/p,class:w}),v=S}this.#s=b}};async function mEe(o){try{return await navigator.clipboard.writeText(o),!0}catch{}let s=document.createElement("textarea");s.value=o,s.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(s),s.select();try{return document.execCommand("copy")}catch{return!1}finally{s.remove()}}var oD=class extends Wu{done=!1;#e;constructor(s){super(),this.#e=s}setText(s){this.#e=s}flash(){mEe(this.#e),this.done=!0,this.update(),setTimeout(()=>{this.done=!1,this.update()},600)}view(){return Ao({class:["overlay-pill","copy",this.done?"done":""],onClick:s=>{s.stopPropagation(),this.flash()}},this.done?"copied":"copy")}};var wTt=".typebulb/paste",ATt={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp"},GC=o=>o.label||o.kind||"agent",wEe=o=>o.failing&&o.state!=="stopped"?"failing":o.state,AEe=o=>`Open this ${o.kind?`${o.kind} `:""}agent's transcript`;var vTt=8,yTt=30,Q5n=3*6e4;var uie=o=>new Date(o).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});var vEe=o=>[o.runs?`${o.runs} run, ${o.failed} failed`:"",yEe(o)].filter(Boolean).join(", ")||"none",yEe=o=>o.lookups?`${o.lookups} ${o.lookups===1?"lookup":"lookups"}`:"";var xTt=o=>o.open.filter(s=>!s.interrupted);var ETt=(o,s)=>o.state==="running"?Math.max(0,s-o.asOf):0,CTt=(o,s)=>o.activeMs+ETt(o,s);function J5n(o,s){let a=o.state==="finished"?xTt(o).filter(h=>h.background):[];return a.length?`finished, background call running ${Sl(s-(a[0].at??s))}${a.length>1?` (+${a.length-1} more)`:""}`:o.state}var kEe=(o,s)=>({state:J5n(o,s),active:`${Sl(CTt(o,s))} active`,idle:o.idleMs?`${Sl(o.idleMs)} idle`:""}),U5n=(o,s)=>{let a=kEe(o,s);return[a.state,a.active,a.idle].filter(Boolean).join(" \xB7 ")},kTt=(o,s)=>o.interrupted?`${o.label}: interrupted, its process has ended`:`${o.label}, ${Sl(s-(o.at??s))}${o.background?" (background)":""}`,z5n=(o,s)=>`nothing open, last entry ${Sl(s-o.asOf)} ago`;function K5n(o,s){if(!o.open.length)return[`Now: ${z5n(o,s)}`,...o.latest?[`Latest: ${o.latest.label} \xB7 ${hie(o.latest.run)}${o.latest.run.ms!==void 0?` after ${Sl(o.latest.run.ms)}`:""}`]:[]];let a=(h,p)=>h.said?[`${p}"${h.said}"`]:[];return o.open.length===1?[`Now: ${kTt(o.open[0],s)}`,...a(o.open[0]," ")]:["Now:",...o.open.flatMap(h=>[` ${kTt(h,s)}`,...a(h," ")])]}function W5n(o,s){let a=o.latest;return`latest: ${a.interrupted?"interrupted":a.open?`running ${Sl(s-(a.at??s))}`:`${hie(a)}${a.ms!==void 0?` after ${Sl(a.ms)}`:""}`}${o.streak>=2?`, failed ${o.streak} in a row`:""}`}function STt(o,s){let a=[`Sub-agent "${o.name}" (${o.id}): ${U5n(o,s)}${o.asOf?` \xB7 as of ${uie(o.asOf)}`:""}`,""];a.push(...K5n(o,s));let h=o.commands;a.push(`Commands: ${vEe(h)}`);let{shown:p,more:b}=CEe(h);for(let S of p){let T=fie(S);a.push(` ${S.cmd} \xD7${S.runs}${S.failed?`, ${S.failed} failed`:""}${T?` \xB7 ${T}`:""}`,` ${W5n(S,s)}`);let D=[S.latest.first,S.latest.last].filter(Boolean).map(B=>`"${B}"`).join(" \u2026 ");D&&a.push(` ${D}`)}b&&a.push(` ${SEe(b)}`),aie(h).runs&&a.push(` ${lie(h)}`),o.activeMs&&a.push(`Time: ${Y5n(o,s)}`),o.narration.length&&a.push("Narration:",...o.narration.map(S=>` ${S}`)),a.push(`Files written: ${xEe(o)}`);for(let S of o.files){let T=S.also.length?` also ${X5n(S)}`:"";a.push(` ${die(S)}${S.ignored?" (ignored)":S.committed?" (committed)":""}${T}`,...S.blind.map(D=>` ${D}`))}let{shown:v,earlier:w}=IEe(o);return a.push(`Files read: ${o.read.length||"none"}`,...w?[` +${w} earlier`]:[],...v.map(S=>` ${V5n(S)}`)),a.join(`
|
|
2195
|
-
`)}var xEe=o=>{let s=o.files.filter(a=>!a.committed&&!a.ignored).length;return o.files.length?`${o.files.length} (${s} uncommitted)`:"none"};function EEe(o,s){let a=o.toolMs+(xTt(o).some(h=>!h.background)?ETt(o,s):0);return{tools:a,model:Math.max(0,CTt(o,s)-a)}}var Y5n=(o,s)=>{let a=EEe(o,s);return`${Sl(a.tools)} in tools, ${Sl(a.model)} in the model`},X5n=o=>o.also.map(s=>`"${s.name}" ${uie(s.at)}`).join(", "),ITt=o=>o.failed>0||o.long||o.runs>=3||o.tags.length>0,CEe=o=>{let s=o.groups.filter(ITt);return{shown:s.slice(0,vTt),more:Math.max(0,s.length-vTt)}},SEe=o=>`+${o} more like these`,aie=o=>{let s=o.groups.filter(a=>!ITt(a));return{runs:s.reduce((a,h)=>a+h.runs-h.open,0),ms:s.reduce((a,h)=>a+h.ms,0)}},lie=(o,s=!0)=>{let a=aie(o);return`${a.runs}${s?" other":""} ${a.runs===1?"run":"runs"} passed, ${Sl(a.ms)} in all`},fie=o=>[...o.tags,o.long?`over ${Sl(Q5n)}`:""].filter(Boolean).join(", ");var hie=o=>o.outcome&&o.outcome!=="completed"&&o.outcome!=="failed"&&o.exit===void 0?o.outcome:o.exit!==void 0?`exit ${o.exit}`:o.failed?"error":"ok",die=o=>o.deleted?`${o.path} (deleted)`:o.from?`${o.path} (moved from ${o.from})`:o.path,V5n=o=>o.times>1?`${o.path} \xD7${o.times}`:o.path,IEe=o=>({shown:o.read.slice(-yTt),earlier:Math.max(0,o.read.length-yTt)});var Edr=5*6e4,Cdr=10*6e4,Sdr=2*6e4;var Z5n=2e3,TEe=(o="cs-list",s="none")=>tt({class:o},tt({class:"cs-item cs-dim"},s)),TTt=o=>s=>{s.preventDefault(),tb.server.openFile(o)},_Ee=o=>`\u200E${o}\u200E`,pie=class extends Wu{open=!1;#e=null;#t="";#n="";#r=!1;#s=0;#i;bind(s){this.#i=s}toggle(){this.open=!this.open,this.sync(),this.#i?.onChange()}show(s){this.open=s,this.#e=null,this.#t="",this.#s=0,this.sync()}async sync(){let s=this.#i?.id();if(!(!this.open||!s||this.#r||Date.now()-this.#s<Z5n)){this.#r=!0;try{let a=await tb.server.childStatus(s);s===this.#i?.id()&&(a?.ok?(this.#e=a.report,this.#t=""):this.#t=a?.error??"could not read its status")}catch{this.#t="could not read its status"}this.#r=!1,this.#s=Date.now(),this.#i?.onChange()}}view(){let s=this.#e;if(!s)return tt({class:"messages child-status",key:"child-status"},tt({class:"child-status-pending"},this.#t||"Loading\u2026"));let a=Date.now();return tt({class:"messages child-status",key:"child-status"},this.#f(s,a),this.#l(s,a),this.#a(s,a),this.#m(s),this.#p(s),this.#g(s),tt({class:"child-status-foot"},this.#t?tt({class:"child-status-note err"},this.#t):null,tt({class:"child-status-actions"},lg({onClick:h=>{h.preventDefault(),this.#o(s)}},this.#n||"Copy Status"),lg({onClick:h=>{h.preventDefault(),this.toggle()}},"Raw Transcript"))))}async#o(s){this.#n=await mEe(STt(s,Date.now()))?"Copied":"Copy failed",setTimeout(()=>{this.#n="",this.#i?.onChange()},1500),this.#i?.onChange()}#c(s){this.open=!1,this.#i?.reveal(s)}#u(s,a){return lg({class:"cs-mono cs-link",title:"Show in the transcript",onClick:h=>{h.preventDefault(),this.#c(s)}},a)}#f(s,a){let h=EEe(s,a),p=kEe(s,a);return tt({class:"cs-header"},tt({class:"cs-title"},s.name),tt({class:["cs-subtitle",s.state==="failing"?"cs-bad":""]},tt({class:"cs-tile"},Vt({class:["children-dot",s.state==="finished"?"done":s.state]}),p.state),tt({class:"cs-tile"},p.active,s.activeMs?[Vt({class:"cs-tile-rule"}),Vt({class:"cs-time"},Vt(`${Sl(h.tools)} tools`),Vt(`${Sl(h.model)} model`))]:null),p.idle?tt({class:"cs-tile",title:"Time it sat finished, waiting for a message to wake it. Not counted in active time."},p.idle):null,s.asOf?tt({class:"cs-tile"},`last entry ${Sl(a-s.asOf)} ago`):null))}#l(s,a){let h=s.latest,p=[...s.open.map(b=>tt({class:"cs-item"},tt({class:"cs-item-main"},this.#u(b.id,b.label),tt({class:"cs-item-meta"},b.interrupted?Vt({class:"cs-pill bad"},"interrupted"):Vt({class:"cs-pill run"},`running ${Sl(a-(b.at??a))}`),b.background&&!b.interrupted?Vt({class:"cs-pill"},"background"):null)),b.said?tt({class:"cs-item-sub cs-mono"},b.said):null)),h?tt({class:"cs-item"},tt({class:"cs-item-main"},this.#u(h.id,h.label),tt({class:"cs-item-meta"},this.#h(h.run),h.run.ms!==void 0?Vt({class:"cs-dim"},Sl(h.run.ms)):null))):null].filter(Boolean);return p.length?tt({class:"cs-section"},tt({class:"cs-h"},"Now"),tt({class:"cs-list"},p)):null}#h(s){let a=hie(s);return Vt({class:["cs-pill",s.failed?"bad":a==="ok"||a.startsWith("exit")?"ok":""]},a)}#a(s,a){let h=s.commands,{shown:p,more:b}=CEe(h),v=aie(h);return p.length?tt({class:"cs-section"},tt({class:"cs-h"},"Commands",Vt({class:"cs-count"},vEe(h))),tt({class:"cs-list"},p.map(w=>{let S=[w.latest.first,w.latest.last].filter(Boolean);return tt({class:"cs-item"},tt({class:"cs-item-main"},this.#u(w.latest.id,w.cmd),this.#d(w,a)),S.length?tt({class:"cs-item-sub cs-mono"},S.map((T,D)=>[D?Vt({class:"cs-dim"}," \u2026 "):null,T])):null)})),b?tt({class:"cs-more"},SEe(b)):null,v.runs?tt({class:"cs-more"},lie(h)):null):tt({class:"cs-section"},tt({class:"cs-h"},"Commands"),TEe("cs-list",[v.runs?lie(h,!1):"",yEe(h)].filter(Boolean).join(", ")||"none"))}#d(s,a){let h=s.latest,p=h.interrupted?Vt({class:"cs-pill bad"},"interrupted"):h.open?Vt({class:"cs-pill run"},`running ${Sl(a-(h.at??a))}`):this.#h(h);return tt({class:"cs-item-meta"},p,!h.open&&h.ms!==void 0?Vt({class:"cs-dim"},Sl(h.ms)):null,s.runs>1?Vt({class:"cs-dim"},`\xD7${s.runs}`):null,s.failed&&(s.runs>1||!h.failed)?Vt({class:"cs-bad"},`${s.failed} failed`):null,s.streak>=2?Vt({class:"cs-pill bad"},`failed ${s.streak} in a row`):null,fie(s)?Vt({class:"cs-pill warn"},fie(s)):null)}#p(s){return tt({class:"cs-section"},tt({class:"cs-h"},"Files written",s.files.length?Vt({class:"cs-count"},xEe(s)):null),s.files.length?tt({class:"cs-list cs-files"},s.files.map(a=>tt({class:"cs-item"},tt({class:"cs-item-main"},a.deleted?Vt({class:"cs-path",title:die(a)},_Ee(die(a))):lg({class:"cs-path cs-link",title:`Open ${a.path}`,onClick:TTt(a.path)},_Ee(a.path)),tt({class:"cs-item-meta"},a.from?Vt({class:"cs-dim"},`moved from ${a.from}`):null,Vt({class:["cs-pill",a.committed||a.ignored?"":"run"]},a.ignored?"ignored":a.committed?"committed":"uncommitted"))),a.also.length||a.blind.length?tt({class:"cs-item-sub"},a.also.length?tt({class:"cs-chips"},Vt({class:"cs-dim"},"also "),a.also.map(h=>Vt({class:"cs-chip"},h.name,Vt({class:"cs-dim"},` ${uie(h.at)}`)))):null,a.blind.map(h=>tt({class:"cs-blind"},h))):null))):TEe("cs-list cs-files"))}#m(s){return s.narration.length?tt({class:"cs-section"},tt({class:"cs-h"},"Narration"),tt({class:"cs-list cs-files"},s.narration.map(a=>tt({class:"cs-item"},a)))):null}#g(s){let{shown:a,earlier:h}=IEe(s);return tt({class:"cs-section"},tt({class:"cs-h"},"Files read",s.read.length?Vt({class:"cs-count"},`${s.read.length}`):null),s.read.length?tt({class:"cs-list cs-files"},h?tt({class:"cs-item cs-dim"},`+${h} earlier`):null,a.map(p=>tt({class:"cs-item"},tt({class:"cs-item-main"},lg({class:"cs-path cs-link",title:`Open ${p.path}`,onClick:TTt(p.path)},_Ee(p.path)),p.times>1?tt({class:"cs-item-meta"},Vt({class:"cs-dim"},`\xD7${p.times}`)):null)))):TEe("cs-list cs-files"))}};var gie=class extends iw{children=[];enabled=!1;viewing=null;status=new pie;#e=[];#t=null;#n=0;get swaps(){return this.#n}keepOpenSelector=".children-wrap";filterId="children-filter";listSelector=".children-list";onActivate(s){let a=this.rows()[s];a&&this.openChild(a.id)}onAttached(){setInterval(()=>{this.refresh()},3e3)}rows(){let s=this.filter.trim().toLowerCase();return s?this.children.filter(a=>[a.kind,a.label].filter(Boolean).join(" ").toLowerCase().includes(s)):this.children}get running(){return this.children.filter(s=>s.state==="running").length}async refresh(){if(this.enabled)try{let s=ryt((await tb.server.listChildren()).sort((h,p)=>h.mtime-p.mtime));if(this.open&&this.#e.length){let h=new Map(this.#e.map((p,b)=>[p,b]));s=s.map((p,b)=>[p,h.get(p.id)??this.#e.length+b]).sort((p,b)=>p[1]-b[1]).map(([p])=>p)}let a=s.length!==this.children.length||s.some((h,p)=>{let b=this.children[p];return h.id!==b?.id||h.state!==b.state||h.mtime!==b.mtime||h.tokens!==b.tokens})||s.some(h=>h.state==="running");this.children=s,this.#r(),a&&(this.update(),this.keepBottom())}catch(s){console.error("[mirror] listChildren failed",s)}}syncFromPoll(s,a){if(a!==this.#n)return!1;let h=this.viewing?.id??null;return this.#t=s,this.#r(),s&&!this.viewing&&this.refresh(),(this.viewing?.id??null)!==h}reset(){this.children=[],this.refresh()}#r(){this.viewing=this.#t?this.children.find(s=>s.id===this.#t)??null:null}async openChild(s,a=!1){this.close(),this.parent.messageList.stickToBottomNextRender(),this.#n++;try{await tb.server.openChild(s),this.#n++,this.#t=s,this.#r(),this.status.show(a),this.update()}catch(h){console.error("[mirror] openChild failed",h)}this.refresh()}async closeChild(){this.parent.messageList.stickToBottomNextRender(),this.status.open=!1,this.#n++;try{await tb.server.closeChild(),this.#n++,this.#t=null,this.#r(),this.update()}catch(s){console.error("[mirror] closeChild failed",s)}}show(){this.beginOpen(),this.#e=this.children.map(s=>s.id),this.refresh(),this.refreshList(),this.armClose(),this.focusFilter()}view(){let s=this.children.length;return!this.enabled||s===0&&!this.viewing&&!this.open?tt({class:"children-wrap"}):tt({class:"children-wrap pop-center"},this.viewing?this.viewingPill():this.chip(s),this.open?this.popup():null)}chip(s){let a=this.running;return Ao({class:["pill","children-pill",_F(a>0),this.open?"on":""],"data-tip":a?`${a} of ${s} agent${s===1?"":"s"} still working \u2014 open one`:`${s} agent${s===1?"":"s"} this session spawned \u2014 open one`,ariaLabel:a?`Agents (${a} of ${s} running)`:`Agents (${s})`,onClick:h=>{h.stopPropagation(),this.open?this.close():this.show()}},Vt({class:"glyph-img"},"\u{1F916}"),String(a),Vt({class:"glyph-img"},"\u{1F916}"))}viewingPill(){let s=this.viewing,a=this.children.length;return Ao({class:["pill","glyph","children-pill","viewing","on",_F(s.state==="running")],"data-tip":`${a} agent${a===1?"":"s"} \u2014 switch`,onClick:h=>{h.stopPropagation(),this.open?this.close():this.show()}},Vt({class:"glyph-img"},"\u{1F916}"),Vt({class:"children-doc-label",title:GC(s)},GC(s)),ite(()=>{this.closeChild()}))}popup(){let s=this.rows();return tt({class:["servers-pop","children-pop"]},s.length===0?this.emptyState("No agents in this session yet."):tt({class:"children-list",onScroll:()=>this.onListScroll()},s.map((a,h)=>this.row(a,h))),this.filterBox(this.children.length,"agent"))}row(s,a){return tt({class:["children-row",a===this.highlighted?"active":"",this.viewing?.id===s.id?"viewing":""],style:s.depth>1?{paddingLeft:`${(s.depth-1)*16+10}px`}:void 0,onMouseEnter:()=>{this.highlighted!==a&&(this.highlighted=a,this.update())},onClick:h=>{h.stopPropagation(),this.openChild(s.id)}},Vt({class:["children-dot",wEe(s)]}),Vt({class:["children-label",s.state==="running"?"shimmer-text shimmer-slow":""]},GC(s)),s.kind?Vt({class:"children-kind"},s.kind):null,s.model?Vt({class:"children-model"},s.effort?`${s.model} \xB7 ${s.effort}`:s.model):null,Vt({class:"children-time"},s.started?Sl((s.state==="running"?Date.now():s.mtime)-s.started):""),s.failing?Vt({class:"children-tokens failing",title:"Its latest reply is an API error, not the model's"},"error"):Vt({class:"children-tokens"},s.tokens?BF(s.tokens):""),Vt({class:"children-status-link","data-tip":"Where this agent stands: what it is waiting on, its commands, files and hand-backs",onClick:h=>{h.stopPropagation(),this.openChild(s.id,!0)}},"status"))}};var _Tt=new Map,MTt=(o,s)=>s+`
|
|
2195
|
+
`)}var xEe=o=>{let s=o.files.filter(a=>!a.committed&&!a.ignored).length;return o.files.length?`${o.files.length} (${s} uncommitted)`:"none"};function EEe(o,s){let a=o.toolMs+(xTt(o).some(h=>!h.background)?ETt(o,s):0);return{tools:a,model:Math.max(0,CTt(o,s)-a)}}var Y5n=(o,s)=>{let a=EEe(o,s);return`${Sl(a.tools)} in tools, ${Sl(a.model)} in the model`},X5n=o=>o.also.map(s=>`"${s.name}" ${uie(s.at)}`).join(", "),ITt=o=>o.failed>0||o.long||o.runs>=3||o.tags.length>0,CEe=o=>{let s=o.groups.filter(ITt);return{shown:s.slice(0,vTt),more:Math.max(0,s.length-vTt)}},SEe=o=>`+${o} more like these`,aie=o=>{let s=o.groups.filter(a=>!ITt(a));return{runs:s.reduce((a,h)=>a+h.runs-h.open,0),hidden:s.reduce((a,h)=>a+h.hidden,0),ms:s.reduce((a,h)=>a+h.ms,0)}},lie=(o,s=!0)=>{let a=aie(o),h=a.runs-a.hidden,p=s?" other":"",b=S=>S===1?"run":"runs",v=`with ${a.hidden===1?"its":"their"} exit hidden by a pipe`;return`${h?`${h}${p} ${b(h)} passed${a.hidden?`, ${a.hidden} ${v}`:""}`:`${a.hidden}${p} ${b(a.hidden)} ${v}`}, ${Sl(a.ms)} in all`},fie=o=>[...o.tags,o.long?`over ${Sl(Q5n)}`:""].filter(Boolean).join(", ");var hie=o=>o.hidden?"exit hidden":o.outcome&&o.outcome!=="completed"&&o.outcome!=="failed"&&o.exit===void 0?o.outcome:o.exit!==void 0?`exit ${o.exit}`:o.failed?"error":"ok",die=o=>o.deleted?`${o.path} (deleted)`:o.from?`${o.path} (moved from ${o.from})`:o.path,V5n=o=>o.times>1?`${o.path} \xD7${o.times}`:o.path,IEe=o=>({shown:o.read.slice(-yTt),earlier:Math.max(0,o.read.length-yTt)});var Cdr=5*6e4,Sdr=10*6e4,Idr=2*6e4;var Z5n=2e3,TEe=(o="cs-list",s="none")=>tt({class:o},tt({class:"cs-item cs-dim"},s)),TTt=o=>s=>{s.preventDefault(),tb.server.openFile(o)},_Ee=o=>`\u200E${o}\u200E`,pie=class extends Wu{open=!1;#e=null;#t="";#n="";#r=!1;#s=0;#i;bind(s){this.#i=s}toggle(){this.open=!this.open,this.sync(),this.#i?.onChange()}show(s){this.open=s,this.#e=null,this.#t="",this.#s=0,this.sync()}async sync(){let s=this.#i?.id();if(!(!this.open||!s||this.#r||Date.now()-this.#s<Z5n)){this.#r=!0;try{let a=await tb.server.childStatus(s);s===this.#i?.id()&&(a?.ok?(this.#e=a.report,this.#t=""):this.#t=a?.error??"could not read its status")}catch{this.#t="could not read its status"}this.#r=!1,this.#s=Date.now(),this.#i?.onChange()}}view(){let s=this.#e;if(!s)return tt({class:"messages child-status",key:"child-status"},tt({class:"child-status-pending"},this.#t||"Loading\u2026"));let a=Date.now();return tt({class:"messages child-status",key:"child-status"},this.#f(s,a),this.#l(s,a),this.#a(s,a),this.#m(s),this.#p(s),this.#g(s),tt({class:"child-status-foot"},this.#t?tt({class:"child-status-note err"},this.#t):null,tt({class:"child-status-actions"},lg({onClick:h=>{h.preventDefault(),this.#o(s)}},this.#n||"Copy Status"),lg({onClick:h=>{h.preventDefault(),this.toggle()}},"Raw Transcript"))))}async#o(s){this.#n=await mEe(STt(s,Date.now()))?"Copied":"Copy failed",setTimeout(()=>{this.#n="",this.#i?.onChange()},1500),this.#i?.onChange()}#c(s){this.open=!1,this.#i?.reveal(s)}#u(s,a){return lg({class:"cs-mono cs-link",title:"Show in the transcript",onClick:h=>{h.preventDefault(),this.#c(s)}},a)}#f(s,a){let h=EEe(s,a),p=kEe(s,a);return tt({class:"cs-header"},tt({class:"cs-title"},s.name),tt({class:["cs-subtitle",s.state==="failing"?"cs-bad":""]},tt({class:"cs-tile"},Vt({class:["children-dot",s.state==="finished"?"done":s.state]}),p.state),tt({class:"cs-tile"},p.active,s.activeMs?[Vt({class:"cs-tile-rule"}),Vt({class:"cs-time"},Vt(`${Sl(h.tools)} tools`),Vt(`${Sl(h.model)} model`))]:null),p.idle?tt({class:"cs-tile",title:"Time it sat finished, waiting for a message to wake it. Not counted in active time."},p.idle):null,s.asOf?tt({class:"cs-tile"},`last entry ${Sl(a-s.asOf)} ago`):null))}#l(s,a){let h=s.latest,p=[...s.open.map(b=>tt({class:"cs-item"},tt({class:"cs-item-main"},this.#u(b.id,b.label),tt({class:"cs-item-meta"},b.interrupted?Vt({class:"cs-pill bad"},"interrupted"):Vt({class:"cs-pill run"},`running ${Sl(a-(b.at??a))}`),b.background&&!b.interrupted?Vt({class:"cs-pill"},"background"):null)),b.said?tt({class:"cs-item-sub cs-mono"},b.said):null)),h?tt({class:"cs-item"},tt({class:"cs-item-main"},this.#u(h.id,h.label),tt({class:"cs-item-meta"},this.#h(h.run),h.run.ms!==void 0?Vt({class:"cs-dim"},Sl(h.run.ms)):null))):null].filter(Boolean);return p.length?tt({class:"cs-section"},tt({class:"cs-h"},"Now"),tt({class:"cs-list"},p)):null}#h(s){let a=hie(s);return Vt({class:["cs-pill",s.failed?"bad":!s.hidden&&(a==="ok"||a.startsWith("exit"))?"ok":""]},a)}#a(s,a){let h=s.commands,{shown:p,more:b}=CEe(h),v=aie(h);return p.length?tt({class:"cs-section"},tt({class:"cs-h"},"Commands",Vt({class:"cs-count"},vEe(h))),tt({class:"cs-list"},p.map(w=>{let S=[w.latest.first,w.latest.last].filter(Boolean);return tt({class:"cs-item"},tt({class:"cs-item-main"},this.#u(w.latest.id,w.cmd),this.#d(w,a)),S.length?tt({class:"cs-item-sub cs-mono"},S.map((T,D)=>[D?Vt({class:"cs-dim"}," \u2026 "):null,T])):null)})),b?tt({class:"cs-more"},SEe(b)):null,v.runs?tt({class:"cs-more"},lie(h)):null):tt({class:"cs-section"},tt({class:"cs-h"},"Commands"),TEe("cs-list",[v.runs?lie(h,!1):"",yEe(h)].filter(Boolean).join(", ")||"none"))}#d(s,a){let h=s.latest,p=h.interrupted?Vt({class:"cs-pill bad"},"interrupted"):h.open?Vt({class:"cs-pill run"},`running ${Sl(a-(h.at??a))}`):this.#h(h);return tt({class:"cs-item-meta"},p,!h.open&&h.ms!==void 0?Vt({class:"cs-dim"},Sl(h.ms)):null,s.runs>1?Vt({class:"cs-dim"},`\xD7${s.runs}`):null,s.failed&&(s.runs>1||!h.failed)?Vt({class:"cs-bad"},`${s.failed} failed`):null,s.streak>=2?Vt({class:"cs-pill bad"},`failed ${s.streak} in a row`):null,fie(s)?Vt({class:"cs-pill warn"},fie(s)):null)}#p(s){return tt({class:"cs-section"},tt({class:"cs-h"},"Files written",s.files.length?Vt({class:"cs-count"},xEe(s)):null),s.files.length?tt({class:"cs-list cs-files"},s.files.map(a=>tt({class:"cs-item"},tt({class:"cs-item-main"},a.deleted?Vt({class:"cs-path",title:die(a)},_Ee(die(a))):lg({class:"cs-path cs-link",title:`Open ${a.path}`,onClick:TTt(a.path)},_Ee(a.path)),tt({class:"cs-item-meta"},a.from?Vt({class:"cs-dim"},`moved from ${a.from}`):null,Vt({class:["cs-pill",a.committed||a.ignored?"":"run"]},a.ignored?"ignored":a.committed?"committed":"uncommitted"))),a.also.length||a.blind.length?tt({class:"cs-item-sub"},a.also.length?tt({class:"cs-chips"},Vt({class:"cs-dim"},"also "),a.also.map(h=>Vt({class:"cs-chip"},h.name,Vt({class:"cs-dim"},` ${uie(h.at)}`)))):null,a.blind.map(h=>tt({class:"cs-blind"},h))):null))):TEe("cs-list cs-files"))}#m(s){return s.narration.length?tt({class:"cs-section"},tt({class:"cs-h"},"Narration"),tt({class:"cs-list cs-files"},s.narration.map(a=>tt({class:"cs-item"},a)))):null}#g(s){let{shown:a,earlier:h}=IEe(s);return tt({class:"cs-section"},tt({class:"cs-h"},"Files read",s.read.length?Vt({class:"cs-count"},`${s.read.length}`):null),s.read.length?tt({class:"cs-list cs-files"},h?tt({class:"cs-item cs-dim"},`+${h} earlier`):null,a.map(p=>tt({class:"cs-item"},tt({class:"cs-item-main"},lg({class:"cs-path cs-link",title:`Open ${p.path}`,onClick:TTt(p.path)},_Ee(p.path)),p.times>1?tt({class:"cs-item-meta"},Vt({class:"cs-dim"},`\xD7${p.times}`)):null)))):TEe("cs-list cs-files"))}};var gie=class extends iw{children=[];enabled=!1;viewing=null;status=new pie;#e=[];#t=null;#n=0;get swaps(){return this.#n}keepOpenSelector=".children-wrap";filterId="children-filter";listSelector=".children-list";onActivate(s){let a=this.rows()[s];a&&this.openChild(a.id)}onAttached(){setInterval(()=>{this.refresh()},3e3)}rows(){let s=this.filter.trim().toLowerCase();return s?this.children.filter(a=>[a.kind,a.label].filter(Boolean).join(" ").toLowerCase().includes(s)):this.children}get running(){return this.children.filter(s=>s.state==="running").length}async refresh(){if(this.enabled)try{let s=ryt((await tb.server.listChildren()).sort((h,p)=>h.mtime-p.mtime));if(this.open&&this.#e.length){let h=new Map(this.#e.map((p,b)=>[p,b]));s=s.map((p,b)=>[p,h.get(p.id)??this.#e.length+b]).sort((p,b)=>p[1]-b[1]).map(([p])=>p)}let a=s.length!==this.children.length||s.some((h,p)=>{let b=this.children[p];return h.id!==b?.id||h.state!==b.state||h.mtime!==b.mtime||h.tokens!==b.tokens})||s.some(h=>h.state==="running");this.children=s,this.#r(),a&&(this.update(),this.keepBottom())}catch(s){console.error("[mirror] listChildren failed",s)}}syncFromPoll(s,a){if(a!==this.#n)return!1;let h=this.viewing?.id??null;return this.#t=s,this.#r(),s&&!this.viewing&&this.refresh(),(this.viewing?.id??null)!==h}reset(){this.children=[],this.refresh()}#r(){this.viewing=this.#t?this.children.find(s=>s.id===this.#t)??null:null}async openChild(s,a=!1){this.close(),this.parent.messageList.stickToBottomNextRender(),this.#n++;try{await tb.server.openChild(s),this.#n++,this.#t=s,this.#r(),this.status.show(a),this.update()}catch(h){console.error("[mirror] openChild failed",h)}this.refresh()}async closeChild(){this.parent.messageList.stickToBottomNextRender(),this.status.open=!1,this.#n++;try{await tb.server.closeChild(),this.#n++,this.#t=null,this.#r(),this.update()}catch(s){console.error("[mirror] closeChild failed",s)}}show(){this.beginOpen(),this.#e=this.children.map(s=>s.id),this.refresh(),this.refreshList(),this.armClose(),this.focusFilter()}view(){let s=this.children.length;return!this.enabled||s===0&&!this.viewing&&!this.open?tt({class:"children-wrap"}):tt({class:"children-wrap pop-center"},this.viewing?this.viewingPill():this.chip(s),this.open?this.popup():null)}chip(s){let a=this.running;return Ao({class:["pill","children-pill",_F(a>0),this.open?"on":""],"data-tip":a?`${a} of ${s} agent${s===1?"":"s"} still working \u2014 open one`:`${s} agent${s===1?"":"s"} this session spawned \u2014 open one`,ariaLabel:a?`Agents (${a} of ${s} running)`:`Agents (${s})`,onClick:h=>{h.stopPropagation(),this.open?this.close():this.show()}},Vt({class:"glyph-img"},"\u{1F916}"),String(a),Vt({class:"glyph-img"},"\u{1F916}"))}viewingPill(){let s=this.viewing,a=this.children.length;return Ao({class:["pill","glyph","children-pill","viewing","on",_F(s.state==="running")],"data-tip":`${a} agent${a===1?"":"s"} \u2014 switch`,onClick:h=>{h.stopPropagation(),this.open?this.close():this.show()}},Vt({class:"glyph-img"},"\u{1F916}"),Vt({class:"children-doc-label",title:GC(s)},GC(s)),ite(()=>{this.closeChild()}))}popup(){let s=this.rows();return tt({class:["servers-pop","children-pop"]},s.length===0?this.emptyState("No agents in this session yet."):tt({class:"children-list",onScroll:()=>this.onListScroll()},s.map((a,h)=>this.row(a,h))),this.filterBox(this.children.length,"agent"))}row(s,a){return tt({class:["children-row",a===this.highlighted?"active":"",this.viewing?.id===s.id?"viewing":""],style:s.depth>1?{paddingLeft:`${(s.depth-1)*16+10}px`}:void 0,onMouseEnter:()=>{this.highlighted!==a&&(this.highlighted=a,this.update())},onClick:h=>{h.stopPropagation(),this.openChild(s.id)}},Vt({class:["children-dot",wEe(s)]}),Vt({class:["children-label",s.state==="running"?"shimmer-text shimmer-slow":""]},GC(s)),s.kind?Vt({class:"children-kind"},s.kind):null,s.model?Vt({class:"children-model"},s.effort?`${s.model} \xB7 ${s.effort}`:s.model):null,Vt({class:"children-time"},s.started?Sl((s.state==="running"?Date.now():s.mtime)-s.started):""),s.failing?Vt({class:"children-tokens failing",title:"Its latest reply is an API error, not the model's"},"error"):Vt({class:"children-tokens"},s.tokens?BF(s.tokens):""),Vt({class:"children-status-link","data-tip":"Where this agent stands: what it is waiting on, its commands, files and hand-backs",onClick:h=>{h.stopPropagation(),this.openChild(s.id,!0)}},"status"))}};var _Tt=new Map,MTt=(o,s)=>s+`
|
|
2196
2196
|
|
|
2197
2197
|
---
|
|
2198
2198
|
|