dispach 0.1.0 → 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.
- package/README.md +131 -31
- package/dist/App-b1yrwrcq.js +11 -0
- package/dist/{App-dxqm39zx.js.map → App-b1yrwrcq.js.map} +1 -1
- package/dist/{ConfigEditor-7v5nebvy.js → ConfigEditor-n8hdw6r7.js} +4 -4
- package/dist/{ConfigEditor-7v5nebvy.js.map → ConfigEditor-n8hdw6r7.js.map} +1 -1
- package/dist/{KeyProbe-vjhmdpx6.js → KeyProbe-9jjeze5r.js} +3 -3
- package/dist/{KeyProbe-vjhmdpx6.js.map → KeyProbe-9jjeze5r.js.map} +1 -1
- package/dist/{Picker-jxaesaxy.js → Picker-hfeh1g6m.js} +3 -3
- package/dist/{Picker-jxaesaxy.js.map → Picker-hfeh1g6m.js.map} +1 -1
- package/dist/{SessionPicker-z2t0p4b5.js → SessionPicker-zyqkg4dn.js} +3 -3
- package/dist/{SessionPicker-z2t0p4b5.js.map → SessionPicker-zyqkg4dn.js.map} +1 -1
- package/dist/{SkillBrowser-yyf2gy0q.js → SkillBrowser-3qdp8080.js} +3 -3
- package/dist/{SkillBrowser-yyf2gy0q.js.map → SkillBrowser-3qdp8080.js.map} +1 -1
- package/dist/WizardApp-vzpbydy3.js +5 -0
- package/dist/{WizardApp-12ndxgqv.js.map → WizardApp-vzpbydy3.js.map} +1 -1
- package/dist/client.js +10 -10
- package/dist/client.js.map +5 -5
- package/dist/{config-yz0nz51b.js → config-g7za9x13.js} +13 -13
- package/dist/{config-yz0nz51b.js.map → config-g7za9x13.js.map} +1 -1
- package/dist/credential-npr6z8c8.js +19 -0
- package/dist/{credential-wgt4gvcz.js.map → credential-npr6z8c8.js.map} +2 -2
- package/dist/index-02dn6m2j.js +7 -0
- package/dist/{index-h2yds678.js.map → index-02dn6m2j.js.map} +1 -1
- package/dist/index-0d93hyfc.js +6 -0
- package/dist/{index-rqbtm761.js.map → index-0d93hyfc.js.map} +1 -1
- package/dist/index-1c5113t4.js +66 -0
- package/dist/index-1c5113t4.js.map +12 -0
- package/dist/{index-3nwfz9jq.js → index-258d8bzg.js} +10 -10
- package/dist/{index-3nwfz9jq.js.map → index-258d8bzg.js.map} +1 -1
- package/dist/{index-9d011p3q.js → index-3g3ny01d.js} +4 -4
- package/dist/{index-9d011p3q.js.map → index-3g3ny01d.js.map} +1 -1
- package/dist/{index-8bmhd2hj.js → index-4cf6v9nb.js} +4 -4
- package/dist/{index-8bmhd2hj.js.map → index-4cf6v9nb.js.map} +1 -1
- package/dist/{index-bwckzbf8.js → index-4z7axw4r.js} +4 -4
- package/dist/{index-bwckzbf8.js.map → index-4z7axw4r.js.map} +1 -1
- package/dist/{index-xgqzk5cq.js → index-6p999cx4.js} +6 -6
- package/dist/{index-xgqzk5cq.js.map → index-6p999cx4.js.map} +1 -1
- package/dist/index-6q4wf8e3.js +6 -0
- package/dist/{index-jym27m75.js.map → index-6q4wf8e3.js.map} +1 -1
- package/dist/{index-cx3vz7sf.js → index-9r0wyj6w.js} +4 -4
- package/dist/{index-cx3vz7sf.js.map → index-9r0wyj6w.js.map} +1 -1
- package/dist/{index-j97vttdt.js → index-ammv5st7.js} +6 -6
- package/dist/{index-j97vttdt.js.map → index-ammv5st7.js.map} +1 -1
- package/dist/{index-qc2vrq9z.js → index-cqqb6gaq.js} +5 -5
- package/dist/{index-qc2vrq9z.js.map → index-cqqb6gaq.js.map} +1 -1
- package/dist/{index-jk0def33.js → index-d4x6yvqh.js} +4 -4
- package/dist/{index-jk0def33.js.map → index-d4x6yvqh.js.map} +1 -1
- package/dist/index-fecm8xe7.js +77 -0
- package/dist/index-fecm8xe7.js.map +12 -0
- package/dist/{index-e8n70sgj.js → index-fex44816.js} +4 -4
- package/dist/{index-e8n70sgj.js.map → index-fex44816.js.map} +1 -1
- package/dist/{index-gbnc99j8.js → index-ff514z3y.js} +9 -9
- package/dist/{index-gbnc99j8.js.map → index-ff514z3y.js.map} +1 -1
- package/dist/{index-t1xvacym.js → index-gme2egyq.js} +4 -4
- package/dist/{index-t1xvacym.js.map → index-gme2egyq.js.map} +1 -1
- package/dist/{index-mrtb5y08.js → index-gz9x25tz.js} +4 -4
- package/dist/{index-mrtb5y08.js.map → index-gz9x25tz.js.map} +1 -1
- package/dist/{index-9nsfs0vy.js → index-h9mw7b9d.js} +4 -4
- package/dist/{index-9nsfs0vy.js.map → index-h9mw7b9d.js.map} +1 -1
- package/dist/{index-6b7qvh1x.js → index-hwpvhaza.js} +4 -4
- package/dist/{index-6b7qvh1x.js.map → index-hwpvhaza.js.map} +1 -1
- package/dist/{index-6z0yr17z.js → index-j55s3ehk.js} +7 -7
- package/dist/{index-6z0yr17z.js.map → index-j55s3ehk.js.map} +1 -1
- package/dist/{index-mgdgx22q.js → index-j7gyr5nx.js} +6 -6
- package/dist/{index-mgdgx22q.js.map → index-j7gyr5nx.js.map} +1 -1
- package/dist/{index-7da4fqcr.js → index-mtn0g9vc.js} +5 -5
- package/dist/{index-7da4fqcr.js.map → index-mtn0g9vc.js.map} +1 -1
- package/dist/{index-rqzg861g.js → index-qdbq8crg.js} +4 -4
- package/dist/{index-rqzg861g.js.map → index-qdbq8crg.js.map} +1 -1
- package/dist/{index-xqyms08r.js → index-s9mbq7h6.js} +4 -4
- package/dist/{index-xqyms08r.js.map → index-s9mbq7h6.js.map} +1 -1
- package/dist/{index-9f9pp2ef.js → index-tf71ap9v.js} +4 -4
- package/dist/{index-9f9pp2ef.js.map → index-tf71ap9v.js.map} +1 -1
- package/dist/index-ttwyrdjs.js +427 -0
- package/dist/index-ttwyrdjs.js.map +11 -0
- package/dist/{index-2cvtz0fy.js → index-tv4yv7d2.js} +228 -228
- package/dist/{index-2cvtz0fy.js.map → index-tv4yv7d2.js.map} +9 -9
- package/dist/{index-fvhg0xyd.js → index-ty24n0jh.js} +79 -79
- package/dist/{index-fvhg0xyd.js.map → index-ty24n0jh.js.map} +1 -1
- package/dist/index-v8e92nfw.js +6 -0
- package/dist/{index-b8zwg8a3.js.map → index-v8e92nfw.js.map} +1 -1
- package/dist/index-vgc3y3rm.js +6 -0
- package/dist/{index-my5cjx00.js.map → index-vgc3y3rm.js.map} +1 -1
- package/dist/index-whaw4b18.js +6 -0
- package/dist/index-whaw4b18.js.map +10 -0
- package/dist/index.js +202 -198
- package/dist/index.js.map +6 -6
- package/dist/lib/bootstrap.d.ts +13 -0
- package/dist/lib/bootstrap.d.ts.map +1 -1
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/init-flow.d.ts +17 -4
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/{web-w7r68df1.js → web-vkb16r62.js} +5 -5
- package/dist/{web-w7r68df1.js.map → web-vkb16r62.js.map} +1 -1
- package/dist/wire.js +10 -10
- package/dist/wire.js.map +4 -4
- package/package.json +2 -2
- package/dist/App-dxqm39zx.js +0 -11
- package/dist/WizardApp-12ndxgqv.js +0 -5
- package/dist/credential-wgt4gvcz.js +0 -19
- package/dist/index-9pj1ws0p.js +0 -77
- package/dist/index-9pj1ws0p.js.map +0 -12
- package/dist/index-b5wwtxzk.js +0 -66
- package/dist/index-b5wwtxzk.js.map +0 -12
- package/dist/index-b8zwg8a3.js +0 -6
- package/dist/index-bry9bzt3.js +0 -427
- package/dist/index-bry9bzt3.js.map +0 -11
- package/dist/index-h2yds678.js +0 -7
- package/dist/index-jym27m75.js +0 -6
- package/dist/index-my5cjx00.js +0 -6
- package/dist/index-rqbtm761.js +0 -6
- package/dist/index-yr25dnf5.js +0 -6
- package/dist/index-yr25dnf5.js.map +0 -10
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{E,
|
|
3
|
-
`)}function
|
|
4
|
-
`)}function
|
|
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
|
|
6
|
-
hint: ${s}`)}case"context.dropped":{let{messages:n,budget:r}=t.data;return c(e,"note",`context: ${n} older message(s) did not fit the ${r}-token budget and were left out`)}case"agent.warning":{let{code:n,message:r}=t.data;return c(e,"note",`${n}: ${r}`)}case"context.pressure":return{...e,pressure:t.data.fraction};case"compaction.stage":{let{stage:n,changed:r,before:s,after:u}=t.data;if(!r||n!=="collapse"&&n!=="reset")return e;return c(e,"note",`context: ${n==="reset"?"the conversation so far was replaced by a summary":"earlier turns were replaced by a summary"} (${s} → ${u} tokens)`)}case"phase.changed":{let{to:n,tools:r}=t.data;return{...c(e,"note",`phase: now in ${n} · ${r} tool${r===1?"":"s"} available`),phase:n}}case"context.reset":{let{warning:n}=t.data;return n===void 0?e:c(e,"note",`context: ${n}`)}default:return e}}function
|
|
7
|
-
`))}function
|
|
8
|
-
`);n.push(s({key:`${o.id}:title`,role:"banner",text:p,bold:!0}));for(let[y,g]of m.entries())for(let[h,C]of
|
|
9
|
-
export{
|
|
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
|
+
`)}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
|
+
`)}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
|
+
`)}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}
|
|
6
|
+
hint: ${s}`)}case"context.dropped":{let{messages:n,budget:r}=t.data;return c(e,"note",`context: ${n} older message(s) did not fit the ${r}-token budget and were left out`)}case"agent.warning":{let{code:n,message:r}=t.data;return c(e,"note",`${n}: ${r}`)}case"context.pressure":return{...e,pressure:t.data.fraction};case"compaction.stage":{let{stage:n,changed:r,before:s,after:u}=t.data;if(!r||n!=="collapse"&&n!=="reset")return e;return c(e,"note",`context: ${n==="reset"?"the conversation so far was replaced by a summary":"earlier turns were replaced by a summary"} (${s} → ${u} tokens)`)}case"phase.changed":{let{to:n,tools:r}=t.data;return{...c(e,"note",`phase: now in ${n} · ${r} tool${r===1?"":"s"} available`),phase:n}}case"context.reset":{let{warning:n}=t.data;return n===void 0?e:c(e,"note",`context: ${n}`)}default:return e}}function yr(e){return`${e.promptTokens} prompt · ${e.outputTokens} output · ${e.durationMs} ms`}function ko(e){if(e.length===0)return S;return c(S,"banner",e.join(`
|
|
7
|
+
`))}function So(e,t){let n=e;for(let r of t){if(r.text.trim()==="")continue;n=c(n,r.role,r.text)}return n}function xo(e){for(let t=e.length-1;t>=0;t-=1){let n=e[t]?.stats;if(n!==void 0)return n}return}function Eo(e,t){let n=[],r=e.filter((u)=>u.role!=="reasoning"||t.showReasoning),s=(u)=>({...u,lead:0,continuation:!1});for(let[u,o]of r.entries()){if(u>0)n.push(s({key:`${o.id}:gap`,role:o.role,text:""}));if(o.role==="banner"){let[p="",...m]=o.text.split(`
|
|
8
|
+
`);n.push(s({key:`${o.id}:title`,role:"banner",text:p,bold:!0}));for(let[y,g]of m.entries())for(let[h,C]of sr(g,t.columns).entries())n.push({key:`${o.id}:note-${y}-${h}`,role:"banner",text:C,dim:!0,lead:0,continuation:h>0});continue}let d=Zo[o.role],a=" ".repeat([...d].length),i=sr(o.text,Math.max(1,t.columns-[...d].length));if(o.role==="reasoning"){let p=t.expandReasoning===!0?i.length:Math.min(i.length,ns),m=i.length-p;n.push(s({key:`${o.id}:label`,role:"reasoning",dim:!0,text:m>0?`· reasoning · ${i.length} rows · ⌥r expands`:`· reasoning · ${i.length} row${i.length===1?"":"s"}`}));for(let[y,g]of i.slice(0,p).entries())n.push({key:`${o.id}:${y}`,role:"reasoning",text:`${a}${g}`,lead:a.length,continuation:y>0});if(m>0)n.push(s({key:`${o.id}:folded`,role:"reasoning",dim:!0,text:`${a}… ${m} more row${m===1?"":"s"}`}));continue}for(let[p,m]of i.entries())n.push({key:`${o.id}:${p}`,role:o.role,text:`${p===0?d:a}${m}`,lead:[...d].length,continuation:p>0});if(o.stats!==void 0&&!t.quiet)n.push(s({key:`${o.id}:stats`,role:o.role,text:` ${yr(o.stats)}`,dim:!0}))}return n}
|
|
9
|
+
export{Yn,yo,wo,on,sn,$t,Xn,lt,bo,vo,yr,ko,So,xo,Eo};
|
|
10
10
|
|
|
11
|
-
//# debugId=
|
|
12
|
-
//# sourceMappingURL=index-
|
|
11
|
+
//# debugId=80D41C99B8E2899264756E2164756E21
|
|
12
|
+
//# sourceMappingURL=index-258d8bzg.js.map
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"/**\n * Events in, view state out. Pure, and the only place that decides what a turn looks like.\n *\n * The CLI has always been a `runtime.bus` subscriber; this makes it a *reducer* over that bus\n * instead of a set of callbacks writing to stdout. Three things follow from that:\n *\n * - \"What does the reader see when a turn errors mid-stream?\" is a unit test rather than something\n * reproduced by hand against a live endpoint.\n * - Finished items are append-only and immutable, which is exactly the contract Ink's `<Static>`\n * needs: a node written once and never re-rendered. The still-moving reply lives in `live`, so\n * the dynamic region stays one item regardless of how long the conversation gets.\n * - Phase 4's SSE client and Phase 12's TUI client can consume the same reduction instead of\n * re-deriving it.\n *\n * No clock and no randomness: ids come from a counter in the state, so the same events always\n * produce the same output and the tests need no fakes.\n */\n\nimport { type AnyEvent, endNote } from \"@dispach/core\"\nimport { MAX_TRANSCRIPT_ITEMS, REASONING_FOLD_ROWS } from \"#lib/const\"\nimport { ROLE_PREFIX } from \"#lib/theme\"\nimport type {\n TranscriptItem,\n TranscriptRole,\n TranscriptRow,\n TranscriptState,\n TurnStats,\n} from \"#lib/types\"\nimport { wrapText } from \"#lib/wrap\"\n\n/**\n * The transcript is driven by more than the bus — a typed line and a cancellation request are not\n * events — so the reducer takes an action union rather than an event directly.\n */\nexport type TranscriptAction =\n | { readonly kind: \"user\"; readonly text: string }\n | { readonly kind: \"event\"; readonly event: AnyEvent }\n | { readonly kind: \"note\"; readonly text: string }\n | { readonly kind: \"cancelling\" }\n /**\n * A model delta that has already been through the dialect's stream filter.\n *\n * Filtering cannot happen in here: a filter is stateful and this reducer is pure. So the caller\n * owns one per step and dispatches what is left. A caller that dispatches the raw `model.chunk`\n * event instead still works — it just shows the invocation blocks, which is right for a dialect\n * with no in-band protocol and wrong for NLT.\n */\n | { readonly kind: \"delta\"; readonly of: \"text\" | \"reasoning\"; readonly text: string }\n /**\n * Drop the oldest items if the buffer is over `MAX_TRANSCRIPT_ITEMS`.\n *\n * An action rather than something `append` does on its own, because whether it is *safe* depends on\n * a fact this reducer cannot see: rows are addressed by position, so dropping any from the front\n * moves every offset below them. A reader parked twelve turns back would keep their offset and\n * silently start reading different text — the appearance of a live session that is not one, which is\n * the failure `ScrollState.pinned` exists to make impossible. Only the layer holding that flag knows\n * when eviction is allowed, so only it can ask.\n */\n | { readonly kind: \"trim\" }\n\nexport const EMPTY_TRANSCRIPT: TranscriptState = {\n items: [],\n live: undefined,\n status: \"idle\",\n nextId: 0,\n turnFrom: undefined,\n}\n\nfunction append(\n state: TranscriptState,\n role: TranscriptRole,\n text: string,\n extra: {\n readonly stats?: TurnStats\n readonly callId?: string\n readonly pending?: boolean\n } = {},\n): TranscriptState {\n const item: TranscriptItem = {\n id: `t${state.nextId}`,\n role,\n text,\n ...(extra.stats === undefined ? {} : { stats: extra.stats }),\n ...(extra.callId === undefined ? {} : { callId: extra.callId }),\n ...(extra.pending === undefined ? {} : { pending: extra.pending }),\n }\n return { ...state, items: [...state.items, item], nextId: state.nextId + 1 }\n}\n\n/**\n * Commit whatever the model has streamed so far, and clear it.\n *\n * Called at each step boundary rather than once at the end of the turn, which is what puts the\n * transcript back in the order things happened. Committing at `turn.end` alone produced a turn shaped\n * \"every tool row, then all the reasoning, then all the text\" — so the reasoning that *decided* to call\n * a tool was printed below the tool's result, and step one's reasoning was concatenated onto step two's\n * with no break between them. Live output on a real turn read `…look for it in my workspace.The user is\n * asking me to…`, two sentences from two steps with nothing marking the join.\n *\n * Reasoning goes in ahead of the text it produced. Whether it is *shown* is the view's business — the\n * item is written either way, so `--show-reasoning` can be honoured after the fact.\n */\nfunction flushLive(state: TranscriptState): TranscriptState {\n const live = state.live\n if (live === undefined) return state\n let next = state\n if (live.reasoning !== \"\") next = append(next, \"reasoning\", live.reasoning)\n if (live.text !== \"\") next = append(next, \"assistant\", live.text)\n return { ...next, live: undefined }\n}\n\n/** `data` is typed per event in core's map; narrowing by `type` first is what makes this safe. */\nexport function reduce(state: TranscriptState, action: TranscriptAction): TranscriptState {\n switch (action.kind) {\n case \"user\":\n return append(state, \"user\", action.text)\n\n case \"note\":\n return append(state, \"note\", action.text)\n\n case \"cancelling\":\n // A state, not an item. Cancellation that produced partial text still ends in a\n // `turn.end`, and that is what commits the text.\n return state.status === \"idle\" ? state : { ...state, status: \"cancelling\" }\n\n case \"delta\":\n return applyDelta(state, action.of, action.text)\n\n case \"event\":\n return reduceEvent(state, action.event)\n\n case \"trim\":\n return trim(state)\n }\n}\n\n/**\n * The oldest items above the cap, dropped. Identity when there is nothing to do.\n *\n * Returning the same object rather than a copy is what makes this cheap to ask about: `useReducer`\n * compares by reference and skips the render, so the caller can dispatch on every change without\n * checking first — and a caller that has to check first is a caller that eventually forgets.\n *\n * The banner is an ordinary item and goes with the rest. It is four hundred turns of scrollback above\n * the reader by then, and exempting it would leave the session's opening line pinned above a\n * conversation it no longer describes.\n */\nfunction trim(state: TranscriptState): TranscriptState {\n const over = state.items.length - MAX_TRANSCRIPT_ITEMS\n return over <= 0 ? state : { ...state, items: state.items.slice(over) }\n}\n\nfunction applyDelta(\n state: TranscriptState,\n kind: \"text\" | \"reasoning\",\n delta: string,\n): TranscriptState {\n if (delta === \"\") return state\n const live = state.live ?? { text: \"\", reasoning: \"\", last: undefined }\n return {\n ...state,\n live: {\n text: kind === \"text\" ? live.text + delta : live.text,\n reasoning: kind === \"reasoning\" ? live.reasoning + delta : live.reasoning,\n last: kind,\n },\n // A cancellation already asked for is not undone by another token arriving in flight; the\n // request stands until the turn actually ends.\n status: state.status === \"cancelling\" ? \"cancelling\" : \"streaming\",\n }\n}\n\nfunction reduceEvent(state: TranscriptState, event: AnyEvent): TranscriptState {\n switch (event.type) {\n case \"turn.start\":\n return {\n ...state,\n live: { text: \"\", reasoning: \"\", last: undefined },\n status: \"thinking\",\n turnFrom: state.items.length,\n }\n\n case \"model.result\":\n // The step boundary. `model.result` is emitted once per model call, so this is where a step's\n // reasoning and text stop growing — no new event was needed to find it.\n return flushLive(state)\n\n case \"model.chunk\":\n return applyDelta(state, event.data.kind, event.data.delta)\n\n case \"tool.call\":\n // Committed the moment the call starts, not when it returns: a tool that takes eight\n // seconds must not leave the screen looking like a stalled model. Anything the model\n // streamed before deciding to call it is flushed first, so the reasoning sits above the\n // call it explains rather than below the call's result.\n return {\n ...append(\n flushLive(state),\n \"tool\",\n `${event.data.slug}${event.data.mutating ? \" (changes state)\" : \"\"}`,\n { callId: event.data.callId, pending: true },\n ),\n status: state.status === \"cancelling\" ? \"cancelling\" : \"working\",\n }\n\n case \"tool.result\": {\n const { slug, callId, ok, latencyMs, truncated } = event.data\n const text = `${slug} — ${ok ? \"ok\" : \"failed\"} · ${latencyMs} ms${truncated ? \" · observation trimmed\" : \"\"}`\n // The call's own row, completed. Matched on `callId` rather than on position, because calls\n // can overlap and \"the last tool row\" is then not the row this result belongs to.\n const at = state.items.findIndex(\n (item) => item.callId === callId && item.pending === true,\n )\n if (at === -1) {\n // No row to complete — a result for a call this transcript never saw. Appended rather\n // than dropped: an observation nobody can account for is exactly the thing worth seeing.\n return append(state, ok ? \"tool\" : \"error\", text)\n }\n const items = [...state.items]\n const item = items[at] as TranscriptItem\n items[at] = { id: item.id, role: ok ? \"tool\" : \"error\", text, callId }\n return { ...state, items }\n }\n\n case \"tool.gated\":\n // Deliberately visible. A blocked write is the one tool outcome a person must not have\n // to go looking for — and it is a `note` rather than an `error` because the wire spec is\n // explicit that this is not one: the turn continues and the model reports back.\n return append(state, \"note\", `${event.data.slug} — blocked: ${event.data.reason}`)\n\n case \"tool.repair\":\n // A silent repair is indistinguishable from a slow turn, and it costs a whole step.\n return append(\n state,\n \"note\",\n `${event.data.slugs.join(\", \")} — could not be used, asking the model again`,\n )\n\n case \"model.retry\": {\n const { status, attempt, delayMs } = event.data\n return append(\n state,\n \"note\",\n `retrying after HTTP ${status} — attempt ${attempt}, waiting ${delayMs} ms`,\n )\n }\n\n case \"turn.end\": {\n const { reason, steps, tokens, durationMs } = event.data\n const stats: TurnStats = {\n promptTokens: tokens.prompt,\n outputTokens: tokens.output,\n durationMs,\n steps,\n reason,\n }\n\n // Whatever the last step streamed but never got a `model.result` for — a cancelled turn, or\n // one that ended on an error mid-stream. On a clean turn this is a no-op, because each step\n // committed itself as it finished.\n const next = flushLive(state)\n const from = state.turnFrom ?? 0\n // The reply this turn produced, which is where its cost belongs. Searched from the turn's own\n // first item: without that floor, a turn that produced no text would hang its statistics on\n // the *previous* turn's reply, which reads as that reply having cost twice.\n let reply = -1\n for (let at = next.items.length - 1; at >= from; at -= 1) {\n if (next.items[at]?.role === \"assistant\") {\n reply = at\n break\n }\n }\n // Why the turn stopped, from the formatter the plain path uses. Until this existed\n // `stats.reason` reached the reducer and was rendered nowhere, so a turn the step budget\n // cut off looked exactly like a completed one — which is how an agent came to stop\n // mid-task on \"Let me install it\" with nothing on screen explaining it.\n const why = endNote(reason, { steps, durationMs })\n\n if (reply === -1) {\n // A turn that produced nothing is not a normal outcome and must not look like one.\n const said = append(\n next,\n \"note\",\n why ?? (reason === \"final\" ? \"the model returned no text\" : \"\"),\n { stats },\n )\n return { ...said, live: undefined, status: \"idle\", turnFrom: undefined }\n }\n const items = [...next.items]\n const item = items[reply] as TranscriptItem\n items[reply] = { ...item, stats }\n const settled: TranscriptState = {\n ...next,\n items,\n live: undefined,\n status: \"idle\",\n turnFrom: undefined,\n }\n // Below the reply, not attached to it: the reply is what the model said, and this is what\n // the runtime did. Attaching it to the item would put a harness sentence in the model's\n // voice — the distinction `note` exists for.\n return why === undefined ? settled : append(settled, \"note\", why)\n }\n\n // `agent.error` used to fall through to here. It was declared in Phase 1, carried a\n // hint, and was emitted by **nothing, ever** — so this label was reachable only from a\n // test that constructed one by hand. Deleted rather than wired up: `error` already\n // carries every uncaught failure, and a second error event with no emitter is vocabulary\n // that makes the catalogue look richer than it is.\n case \"error\": {\n const { code, message, hint } = event.data\n return append(state, \"error\", `${code}: ${message}\\nhint: ${hint}`)\n }\n\n case \"context.dropped\": {\n const { messages, budget } = event.data\n // A note, not a stage line: the ladder decided what to compact and this is the budget\n // running out regardless. Worth saying because the agent is now answering without part of\n // the conversation, and nothing else on any surface would mention it.\n return append(\n state,\n \"note\",\n `context: ${messages} older message(s) did not fit the ${budget}-token budget and were left out`,\n )\n }\n\n case \"agent.warning\": {\n const { code, message } = event.data\n return append(state, \"note\", `${code}: ${message}`)\n }\n\n case \"context.pressure\":\n // A gauge, so it replaces rather than accumulates. `source` is deliberately not shown: it\n // is diagnostic and the status line has no room for a word that changes nothing a person\n // would do — it is on the event for whoever is reading events.\n return { ...state, pressure: event.data.fraction }\n\n case \"compaction.stage\": {\n const { stage, changed, before, after } = event.data\n // Only the stages that destroy detail get a line. trim, snip and micro are recoverable —\n // the conversation is still in the store and a snipped observation keeps a pointer — while\n // collapse and reset replace a span of the conversation with a summary, and a person who\n // was not watching the gauge still needs to know that happened.\n if (!changed || (stage !== \"collapse\" && stage !== \"reset\")) return state\n const what =\n stage === \"reset\"\n ? \"the conversation so far was replaced by a summary\"\n : \"earlier turns were replaced by a summary\"\n return append(state, \"note\", `context: ${what} (${before} → ${after} tokens)`)\n }\n\n case \"phase.changed\": {\n const { to, tools } = event.data\n // A line *and* the gauge. The line because a phase change is the reason the agent's\n // abilities changed mid-conversation, and a person scrolling back needs it where it\n // happened; the gauge because \"which phase am I in\" is a current-state question.\n const next = append(\n state,\n \"note\",\n `phase: now in ${to} · ${tools} tool${tools === 1 ? \"\" : \"s\"} available`,\n )\n return { ...next, phase: to }\n }\n\n case \"context.reset\": {\n const { warning } = event.data\n // The count itself is not shown — the note above already said what happened. A *second*\n // reset is a configuration problem rather than a busy session, and that is worth a line.\n return warning === undefined ? state : append(state, \"note\", `context: ${warning}`)\n }\n\n default:\n // Boot and bookkeeping events — `runtime.ready`, `store.ready`, `model.call`,\n // `context.assembled`. They belong to the banner and the status bar, not the transcript. Ignored explicitly so that a new event type added in a later\n // phase is inert here rather than a crash.\n return state\n }\n}\n\n/** What a renderer writes for a turn's cost. Kept here so the plain and rich paths agree. */\nexport function formatStats(stats: TurnStats): string {\n return `${stats.promptTokens} prompt · ${stats.outputTokens} output · ${stats.durationMs} ms`\n}\n\n/**\n * Opening banner — version, session, store, any turn a previous process left unfinished.\n *\n * One `banner` item rather than N notes, so the rich renderer can box it as a unit. The plain\n * path never calls this — it writes the lines directly — so plain output is unchanged by the\n * boxing.\n */\nexport function seed(notes: readonly string[]): TranscriptState {\n if (notes.length === 0) return EMPTY_TRANSCRIPT\n return append(EMPTY_TRANSCRIPT, \"banner\", notes.join(\"\\n\"))\n}\n\n/** One earlier message, as much of it as a transcript row needs. */\nexport interface PriorMessage {\n readonly role: \"user\" | \"assistant\"\n readonly text: string\n}\n\n/**\n * Put the conversation that already happened on the screen.\n *\n * Resuming used to paint an empty transcript over a full history: the messages reached the *model* and\n * never the person, so the banner said `17 message(s)` above a blank screen and the only honest reading\n * was that something had been lost. Rendering them is what makes that count verifiable.\n *\n * A separate function rather than a second argument to `seed`, because an optional parameter here would\n * have to distinguish \"no history\" from \"not asked for\" — and under `exactOptionalPropertyTypes` a\n * default parameter fires on an explicitly passed `undefined`, which has already cost this repo a\n * debugging round. `seedHistory(seed(banner), prior)` composes with nothing to remember.\n *\n * **Prose only.** Tool calls and observations are left out for the same reason they are left out of the\n * memory index: an observation is a wall of text a stranger wrote, and replaying forty of them above the\n * composer buries the conversation the person came back for. The turn statistics are left off too — they\n * were true of a process that has exited, and a cost line under a resumed reply reads as this session's.\n */\nexport function seedHistory(\n state: TranscriptState,\n messages: readonly PriorMessage[],\n): TranscriptState {\n let next = state\n for (const message of messages) {\n if (message.text.trim() === \"\") continue\n next = append(next, message.role, message.text)\n }\n return next\n}\n\n/** The most recent completed turn's cost, for the status bar. */\nexport function lastStats(items: readonly TranscriptItem[]): TurnStats | undefined {\n for (let i = items.length - 1; i >= 0; i -= 1) {\n const stats = items[i]?.stats\n if (stats !== undefined) return stats\n }\n return undefined\n}\n\n// ─── the finished conversation, as rows ──────────────────────────────────────────────────\n\n/**\n * Flatten items into the rows a windowed transcript scrolls through.\n *\n * ## Why rows rather than items\n *\n * Scrolling by item is the cheaper thing to build and the wrong unit. One assistant reply is a single\n * item and forty rows on screen, so an item-indexed window either shows the whole answer or none of it —\n * page-up from the bottom of a long reply would jump over the entire thing and land on the question\n * before it. Rows are what a reader moves through, so rows are what the offset counts.\n *\n * Wrapping happens here, not in Ink. A window has to know its content's height before it draws any of\n * it, and a count Ink might disagree with is a window off by however many lines wrapped — which shows up\n * as the last line of a reply hidden under the composer, intermittently, depending on the text.\n *\n * Pure, and one derivation for both halves of the frame: the component renders these rows and the layout\n * asks how many there are.\n */\nexport function transcriptRows(\n items: readonly TranscriptItem[],\n options: {\n readonly showReasoning: boolean\n readonly quiet: boolean\n readonly columns: number\n /** Reasoning blocks are shown whole rather than folded to `REASONING_FOLD_ROWS`. */\n readonly expandReasoning?: boolean\n },\n): readonly TranscriptRow[] {\n const rows: TranscriptRow[] = []\n const visible = items.filter((item) => item.role !== \"reasoning\" || options.showReasoning)\n\n /**\n * A row this renderer invented: a gap, a label, a fold notice, a stats line.\n *\n * `lead: 0` because there is no prefix to exclude, and `continuation: false` because it starts a line of\n * its own. Selectable, deliberately — a stats line or a banner note is text somebody may well want to\n * copy, and the cells worth excluding are the role prefixes, which are per-row and handled below.\n */\n const chrome = (row: Omit<TranscriptRow, \"lead\" | \"continuation\">): TranscriptRow => ({\n ...row,\n lead: 0,\n continuation: false,\n })\n\n for (const [at, item] of visible.entries()) {\n // A blank row between items, and never a trailing one. The rich transcript is read rather than\n // grepped, and two turns that touch each other read as one wall of text; a blank row at the end\n // would instead be a permanent gap above the composer.\n if (at > 0) rows.push(chrome({ key: `${item.id}:gap`, role: item.role, text: \"\" }))\n\n if (item.role === \"banner\") {\n // The banner keeps its content and loses its border. A bordered box inside a windowed list\n // costs two rows this module cannot count — Ink measures the frame, not us — and the frame\n // was decoration on a surface that is now itself a frame.\n const [title = \"\", ...lines] = item.text.split(\"\\n\")\n rows.push(chrome({ key: `${item.id}:title`, role: \"banner\", text: title, bold: true }))\n for (const [n, line] of lines.entries()) {\n for (const [w, wrapped] of wrapText(line, options.columns).entries()) {\n rows.push({\n key: `${item.id}:note-${n}-${w}`,\n role: \"banner\",\n text: wrapped,\n dim: true,\n lead: 0,\n // Only rows the *wrap* invented continue; a fresh source line does not.\n continuation: w > 0,\n })\n }\n }\n continue\n }\n\n const prefix = ROLE_PREFIX[item.role]\n const pad = \" \".repeat([...prefix].length)\n // The prefix is part of the first row's width and an indent on every row after it, so a reply\n // that wraps stays in one column instead of reading as a second message.\n const body = wrapText(item.text, Math.max(1, options.columns - [...prefix].length))\n\n if (item.role === \"reasoning\") {\n // A header row and an indented body, rather than a label wide enough to be the indent. Folded\n // unless asked for: the block is secondary, and at full length it routinely fills the screen\n // and pushes the reply it produced out of sight.\n const shown =\n options.expandReasoning === true\n ? body.length\n : Math.min(body.length, REASONING_FOLD_ROWS)\n const folded = body.length - shown\n rows.push(\n chrome({\n key: `${item.id}:label`,\n role: \"reasoning\",\n dim: true,\n text:\n folded > 0\n ? `· reasoning · ${body.length} rows · ⌥r expands`\n : `· reasoning · ${body.length} row${body.length === 1 ? \"\" : \"s\"}`,\n }),\n )\n for (const [n, line] of body.slice(0, shown).entries()) {\n rows.push({\n key: `${item.id}:${n}`,\n role: \"reasoning\",\n text: `${pad}${line}`,\n lead: pad.length,\n continuation: n > 0,\n })\n }\n if (folded > 0) {\n rows.push(\n chrome({\n key: `${item.id}:folded`,\n role: \"reasoning\",\n dim: true,\n text: `${pad}… ${folded} more row${folded === 1 ? \"\" : \"s\"}`,\n }),\n )\n }\n continue\n }\n\n for (const [n, line] of body.entries()) {\n rows.push({\n key: `${item.id}:${n}`,\n role: item.role,\n text: `${n === 0 ? prefix : pad}${line}`,\n // The prefix on the first row and its hanging indent on every row after it are the same\n // width, so one number covers both — and it is exactly the span a copy must drop.\n lead: [...prefix].length,\n continuation: n > 0,\n })\n }\n\n if (item.stats !== undefined && !options.quiet) {\n rows.push(\n chrome({\n key: `${item.id}:stats`,\n role: item.role,\n text: ` ${formatStats(item.stats)}`,\n dim: true,\n }),\n )\n }\n }\n\n return rows\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";wLAuCO,IAAM,GAAkD,CAC3D,CAAE,KAAM,OAAQ,KAAM,QAAS,QAAS,CAAC,EAAG,QAAS,WAAY,EACjE,CAKI,KAAM,SACN,KAAM,UACN,QAAS,CAAC,EACV,QAAS,kFACb,EACA,CAII,KAAM,UACN,KAAM,WACN,QAAS,CAAC,EACV,QACI,uFACR,EACA,CACI,KAAM,UACN,KAAM,WACN,QAAS,CAAC,EACV,QACI,sGACR,EACA,CACI,KAAM,QACN,KAAM,SACN,QAAS,CAAC,EACV,QAAS,kEACb,EACA,CAII,KAAM,MACN,KAAM,OACN,QAAS,CAAC,EACV,QACI,2GACR,EACA,CACI,KAAM,QACN,KAAM,SACN,QAAS,CAAC,EACV,QACI,kGACR,EACA,CACI,KAAM,OACN,KAAM,QACN,QAAS,CAAC,QAAS,IAAI,EAIvB,QAAS,qDACb,CACJ,EAoBa,GAAe,+CAUf,GAAmB,uDAEnB,EAA0C,CACnD,CACI,MAAO,KACP,QACI,kGACR,EACA,CAAE,MAAO,KAAM,QAAS,6DAA8D,EACtF,CAAE,MAAO,UAAW,QAAS,6BAA8B,EAC3D,CAAE,MAAO,UAAW,QAAS,kCAAmC,EAChE,CAAE,MAAO,UAAW,QAAS,8CAA+C,EAC5E,CAAE,MAAO,KAAM,QAAS,mCAAoC,EAC5D,CAAE,MAAO,UAAW,QAAS,+CAAgD,EA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11
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
function
|
|
3
|
-
export{
|
|
2
|
+
function jo(t){let e=[],r=/\[(\d+);(\d+)(?::(\d+))?([A-Za-z~])/g;for(let s of t.matchAll(r)){let a=Number(s[1]),n=Number(s[2]),i=s[3],o=s[4]??"";if(!Number.isFinite(a)||!Number.isFinite(n)||n<1)continue;e.push({modifier:n,final:o,param:a,eventType:i===void 0?void 0:i==="3"?"release":i==="2"?"repeat":"press"})}return e}function zo(t){let e=t.codePointAt(0)===27?t.slice(1):t;return/^\[\?\d*u$/.test(e)}function u(t,e,r){switch(t.final){case"A":return e.upArrow;case"B":return e.downArrow;case"C":return e.rightArrow;case"D":return e.leftArrow;case"H":return e.home;case"F":return e.end;case"~":switch(t.param){case 1:case 7:return e.home;case 3:return e.delete;case 4:case 8:return e.end;case 5:return e.pageUp;case 6:return e.pageDown;default:return!1}case"u":if(t.param===13)return e.return;if(t.param===127)return e.backspace;if(t.param===27)return e.escape;return r!==""&&r===String.fromCodePoint(t.param).toLowerCase();default:return!1}}function Bo(t,e,r){let s=r.findIndex((i)=>u(i,t,e));if(s===-1)return t;let[a]=r.splice(s,1);if(a===void 0)return t;let n=a.modifier-1;return{...t,shift:(n&1)!==0,meta:(n&2)!==0,ctrl:(n&4)!==0,super:(n&8)!==0,...a.eventType===void 0?{}:{eventType:a.eventType}}}
|
|
3
|
+
export{jo,zo,Bo};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=589CEF45110B7FB164756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-3g3ny01d.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * Reading a modifier off the bytes, because Ink's reading of it is lossy.\n *\n * ## The defect this exists for\n *\n * Warp sends `cmd+left` as `CSI 1;9D` — modifier 9, which decodes to the super bit — and **omits the\n * event-type field**. Ink's kitty branch for special keys requires that field (its regex demands a\n * `:<event>` group), so the sequence falls through to its legacy branch, which does:\n *\n * key.meta = key.meta || !!(modifier & 10)\n *\n * `10` is `alt | super`. With modifier 8 that is `8 & 10 === 8`, truthy — so **super arrives as meta**,\n * and `cmd+left` becomes indistinguishable from `option+left` before our keymap is called at all.\n * Reported from a real session: both chords navigated by word, which is the only symptom this can have.\n *\n * Negotiating `reportEventTypes` was supposed to avoid this by making Warp include the field. It does not\n * — measured by the symptom, not assumed — and a fix that depends on a terminal populating an optional\n * field is a fix that works on some terminals. So the modifier is decoded here, from the bytes, where it\n * is unambiguous: bit 8 is super whether or not an event type follows it.\n *\n * ## Why this is not a second parser\n *\n * It reads *one* field. Key identity still comes from Ink — `leftArrow`, `home`, `input` — and this only\n * overrides the four modifier flags, and only when a sequence was actually found and matched to the key\n * Ink reported. Anything unrecognised leaves the key exactly as it arrived, so the worst case is today's\n * behaviour rather than a new class of wrong.\n */\n\nimport type { KeyState } from \"#lib/types\"\n\n/** Modifier bits, per the xterm and kitty encodings: the wire value is `1 + these`. */\nconst SHIFT = 1\nconst ALT = 2\nconst CTRL = 4\nconst SUPER = 8\n\n/** One modified key found in a chunk. `final` identifies the key for CSI forms, `param` for `u`. */\nexport interface CsiKey {\n readonly modifier: number\n readonly final: string\n /** The first parameter: a key number for `~` forms, a codepoint for `u`, else 1. */\n readonly param: number\n readonly eventType: \"press\" | \"repeat\" | \"release\" | undefined\n}\n\n/**\n * Every modified key in a chunk, oldest first.\n *\n * Matches `CSI <param> ; <modifier> [: <event>] <final>`, which covers the arrows (`A`-`D`), Home and End\n * (`H`/`F`), the tilde forms (`1~` `3~` `4~` `5~` `6~` `7~` `8~`) and kitty's letter form (`u`) in one\n * expression, because they differ only in the final byte. A sequence with no modifier parameter is skipped\n * — there is nothing to correct on an unmodified key. The leading escape is not required: Ink strips one\n * from the front of a chunk before a handler sees it, the same reason `lib/mouse.ts` anchors instead.\n */\nexport function csiKeys(chunk: string): readonly CsiKey[] {\n const found: CsiKey[] = []\n const pattern = /\\[(\\d+);(\\d+)(?::(\\d+))?([A-Za-z~])/g\n for (const match of chunk.matchAll(pattern)) {\n const param = Number(match[1])\n const modifier = Number(match[2])\n const event = match[3]\n const final = match[4] ?? \"\"\n if (!Number.isFinite(param) || !Number.isFinite(modifier) || modifier < 1) continue\n found.push({\n modifier,\n final,\n param,\n eventType:\n event === undefined\n ? undefined\n : event === \"3\"\n ? \"release\"\n : event === \"2\"\n ? \"repeat\"\n : \"press\",\n })\n }\n return found\n}\n\n/**\n * A terminal *reply*, not a keystroke: `CSI ? <flags> u`.\n *\n * Ink asks the terminal for its kitty-keyboard flags at mount, waits 200 ms, and strips the answer out of\n * stdin if one arrives in time. Measured in a real Warp session: it arrived **late**, the window had\n * closed, and the bytes fell through to `useInput` as ordinary text — `input \"[?0u\"`, resolving to an\n * insert. Left unclaimed that types `[?0u` into somebody's first message, which is the same class of\n * defect as a mouse report reaching the buffer and is claimed here for the same reason.\n *\n * Deliberately narrow. Only this one reply is recognised, because it is the only one this runtime *asks*\n * for — and the finals it would be tempting to generalise to are dangerous: `CSI 1;2R` is a real modified\n * F3 key, so claiming `R` would swallow a keystroke to catch a reply nobody requested.\n */\nexport function isTerminalReply(input: string): boolean {\n // The optional escape is stripped by code point rather than matched in the pattern: a control\n // character written into a regex is invisible in the source, which is a lint error for good reason —\n // `lib/keys-view.ts` draws the same line for the same reason.\n const body = input.codePointAt(0) === 0x1b ? input.slice(1) : input\n return /^\\[\\?\\d*u$/.test(body)\n}\n\n/** Which Ink flag a CSI final byte identifies, so a record can be matched to the key Ink reported. */\nfunction identifies(record: CsiKey, key: KeyState, input: string): boolean {\n switch (record.final) {\n case \"A\":\n return key.upArrow\n case \"B\":\n return key.downArrow\n case \"C\":\n return key.rightArrow\n case \"D\":\n return key.leftArrow\n case \"H\":\n return key.home\n case \"F\":\n return key.end\n case \"~\":\n switch (record.param) {\n case 1:\n case 7:\n return key.home\n case 3:\n return key.delete\n case 4:\n case 8:\n return key.end\n case 5:\n return key.pageUp\n case 6:\n return key.pageDown\n default:\n return false\n }\n case \"u\":\n // Kitty's letter form. Ink already decodes these correctly, so matching them is only about\n // not consuming a record that belongs to a later keystroke.\n if (record.param === 13) return key.return\n if (record.param === 127) return key.backspace\n if (record.param === 27) return key.escape\n return input !== \"\" && input === String.fromCodePoint(record.param).toLowerCase()\n default:\n return false\n }\n}\n\n/**\n * The key Ink reported, with its modifiers taken from the bytes when they can be.\n *\n * `records` is consumed: the matched entry is removed, so two keys in one chunk stay in step. Matching by\n * identity rather than by position is what makes that safe — a record that does not correspond to the key\n * Ink is reporting is left in the queue for whichever keystroke it belongs to, instead of being applied to\n * this one.\n */\nexport function withRealModifiers(key: KeyState, input: string, records: CsiKey[]): KeyState {\n const at = records.findIndex((record) => identifies(record, key, input))\n if (at === -1) return key\n const [record] = records.splice(at, 1)\n if (record === undefined) return key\n const bits = record.modifier - 1\n return {\n ...key,\n shift: (bits & SHIFT) !== 0,\n // `meta` is Alt/Option only. This is the whole correction: Ink merges super into it and we do not.\n meta: (bits & ALT) !== 0,\n ctrl: (bits & CTRL) !== 0,\n super: (bits & SUPER) !== 0,\n ...(record.eventType === undefined ? {} : { eventType: record.eventType }),\n }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAsDO,SAAS,EAAO,CAAC,EAAkC,CACtD,IAAM,EAAkB,CAAC,EACnB,EAAU,uCAChB,QAAW,KAAS,EAAM,SAAS,CAAO,EAAG,CACzC,IAAM,EAAQ,OAAO,EAAM,EAAE,EACvB,EAAW,OAAO,EAAM,EAAE,EAC1B,EAAQ,EAAM,GACd,EAAQ,EAAM,IAAM,GAC1B,GAAI,CAAC,OAAO,SAAS,CAAK,GAAK,CAAC,OAAO,SAAS,CAAQ,GAAK,EAAW,EAAG,SAC3E,EAAM,KAAK,CACP,WACA,QACA,QACA,UACI,IAAU,OACJ,OACA,IAAU,IACR,UACA,IAAU,IACR,SACA,OAClB,CAAC,EAEL,OAAO,EAgBJ,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
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
function r(n){let e=[];for(let t=0;t<6;t+=1){let o=n[t]??0;e.push("0123456789abcdefghjkmnpqrstvwxyz"[o&31]??"0")}return`local:${e.join("")}`}function
|
|
3
|
-
export{
|
|
2
|
+
function r(n){let e=[];for(let t=0;t<6;t+=1){let o=n[t]??0;e.push("0123456789abcdefghjkmnpqrstvwxyz"[o&31]??"0")}return`local:${e.join("")}`}function Hn(n){return r(n(6))}function uo(n){return new RegExp("^local:[0123456789abcdefghjkmnpqrstvwxyz]{6}$").test(n)}
|
|
3
|
+
export{Hn,uo};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=202C16E557D8B59264756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-4cf6v9nb.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * Naming a conversation.\n *\n * Every `run` used to land in `local:default`, which made the store one long transcript per agent:\n * yesterday's debugging session and this morning's question shared a history, so the model was\n * conditioned on both and neither could be resumed without the other. A key per run fixes that, and it\n * moves the cost — you now have to *say* which conversation you mean, which is what `--continue` and the\n * exit pointer are for.\n *\n * ## Why six random characters rather than a timestamp\n *\n * A timestamp sorts and reads well and is twenty characters somebody has to type. `sessions` already\n * sorts by `lastActivityAt`, so the ordering a timestamp would carry is information the *listing* has and\n * the key does not need — and the two things a person actually does with a key are read it off a pointer\n * line and type it back. Six symbols is one glance and one word.\n *\n * ## Why the prefix stays\n *\n * `local:` says which surface opened the conversation, and it is already load-bearing: Telegram writes\n * `tg:<chat>`, so the prefix is what stops a chat id colliding with a terminal session. A bare key would\n * work today and break the first time two surfaces agreed on a name.\n *\n * Pure: the randomness arrives as bytes, so a test gets the key it asked for.\n */\n\n/**\n * Base-32 without the symbols that look like each other.\n *\n * `i`, `l`, `o` and `u` are out — a key is read off a screen and typed back, and `local:1i0o` is one\n * nobody transcribes reliably. Exactly 32 symbols also divides a byte's low five bits, so there is no\n * modulo bias: an alphabet that does not divide evenly makes its first symbols more likely than its last,\n * which matters here not for secrecy but because it makes collisions more likely than the count below\n * claims.\n */\nconst ALPHABET = \"0123456789abcdefghjkmnpqrstvwxyz\"\n\n/** Symbols after the prefix. Six gives 32^6 ≈ 1.07 billion, so a 50% collision needs ~39,000 sessions. */\nexport const SESSION_KEY_LENGTH = 6\n\n/** The surface that opened the conversation. A terminal session; Telegram writes its own prefix. */\nexport const LOCAL_SESSION_PREFIX = \"local\"\n\n/**\n * A key from six bytes.\n *\n * Only the low five bits of each byte are read, which is why the alphabet is exactly 32 long.\n */\nexport function sessionKeyFrom(bytes: Uint8Array): string {\n const symbols: string[] = []\n for (let at = 0; at < SESSION_KEY_LENGTH; at += 1) {\n const byte = bytes[at] ?? 0\n symbols.push(ALPHABET[byte & 0x1f] ?? \"0\")\n }\n return `${LOCAL_SESSION_PREFIX}:${symbols.join(\"\")}`\n}\n\n/**\n * A freshly minted key, from an injected source of randomness.\n *\n * The one derivation. `resolveSession` computed `sessionKeyFrom(random(SESSION_KEY_LENGTH))` inline and\n * `/new` needed the same line — two copies of \"what a generated session is called\" is how two surfaces\n * come to disagree about it, the same reason `logPaths` moved into `lib/sandbox.ts` rather than being\n * copied into `remove`.\n *\n * `random` is a parameter rather than a `crypto` call so a test gets the key it asked for, and so the\n * component layer never has to reach for crypto to open a conversation.\n */\nexport function newSessionKey(random: (count: number) => Uint8Array): string {\n return sessionKeyFrom(random(SESSION_KEY_LENGTH))\n}\n\n/**\n * True for a key this module could have produced.\n *\n * Used to *explain* a key rather than to validate one — a hand-written `--session mine` is perfectly\n * valid and must stay so. It exists because a generated key is the one a person did not choose, and a\n * listing can say so.\n */\nexport function isGeneratedSessionKey(key: string): boolean {\n return new RegExp(`^${LOCAL_SESSION_PREFIX}:[${ALPHABET}]{${SESSION_KEY_LENGTH}}$`).test(key)\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AA+CO,SAAS,CAAc,CAAC,EAA2B,CACtD,IAAM,EAAoB,CAAC,EAC3B,QAAS,EAAK,EAAG,EAZa,EAYY,GAAM,EAAG,CAC/C,IAAM,EAAO,EAAM,IAAO,EAC1B,EAAQ,KAjBC,mCAiBa,EAAO,KAAS,GAAG,EAE7C,MAAO,SAA2B,EAAQ,KAAK,EAAE,IAc9C,SAAS,EAAa,CAAC,EAA+C,CACzE,OAAO,EAAe,EA/BQ,CA+BiB,CAAC,EAU7C,SAAS,EAAqB,CAAC,EAAsB,CACxD,OAAO,IAAI,OAAO,+CAAgE,EAAE,KAAK,CAAG",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "202C16E557D8B59264756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{o,oe}from"./index-
|
|
3
|
-
export{
|
|
2
|
+
import{o,oe}from"./index-d4x6yvqh.js";import{Box as l,Text as e}from"ink";import{jsx as n,jsxs as d}from"react/jsx-runtime";function it({title:t,lines:i}){return d(l,{flexDirection:"column",borderStyle:oe,borderColor:o.borderActive,paddingX:1,children:[n(e,{bold:!0,color:o.accent,children:t}),i.map((r)=>n(e,{dimColor:!0,children:r},r))]})}
|
|
3
|
+
export{it};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=C0826684AC8FD63F64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-4z7axw4r.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * The welcome box: product identity in a rounded frame, context lines dim beneath it.\n *\n * Purely presentational — the caller supplies the title (usually `BRAND.name + version`) and the\n * lines, so this renders identically at the top of a chat session, a wizard, or the picker.\n *\n * Every boxed surface stretches to the full terminal width — no `alignSelf`. Content-fit boxes\n * next to full-width ones read as different components; one rule everywhere is what makes the\n * screens look like one product.\n */\n\nimport { Box, Text } from \"ink\"\nimport { BORDER_STYLE, THEME } from \"#lib/theme\"\n\nexport interface BannerProps {\n readonly title: string\n readonly lines: readonly string[]\n}\n\nexport function Banner({ title, lines }: BannerProps) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle={BORDER_STYLE}\n borderColor={THEME.borderActive}\n paddingX={1}\n >\n <Text bold color={THEME.accent}>\n {title}\n </Text>\n {lines.map((line) => (\n <Text key={line} dimColor>\n {line}\n </Text>\n ))}\n </Box>\n )\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";sCAWA,cAAS,UAAK,8DAQP,SAAS,EAAM,EAAG,QAAO,SAAsB,CAClD,OACI,EAcE,EAdF,CACI,cAAc,SACd,YAAa,GACb,YAAa,EAAM,aACnB,SAAU,EAJd,SAcE,CARE,EAEE,EAFF,CAAM,KAAI,GAAC,MAAO,EAAM,OAAxB,SACK,EACH,EACD,EAAM,IAAI,CAAC,IACR,EAEE,EAFF,CAAiB,SAAQ,GAAzB,SACK,GADM,CAET,CACL,GACH",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "C0826684AC8FD63F64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
3
|
-
`)}t.length=0}async function T(e){await y(),J(),process.exitCode=e,await ue()}async function
|
|
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
|
+
`)}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
|
-
`),
|
|
6
|
-
export{
|
|
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=
|
|
9
|
-
//# sourceMappingURL=index-
|
|
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,CAAE,IAAK,QAAQ,OAAQ,GAAI,QAAQ,KAAM,EAKpD,IAAM,EAAwB,CAAC,EAC3B,EAAkB,GAClB,EAAW,GACX,EAAQ,GACR,EAAY,GACZ,EAAQ,GACR,EAAe,GACf,EAAiB,GAUd,SAAS,EAAiB,EAAS,CACtC,EAAQ,GAeL,SAAS,EAAa,EAAS,CAClC,EAAQ,GACR,EAAY,GAaT,SAAS,EAAS,EAAS,CAC9B,EAAQ,GACR,EAAQ,GAeL,SAAS,CAAgB,EAAS,CACrC,EAAQ,GACR,EAAe,GAOZ,SAAS,CAAM,CAAC,EAA0B,CAC7C,EAAU,KAAK,CAAQ,EAmBpB,SAAS,EAAY,EAAS,CACjC,EAAiB,GAOd,SAAS,CAAe,CAAC,EAA2B,EAAe,EAAS,CAC/E,GAAI,GAAY,CAAC,EAAO,OAExB,GADA,EAAW,GACP,EAAQ,GAAG,QAAU,IAAQ,EAAQ,GAAG,aAAe,OACvD,EAAQ,GAAG,WAAW,EAAK,EAE/B,GAAI,EAAQ,IAAI,QAAU,GAAM,OAOhC,GAHA,EAAQ,IAAI,MAAM,GAAG,KAAc,IAAa,EAG5C,EAAO,EAAQ,IAAI,MAAM,EAAa,EAa1C,GAAI,EAAc,EAAQ,IAAI,MAAM,EAAqB,EACzD,GAAI,EAAW,EAAQ,IAAI,MAAM,EAAgB,EAiDrD,eAAsB,EAAW,CAAC,EAAoB,QAAQ,OAAuB,C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AkC,CAC1D,GAAI,EAAO,KAAM,MAAO,CAAE,KAAM,OAAQ,QAAS,mBAAoB,EACrE,GAAI,EAAO,MAAO,MAAO,CAAE,KAAM,QAAS,QAAS,oBAAqB,EAKxE,GAAI,EAAO,QAAS,MAAO,CAAE,KAAM,QAAS,QAAS,yBAA0B,EAE/E,GAAI,CAAC,EAAO,YAAa,MAAO,CAAE,KAAM,QAAS,QAAS,0BAA2B,EAErF,GAAI,CAAC,EAAO,WAAY,MAAO,CAAE,KAAM,QAAS,QAAS,yBAA0B,EAEnF,GAAI,EAAO,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": "
|
|
10
|
+
"debugId": "3E8EC0EBBACD374564756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
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
|
+
export{nn};
|
|
4
|
+
|
|
5
|
+
//# debugId=F7AC4B15F45FF29764756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-6q4wf8e3.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * A labelled text input for wizard questions: label, caret, LineCursor, optional error line.\n *\n * The editing itself lives upstream — the screen root routes keys through `keyToIntent` into\n * `applyIntent` and hands the resulting `EditorState` down — so every editing nicety the chat\n * input has (^A/^E, ^W, code-point cursor) works here without a second implementation.\n */\n\nimport { Box, Text } from \"ink\"\nimport { LineCursor } from \"#components/LineCursor\"\nimport { GLYPH, THEME } from \"#lib/theme\"\nimport type { EditorState } from \"#lib/types\"\n\nexport interface TextFieldProps {\n readonly label: string\n readonly editor: EditorState\n /** The question's default, shown dim when the buffer is empty; enter accepts it. */\n readonly placeholder?: string\n /** A validation failure, rendered beneath in the error colour. Cleared upstream on edit. */\n readonly error?: string\n /** Mask the value as it is typed. Passed straight through to the cursor. */\n readonly secret?: boolean\n /**\n * Columns available for the value. **Not optional in practice.**\n *\n * `LineCursor`'s own docstring says it: omitted, nothing wraps and a line wider than whatever draws\n * this is truncated by Ink at a width nobody chose. This component never passed it, and in the\n * settings editor — which draws the field into an unbordered column — a value longer than the\n * terminal was clipped at the right edge with the caret *past* the clip. You could not see what you\n * were typing, and `tools.pinned` is 92 characters in a generated manifest, so it was the first long\n * value anybody opened.\n *\n * **The wizard was not affected, and checking that mattered**: its bordered frame gives the `<Text>`\n * a bounded width, so Ink wrapped it anyway. Measured, after the assumption that it must be broken\n * too — the guard that would have \"proved\" it passed with the fix reverted. It is passed there now\n * regardless, because whoever owns a bounded window should wrap the text itself rather than leave it\n * to whatever happens to enclose it, and because `maxRows` genuinely bounds the height.\n */\n readonly columns?: number\n /** Rows the value may take before the view scrolls to follow the cursor. */\n readonly maxRows?: number\n}\n\nexport function TextField({\n label,\n editor,\n placeholder,\n error,\n secret,\n columns,\n maxRows,\n}: TextFieldProps) {\n return (\n <Box flexDirection=\"column\">\n <Text>{label}</Text>\n {/*\n * The prompt glyph is the cursor's `gutter` rather than a sibling `<Text>`. Two reasons, and\n * the second is not optional: it keeps a wrapped or multi-line value in one column, and\n * `LineCursor` renders a `<Box>`, which inside a `<Text>` produces an empty frame — no error,\n * nothing on screen. A frame test caught that; nothing else would have.\n */}\n <LineCursor\n editor={editor}\n gutter={GLYPH.prompt}\n {...(placeholder === undefined ? {} : { placeholder })}\n {...(secret === true ? { secret: true } : {})}\n {...(columns === undefined ? {} : { columns })}\n {...(maxRows === undefined ? {} : { maxRows })}\n />\n {error === undefined ? null : (\n <Text color={THEME.error}>\n {GLYPH.error}\n {error}\n </Text>\n )}\n </Box>\n )\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";yEAQA,cAAS,UAAK,8DAmCP,SAAS,EAAS,EACrB,QACA,SACA,cACA,QACA,SACA,UACA,WACe,CACf,OACI,EAsBE,EAtBF,CAAK,cAAc,SAAnB,SAsBE,CArBE,EAAe,EAAf,UAAO,EAAQ,EAOf,EAAC,GAAD,CACI,OAAQ,EACR,OAAQ,EAAM,UACT,IAAgB,OAAY,CAAC,EAAI,CAAE,aAAY,KAC/C,IAAW,GAAO,CAAE,OAAQ,EAAK,EAAI,CAAC,KACtC,IAAY,OAAY,CAAC,EAAI,CAAE,SAAQ,KACvC,IAAY,OAAY,CAAC,EAAI,CAAE,SAAQ,EAChD,EACC,IAAU,OAAY,KACnB,EAGE,EAHF,CAAM,MAAO,EAAM,MAAnB,SAGE,CAFG,EAAM,MACN,GACH,GAER",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "F7AC4B15F45FF29764756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{o,S}from"./index-
|
|
3
|
-
export{
|
|
2
|
+
import{o,S}from"./index-d4x6yvqh.js";import{Box as y,Text as h}from"ink";import{jsx as k,jsxs as b}from"react/jsx-runtime";function an({lines:t}){let r=t.map((n,e)=>({at:e,text:n}));return k(y,{flexDirection:"column",children:r.map((n)=>b(h,{color:o.brand,bold:!0,wrap:"truncate",children:[" ".repeat(dt),n.text]},`mark-${n.at}`))})}var dt=1;var m="#",u={A:[".###.","#...#","#####","#...#","#...#"],B:["####.","#...#","####.","#...#","####."],C:[".####","#....","#....","#....",".####"],D:["####.","#...#","#...#","#...#","####."],E:["#####","#....","####.","#....","#####"],F:["#####","#....","####.","#....","#...."],G:[".####","#....","#..##","#...#",".###."],H:["#...#","#...#","#####","#...#","#...#"],I:["#####","..#..","..#..","..#..","#####"],J:["..###","....#","....#","#...#",".###."],K:["#...#","#..#.","###..","#..#.","#...#"],L:["#....","#....","#....","#....","#####"],M:["#...#","##.##","#.#.#","#...#","#...#"],N:["#...#","##..#","#.#.#","#..##","#...#"],O:[".###.","#...#","#...#","#...#",".###."],P:["####.","#...#","####.","#....","#...."],Q:[".###.","#...#","#.#.#","#..#.",".##.#"],R:["####.","#...#","####.","#..#.","#...#"],S:[".####","#....",".###.","....#","####."],T:["#####","..#..","..#..","..#..","..#.."],U:["#...#","#...#","#...#","#...#",".###."],V:["#...#","#...#","#...#",".#.#.","..#.."],W:["#...#","#...#","#.#.#","##.##","#...#"],X:["#...#",".#.#.","..#..",".#.#.","#...#"],Y:["#...#",".#.#.","..#..","..#..","..#.."],Z:["#####","...#.","..#..",".#...","#####"],"0":[".###.","#..##","#.#.#","##..#",".###."],"1":["..#..",".##..","..#..","..#..",".###."],"2":[".###.","#...#","..##.",".#...","#####"],"3":["####.","....#",".###.","....#","####."],"4":["#..#.","#..#.","#####","...#.","...#."],"5":["#####","#....","####.","....#","####."],"6":[".###.","#....","####.","#...#",".###."],"7":["#####","....#","...#.","..#..",".#..."],"8":[".###.","#...#",".###.","#...#",".###."],"9":[".###.","#...#",".####","....#",".###."],".":[".....",".....",".....",".....","..#.."],"-":[".....",".....",".###.",".....","....."]," ":[".....",".....",".....",".....","....."]},w=5,x=1;function T(t){return[...t.toUpperCase()].every((r)=>u[r]!==void 0)}function B(t){let r=[...t.toUpperCase()].map((e)=>u[e]??u[" "]),n=".".repeat(x);return Array.from({length:w},(e,s)=>r.map((a)=>a?.[s]??"").join(n))}function f(t,r,n){let e=r.repeat(n),s=" ".repeat(n);return t.map((a)=>[...a].map((i)=>i===m?e:s).join(""))}function W(t){let r=[".".repeat([...t[0]??""].length),...t],n=[];for(let e=0;e<r.length;e+=2){let s=[...r[e]??""],a=[...r[e+1]??""],i=[];for(let l=0;l<Math.max(s.length,a.length);l+=1){let d=s[l]===m,c=a[l]===m;i.push(d&&c?"█":d?"▀":c?"▄":" ")}n.push(i.join(""))}return n}function g(t,r){return[S([...t.toUpperCase()].join(" "),r)]}function p(t){return t.reduce((r,n)=>Math.max(r,[...n].length),0)}function ln(t,r){let n=t.trim();if(n===""||!T(n)){let i=g(n,r.columns);return{lines:i,tier:"plain",width:p(i)}}let e=B(n),s=[{tier:"wide",lines:f(e,"█",2)},{tier:"block",lines:f(e,"█",1)},{tier:"half",lines:W(e)}];for(let i of s){let l=i.lines.map((c)=>c.replace(/\s+$/,"")),d=p(l);if(d<=r.columns&&l.length<=r.rows)return{lines:l,tier:i.tier,width:d}}let a=g(n,r.columns);return{lines:a,tier:"plain",width:p(a)}}
|
|
3
|
+
export{an,dt,ln};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=2DBA414D93B89F4C64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-9r0wyj6w.js.map
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"/**\n * The product name, drawn large, from a glyph grid.\n *\n * ## Why a grid and not a string\n *\n * Hard rule 3: no brand strings outside `brand.ts`, so that a rename is one commit. An ASCII wordmark is\n * a brand string — a literal one would be the single largest violation in the tree. So this renders\n * whatever `BRAND.name` happens to say, from a table of letters, and a rename changes nothing here.\n *\n * ## The research, and what it settled\n *\n * Three findings shaped this. **5×5 pixels is the floor** for a legible Latin glyph without\n * anti-aliasing, so that is the grid. **A width-aware fallback is mandatory rather than polish** — the\n * big figlet faces (`big`, `ansi-shadow`) pass 120 columns on a nine-letter word, and this CLI's floor is\n * 40. And **half-blocks are the density trick**: one character cell per pixel renders a 5×5 glyph tall and\n * thin, because a cell is roughly 1:2, while packing two pixel rows into one cell with `▀▄█` brings it\n * back to nearly square.\n *\n * A third-party font was the obvious shortcut and is not taken: embedding `.flf` data or another\n * project's bitmap into an Apache-2.0 repo buys a licence question, and 26 letters are verifiable by\n * rendering them.\n *\n * ## One table, four renderings\n *\n * The tiers are parameter changes over the same grid — how many columns a pixel occupies, and whether\n * rows are packed — not four codepaths:\n *\n * | tier | pixel | rows | nine letters |\n * | --- | --- | --- | --- |\n * | `wide` | 2 columns | 5 | 106 columns |\n * | `block` | 1 column | 5 | 53 columns |\n * | `half` | 1 column | 3 | 53 columns |\n * | `plain` | — | 1 | as wide as the name |\n *\n * `plain` is the floor and always fits, because it is the name with spaces in it and gets clipped like\n * any other line. A screen too small for that is a screen with no wordmark, which is a real answer.\n *\n * Pure: text and a size in, lines out. Colour is the component's business.\n */\n\nimport { clip } from \"#lib/rows\"\n\n/** On and off, as authored. `#` reads as ink in the source, which is the only place these are edited. */\nconst ON = \"#\"\n\n/**\n * A 5×5 grid per glyph, authored by hand and verified by rendering.\n *\n * Uppercase only: the input is upper-cased before lookup, because a display face has no lowercase at this\n * size, and inventing one is how a name and its shout become two different-looking products. Digits are\n * here for a version, and `.`/`-`/space for what a name might contain.\n */\nconst GLYPHS: Readonly<Record<string, readonly string[]>> = {\n A: [\".###.\", \"#...#\", \"#####\", \"#...#\", \"#...#\"],\n B: [\"####.\", \"#...#\", \"####.\", \"#...#\", \"####.\"],\n C: [\".####\", \"#....\", \"#....\", \"#....\", \".####\"],\n D: [\"####.\", \"#...#\", \"#...#\", \"#...#\", \"####.\"],\n E: [\"#####\", \"#....\", \"####.\", \"#....\", \"#####\"],\n F: [\"#####\", \"#....\", \"####.\", \"#....\", \"#....\"],\n G: [\".####\", \"#....\", \"#..##\", \"#...#\", \".###.\"],\n H: [\"#...#\", \"#...#\", \"#####\", \"#...#\", \"#...#\"],\n I: [\"#####\", \"..#..\", \"..#..\", \"..#..\", \"#####\"],\n J: [\"..###\", \"....#\", \"....#\", \"#...#\", \".###.\"],\n K: [\"#...#\", \"#..#.\", \"###..\", \"#..#.\", \"#...#\"],\n L: [\"#....\", \"#....\", \"#....\", \"#....\", \"#####\"],\n M: [\"#...#\", \"##.##\", \"#.#.#\", \"#...#\", \"#...#\"],\n N: [\"#...#\", \"##..#\", \"#.#.#\", \"#..##\", \"#...#\"],\n O: [\".###.\", \"#...#\", \"#...#\", \"#...#\", \".###.\"],\n P: [\"####.\", \"#...#\", \"####.\", \"#....\", \"#....\"],\n Q: [\".###.\", \"#...#\", \"#.#.#\", \"#..#.\", \".##.#\"],\n R: [\"####.\", \"#...#\", \"####.\", \"#..#.\", \"#...#\"],\n S: [\".####\", \"#....\", \".###.\", \"....#\", \"####.\"],\n T: [\"#####\", \"..#..\", \"..#..\", \"..#..\", \"..#..\"],\n U: [\"#...#\", \"#...#\", \"#...#\", \"#...#\", \".###.\"],\n V: [\"#...#\", \"#...#\", \"#...#\", \".#.#.\", \"..#..\"],\n W: [\"#...#\", \"#...#\", \"#.#.#\", \"##.##\", \"#...#\"],\n X: [\"#...#\", \".#.#.\", \"..#..\", \".#.#.\", \"#...#\"],\n Y: [\"#...#\", \".#.#.\", \"..#..\", \"..#..\", \"..#..\"],\n Z: [\"#####\", \"...#.\", \"..#..\", \".#...\", \"#####\"],\n \"0\": [\".###.\", \"#..##\", \"#.#.#\", \"##..#\", \".###.\"],\n \"1\": [\"..#..\", \".##..\", \"..#..\", \"..#..\", \".###.\"],\n \"2\": [\".###.\", \"#...#\", \"..##.\", \".#...\", \"#####\"],\n \"3\": [\"####.\", \"....#\", \".###.\", \"....#\", \"####.\"],\n \"4\": [\"#..#.\", \"#..#.\", \"#####\", \"...#.\", \"...#.\"],\n \"5\": [\"#####\", \"#....\", \"####.\", \"....#\", \"####.\"],\n \"6\": [\".###.\", \"#....\", \"####.\", \"#...#\", \".###.\"],\n \"7\": [\"#####\", \"....#\", \"...#.\", \"..#..\", \".#...\"],\n \"8\": [\".###.\", \"#...#\", \".###.\", \"#...#\", \".###.\"],\n \"9\": [\".###.\", \"#...#\", \".####\", \"....#\", \".###.\"],\n \".\": [\".....\", \".....\", \".....\", \".....\", \"..#..\"],\n \"-\": [\".....\", \".....\", \".###.\", \".....\", \".....\"],\n \" \": [\".....\", \".....\", \".....\", \".....\", \".....\"],\n}\n\nconst GLYPH_ROWS = 5\n/** Blank pixel columns between letters. One is enough at this weight; two reads as word spacing. */\nconst TRACKING = 1\n\nexport type WordmarkTier = \"wide\" | \"block\" | \"half\" | \"plain\"\n\nexport interface Wordmark {\n readonly lines: readonly string[]\n readonly tier: WordmarkTier\n /** Code points in the widest line, so a caller can centre it without measuring. */\n readonly width: number\n}\n\n/** Letters this module can draw. A name containing anything else falls back to `plain`. */\nexport function drawable(text: string): boolean {\n return [...text.toUpperCase()].every((char) => GLYPHS[char] !== undefined)\n}\n\n/** The pixel grid for a whole word: rows of `#` and `.`, tracking included. */\nfunction pixels(text: string): readonly string[] {\n const glyphs = [...text.toUpperCase()].map((char) => GLYPHS[char] ?? GLYPHS[\" \"])\n const gap = \".\".repeat(TRACKING)\n return Array.from({ length: GLYPH_ROWS }, (_, row) =>\n glyphs.map((glyph) => glyph?.[row] ?? \"\").join(gap),\n )\n}\n\n/** Every pixel as `columns` cells of the fill character, or of space. */\nfunction solid(grid: readonly string[], fill: string, columns: number): readonly string[] {\n const on = fill.repeat(columns)\n const off = \" \".repeat(columns)\n return grid.map((row) => [...row].map((cell) => (cell === ON ? on : off)).join(\"\"))\n}\n\n/**\n * Two pixel rows to a text row, using the half blocks.\n *\n * This is what makes the compact tier look like type rather than a stretched grid: five pixel rows become\n * three text rows, so a 5-wide glyph is 5×3 cells — near enough square once a cell's own 1:2 ratio is\n * accounted for.\n *\n * Five rows is odd, so one of them pairs with nothing, and **which end gets the blank decides the\n * weight**. Padding the bottom leaves every baseline as a thin `▀`, so the letters sit on a hairline and\n * read light. Padding the *top* puts the blank against the cap line instead: the top stroke becomes `▄`\n * and the baseline becomes a full `█`. Compared side by side that is not a close call — caps want to be\n * bottom-heavy — which is why the blank row is prepended rather than appended.\n */\nfunction packed(grid: readonly string[]): readonly string[] {\n const padded = [\".\".repeat([...(grid[0] ?? \"\")].length), ...grid]\n const lines: string[] = []\n for (let row = 0; row < padded.length; row += 2) {\n const top = [...(padded[row] ?? \"\")]\n const bottom = [...(padded[row + 1] ?? \"\")]\n const cells: string[] = []\n for (let at = 0; at < Math.max(top.length, bottom.length); at += 1) {\n const up = top[at] === ON\n const down = bottom[at] === ON\n cells.push(up && down ? \"█\" : up ? \"▀\" : down ? \"▄\" : \" \")\n }\n lines.push(cells.join(\"\"))\n }\n return lines\n}\n\n/** The name with a space between every letter — the floor, and it always fits because it is clipped. */\nfunction spaced(text: string, columns: number): readonly string[] {\n return [clip([...text.toUpperCase()].join(\" \"), columns)]\n}\n\nfunction widthOf(lines: readonly string[]): number {\n return lines.reduce((widest, line) => Math.max(widest, [...line].length), 0)\n}\n\n/**\n * The largest wordmark that fits, and how it was drawn.\n *\n * Degrades on both axes, because a splash is constrained by both: a 40-column terminal has no room for the\n * grid at any packing, and an 8-row one has no room for five rows of anything. Trailing blank space is\n * trimmed from each line so a caller centring on `width` centres the ink rather than the padding.\n */\nexport function wordmark(\n text: string,\n space: { readonly columns: number; readonly rows: number },\n): Wordmark {\n const trimmed = text.trim()\n if (trimmed === \"\" || !drawable(trimmed)) {\n const lines = spaced(trimmed, space.columns)\n return { lines, tier: \"plain\", width: widthOf(lines) }\n }\n\n const grid = pixels(trimmed)\n const candidates: readonly { tier: WordmarkTier; lines: readonly string[] }[] = [\n { tier: \"wide\", lines: solid(grid, \"█\", 2) },\n { tier: \"block\", lines: solid(grid, \"█\", 1) },\n { tier: \"half\", lines: packed(grid) },\n ]\n\n for (const candidate of candidates) {\n const lines = candidate.lines.map((line) => line.replace(/\\s+$/, \"\"))\n const width = widthOf(lines)\n if (width <= space.columns && lines.length <= space.rows) {\n return { lines, tier: candidate.tier, width }\n }\n }\n\n const lines = spaced(trimmed, space.columns)\n return { lines, tier: \"plain\", width: widthOf(lines) }\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";qCAoBA,cAAS,UAAK,8DAIP,SAAS,EAAS,EAAG,SAAyB,CAIjD,IAAM,EAAO,EAAM,IAAI,CAAC,EAAM,KAAQ,CAAE,KAAI,MAAK,EAAE,EAEnD,OACI,EAOE,EAPF,CAAK,cAAc,SAAnB,SACK,EAAK,IAAI,CAAC,IACP,EAGE,EAHF,CAA6B,MAAO,EAAM,MAAO,KAAI,GAAC,KAAK,WAA3D,SAGE,CAFG,IAAI,OAAO,EAAY,EACvB,EAAI,OAFE,QAAQ,EAAI,IAGrB,CACL,EACH,EAYH,IAAM,GAAe,ECP5B,IAAM,EAAK,IASL,EAAsD,CACxD,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAAG,CAAC,QAAS,QAAS,QAAS,QAAS,OAAO,EAC/C,EAA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|
-
"debugId": "
|
|
9
|
+
"debugId": "2DBA414D93B89F4C64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createInterface as w}from"node:readline";async function
|
|
3
|
-
${u} [y/N] `,t)});return/^y(es)?$/i.test(s.trim())}finally{i.close()}}async function
|
|
4
|
-
${u} `,a)})).trim()===o}finally{s.close()}}async function
|
|
2
|
+
import{createInterface as w}from"node:readline";async function Ye(u,o={}){let e=o.input??process.stdin,r=o.output??process.stdout;if(e.isTTY!==!0)return!1;let i=w({input:e,output:r});try{let s=await new Promise((t)=>{i.question(`
|
|
3
|
+
${u} [y/N] `,t)});return/^y(es)?$/i.test(s.trim())}finally{i.close()}}async function Pr(u,o,e={}){let r=e.input??process.stdin,i=e.output??process.stdout;if(r.isTTY!==!0)return!1;let s=w({input:r,output:i});try{return(await new Promise((a)=>{s.question(`
|
|
4
|
+
${u} `,a)})).trim()===o}finally{s.close()}}async function Mr(u,o={}){let e=o.input??process.stdin,r=o.output??process.stdout;if(e.isTTY!==!0)return;r.write(`
|
|
5
5
|
${u} `);let i=typeof e.setRawMode==="function";if(i)e.setRawMode?.(!0);e.resume?.();try{return await new Promise((s)=>{let t="",a=!1,d=!1,l=(f)=>{e.removeListener("data",p),r.write(`
|
|
6
6
|
`),s(f)},p=(f)=>{let m=typeof f==="string"?f:f.toString("utf8");for(let c of m){let n=c.charCodeAt(0);if(d){if(n>=64&&n<=126)d=!1;continue}if(a){if(a=!1,c==="["||c==="O")d=!0;continue}if(n===27){a=!0;continue}if(n===13||n===10)return l(t);if(n===3)return l(void 0);if(n===4)return l(t===""?void 0:t);if(n===127||n===8){if(t.length>0)t=t.slice(0,-1),r.write("\b \b");continue}if(n<32)continue;t+=c,r.write("*")}};e.on("data",p)})}finally{if(i)e.setRawMode?.(!1)}}
|
|
7
|
-
export{
|
|
7
|
+
export{Ye,Pr,Mr};
|
|
8
8
|
|
|
9
|
-
//# debugId=
|
|
10
|
-
//# sourceMappingURL=index-
|
|
9
|
+
//# debugId=774C111C6BC21DF064756E2164756E21
|
|
10
|
+
//# sourceMappingURL=index-ammv5st7.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * A yes/no question on the plain path.\n *\n * One question, one place. The wizard has its own confirm *screen* under Ink and the picker has a\n * selection; what was missing was the shape a single command needs before doing something outside its\n * own workspace — and the only current caller, `terminal-setup`, is the only command that does that.\n *\n * **Not a TTY means no.** A piped or CI run cannot answer, so the safe answer is the one that changes\n * nothing — and the caller reports that nothing was written rather than treating it as a failure.\n * Defaulting to yes here would make a redirected invocation edit somebody's editor keybindings, which is\n * the kind of surprise that is only discovered later.\n *\n * Deliberately not a general prompt library. A second kind of question can have a second function; a\n * configurable one would grow options nobody needs and hide the TTY rule above inside them. There are\n * three now — `askExactly` is a different bar, and `askSecret` is a different *channel*, because a\n * value that must not be echoed cannot go through readline at all.\n */\n\nimport { createInterface } from \"node:readline\"\n\nexport interface ConfirmOptions {\n /** Injected by tests. The process streams otherwise. */\n readonly input?: NodeJS.ReadableStream & { isTTY?: boolean }\n readonly output?: NodeJS.WritableStream\n}\n\nexport async function askYesNo(question: string, options: ConfirmOptions = {}): Promise<boolean> {\n const input = options.input ?? process.stdin\n const output = options.output ?? process.stdout\n if (input.isTTY !== true) return false\n\n const rl = createInterface({ input, output })\n try {\n const answer = await new Promise<string>((resolve) => {\n rl.question(`\\n${question} [y/N] `, resolve)\n })\n return /^y(es)?$/i.test(answer.trim())\n } finally {\n // Always closed: a readline left open holds the event loop and the process never exits.\n rl.close()\n }\n}\n\n/**\n * A question answered only by typing something back exactly.\n *\n * The bar for an irreversible, multi-part deletion. `askYesNo` is one keypress, which is right for\n * \"shall I edit your keybindings\" and too cheap for \"delete this agent, its conversations and its\n * memory\" — a stray `y` against the wrong listing is a mistake with nothing to undo it, and the whole\n * point of showing the listing first is that somebody reads it. Typing the name is what proves they did.\n *\n * Compared after trimming and nothing else. Case is **not** folded: an agent's ref is the name of a\n * directory, so `Milo` and `milo` are two different agents on a case-sensitive filesystem, and\n * accepting either here would accept the wrong one somewhere else.\n *\n * Not a TTY means no, for the reason `askYesNo` has it: a piped or CI run cannot answer, and the safe\n * answer is the one that changes nothing. The caller reports that nothing was deleted, and `--yes` is\n * how a script says it meant it.\n */\nexport async function askExactly(\n question: string,\n expected: string,\n options: ConfirmOptions = {},\n): Promise<boolean> {\n const input = options.input ?? process.stdin\n const output = options.output ?? process.stdout\n if (input.isTTY !== true) return false\n\n const rl = createInterface({ input, output })\n try {\n const answer = await new Promise<string>((resolve) => {\n rl.question(`\\n${question} `, resolve)\n })\n return answer.trim() === expected\n } finally {\n rl.close()\n }\n}\n\n/**\n * A value typed at a prompt and never echoed. `undefined` means cancelled or unavailable.\n *\n * ## Why this is not readline\n *\n * readline echoes what it reads, and the documented way to stop it is to overwrite a private method on\n * the interface — which needs a cast this codebase does not allow. Reading the bytes is a dozen more\n * lines and it is the honest version: raw mode on, one `*` written per character, raw mode off in a\n * `finally` so a thrown error cannot leave the terminal unable to echo anything the person types next.\n *\n * ## Why a secret never comes from an argument\n *\n * The alternative was `--value`, and it puts the secret in two places nobody intends: the shell's\n * history file, and `ps` output, where every local process can read it for the lifetime of the call.\n * That is the same exposure `renderPlist` throws to prevent — launchd echoes a job's environment in\n * plaintext, so a plist carries no secret — and the reasoning does not change because the process is\n * short-lived. Not a TTY returns `undefined` rather than reading a pipe, so a CI run is *told* that\n * nothing was written instead of a secret arriving from somewhere the caller did not audit.\n *\n * ^C cancels and ^D on an empty line cancels; both return `undefined`, and the caller reports that\n * nothing changed. Backspace is honoured because a mistyped key in a value you cannot see is otherwise\n * unrecoverable without starting the command again.\n */\n/**\n * The narrow surface `askSecret` touches, rather than a widened `ConfirmOptions.input`.\n *\n * `process.stdin`'s declared `on` is a union of overloads, and intersecting that with an object type\n * makes it uncallable — the compiler cannot pick a signature. Declaring only what is used and asserting\n * the real stream against it once keeps the check where it is useful: anything else this function\n * reached for would be a type error here rather than a runtime surprise.\n */\nexport interface SecretInput {\n readonly isTTY?: boolean\n setRawMode?: (mode: boolean) => unknown\n resume?: () => unknown\n on(event: \"data\", listener: (chunk: Buffer | string) => void): unknown\n removeListener(event: \"data\", listener: (chunk: Buffer | string) => void): unknown\n}\n\nexport interface SecretOptions {\n readonly input?: SecretInput\n readonly output?: NodeJS.WritableStream\n}\n\nexport async function askSecret(\n question: string,\n options: SecretOptions = {},\n): Promise<string | undefined> {\n const input = options.input ?? (process.stdin as unknown as SecretInput)\n const output = options.output ?? process.stdout\n if (input.isTTY !== true) return undefined\n\n output.write(`\\n${question} `)\n const raw = typeof input.setRawMode === \"function\"\n if (raw) input.setRawMode?.(true)\n input.resume?.()\n\n try {\n return await new Promise<string | undefined>((resolve) => {\n let value = \"\"\n // Escape-sequence state. Dropping only the escape *byte* left `[A` in the value for an\n // arrow key — two characters of junk in a string nobody can see, which is worse than three\n // because it looks like nothing happened. CSI runs until a byte in 0x40–0x7e ends it.\n let escaped = false\n let csi = false\n const finish = (result: string | undefined) => {\n input.removeListener(\"data\", onData)\n output.write(\"\\n\")\n resolve(result)\n }\n const onData = (chunk: Buffer | string) => {\n const text = typeof chunk === \"string\" ? chunk : chunk.toString(\"utf8\")\n for (const char of text) {\n const code = char.charCodeAt(0)\n if (csi) {\n // The final byte of a CSI sequence, and the end of it.\n if (code >= 0x40 && code <= 0x7e) csi = false\n continue\n }\n if (escaped) {\n escaped = false\n // `[` opens CSI and `O` opens SS3, which is how some terminals send arrows.\n if (char === \"[\" || char === \"O\") csi = true\n continue\n }\n if (code === 27) {\n escaped = true\n continue\n }\n if (code === 13 || code === 10) return finish(value)\n // ^C always cancels; ^D cancels only an empty line, so it cannot silently\n // truncate a value somebody was halfway through typing.\n if (code === 3) return finish(undefined)\n if (code === 4) return finish(value === \"\" ? undefined : value)\n if (code === 127 || code === 8) {\n if (value.length > 0) {\n value = value.slice(0, -1)\n output.write(\"\\b \\b\")\n }\n continue\n }\n // Any remaining control byte is a chord, and a secret has none in it.\n if (code < 32) continue\n value += char\n output.write(\"*\")\n }\n }\n input.on(\"data\", onData)\n })\n } finally {\n // Always restored. A thrown error that left raw mode on would leave the shell that follows\n // unable to echo anything at all, which reads as a hung terminal rather than a failed command.\n if (raw) input.setRawMode?.(false)\n }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAkBA,0BAAS,sBAQT,eAAsB,EAAQ,CAAC,EAAkB,EAA0B,CAAC,EAAqB,CAC7F,IAAM,EAAQ,EAAQ,OAAS,QAAQ,MACjC,EAAS,EAAQ,QAAU,QAAQ,OACzC,GAAI,EAAM,QAAU,GAAM,MAAO,GAEjC,IAAM,EAAK,EAAgB,CAAE,QAAO,QAAO,CAAC,EAC5C,GAAI,CACA,IAAM,EAAS,MAAM,IAAI,QAAgB,CAAC,IAAY,CAClD,EAAG,SAAS;AAAA,EAAK,WAAmB,CAAO,EAC9C,EACD,MAAO,YAAY,KAAK,EAAO,KAAK,CAAC,SACvC,CAEE,EAAG,MAAM,GAoBjB,eAAsB,EAAU,CAC5B,EACA,EACA,EAA0B,CAAC,EACX,CAChB,IAAM,EAAQ,EAAQ,OAAS,QAAQ,MACjC,EAAS,EAAQ,QAAU,QAAQ,OACzC,GAAI,EAAM,QAAU,GAAM,MAAO,GAEjC,IAAM,EAAK,EAAgB,CAAE,QAAO,QAAO,CAAC,EAC5C,GAAI,CAIA,OAHe,MAAM,IAAI,QAAgB,CAAC,IAAY,CAClD,EAAG,SAAS;AAAA,EAAK,KAAa,CAAO,EACxC,GACa,KAAK,IAAM,SAC3B,CACE,EAAG,MAAM,GAgDjB,eAAsB,EAAS,CAC3B,EACA,EAAyB,CAAC,EACC,CAC3B,IAAM,EAAQ,EAAQ,OAAU,QAAQ,MAClC,EAAS,EAAQ,QAAU,QAAQ,OACzC,GAAI,EAAM,QAAU,GAAM,OAE1B,EAAO,MAAM;AAAA,EAAK,IAAW,EAC7B,IAAM,EAAM,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13311],[13312,19903],[19968,40959],[40960,42191],[43360,43391],[44032,55203],[63744,64255],[65040,65049],[65072,65135],[65280,65376],[65504,65510],[127744,128591],[128640,128767],[129280,129535],[129648,129791],[131072,196605],[196608,262141]],w=[[768,879],[1155,1161],[1425,1469],[1552,1562],[1611,1631],[1648,1648],[1750,1756],[2304,2307],[2362,2362],[3633,3633],[3636,3642],[6832,6911],[7616,7679],[8203,8207],[8400,8447],[65024,65039],[65056,65071],[65279,65279]];function m(n,t){for(let[f,e]of t){if(n<f)return!1;if(n<=e)return!0}return!1}function W(n){if(n<32||n>=127&&n<160)return 0;if(m(n,w))return 0;if(m(n,y))return 2;return 1}function g(n){return n.map((t)=>W(t.codePointAt(0)??0))}var T=" ".repeat(8);function
|
|
3
|
-
`).flatMap((f)=>A(f,t))}function
|
|
4
|
-
export{
|
|
2
|
+
var y=[[4352,4447],[11904,12350],[12353,13311],[13312,19903],[19968,40959],[40960,42191],[43360,43391],[44032,55203],[63744,64255],[65040,65049],[65072,65135],[65280,65376],[65504,65510],[127744,128591],[128640,128767],[129280,129535],[129648,129791],[131072,196605],[196608,262141]],w=[[768,879],[1155,1161],[1425,1469],[1552,1562],[1611,1631],[1648,1648],[1750,1756],[2304,2307],[2362,2362],[3633,3633],[3636,3642],[6832,6911],[7616,7679],[8203,8207],[8400,8447],[65024,65039],[65056,65071],[65279,65279]];function m(n,t){for(let[f,e]of t){if(n<f)return!1;if(n<=e)return!0}return!1}function W(n){if(n<32||n>=127&&n<160)return 0;if(m(n,w))return 0;if(m(n,y))return 2;return 1}function g(n){return n.map((t)=>W(t.codePointAt(0)??0))}var T=" ".repeat(8);function vn(n,t){let f=n.replaceAll("\t",T),e=[...f],s=g(e),b=(x,u)=>{let r=0;for(let l=x;l<u;l+=1)r+=s[l]??0;return r};if(t<=0||b(0,e.length)<=t)return[{text:f,lead:0,from:0,to:e.length}];let o=0;while(o<e.length&&(e[o]===" "||e[o]===" "))o+=1;if(o>0){let x=e.slice(o).join("");if(o>=t)return vn(x,t).map((r)=>({...r,from:r.from+o,to:r.to+o}));let u=" ".repeat(o);return vn(x,t-o).map((r)=>({text:`${u}${r.text}`,lead:r.lead+o,from:r.from+o,to:r.to+o}))}let h=[],d=0,i=0,p=(x)=>{h.push({text:e.slice(d,x).join(""),lead:0,from:d,to:x})},a=0;while(a<=e.length){let x=a;while(x<e.length&&e[x]!==" ")x+=1;let u=b(a,x);if(u>t){if(i>0)p(a===d?a:a-1),d=a,i=0;let r=a;while(b(r,x)>t){let l=r,c=0;while(l<x&&c+(s[l]??0)<=t)c+=s[l]??0,l+=1;if(l===r)l=r+1;d=r,p(l),r=l,d=r}d=r,i=b(r,x)}else if(i>0&&i+1+u>t)p(a-1),d=a,i=u;else i=i===0?u:i+1+u;if(x>=e.length)break;a=x+1}return p(e.length),h}function A(n,t){return vn(n,t).map((f)=>f.text)}function Fo(n,t){let f=0;for(let[e,s]of[...n].entries()){if(e>=t)break;f+=s==="\t"?8:1}return f}function sr(n,t){return n.split(`
|
|
3
|
+
`).flatMap((f)=>A(f,t))}function ir(n,t,f){if(n===""||f<=0)return{lines:[],rows:0,hidden:0};let e=sr(n,t);if(e.length<=f)return{lines:e,rows:e.length,hidden:0};return{lines:e.slice(e.length-f),rows:f+1,hidden:e.length-f}}
|
|
4
|
+
export{vn,Fo,sr,ir};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
7
|
-
//# sourceMappingURL=index-
|
|
6
|
+
//# debugId=1C4BBE684410C70264756E2164756E21
|
|
7
|
+
//# sourceMappingURL=index-cqqb6gaq.js.map
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"/**\n * Breaking text into the rows a fixed-width window will draw.\n *\n * ## One wrapping, ours\n *\n * This module used to count rows the way a terminal does — divide the character count by the width — and\n * hand the text to Ink to wrap. Those are two different answers to one question, and the difference is not\n * academic: Ink breaks at spaces, so 240 characters at 80 columns is **four** rows to Ink and three to a\n * division. Every cap built on the division was therefore one row short of what appeared on screen, which\n * on the alternate buffer is a frame taller than the terminal.\n *\n * So the rule is that whoever owns a bounded window wraps the text itself and renders each row with\n * `wrap=\"truncate\"`. The count is then the count, by construction, and a frame test asserts it against a\n * real render rather than trusting the arithmetic.\n *\n * Tabs are expanded to spaces on the way through. A tab's width is the terminal's business and not ours,\n * so a row containing one cannot be measured — expanding it is the only way the number we counted is the\n * number drawn. It changes bytes, never meaning, which is the line decision 4.27 draws.\n */\n\nconst TAB_WIDTH = 8\nconst TAB = \" \".repeat(TAB_WIDTH)\n\nimport { cellWidths } from \"#lib/width\"\n\n/**\n * One drawn row, and which source characters it drew.\n *\n * The offsets exist because a row's text is **not** a slice of its line. Breaking at a space consumes\n * the space, a word longer than the window is cut, and a hanging indent is re-applied to rows that never\n * contained it — so \"which row is source offset 41 on, and at what column\" cannot be recovered from the\n * strings afterwards. Anything that draws a caret over wrapped text needs exactly that, and computing it\n * a second time from the finished rows is how a cursor ends up a column out on the lines that wrapped.\n */\nexport interface WrappedRow {\n /** Exactly what is painted, the re-applied indent included. */\n readonly text: string\n /** Columns of `text` that are indent. A caret never lands to the left of this. */\n readonly lead: number\n /** Source code-point offset of this row's first drawn character. */\n readonly from: number\n /** One past this row's last drawn character. A break at a space leaves a gap before the next `from`. */\n readonly to: number\n}\n\n/**\n * One logical line, broken at spaces to fit `columns`, with the source offsets kept.\n *\n * A word longer than the whole width is cut rather than allowed to overflow — a URL or a base64 blob is\n * the normal case for that, and there is nowhere better to break it. Returns one row for an empty line,\n * because a blank line in a reply is a blank row on screen and dropping it would close up paragraphs the\n * model deliberately separated.\n */\nexport function wrapRows(line: string, columns: number): readonly WrappedRow[] {\n // Tabs are expanded before anything is measured, so offsets are into the *expanded* line. A caller\n // placing a caret has to expand its own column the same way, which `expandColumn` is for.\n const flat = line.replaceAll(\"\\t\", TAB)\n const all = [...flat]\n // Widths per cell, computed once. Every measurement below is a sum over this rather than a count of\n // code points: an emoji is one code point and two columns, so counting made `\"👍\".repeat(10)` measure\n // ten and draw twenty. Offsets stay in code points, because that is what a caller slices with.\n const w = cellWidths(all)\n const span = (from: number, to: number): number => {\n let total = 0\n for (let at = from; at < to; at += 1) total += w[at] ?? 0\n return total\n }\n if (columns <= 0 || span(0, all.length) <= columns) {\n return [{ text: flat, lead: 0, from: 0, to: all.length }]\n }\n\n // Leading whitespace is structure, and splitting on spaces destroys it.\n //\n // Found live: `/help`'s output indents each entry by two spaces, and every line short enough to fit kept\n // them while every line that wrapped lost them — so one list came out at two different indents depending\n // on how long each summary happened to be. Held aside here and re-applied to every row, which also gives\n // a wrapped indented block a hanging indent rather than a ragged left edge.\n let indent = 0\n while (indent < all.length && (all[indent] === \" \" || all[indent] === \"\\u00a0\")) indent += 1\n if (indent > 0) {\n const body = all.slice(indent).join(\"\")\n // An indent as wide as the window is dropped rather than honoured: keeping it would leave no room\n // for the text, and shrinking the width to fit it recurses forever. The recursion terminates either\n // way, because `body` cannot begin with a space.\n if (indent >= columns) {\n return wrapRows(body, columns).map((row) => ({\n ...row,\n from: row.from + indent,\n to: row.to + indent,\n }))\n }\n const pad = \" \".repeat(indent)\n return wrapRows(body, columns - indent).map((row) => ({\n text: `${pad}${row.text}`,\n lead: row.lead + indent,\n from: row.from + indent,\n to: row.to + indent,\n }))\n }\n\n const rows: WrappedRow[] = []\n // `at` is where the pending row starts in the source; `width` is how much of it is drawn so far.\n let at = 0\n let width = 0\n const push = (to: number) => {\n rows.push({ text: all.slice(at, to).join(\"\"), lead: 0, from: at, to })\n }\n let cursor = 0\n while (cursor <= all.length) {\n // The next word, and the single space that introduced it. A run of spaces is not collapsed —\n // only the one space a break consumes is, which is what keeps the offsets honest.\n let end = cursor\n while (end < all.length && all[end] !== \" \") end += 1\n const word = span(cursor, end)\n\n if (word > columns) {\n // Longer than any row can hold. Flush what is pending, then cut it into full rows.\n if (width > 0) {\n push(cursor === at ? cursor : cursor - 1)\n at = cursor\n width = 0\n }\n let take = cursor\n while (span(take, end) > columns) {\n // Advance by *columns*, not by cells. A cut that would land inside a double-width\n // character stops before it, which is why the row can come out one column short: half an\n // emoji is not a thing a terminal can draw, and drawing it anyway is how a row overflows.\n let stop = take\n let filled = 0\n while (stop < end && filled + (w[stop] ?? 0) <= columns) {\n filled += w[stop] ?? 0\n stop += 1\n }\n // A single character wider than the whole window would otherwise loop forever taking\n // nothing. Emit it alone and overflow by one column, which is the only option left.\n if (stop === take) stop = take + 1\n at = take\n push(stop)\n take = stop\n at = take\n }\n at = take\n width = span(take, end)\n } else if (width > 0 && width + 1 + word > columns) {\n // Does not fit beside what is already on this row. The space before it is the break and is\n // drawn by neither row, which is why `to` and the next `from` are not the same number.\n push(cursor - 1)\n at = cursor\n width = word\n } else {\n width = width === 0 ? word : width + 1 + word\n }\n\n if (end >= all.length) break\n cursor = end + 1\n }\n push(all.length)\n return rows\n}\n\nfunction wrapLine(line: string, columns: number): readonly string[] {\n return wrapRows(line, columns).map((row) => row.text)\n}\n\n/** A code-point column in `line` translated into the tab-expanded coordinates `wrapRows` reports. */\nexport function expandColumn(line: string, column: number): number {\n let out = 0\n for (const [at, ch] of [...line].entries()) {\n if (at >= column) break\n out += ch === \"\\t\" ? TAB_WIDTH : 1\n }\n return out\n}\n\n/** Every row `text` occupies at `columns`, newlines respected and long lines broken. */\nexport function wrapText(text: string, columns: number): readonly string[] {\n return text.split(\"\\n\").flatMap((line) => wrapLine(line, columns))\n}\n\n/**\n * The live pane: the rows to draw, how tall that makes it, and how much was dropped.\n *\n * Height-capped on purpose. Ink erases and redraws its whole dynamic tree per frame, so an uncapped pane\n * means redrawing the entire reply on every token — a cost that grows with the length of the answer,\n * precisely when the terminal is busiest. The newest rows are the ones kept, because they are what the\n * reader is looking at, and nothing is lost: the finished reply joins the transcript at `turn.end`.\n *\n * All three numbers from one wrap, because they were computed separately and disagreed. The component\n * needs the rows and the dropped count; the chat frame needs the height to subtract from the terminal\n * *before* the pane renders. Deriving them apart meant the notice's own row was counted by one caller and\n * not the other, which is a layout one row taller than the screen.\n */\nexport interface LivePane {\n /** What to draw, newest last. Already wrapped, so each is one row. */\n readonly lines: readonly string[]\n /** Rows the pane occupies, the \"… n hidden\" notice included. Zero when there is nothing to show. */\n readonly rows: number\n /** Rows dropped off the top. Non-zero is exactly the condition for drawing the notice. */\n readonly hidden: number\n}\n\nexport function livePane(text: string, columns: number, maxRows: number): LivePane {\n if (text === \"\" || maxRows <= 0) return { lines: [], rows: 0, hidden: 0 }\n const all = wrapText(text, columns)\n if (all.length <= maxRows) return { lines: all, rows: all.length, hidden: 0 }\n // The extra row is the notice itself.\n return {\n lines: all.slice(all.length - maxRows),\n rows: maxRows + 1,\n hidden: all.length - maxRows,\n }\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";AA4BA,IAAM,EAA+C,CACjD,CAAC,KAAQ,IAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,MAAQ,KAAM,EACf,CAAC,OAAS,MAAO,EACjB,CAAC,OAAS,MAAO,EACjB,CAAC,OAAS,MAAO,EACjB,CAAC,OAAS,MAAO,EACjB,CAAC,OAAS,MAAO,EACjB,CAAC,OAAS,MAAO,CACrB,EAGM,EAA+C,CACjD,CAAC,IAAQ,GAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM,EACf,CAAC,KAAQ,IAAM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