dispach 0.1.1 → 0.1.2

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.
Files changed (78) hide show
  1. package/README.md +72 -13
  2. package/dist/{App-5a35bjkt.js → App-b1yrwrcq.js} +6 -6
  3. package/dist/{App-5a35bjkt.js.map → App-b1yrwrcq.js.map} +1 -1
  4. package/dist/{ConfigEditor-7nnc2ke6.js → ConfigEditor-n8hdw6r7.js} +2 -2
  5. package/dist/{KeyProbe-kbz0j6sm.js → KeyProbe-9jjeze5r.js} +2 -2
  6. package/dist/{Picker-2zjjt17a.js → Picker-hfeh1g6m.js} +3 -3
  7. package/dist/{Picker-2zjjt17a.js.map → Picker-hfeh1g6m.js.map} +1 -1
  8. package/dist/{SessionPicker-fyyvxy40.js → SessionPicker-zyqkg4dn.js} +3 -3
  9. package/dist/{SessionPicker-fyyvxy40.js.map → SessionPicker-zyqkg4dn.js.map} +1 -1
  10. package/dist/{SkillBrowser-x7r51zy0.js → SkillBrowser-3qdp8080.js} +3 -3
  11. package/dist/{SkillBrowser-x7r51zy0.js.map → SkillBrowser-3qdp8080.js.map} +1 -1
  12. package/dist/{WizardApp-v0dghsyw.js → WizardApp-vzpbydy3.js} +3 -3
  13. package/dist/{WizardApp-v0dghsyw.js.map → WizardApp-vzpbydy3.js.map} +1 -1
  14. package/dist/client.js +10 -10
  15. package/dist/client.js.map +4 -4
  16. package/dist/{config-9cv76yrk.js → config-g7za9x13.js} +5 -5
  17. package/dist/{config-9cv76yrk.js.map → config-g7za9x13.js.map} +1 -1
  18. package/dist/credential-npr6z8c8.js +19 -0
  19. package/dist/{credential-yxqj8x1f.js.map → credential-npr6z8c8.js.map} +2 -2
  20. package/dist/{index-zked16y4.js → index-02dn6m2j.js} +2 -2
  21. package/dist/{index-a4xqgdrm.js → index-0d93hyfc.js} +2 -2
  22. package/dist/{index-5t6wahx8.js → index-1c5113t4.js} +26 -26
  23. package/dist/index-1c5113t4.js.map +12 -0
  24. package/dist/{index-zxh0ntgf.js → index-258d8bzg.js} +2 -2
  25. package/dist/{index-nvm5hwe4.js → index-6p999cx4.js} +5 -5
  26. package/dist/{index-nvm5hwe4.js.map → index-6p999cx4.js.map} +1 -1
  27. package/dist/{index-73jfw4jp.js → index-6q4wf8e3.js} +2 -2
  28. package/dist/{index-r3wwvqzb.js → index-fecm8xe7.js} +16 -16
  29. package/dist/{index-r3wwvqzb.js.map → index-fecm8xe7.js.map} +2 -2
  30. package/dist/{index-83bqtze0.js → index-ff514z3y.js} +5 -5
  31. package/dist/{index-83bqtze0.js.map → index-ff514z3y.js.map} +1 -1
  32. package/dist/{index-17an0jqq.js → index-h9mw7b9d.js} +2 -2
  33. package/dist/{index-5x4dn0gg.js → index-hwpvhaza.js} +2 -2
  34. package/dist/{index-e0j1jafd.js → index-j55s3ehk.js} +5 -5
  35. package/dist/{index-e0j1jafd.js.map → index-j55s3ehk.js.map} +1 -1
  36. package/dist/{index-000rxxy3.js → index-mtn0g9vc.js} +4 -4
  37. package/dist/{index-000rxxy3.js.map → index-mtn0g9vc.js.map} +1 -1
  38. package/dist/{index-dwyr2kdm.js → index-qdbq8crg.js} +4 -4
  39. package/dist/{index-dwyr2kdm.js.map → index-qdbq8crg.js.map} +1 -1
  40. package/dist/{index-ez2mb28y.js → index-s9mbq7h6.js} +4 -4
  41. package/dist/{index-ez2mb28y.js.map → index-s9mbq7h6.js.map} +1 -1
  42. package/dist/{index-0b1hdwnm.js → index-tf71ap9v.js} +2 -2
  43. package/dist/index-ttwyrdjs.js +427 -0
  44. package/dist/index-ttwyrdjs.js.map +11 -0
  45. package/dist/{index-7z4sw2dm.js → index-tv4yv7d2.js} +162 -162
  46. package/dist/{index-7z4sw2dm.js.map → index-tv4yv7d2.js.map} +8 -8
  47. package/dist/{index-d69d6pkm.js → index-ty24n0jh.js} +35 -35
  48. package/dist/{index-d69d6pkm.js.map → index-ty24n0jh.js.map} +1 -1
  49. package/dist/{index-2wmsmcbr.js → index-vgc3y3rm.js} +4 -4
  50. package/dist/{index-2wmsmcbr.js.map → index-vgc3y3rm.js.map} +1 -1
  51. package/dist/index-whaw4b18.js +6 -0
  52. package/dist/index-whaw4b18.js.map +10 -0
  53. package/dist/index.js +50 -50
  54. package/dist/index.js.map +3 -3
  55. package/dist/lib/commands.d.ts.map +1 -1
  56. package/dist/lib/init-flow.d.ts +17 -4
  57. package/dist/lib/init-flow.d.ts.map +1 -1
  58. package/dist/lib/provision.d.ts.map +1 -1
  59. package/dist/{web-x77y8w3v.js → web-vkb16r62.js} +4 -4
  60. package/dist/{web-x77y8w3v.js.map → web-vkb16r62.js.map} +1 -1
  61. package/dist/wire.js +10 -10
  62. package/dist/wire.js.map +4 -4
  63. package/package.json +1 -1
  64. package/dist/credential-yxqj8x1f.js +0 -19
  65. package/dist/index-5t6wahx8.js.map +0 -12
  66. package/dist/index-9bkd0fdj.js +0 -427
  67. package/dist/index-9bkd0fdj.js.map +0 -11
  68. package/dist/index-xf178c4m.js +0 -6
  69. package/dist/index-xf178c4m.js.map +0 -10
  70. /package/dist/{ConfigEditor-7nnc2ke6.js.map → ConfigEditor-n8hdw6r7.js.map} +0 -0
  71. /package/dist/{KeyProbe-kbz0j6sm.js.map → KeyProbe-9jjeze5r.js.map} +0 -0
  72. /package/dist/{index-zked16y4.js.map → index-02dn6m2j.js.map} +0 -0
  73. /package/dist/{index-a4xqgdrm.js.map → index-0d93hyfc.js.map} +0 -0
  74. /package/dist/{index-zxh0ntgf.js.map → index-258d8bzg.js.map} +0 -0
  75. /package/dist/{index-73jfw4jp.js.map → index-6q4wf8e3.js.map} +0 -0
  76. /package/dist/{index-17an0jqq.js.map → index-h9mw7b9d.js.map} +0 -0
  77. /package/dist/{index-5x4dn0gg.js.map → index-hwpvhaza.js.map} +0 -0
  78. /package/dist/{index-0b1hdwnm.js.map → index-tf71ap9v.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{E,ze}from"./index-7z4sw2dm.js";import{Zo}from"./index-d4x6yvqh.js";import{sr}from"./index-cqqb6gaq.js";import{l}from"./index-j7gyr5nx.js";import{ns,os}from"./index-2wmsmcbr.js";var Yn=[{kind:"help",word:"/help",aliases:[],summary:"this list"},{kind:"status",word:"/status",aliases:[],summary:"model, channels, server, store — what this agent is and what is actually running"},{kind:"context",word:"/context",aliases:[],summary:"what is in the prompt right now, per slot, and what the percentage is a percentage of"},{kind:"restart",word:"/restart",aliases:[],summary:"restart the agent, for any configuration changes to take effect (memory files on disk are untouched)"},{kind:"tools",word:"/tools",aliases:[],summary:"what the model may call, and what the catalogue costs every turn"},{kind:"new",word:"/new",aliases:[],summary:"start a fresh conversation — this one stays in the store under its own key, and /sessions goes back to it"},{kind:"reset",word:"/reset",aliases:[],summary:"clear this conversation's history in place, keeping its key — memory files on disk are untouched"},{kind:"exit",word:"/exit",aliases:["/quit",":q"],summary:"leave — asks first, because the screen goes with it"}],yo="⌥⏎ or a trailing \\ for a new line · ⏎ sends",wo="/ commands · ⏎ sends · ⇧⏎ new line · ^C twice leaves",w=[{chord:"^C",summary:"cancel the turn in flight — at an idle prompt, press it twice to leave (the screen goes with it)"},{chord:"^D",summary:"leave when the line is empty; delete forward when it is not"},{chord:"^A / ^E",summary:"start of line / end of line"},{chord:"^B / ^F",summary:"back one character / forward one"},{chord:"^U / ^K",summary:"delete to the start of the line / to the end"},{chord:"^W",summary:"delete the word before the cursor"},{chord:"^P / ^N",summary:"previous / next of what you have already sent"},{chord:"↑ / ↓",summary:"a line up or down inside the message — the same history at its first and last line"},{chord:"⌥⏎ / ⇧⏎",summary:"a new line in the message — ⌥⏎ everywhere, ⇧⏎ where the terminal can tell it apart (`keys` says); a trailing \\ does the same; ⏎ sends it"},{chord:"⌥← / ⌥→",summary:"back one word / forward one — ^← / ^→ do the same"},{chord:"⌥⌫ / ⌥d",summary:"delete the word before the cursor / after it"},{chord:"Home / End",summary:"start of line / end of line, the same as ^A / ^E"},{chord:"cmd← / cmd→",summary:"start of line / end of line, where the terminal reports cmd (else ^A / ^E)"},{chord:"cmd↑ / cmd↓",summary:"the start / end of the whole message, however many lines it has"},{chord:"cmd⌫ / cmd⌦",summary:"delete to the start of the line / to the end"},{chord:"cmdz / cmd⇧z",summary:"undo / redo, the same as ^Z / ^Y"},{chord:"⇧ + any motion",summary:"select as the cursor moves — ⇧← a character, ⇧⌥← a word, ⇧cmd← to the line start, ⇧cmd↑ to the top; typing or ⌫ replaces what is selected"},{chord:"cmda",summary:"select the whole message"},{chord:"^R",summary:"search what you have already sent — ↑↓ to pick, ⏎ to use it, esc to cancel"},{chord:"^Z / ^Y",summary:"undo / redo the last edit — suspend is not available inside a session"},{chord:"PgUp / PgDn",summary:"back and forward through the conversation a screen at a time"},{chord:"⌥↑ / ⌥↓",summary:"the same, one row at a time"},{chord:"⌥PgUp / ⌥PgDn",summary:"the start of the conversation / back to the newest reply"},{chord:"^O / ⌥r",summary:"show the model's reasoning whole — folded to a few rows so the reply stays findable; ^O works on every terminal, ⌥r needs one that reports it"},{chord:"drag",summary:"select text — in the conversation it goes to the clipboard when you let go, so ⌘V works; in the input box it does not, because you are usually about to type over it (⌘C copies, ⌘X cuts). Double-click a word, triple-click a line, esc clears"},{chord:"esc",summary:"return to the newest reply when you have scrolled away"}],D=w.flatMap((e)=>[...e.chord.matchAll(/\^([A-Za-z])/g)].map((t)=>(t[1]??"").toLowerCase())),P=w.flatMap((e)=>[...e.chord.matchAll(/⌥([a-z])(?![A-Za-z])/g)].map((t)=>t[1]??""));var k=/^\/[A-Za-z][\w-]*$/,A=/^(\/[A-Za-z][\w-]*)\s+(.*)$/,f=new Map(Yn.flatMap((e)=>[e.word,...e.aliases].map((t)=>[t.toLowerCase(),e.kind])));function on(e,t=[]){let n=e.trim(),r=f.get(n.toLowerCase());if(r!==void 0)return{kind:r};let s=new Set(t);if(s.has(n.slice(1).toLowerCase())&&k.test(n))return{kind:"command",name:n.slice(1).toLowerCase(),rest:""};let u=A.exec(n);if(u!==null){let d=(u[1]??"").toLowerCase(),a=u[2]??"",i=f.get(d);if(i!==void 0)return{kind:i,rest:a};if(s.has(d.slice(1)))return{kind:"command",name:d.slice(1),rest:a};return}if(!k.test(n))return;let o=E(n.toLowerCase(),[...f.keys(),...t.map((d)=>`/${d}`)]);return{kind:"unknown",word:n,...o===void 0?{}:{nearest:o}}}var T=20;function M(e){return` ${[e.word,...e.aliases].join(" / ").padEnd(T)}${e.summary}`}function I(e){return` ${e.chord.padEnd(T)}${e.summary}`}function sn(){return["commands:",...Yn.map(M),"","keys:",...w.map(I)].join(`
2
+ import{E,ze}from"./index-tv4yv7d2.js";import{Zo}from"./index-d4x6yvqh.js";import{sr}from"./index-cqqb6gaq.js";import{l}from"./index-j7gyr5nx.js";import{ns,os}from"./index-vgc3y3rm.js";var Yn=[{kind:"help",word:"/help",aliases:[],summary:"this list"},{kind:"status",word:"/status",aliases:[],summary:"model, channels, server, store — what this agent is and what is actually running"},{kind:"context",word:"/context",aliases:[],summary:"what is in the prompt right now, per slot, and what the percentage is a percentage of"},{kind:"restart",word:"/restart",aliases:[],summary:"restart the agent, for any configuration changes to take effect (memory files on disk are untouched)"},{kind:"tools",word:"/tools",aliases:[],summary:"what the model may call, and what the catalogue costs every turn"},{kind:"new",word:"/new",aliases:[],summary:"start a fresh conversation — this one stays in the store under its own key, and /sessions goes back to it"},{kind:"reset",word:"/reset",aliases:[],summary:"clear this conversation's history in place, keeping its key — memory files on disk are untouched"},{kind:"exit",word:"/exit",aliases:["/quit",":q"],summary:"leave — asks first, because the screen goes with it"}],yo="⌥⏎ or a trailing \\ for a new line · ⏎ sends",wo="/ commands · ⏎ sends · ⇧⏎ new line · ^C twice leaves",w=[{chord:"^C",summary:"cancel the turn in flight — at an idle prompt, press it twice to leave (the screen goes with it)"},{chord:"^D",summary:"leave when the line is empty; delete forward when it is not"},{chord:"^A / ^E",summary:"start of line / end of line"},{chord:"^B / ^F",summary:"back one character / forward one"},{chord:"^U / ^K",summary:"delete to the start of the line / to the end"},{chord:"^W",summary:"delete the word before the cursor"},{chord:"^P / ^N",summary:"previous / next of what you have already sent"},{chord:"↑ / ↓",summary:"a line up or down inside the message — the same history at its first and last line"},{chord:"⌥⏎ / ⇧⏎",summary:"a new line in the message — ⌥⏎ everywhere, ⇧⏎ where the terminal can tell it apart (`keys` says); a trailing \\ does the same; ⏎ sends it"},{chord:"⌥← / ⌥→",summary:"back one word / forward one — ^← / ^→ do the same"},{chord:"⌥⌫ / ⌥d",summary:"delete the word before the cursor / after it"},{chord:"Home / End",summary:"start of line / end of line, the same as ^A / ^E"},{chord:"cmd← / cmd→",summary:"start of line / end of line, where the terminal reports cmd (else ^A / ^E)"},{chord:"cmd↑ / cmd↓",summary:"the start / end of the whole message, however many lines it has"},{chord:"cmd⌫ / cmd⌦",summary:"delete to the start of the line / to the end"},{chord:"cmdz / cmd⇧z",summary:"undo / redo, the same as ^Z / ^Y"},{chord:"⇧ + any motion",summary:"select as the cursor moves — ⇧← a character, ⇧⌥← a word, ⇧cmd← to the line start, ⇧cmd↑ to the top; typing or ⌫ replaces what is selected"},{chord:"cmda",summary:"select the whole message"},{chord:"^R",summary:"search what you have already sent — ↑↓ to pick, ⏎ to use it, esc to cancel"},{chord:"^Z / ^Y",summary:"undo / redo the last edit — suspend is not available inside a session"},{chord:"PgUp / PgDn",summary:"back and forward through the conversation a screen at a time"},{chord:"⌥↑ / ⌥↓",summary:"the same, one row at a time"},{chord:"⌥PgUp / ⌥PgDn",summary:"the start of the conversation / back to the newest reply"},{chord:"^O / ⌥r",summary:"show the model's reasoning whole — folded to a few rows so the reply stays findable; ^O works on every terminal, ⌥r needs one that reports it"},{chord:"drag",summary:"select text — in the conversation it goes to the clipboard when you let go, so ⌘V works; in the input box it does not, because you are usually about to type over it (⌘C copies, ⌘X cuts). Double-click a word, triple-click a line, esc clears"},{chord:"esc",summary:"return to the newest reply when you have scrolled away"}],D=w.flatMap((e)=>[...e.chord.matchAll(/\^([A-Za-z])/g)].map((t)=>(t[1]??"").toLowerCase())),P=w.flatMap((e)=>[...e.chord.matchAll(/⌥([a-z])(?![A-Za-z])/g)].map((t)=>t[1]??""));var k=/^\/[A-Za-z][\w-]*$/,A=/^(\/[A-Za-z][\w-]*)\s+(.*)$/,f=new Map(Yn.flatMap((e)=>[e.word,...e.aliases].map((t)=>[t.toLowerCase(),e.kind])));function on(e,t=[]){let n=e.trim(),r=f.get(n.toLowerCase());if(r!==void 0)return{kind:r};let s=new Set(t);if(s.has(n.slice(1).toLowerCase())&&k.test(n))return{kind:"command",name:n.slice(1).toLowerCase(),rest:""};let u=A.exec(n);if(u!==null){let d=(u[1]??"").toLowerCase(),a=u[2]??"",i=f.get(d);if(i!==void 0)return{kind:i,rest:a};if(s.has(d.slice(1)))return{kind:"command",name:d.slice(1),rest:a};return}if(!k.test(n))return;let o=E(n.toLowerCase(),[...f.keys(),...t.map((d)=>`/${d}`)]);return{kind:"unknown",word:n,...o===void 0?{}:{nearest:o}}}var T=20;function M(e){return` ${[e.word,...e.aliases].join(" / ").padEnd(T)}${e.summary}`}function I(e){return` ${e.chord.padEnd(T)}${e.summary}`}function sn(){return["commands:",...Yn.map(M),"","keys:",...w.map(I)].join(`
3
3
  `)}function $t(e){let t=e.nearest===void 0?"":` Did you mean ${e.nearest}?`;return`${e.word} is not a command.${t} Type /help for the list — or add a space if you meant to say it to the model.`}function Xn(e){let t=e.describe();return{dialect:t.dialect,catalogueTokens:t.catalogueTokens,tools:e.tools.specs().map((n)=>({slug:n.slug,mutating:n.mutating,trust:n.trust??"trusted",...n.trustReason===void 0?{}:{trustReason:n.trustReason},summary:n.summary}))}}function lt(e){if(e.tools.length===0)return`no tools — this agent pinned none, so the model can only reply. Add them under tools.local or tools.pinned. (call format ${e.dialect})`;let t=e.tools.reduce((r,s)=>Math.max(r,s.slug.length),0),n=e.tools.flatMap((r)=>[` ${r.slug.padEnd(t)} ${r.mutating?"write":"read "} ${r.trust==="untrusted"?"untrusted":"trusted "} ${r.summary}`,...r.trustReason===void 0?[]:[`${" ".repeat(2+t+2+5+2+9+2)}trusted: ${r.trustReason}`]]);return[`${e.tools.length} tool${e.tools.length===1?"":"s"} · call format ${e.dialect} · catalogue ${e.catalogueTokens} tokens, on every turn`,...n].join(`
4
4
  `)}function bo(e){let t=Math.max(1,e.window-e.wireTokens-e.reserveOutput),n=(e.total/t*100).toFixed(1),r=e.calibration.samples===0?"estimated — the estimator runs low on tool-heavy prompts":`corrected ×${e.calibration.ratio.toFixed(2)} from ${e.calibration.samples} reported ${e.calibration.samples===1?"figure":"figures"}`,s=e.slots.reduce((a,i)=>Math.max(a,i.label.length),0),u=e.slots.map((a)=>` ${String(a.slot).padStart(2)} ${a.label.padEnd(s)} ${String(a.tokens).padStart(6)}${a.pinned?" pinned":""}`),o=e.history.reduce((a,i)=>Math.max(a,i.label.length),0),d=e.history.length===0?[]:e.history.map((a)=>` ${a.label.padEnd(o)} ${String(a.tokens).padStart(6)} ${b(a.tokens,e.total).padStart(6)} ${String(a.messages).padStart(3)} msg`);return[l([{label:"window",value:`${e.window} (${e.windowSource})`},{label:"budget",value:`${t} = window ${e.window} − wire ${e.wireTokens} − reserveOutput ${e.reserveOutput}`},{label:"prompt",value:`${e.total} tokens · ${n}% of budget`},{label:"counted",value:r},{label:"compaction",value:e.lastCompaction??"none this session"},{label:"cache",value:e.cache===void 0?"not reported by this endpoint":`${e.cache.cached} of ${e.cache.prompt} prompt tokens (${b(e.cache.cached,e.cache.prompt)}) over ${e.cache.turns} turn${e.cache.turns===1?"":"s"} · ${e.cache.source}`}]),""," slots",...u,...d.length===0?[]:[""," history, by kind — share of the whole prompt",...d]].join(`
5
5
  `)}function b(e,t){return t<=0?"—":`${(e/t*100).toFixed(1)}%`}var S={items:[],live:void 0,status:"idle",nextId:0,turnFrom:void 0};function c(e,t,n,r={}){let s={id:`t${e.nextId}`,role:t,text:n,...r.stats===void 0?{}:{stats:r.stats},...r.callId===void 0?{}:{callId:r.callId},...r.pending===void 0?{}:{pending:r.pending}};return{...e,items:[...e.items,s],nextId:e.nextId+1}}function x(e){let t=e.live;if(t===void 0)return e;let n=e;if(t.reasoning!=="")n=c(n,"reasoning",t.reasoning);if(t.text!=="")n=c(n,"assistant",t.text);return{...n,live:void 0}}function vo(e,t){switch(t.kind){case"user":return c(e,"user",t.text);case"note":return c(e,"note",t.text);case"cancelling":return e.status==="idle"?e:{...e,status:"cancelling"};case"delta":return R(e,t.of,t.text);case"event":return O(e,t.event);case"trim":return N(e)}}function N(e){let t=e.items.length-os;return t<=0?e:{...e,items:e.items.slice(t)}}function R(e,t,n){if(n==="")return e;let r=e.live??{text:"",reasoning:"",last:void 0};return{...e,live:{text:t==="text"?r.text+n:r.text,reasoning:t==="reasoning"?r.reasoning+n:r.reasoning,last:t},status:e.status==="cancelling"?"cancelling":"streaming"}}function O(e,t){switch(t.type){case"turn.start":return{...e,live:{text:"",reasoning:"",last:void 0},status:"thinking",turnFrom:e.items.length};case"model.result":return x(e);case"model.chunk":return R(e,t.data.kind,t.data.delta);case"tool.call":return{...c(x(e),"tool",`${t.data.slug}${t.data.mutating?" (changes state)":""}`,{callId:t.data.callId,pending:!0}),status:e.status==="cancelling"?"cancelling":"working"};case"tool.result":{let{slug:n,callId:r,ok:s,latencyMs:u,truncated:o}=t.data,d=`${n} — ${s?"ok":"failed"} · ${u} ms${o?" · observation trimmed":""}`,a=e.items.findIndex((m)=>m.callId===r&&m.pending===!0);if(a===-1)return c(e,s?"tool":"error",d);let i=[...e.items],p=i[a];return i[a]={id:p.id,role:s?"tool":"error",text:d,callId:r},{...e,items:i}}case"tool.gated":return c(e,"note",`${t.data.slug} — blocked: ${t.data.reason}`);case"tool.repair":return c(e,"note",`${t.data.slugs.join(", ")} — could not be used, asking the model again`);case"model.retry":{let{status:n,attempt:r,delayMs:s}=t.data;return c(e,"note",`retrying after HTTP ${n} — attempt ${r}, waiting ${s} ms`)}case"turn.end":{let{reason:n,steps:r,tokens:s,durationMs:u}=t.data,o={promptTokens:s.prompt,outputTokens:s.output,durationMs:u,steps:r,reason:n},d=x(e),a=e.turnFrom??0,i=-1;for(let h=d.items.length-1;h>=a;h-=1)if(d.items[h]?.role==="assistant"){i=h;break}let p=ze(n,{steps:r,durationMs:u});if(i===-1)return{...c(d,"note",p??(n==="final"?"the model returned no text":""),{stats:o}),live:void 0,status:"idle",turnFrom:void 0};let m=[...d.items],y=m[i];m[i]={...y,stats:o};let g={...d,items:m,live:void 0,status:"idle",turnFrom:void 0};return p===void 0?g:c(g,"note",p)}case"error":{let{code:n,message:r,hint:s}=t.data;return c(e,"error",`${n}: ${r}
@@ -9,4 +9,4 @@ hint: ${s}`)}case"context.dropped":{let{messages:n,budget:r}=t.data;return c(e,"
9
9
  export{Yn,yo,wo,on,sn,$t,Xn,lt,bo,vo,yr,ko,So,xo,Eo};
10
10
 
11
11
  //# debugId=80D41C99B8E2899264756E2164756E21
12
- //# sourceMappingURL=index-zxh0ntgf.js.map
12
+ //# sourceMappingURL=index-258d8bzg.js.map
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import{xe}from"./index-000rxxy3.js";import{Ho}from"./index-d4x6yvqh.js";import{Xo,_n,Qo,es,s,is}from"./index-2wmsmcbr.js";function p(){return{out:process.stdout,in:process.stdin}}var t=[],i=!1,a=!1,n=!1,d=!1,u=!1,l=!1,c=!1;function Wt(){n=!0}function me(){n=!0,d=!0}function Zr(){n=!0,u=!0}function f(){n=!0,l=!0}function b(e){t.push(e)}function Vr(){c=!0}function J(e=p()){if(a||!n)return;if(a=!0,e.in.isTTY===!0&&e.in.setRawMode!==void 0)e.in.setRawMode(!1);if(e.out.isTTY!==!0)return;if(e.out.write(`${_n}${Xo}`),u)e.out.write(Ho);if(l)e.out.write(es);if(d)e.out.write(Qo)}async function ue(e=process.stdout){if(e.writableEnded===!0||e.destroyed===!0)return;await new Promise((o)=>{e.write("",()=>o())})}async function y(){for(let e of[...t].reverse())try{await e()}catch(o){process.stderr.write(`warning: cleanup failed: ${o instanceof Error?o.message:String(o)}
2
+ import{Ee}from"./index-mtn0g9vc.js";import{Ho}from"./index-d4x6yvqh.js";import{Xo,_n,Qo,es,s,is}from"./index-vgc3y3rm.js";function p(){return{out:process.stdout,in:process.stdin}}var t=[],i=!1,a=!1,n=!1,d=!1,u=!1,l=!1,c=!1;function Wt(){n=!0}function pe(){n=!0,d=!0}function Zr(){n=!0,u=!0}function f(){n=!0,l=!0}function b(e){t.push(e)}function Vr(){c=!0}function J(e=p()){if(a||!n)return;if(a=!0,e.in.isTTY===!0&&e.in.setRawMode!==void 0)e.in.setRawMode(!1);if(e.out.isTTY!==!0)return;if(e.out.write(`${_n}${Xo}`),u)e.out.write(Ho);if(l)e.out.write(es);if(d)e.out.write(Qo)}async function ue(e=process.stdout){if(e.writableEnded===!0||e.destroyed===!0)return;await new Promise((o)=>{e.write("",()=>o())})}async function y(){for(let e of[...t].reverse())try{await e()}catch(o){process.stderr.write(`warning: cleanup failed: ${o instanceof Error?o.message:String(o)}
3
3
  `)}t.length=0}async function T(e){await y(),J(),process.exitCode=e,await ue()}async function Dn(e){await T(e),process.exit(e)}function Yr(){if(i)return;i=!0,process.on("exit",()=>J()),process.on("SIGTERM",()=>{if(c)return;Dn(is)});let e=(o)=>(r)=>{J();let m=r instanceof Error?r.stack??r.message:String(r);process.stderr.write(`
4
4
  ${o}: ${m}
5
- `),Dn(s)};process.on("uncaughtException",e("uncaught exception")),process.on("unhandledRejection",e("unhandled rejection"))}function Z(e){if(e??xe().noEnhancedKeys)return{};return f(),{kittyKeyboard:{mode:"enabled",flags:["disambiguateEscapeCodes","reportEventTypes"]}}}function E(e){if(e.json)return{mode:"json",because:"--json was passed"};if(e.plain)return{mode:"plain",because:"--plain was passed"};if(e.oneShot)return{mode:"plain",because:"--input is always plain"};if(!e.stdoutIsTTY)return{mode:"plain",because:"stdout is not a terminal"};if(!e.stdinIsTTY)return{mode:"plain",because:"stdin is not a terminal"};if(e.env.noColor)return{mode:"plain",because:"NO_COLOR is set"};if(e.env.dumbTerminal)return{mode:"plain",because:"TERM is dumb"};if(e.env.ci)return{mode:"plain",because:"CI is set"};return{mode:"rich",because:"stdout and stdin are both terminals"}}function ie(e){return E({...e,stdinIsTTY:process.stdin.isTTY===!0,stdoutIsTTY:process.stdout.isTTY===!0,env:xe()})}
6
- export{Wt,me,Zr,b,Vr,J,ue,Dn,Yr,Z,ie};
5
+ `),Dn(s)};process.on("uncaughtException",e("uncaught exception")),process.on("unhandledRejection",e("unhandled rejection"))}function Z(e){if(e??Ee().noEnhancedKeys)return{};return f(),{kittyKeyboard:{mode:"enabled",flags:["disambiguateEscapeCodes","reportEventTypes"]}}}function E(e){if(e.json)return{mode:"json",because:"--json was passed"};if(e.plain)return{mode:"plain",because:"--plain was passed"};if(e.oneShot)return{mode:"plain",because:"--input is always plain"};if(!e.stdoutIsTTY)return{mode:"plain",because:"stdout is not a terminal"};if(!e.stdinIsTTY)return{mode:"plain",because:"stdin is not a terminal"};if(e.env.noColor)return{mode:"plain",because:"NO_COLOR is set"};if(e.env.dumbTerminal)return{mode:"plain",because:"TERM is dumb"};if(e.env.ci)return{mode:"plain",because:"CI is set"};return{mode:"rich",because:"stdout and stdin are both terminals"}}function ie(e){return E({...e,stdinIsTTY:process.stdin.isTTY===!0,stdoutIsTTY:process.stdout.isTTY===!0,env:Ee()})}
6
+ export{Wt,pe,Zr,b,Vr,J,ue,Dn,Yr,Z,ie};
7
7
 
8
- //# debugId=565CE5564AE8627C64756E2164756E21
9
- //# sourceMappingURL=index-nvm5hwe4.js.map
8
+ //# debugId=3E8EC0EBBACD374564756E2164756E21
9
+ //# sourceMappingURL=index-6p999cx4.js.map
@@ -7,6 +7,6 @@
7
7
  "/**\n * How output is rendered, resolved once per process.\n *\n * This mirrors the reasoning behind decision 3.5, which forbids the tool dialect from changing with\n * the model: behaviour that shifts silently with the environment cannot be reasoned about. So the\n * resolution is total and ordered, and it returns *why* it chose — the reason is printable, which is\n * what turns \"it wasn't interactive and I don't know why\" into a question with an answer.\n *\n * Measured, not assumed: importing Ink and React costs ~65 ms under Bun and ~170-210 ms under Node,\n * against a ~70 ms total runtime for `validate --json`. Nothing on a non-rich path may import them,\n * which is why this returns a mode rather than a renderer.\n */\n\nimport { readEnv } from \"#lib/env\"\nimport type { ModeDecision, ModeInputs } from \"#lib/schema\"\n\n/**\n * Total and ordered. Every branch is reachable and every input is consulted, so no combination of\n * flags and environment lands somewhere undocumented.\n */\nexport function resolveMode(inputs: ModeInputs): ModeDecision {\n if (inputs.json) return { mode: \"json\", because: \"--json was passed\" }\n if (inputs.plain) return { mode: \"plain\", because: \"--plain was passed\" }\n\n // A one-shot is a scripting affordance. Its output must not depend on whether a human happened\n // to be at a terminal, or `--input` would mean two different things in a shell script and in a\n // shell.\n if (inputs.oneShot) return { mode: \"plain\", because: \"--input is always plain\" }\n\n if (!inputs.stdoutIsTTY) return { mode: \"plain\", because: \"stdout is not a terminal\" }\n // A live transcript with no way to type into it is a worse plain renderer, not a better one.\n if (!inputs.stdinIsTTY) return { mode: \"plain\", because: \"stdin is not a terminal\" }\n\n if (inputs.env.noColor) return { mode: \"plain\", because: \"NO_COLOR is set\" }\n if (inputs.env.dumbTerminal) return { mode: \"plain\", because: \"TERM is dumb\" }\n // CI logs are files that happen to scroll. Cursor movement in one is noise forever.\n if (inputs.env.ci) return { mode: \"plain\", because: \"CI is set\" }\n\n return { mode: \"rich\", because: \"stdout and stdin are both terminals\" }\n}\n\n/**\n * Deliberately not consulted: `FORCE_COLOR`. It says how much colour a stream can carry, not\n * whether a human is watching, and honouring it here would turn a CI job that wanted coloured logs\n * into one driving a cursor around a file. Ink's own colour depth still respects it.\n */\nexport function resolveModeFromProcess(flags: {\n readonly json: boolean\n readonly plain: boolean\n readonly oneShot: boolean\n}): ModeDecision {\n return resolveMode({\n ...flags,\n stdinIsTTY: process.stdin.isTTY === true,\n stdoutIsTTY: process.stdout.isTTY === true,\n env: readEnv(),\n })\n}\n"
8
8
  ],
9
9
  "mappings": ";0HA6CA,SAAS,CAAc,EAAoB,CACvC,MAAO,CAA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O,IAAI,QAAS,MAAO,CAAE,KAAM,QAAS,QAAS,iBAAkB,EAC3E,GAAI,EAAO,IAAI,aAAc,MAAO,CAAE,KAAM,QAAS,QAAS,cAAe,EAE7E,GAAI,EAAO,IAAI,GAAI,MAAO,CAAE,KAAM,QAAS,QAAS,WAAY,EAEhE,MAAO,CAAE,KAAM,OAAQ,QAAS,qCAAsC,EAQnE,SAAS,EAAsB,CAAC,EAItB,CACb,OAAO,EAAY,IACZ,EACH,WAAY,QAAQ,MAAM,QAAU,GACpC,YAAa,QAAQ,OAAO,QAAU,GACtC,IAAK,GAAQ,CACjB,CAAC",
10
- "debugId": "565CE5564AE8627C64756E2164756E21",
10
+ "debugId": "3E8EC0EBBACD374564756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import{o,u}from"./index-d4x6yvqh.js";import{bn}from"./index-zked16y4.js";import{Box as m,Text as i}from"ink";import{jsx as d,jsxs as l}from"react/jsx-runtime";function nn({label:p,editor:a,placeholder:e,error:r,secret:f,columns:t,maxRows:n}){return l(m,{flexDirection:"column",children:[d(i,{children:p}),d(bn,{editor:a,gutter:u.prompt,...e===void 0?{}:{placeholder:e},...f===!0?{secret:!0}:{},...t===void 0?{}:{columns:t},...n===void 0?{}:{maxRows:n}}),r===void 0?null:l(i,{color:o.error,children:[u.error,r]})]})}
2
+ import{o,u}from"./index-d4x6yvqh.js";import{bn}from"./index-02dn6m2j.js";import{Box as m,Text as i}from"ink";import{jsx as d,jsxs as l}from"react/jsx-runtime";function nn({label:p,editor:a,placeholder:e,error:r,secret:f,columns:t,maxRows:n}){return l(m,{flexDirection:"column",children:[d(i,{children:p}),d(bn,{editor:a,gutter:u.prompt,...e===void 0?{}:{placeholder:e},...f===!0?{secret:!0}:{},...t===void 0?{}:{columns:t},...n===void 0?{}:{maxRows:n}}),r===void 0?null:l(i,{color:o.error,children:[u.error,r]})]})}
3
3
  export{nn};
4
4
 
5
5
  //# debugId=F7AC4B15F45FF29764756E2164756E21
6
- //# sourceMappingURL=index-73jfw4jp.js.map
6
+ //# sourceMappingURL=index-6q4wf8e3.js.map