dispach 0.1.2 → 0.2.0-pilot.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +196 -118
- package/dist/APEv2Parser-2wqk09q7.js +5 -0
- package/dist/APEv2Parser-2wqk09q7.js.map +9 -0
- package/dist/AiffParser-zw4g2bdd.js +5 -0
- package/dist/AiffParser-zw4g2bdd.js.map +12 -0
- package/dist/App-ez7ve0yp.js +11 -0
- package/dist/{App-b1yrwrcq.js.map → App-ez7ve0yp.js.map} +6 -7
- package/dist/AsfParser-2hfcf5z2.js +5 -0
- package/dist/AsfParser-2hfcf5z2.js.map +14 -0
- package/dist/ConfigEditor-aamadrx3.js +6 -0
- package/dist/{ConfigEditor-n8hdw6r7.js.map → ConfigEditor-aamadrx3.js.map} +2 -2
- package/dist/DsdiffParser-n8smktvb.js +5 -0
- package/dist/DsdiffParser-n8smktvb.js.map +11 -0
- package/dist/DsfParser-npmjp4vr.js +5 -0
- package/dist/DsfParser-npmjp4vr.js.map +11 -0
- package/dist/FlacParser-xpbs2zmb.js +5 -0
- package/dist/FlacParser-xpbs2zmb.js.map +9 -0
- package/dist/KeyProbe-4fp152yv.js +5 -0
- package/dist/{KeyProbe-9jjeze5r.js.map → KeyProbe-4fp152yv.js.map} +2 -2
- package/dist/MP4Parser-es3afcmw.js +5 -0
- package/dist/MP4Parser-es3afcmw.js.map +12 -0
- package/dist/MatroskaParser-kxysj649.js +5 -0
- package/dist/MatroskaParser-kxysj649.js.map +13 -0
- package/dist/MpegParser-b3rr7b0f.js +5 -0
- package/dist/MpegParser-b3rr7b0f.js.map +13 -0
- package/dist/MusepackParser-sgjzmq0r.js +5 -0
- package/dist/MusepackParser-sgjzmq0r.js.map +16 -0
- package/dist/OggParser-x8h54ynf.js +5 -0
- package/dist/OggParser-x8h54ynf.js.map +18 -0
- package/dist/Picker-rq015kzc.js +5 -0
- package/dist/{Picker-hfeh1g6m.js.map → Picker-rq015kzc.js.map} +2 -2
- package/dist/SessionPicker-03zyvd2f.js +5 -0
- package/dist/{SessionPicker-zyqkg4dn.js.map → SessionPicker-03zyvd2f.js.map} +2 -2
- package/dist/SkillBrowser-8s8rjv98.js +5 -0
- package/dist/{SkillBrowser-3qdp8080.js.map → SkillBrowser-8s8rjv98.js.map} +2 -2
- package/dist/WavPackParser-w515nnw2.js +5 -0
- package/dist/WavPackParser-w515nnw2.js.map +11 -0
- package/dist/WaveParser-sb0w9m20.js +5 -0
- package/dist/WaveParser-sb0w9m20.js.map +13 -0
- package/dist/WizardApp-wr1tftcr.js +5 -0
- package/dist/{WizardApp-vzpbydy3.js.map → WizardApp-wr1tftcr.js.map} +3 -3
- package/dist/agents.d.ts +19 -3
- package/dist/agents.d.ts.map +1 -1
- package/dist/channels-gx951qdp.js +31 -0
- package/dist/channels-gx951qdp.js.map +10 -0
- package/dist/channels.d.ts +26 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/client.js +11 -11
- package/dist/client.js.map +3 -3
- package/dist/config-wvjeejgd.js +24 -0
- package/dist/{config-g7za9x13.js.map → config-wvjeejgd.js.map} +2 -2
- package/dist/credential-10dn3fxj.js +19 -0
- package/dist/{credential-npr6z8c8.js.map → credential-10dn3fxj.js.map} +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/index-10009hp8.js +11 -0
- package/dist/index-10009hp8.js.map +11 -0
- package/dist/index-1xwrkwh5.js +14 -0
- package/dist/index-1xwrkwh5.js.map +50 -0
- package/dist/index-34p39yfc.js +47 -0
- package/dist/index-34p39yfc.js.map +15 -0
- package/dist/index-3y96s740.js +6 -0
- package/dist/{index-hwpvhaza.js.map → index-3y96s740.js.map} +1 -1
- package/dist/index-4ybeefmn.js +6 -0
- package/dist/index-4ybeefmn.js.map +11 -0
- package/dist/index-59z88wrb.js +6 -0
- package/dist/{index-h9mw7b9d.js.map → index-59z88wrb.js.map} +2 -2
- package/dist/index-5fwzn21m.js +6 -0
- package/dist/{index-gz9x25tz.js.map → index-5fwzn21m.js.map} +2 -2
- package/dist/index-6dvnfk8y.js +6 -0
- package/dist/index-6dvnfk8y.js.map +10 -0
- package/dist/index-6p70fnb7.js +153 -0
- package/dist/index-6p70fnb7.js.map +20 -0
- package/dist/index-6s471ydn.js +12 -0
- package/dist/{index-j55s3ehk.js.map → index-6s471ydn.js.map} +2 -2
- package/dist/index-87wcawta.js +6 -0
- package/dist/{index-0d93hyfc.js.map → index-87wcawta.js.map} +2 -2
- package/dist/index-92gfcbw0.js +6 -0
- package/dist/index-92gfcbw0.js.map +9 -0
- package/dist/index-a0h0p20f.js +991 -0
- package/dist/{index-tv4yv7d2.js.map → index-a0h0p20f.js.map} +27 -23
- package/dist/index-bamw24xc.js +6 -0
- package/dist/{index-6q4wf8e3.js.map → index-bamw24xc.js.map} +1 -1
- package/dist/index-c8ge88a9.js +12 -0
- package/dist/{index-258d8bzg.js.map → index-c8ge88a9.js.map} +4 -3
- package/dist/index-cb2q8nae.js +6 -0
- package/dist/index-cb2q8nae.js.map +13 -0
- package/dist/index-ct6bw0a6.js +6 -0
- package/dist/{index-4z7axw4r.js.map → index-ct6bw0a6.js.map} +1 -1
- package/dist/index-cz6yjxyz.js +10 -0
- package/dist/index-cz6yjxyz.js.map +42 -0
- package/dist/index-d0c5abkw.js +6 -0
- package/dist/{index-vgc3y3rm.js.map → index-d0c5abkw.js.map} +3 -3
- package/dist/index-d0vagham.js +31 -0
- package/dist/index-d0vagham.js.map +188 -0
- package/dist/index-d0zxvr99.js +90 -0
- package/dist/index-d0zxvr99.js.map +13 -0
- package/dist/{index-s9mbq7h6.js → index-d9c97ver.js} +4 -4
- package/dist/{index-s9mbq7h6.js.map → index-d9c97ver.js.map} +1 -1
- package/dist/index-e508e0vt.js +6 -0
- package/dist/{index-tf71ap9v.js.map → index-e508e0vt.js.map} +1 -1
- package/dist/index-esq0knqx.js +6 -0
- package/dist/index-esq0knqx.js.map +10 -0
- package/dist/index-featyhps.js +6 -0
- package/dist/index-featyhps.js.map +10 -0
- package/dist/index-fnq44zdt.js +45 -0
- package/dist/index-fnq44zdt.js.map +74 -0
- package/dist/index-gmn80dwc.js +7 -0
- package/dist/{index-02dn6m2j.js.map → index-gmn80dwc.js.map} +2 -2
- package/dist/index-gwhx69qs.js +66 -0
- package/dist/index-gwhx69qs.js.map +12 -0
- package/dist/index-kjgzhf3w.js +9 -0
- package/dist/{index-6p999cx4.js.map → index-kjgzhf3w.js.map} +4 -6
- package/dist/index-m68cd91a.js +12 -0
- package/dist/index-m68cd91a.js.map +23 -0
- package/dist/{index-3g3ny01d.js → index-mhmgw54j.js} +4 -4
- package/dist/{index-3g3ny01d.js.map → index-mhmgw54j.js.map} +1 -1
- package/dist/{index-gme2egyq.js → index-qm612hwa.js} +4 -4
- package/dist/{index-gme2egyq.js.map → index-qm612hwa.js.map} +1 -1
- package/dist/{index-j7gyr5nx.js → index-qwntpbwe.js} +7 -7
- package/dist/{index-j7gyr5nx.js.map → index-qwntpbwe.js.map} +1 -1
- package/dist/index-qx3xdk4x.js +6 -0
- package/dist/{index-d4x6yvqh.js.map → index-qx3xdk4x.js.map} +3 -4
- package/dist/{index-4cf6v9nb.js → index-rh0meegk.js} +4 -4
- package/dist/{index-4cf6v9nb.js.map → index-rh0meegk.js.map} +1 -1
- package/dist/index-ryb159ff.js +9 -0
- package/dist/{index-ff514z3y.js.map → index-ryb159ff.js.map} +3 -5
- package/dist/{index-ammv5st7.js → index-s6zfpyqa.js} +6 -6
- package/dist/{index-ammv5st7.js.map → index-s6zfpyqa.js.map} +1 -1
- package/dist/index-s9va2kmc.js +429 -0
- package/dist/index-s9va2kmc.js.map +11 -0
- package/dist/index-v5dmsgpx.js +7 -0
- package/dist/index-v5dmsgpx.js.map +11 -0
- package/dist/index-vaj3mn3a.js +6 -0
- package/dist/index-vaj3mn3a.js.map +14 -0
- package/dist/index-vy0rbzws.js +6 -0
- package/dist/{index-fex44816.js.map → index-vy0rbzws.js.map} +2 -2
- package/dist/index-w0s77wfx.js +6 -0
- package/dist/{index-v8e92nfw.js.map → index-w0s77wfx.js.map} +1 -1
- package/dist/index-wx1jzjzr.js +6 -0
- package/dist/{index-qdbq8crg.js.map → index-wx1jzjzr.js.map} +2 -2
- package/dist/index-xbn26c8g.js +126 -0
- package/dist/index-xbn26c8g.js.map +14 -0
- package/dist/index-ytvwyp6k.js +6 -0
- package/dist/{index-9r0wyj6w.js.map → index-ytvwyp6k.js.map} +2 -2
- package/dist/{index-cqqb6gaq.js → index-yvnwpxbb.js} +5 -5
- package/dist/{index-cqqb6gaq.js.map → index-yvnwpxbb.js.map} +1 -1
- package/dist/index.js +379 -448
- package/dist/index.js.map +26 -28
- package/dist/init.d.ts.map +1 -1
- package/dist/lib/agent-secrets.d.ts +38 -0
- package/dist/lib/agent-secrets.d.ts.map +1 -0
- package/dist/lib/agent-template.d.ts +54 -0
- package/dist/lib/agent-template.d.ts.map +1 -0
- package/dist/lib/channel-actions.d.ts +103 -0
- package/dist/lib/channel-actions.d.ts.map +1 -0
- package/dist/lib/chat-frame.d.ts +12 -1
- package/dist/lib/chat-frame.d.ts.map +1 -1
- package/dist/lib/commands.d.ts +13 -0
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/const.d.ts +1 -1
- package/dist/lib/daemon-plan.d.ts.map +1 -1
- package/dist/lib/help.d.ts.map +1 -1
- package/dist/lib/host-actions.d.ts +121 -0
- package/dist/lib/host-actions.d.ts.map +1 -0
- package/dist/lib/init-flow.d.ts +32 -0
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/init-whatsapp.d.ts +52 -0
- package/dist/lib/init-whatsapp.d.ts.map +1 -0
- package/dist/lib/plugin-install.d.ts +120 -0
- package/dist/lib/plugin-install.d.ts.map +1 -0
- package/dist/lib/providers.d.ts.map +1 -1
- package/dist/lib/provision.d.ts +13 -0
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/lib/readme-table.d.ts +15 -0
- package/dist/lib/readme-table.d.ts.map +1 -0
- package/dist/lib/sandbox.d.ts +17 -0
- package/dist/lib/sandbox.d.ts.map +1 -1
- package/dist/lib/schema.d.ts +34 -1
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/subcommand.d.ts.map +1 -1
- package/dist/lib/web-url.d.ts +15 -0
- package/dist/lib/web-url.d.ts.map +1 -0
- package/dist/lib/wizard.d.ts.map +1 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/plugins.d.ts +27 -8
- package/dist/plugins.d.ts.map +1 -1
- package/dist/restart.d.ts +21 -0
- package/dist/restart.d.ts.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/schedules.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/sessions.d.ts.map +1 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/status.d.ts +16 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/web-61cjhpv2.js +14 -0
- package/dist/{web-vkb16r62.js.map → web-61cjhpv2.js.map} +3 -3
- package/dist/web.d.ts +2 -13
- package/dist/web.d.ts.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/wrapper-9msjh1xg.js +5 -0
- package/dist/wrapper-9msjh1xg.js.map +9 -0
- package/package.json +6 -3
- package/dist/App-b1yrwrcq.js +0 -11
- package/dist/ConfigEditor-n8hdw6r7.js +0 -6
- package/dist/KeyProbe-9jjeze5r.js +0 -5
- package/dist/Picker-hfeh1g6m.js +0 -5
- package/dist/SessionPicker-zyqkg4dn.js +0 -5
- package/dist/SkillBrowser-3qdp8080.js +0 -5
- package/dist/WizardApp-vzpbydy3.js +0 -5
- package/dist/config-g7za9x13.js +0 -24
- package/dist/credential-npr6z8c8.js +0 -19
- package/dist/index-02dn6m2j.js +0 -7
- package/dist/index-0d93hyfc.js +0 -6
- package/dist/index-1c5113t4.js +0 -66
- package/dist/index-1c5113t4.js.map +0 -12
- package/dist/index-258d8bzg.js +0 -12
- package/dist/index-4z7axw4r.js +0 -6
- package/dist/index-6p999cx4.js +0 -9
- package/dist/index-6q4wf8e3.js +0 -6
- package/dist/index-9r0wyj6w.js +0 -6
- package/dist/index-d4x6yvqh.js +0 -6
- package/dist/index-fecm8xe7.js +0 -77
- package/dist/index-fecm8xe7.js.map +0 -12
- package/dist/index-fex44816.js +0 -6
- package/dist/index-ff514z3y.js +0 -14
- package/dist/index-gz9x25tz.js +0 -6
- package/dist/index-h9mw7b9d.js +0 -6
- package/dist/index-hwpvhaza.js +0 -6
- package/dist/index-j55s3ehk.js +0 -12
- package/dist/index-mtn0g9vc.js +0 -7
- package/dist/index-mtn0g9vc.js.map +0 -11
- package/dist/index-qdbq8crg.js +0 -6
- package/dist/index-tf71ap9v.js +0 -6
- package/dist/index-ttwyrdjs.js +0 -427
- package/dist/index-ttwyrdjs.js.map +0 -11
- package/dist/index-tv4yv7d2.js +0 -903
- package/dist/index-ty24n0jh.js +0 -167
- package/dist/index-ty24n0jh.js.map +0 -19
- package/dist/index-v8e92nfw.js +0 -6
- package/dist/index-vgc3y3rm.js +0 -6
- package/dist/index-whaw4b18.js +0 -6
- package/dist/index-whaw4b18.js.map +0 -10
- package/dist/web-vkb16r62.js +0 -14
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
3
|
-
`)}function
|
|
4
|
-
${t}`}function
|
|
2
|
+
import{y}from"./index-qx3xdk4x.js";var u=" ",i=2;function E(t){let r=t.filter((n)=>n.value!=="");if(r.length===0)return"";let e=Math.max(...r.map((n)=>n.label.length));return r.map((n)=>{let o=`${u}${n.label.padEnd(e)}${" ".repeat(i)}${n.value}`;return n.note===void 0?o:`${o}${" ".repeat(i)}${n.note}`}).join(`
|
|
3
|
+
`)}function N(t,r=!1){return r?t:`
|
|
4
|
+
${t}`}function f(t){return`${u}${y.bullet}${t}`}function p(t,r=2){let e=" ".repeat(r);return t.split(`
|
|
5
5
|
`).map((n)=>n===""?n:`${e}${n}`).join(`
|
|
6
|
-
`)}function
|
|
7
|
-
export{
|
|
6
|
+
`)}function KA(t){if(!Number.isFinite(t)||t<0)return"unknown";if(t<1024)return`${Math.round(t)} B`;let r=["KB","MB","GB","TB"],e=t/1024,n=0;while(e>=1024&&n<r.length-1)e/=1024,n+=1;return`${e<10?e.toFixed(1):Math.round(e)} ${r[n]}`}function Kt(t){if(!Number.isFinite(t)||t<0)return"unknown";let r=Math.floor(t/1000);if(r<60)return`${r}s`;let e=Math.floor(r/60);if(e<60)return`${e}m ${r%60}s`;let n=Math.floor(e/60);if(n<24)return`${n}h ${e%60}m`;return`${Math.floor(n/24)}d ${n%24}h`}function xA(t,r){if(r===""||!t.startsWith(r))return t;let e=t.slice(r.length);return e===""?"~":e.startsWith("/")?`~${e}`:t}var a=60000,s=24;function YA(t,r){let e=r-Date.parse(t);if(Number.isNaN(e))return t;let n=Math.floor(e/a);if(n<1)return"just now";if(n<60)return`${n}m ago`;let o=Math.floor(n/60);if(o<s)return`${o}h ago`;return`${Math.floor(o/s)}d ago`}
|
|
7
|
+
export{E,N,f,p,KA,Kt,xA,YA};
|
|
8
8
|
|
|
9
|
-
//# debugId=
|
|
10
|
-
//# sourceMappingURL=index-
|
|
9
|
+
//# debugId=40A1C39C5790EF5564756E2164756E21
|
|
10
|
+
//# sourceMappingURL=index-qwntpbwe.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * The plain path's shared vocabulary — the half of the house style that never had one.\n *\n * `theme.ts` serves the Ink path. The plain path is most of the binary, and until this file every\n * command that printed a labelled block invented its own: eight hand-rolled `padEnd` widths across\n * seven files (9, 14, `FLAG_COLUMN`, `ENV_COLUMN`, `COMMAND_COLUMN`, and three computed maxima),\n * with `agents.ts` emitting tab-separated columns while everything beside it emitted padded ones.\n * `agents` and `validate` genuinely looked like output from two different products.\n *\n * So this is not a new style — it is the existing one, written down once. A new surface that wants\n * a labelled block, a status word or a byte count reaches here rather than adding a ninth variant.\n *\n * **Pure.** No `node:*`, no `process`, no colour decision. Every function is text in, text out, so\n * it belongs on the boundaries test's `PURE` list and every rendering rule is unit-testable without\n * capturing stdout. Colour is deliberately *not* applied here: the plain path is read as often from\n * a log file as from a terminal, and a module that emitted escape codes would have to know which,\n * which is `resolveMode`'s job and nowhere near a formatter's.\n */\n\nimport { GLYPH } from \"#lib/theme\"\n\n/** Where a labelled block starts, and the space between the widest label and its value. */\nconst INDENT = \" \"\nconst GAP = 2\n\nexport interface Row {\n readonly label: string\n readonly value: string\n /**\n * Trailing text, aligned past the value.\n *\n * Its own field rather than something the caller concatenates, because the interesting rows\n * are the ones carrying a fact *and* its consequence — \"2463 · launchd has restarted this\n * 2463 times\" — and a caller building that by hand loses the alignment on the next row.\n */\n readonly note?: string\n}\n\n/**\n * A labelled block: two-space indent, labels padded to the widest, values aligned.\n *\n * Rows with an empty value are dropped rather than printed blank. A field that does not apply is\n * not the same as a field that is empty, and printing `logs` with nothing after it invites the\n * reader to wonder which one they are looking at.\n */\nexport function keyValue(rows: readonly Row[]): string {\n const shown = rows.filter((row) => row.value !== \"\")\n if (shown.length === 0) return \"\"\n const width = Math.max(...shown.map((row) => row.label.length))\n return shown\n .map((row) => {\n const head = `${INDENT}${row.label.padEnd(width)}${\" \".repeat(GAP)}${row.value}`\n return row.note === undefined ? head : `${head}${\" \".repeat(GAP)}${row.note}`\n })\n .join(\"\\n\")\n}\n\n/** A heading with its own blank line above, unless it opens the output. */\nexport function section(title: string, first = false): string {\n return first ? title : `\\n${title}`\n}\n\nexport function bullet(text: string): string {\n return `${INDENT}${GLYPH.bullet}${text}`\n}\n\n/** Indent a block that was rendered elsewhere — a log tail, a nested report. */\nexport function indent(text: string, depth = 2): string {\n const pad = \" \".repeat(depth)\n return text\n .split(\"\\n\")\n .map((line) => (line === \"\" ? line : `${pad}${line}`))\n .join(\"\\n\")\n}\n\n/**\n * Bytes as a person reads them.\n *\n * Binary units, and the decimal place only below 10 in each unit — `1.2 MB` is worth a digit,\n * `847 MB` is not, and the extra precision only makes a size harder to compare at a glance.\n */\nexport function bytes(count: number): string {\n if (!Number.isFinite(count) || count < 0) return \"unknown\"\n if (count < 1024) return `${Math.round(count)} B`\n const units = [\"KB\", \"MB\", \"GB\", \"TB\"]\n let value = count / 1024\n let unit = 0\n while (value >= 1024 && unit < units.length - 1) {\n value /= 1024\n unit += 1\n }\n return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[unit]}`\n}\n\n/**\n * A span, in the largest two units that carry information.\n *\n * \"3h 12m\" rather than \"3.2 hours\" or \"11520 seconds\": an uptime is read to answer \"since roughly\n * when\", and two units is where that question stops getting better answers.\n */\nexport function duration(ms: number): string {\n if (!Number.isFinite(ms) || ms < 0) return \"unknown\"\n const seconds = Math.floor(ms / 1000)\n if (seconds < 60) return `${seconds}s`\n const minutes = Math.floor(seconds / 60)\n if (minutes < 60) return `${minutes}m ${seconds % 60}s`\n const hours = Math.floor(minutes / 60)\n if (hours < 24) return `${hours}h ${minutes % 60}m`\n return `${Math.floor(hours / 24)}d ${hours % 24}h`\n}\n\n/**\n * `~/…` for a path under home, so a block of paths stays readable at a glance.\n *\n * Takes `home` rather than reading it, because this module is pure — and because the daemon's\n * output has to be able to render a path under a *different* home than the current process's when\n * it is describing a service definition it did not write.\n */\nexport function tildify(path: string, home: string): string {\n if (home === \"\" || !path.startsWith(home)) return path\n const rest = path.slice(home.length)\n return rest === \"\" ? \"~\" : rest.startsWith(\"/\") ? `~${rest}` : path\n}\n\nconst MINUTE_MS = 60_000\nconst HOURS_PER_DAY = 24\n\n/**\n * How long ago, in the shortest honest form.\n *\n * `now` is a parameter rather than a `Date.now()` call, which is what lets this live in a pure module and\n * be shared. It was previously private to `sessions.ts` and read the clock itself, so the session picker\n * would have had to reimplement it — and two renderings of \"how old is this conversation\" that disagree\n * is the drift this module exists to end.\n *\n * An unparseable timestamp is returned as itself. A store row with a bad date is a real thing to see, and\n * \"NaNm ago\" says nothing about it.\n */\nexport function ago(iso: string, now: number): string {\n const ms = now - Date.parse(iso)\n if (Number.isNaN(ms)) return iso\n const mins = Math.floor(ms / MINUTE_MS)\n if (mins < 1) return \"just now\"\n if (mins < 60) return `${mins}m ago`\n const hours = Math.floor(mins / 60)\n if (hours < HOURS_PER_DAY) return `${hours}h ago`\n return `${Math.floor(hours / HOURS_PER_DAY)}d ago`\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";mCAsBA,IAAM,EAAS,KACT,EAAM,EAsBL,SAAS,CAAQ,CAAC,EAA8B,CACnD,IAAM,EAAQ,EAAK,OAAO,CAAC,IAAQ,EAAI,QAAU,EAAE,EACnD,GAAI,EAAM,SAAW,EAAG,MAAO,GAC/B,IAAM,EAAQ,KAAK,IAAI,GAAG,EAAM,IAAI,CAAC,IAAQ,EAAI,MAAM,MAAM,CAAC,EAC9D,OAAO,EACF,IAAI,CAAC,IAAQ,CACV,IAAM,EAAO,GAAG,IAAS,EAAI,MAAM,OAAO,CAAK,IAAI,IAAI,OAAO,CAAG,IAAI,EAAI,QACzE,OAAO,EAAI,OAAS,OAAY,EAAO,GAAG,IAAO,IAAI,OAAO,CAAG,IAAI,EAAI,OAC1E,EACA,KAAK;AAAA,CAAI,EAIX,SAAS,CAAO,CAAC,EAAe,EAAQ,GAAe,CAC1D,OAAO,EAAQ,EAAQ;AAAA,EAAK,IAGzB,SAAS,CAAM,CAAC,EAAsB,CACzC,MAAO,GAAG,IAAS,EAAM,SAAS,IAI/B,SAAS,CAAM,CAAC,EAAc,EAAQ,EAAW,CACpD,IAAM,EAAM,IAAI,OAAO,CAAK,EAC5B,OAAO,EACF,MAAM;AAAA,CAAI,EACV,IAAI,CAAC,IAAU,IAAS,GAAK,EAAO,GAAG,IAAM,GAAO,EACpD,KAAK;AAAA,CAAI,EASX,SAAS,EAAK,CAAC,EAAuB,CACzC,GAAI,CAAC,OAAO,SAAS,CAAK,GAAK,EAAQ,EAAG,MAAO,UACjD,GAAI,EAAQ,KAAM,MAAO,GAAG,KAAK,M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,KAAK,MAAM,EAAQ,CAAa",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "40A1C39C5790EF5564756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var i={accent:"magenta",muted:"gray",success:"green",warning:"yellow",error:"red",info:"blue",emphasis:"cyan",selection:"blue",border:"gray",borderActive:"magenta",brand:"magenta"},Xr={idle:i.success,thinking:i.warning,streaming:i.accent,working:i.info,cancelling:i.emphasis},$r={user:i.accent,assistant:void 0,reasoning:i.muted,note:i.muted,error:i.error,tool:i.info,banner:void 0},es={user:"› ",assistant:"",reasoning:" ",note:"· ",error:"✖ ",tool:" · ",banner:""},y={prompt:"› ",pointer:"❯ ",bullet:"· ",error:"✖ ",dot:"● ",check:"✓ ",ellipsis:"…",create:"+ ",checked:"◉ ",unchecked:"◯ "},Si=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],As=80,ve="round";var Wr="\x1B[?1000h\x1B[?1002h\x1B[?1006h",zr="\x1B[?1006l\x1B[?1002l\x1B[?1000l";var d=/(?:^|\u001B)\[<(\d+);(\d+);(\d+)([Mm])/g,u=/(?:^|\u001B)\[M[\s\S]{3}/g;function Zr(t){if(!t.includes("[<")&&!t.includes("[M"))return;let r=0,o=!1,s,a,c=!1;for(let e of t.matchAll(d)){o=!0;let n=Number(e[1]);if(n===64){r-=3;continue}if(n===65){r+=3;continue}s={column:Math.max(0,Number(e[2])-1),row:Math.max(0,Number(e[3])-1)},a=e[4]==="m"?"release":(n&32)!==0?"drag":"press",c=(n&4)!==0}for(let e of t.matchAll(u)){o=!0;let n=(e[0].codePointAt(e[0].length-3)??32)-32;if(n===64)r-=3;else if(n===65)r+=3}if(!o)return;return{rows:r,...s===void 0?{}:{at:s},...a===void 0?{}:{kind:a},...c?{shift:c}:{}}}
|
|
3
|
+
export{Wr,zr,Zr,i,Xr,$r,es,y,Si,As,ve};
|
|
4
|
+
|
|
5
|
+
//# debugId=CD7608A2DAF1AE7564756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-qx3xdk4x.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/lib/theme.ts", "../src/lib/
|
|
3
|
+
"sources": ["../src/lib/theme.ts", "../src/lib/mouse.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"/**\n * The one home for appearance: colour tokens, glyphs, and the maps components render from.\n *\n * `lib/const.ts` keeps *behavioural* numbers (row caps, history limits, control sequences); this\n * module holds everything a person would touch to change how the CLI looks. Splitting the two\n * extends the \"no magic value inline\" rule rather than weakening it — one home each, and a\n * component containing a literal colour name is a review failure.\n *\n * Tokens are plain Ink colour names (16-colour safe; Ink's chalk layer maps them per terminal),\n * which keeps this module PURE-listable. `brand` is the single deliberate exception and says why. `NO_COLOR` needs no handling here: the mode resolution\n * forces plain output before Ink ever loads, and chalk independently honours it anyway.\n *\n * This is deliberately a single built-in token set, not a theming system — decision 11.12\n * reverses Phase 2.5's \"themes\" non-goal in the narrowest possible sense. User-configurable\n * themes stay a non-goal.\n */\n\nimport type { TranscriptRole, TurnStatus } from \"#lib/types\"\n\nexport interface Theme {\n /** The one accent, used sparingly: caret, selection cursor, user lines, banner border. */\n readonly accent: string\n /** Hints, notes, reasoning, breadcrumbs. */\n readonly muted: string\n readonly success: string\n readonly warning: string\n readonly error: string\n /** Tool rows and tool-running status. */\n readonly info: string\n /** Cancelling — the one transitional state worth its own colour. */\n readonly emphasis: string\n /**\n * The background a selected run is painted on.\n *\n * A background rather than `inverse`, which is what the caret uses. Inverse swaps foreground and\n * background, so on a coloured run it produces a different colour per role and reads as three\n * highlights rather than one selection — and where a selection contains the caret the two inversions\n * cancel and the caret disappears inside it. A solid background composes instead of fighting.\n */\n readonly selection: string\n /** Non-focal boxes: cards, frames. */\n readonly border: string\n /** The focused box: the input line, the banner. */\n readonly borderActive: string\n /**\n * The wordmark, and only the wordmark.\n *\n * The one token that is a hex triplet rather than an Ink colour name, chosen by the owner. Every other\n * token is 16-colour safe on purpose — a name lets chalk pick whatever the terminal actually has — and\n * this is the deliberate exception, because a brand mark is the one element whose *exact* colour is the\n * point. Chalk downsamples it per terminal rather than failing: on a 256-colour terminal it lands on the\n * nearest cube entry, on a 16-colour one on bright green, which is the right neighbour. `NO_COLOR` is\n * handled before Ink loads at all, by the mode resolution.\n *\n * Not reused anywhere else. A second consumer would make it an accent, and the accent already exists.\n */\n readonly brand: string\n}\n\nexport const THEME: Theme = {\n accent: \"magenta\",\n muted: \"gray\",\n success: \"green\",\n warning: \"yellow\",\n error: \"red\",\n info: \"blue\",\n emphasis: \"cyan\",\n // 16-colour safe like every token but `brand`: chalk maps it to whatever the terminal has, and a\n // named colour survives a 16-colour terminal where a hex triplet would be approximated.\n selection: \"blue\",\n border: \"gray\",\n borderActive: \"magenta\",\n brand: \"magenta\",\n}\n\n/** Status-dot colours, previously inlined in StatusBar. */\nexport const STATUS_COLOR: Record<TurnStatus, string> = {\n idle: THEME.success,\n thinking: THEME.warning,\n streaming: THEME.accent,\n working: THEME.info,\n cancelling: THEME.emphasis,\n}\n\n/** Transcript role colours, previously inlined in Transcript. `undefined` = terminal default. */\nexport const ROLE_COLOR: Record<TranscriptRole, string | undefined> = {\n user: THEME.accent,\n assistant: undefined,\n reasoning: THEME.muted,\n note: THEME.muted,\n error: THEME.error,\n tool: THEME.info,\n banner: undefined,\n}\n\n/**\n * What each role puts before its text, and re-applies as a hanging indent on every row after the first.\n *\n * That second half is why `reasoning` is **two columns** rather than the `\\u00b7 reasoning \\u00b7 ` it used to be.\n * A prefix is an indent, so the longest block in the transcript was also the narrowest — 86 columns of a\n * 100-column terminal, on the one item that is routinely forty rows long. The label moved to a header row\n * of its own, where it costs one row once instead of fourteen columns per row.\n */\nexport const ROLE_PREFIX: Record<TranscriptRole, string> = {\n user: \"› \",\n assistant: \"\",\n reasoning: \" \",\n note: \"· \",\n error: \"✖ \",\n tool: \" · \",\n banner: \"\",\n}\n\n/** The glyph vocabulary. Components compose these; none defines its own. */\nexport const GLYPH = {\n prompt: \"› \",\n pointer: \"❯ \",\n bullet: \"· \",\n error: \"✖ \",\n dot: \"● \",\n check: \"✓ \",\n ellipsis: \"…\",\n create: \"+ \",\n /** Multi-select boxes. Two glyphs so a ticked row reads as ticked without colour. */\n checked: \"◉ \",\n unchecked: \"◯ \",\n} as const\n\n/** Braille spinner. Ten glyphs in a const, not a dependency — decision 11.10 holds. */\nexport const SPINNER_FRAMES = [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"] as const\nexport const SPINNER_INTERVAL_MS = 80\n\n/** cli-boxes ships inside Ink 7; rounded is the house border. Zero new dependencies. */\nexport const BORDER_STYLE = \"round\" as const\n",
|
|
6
|
-
"/**\n * Laying a catalogue row out in a fixed number of columns. Pure, so the layout is testable as strings.\n *\n * ## Why this is not a component's problem\n *\n * The first version put the name, the size and the whole description in one `<Text>` and let Ink wrap.\n * Every row longer than the terminal became two or three lines, the checkbox column stopped lining up,\n * and a list of forty skills was unreadable. Wrapping is not a styling detail in a list — it destroys the\n * one property a list has, which is that a row is a row.\n *\n * So the width arithmetic lives here, in one place, as functions over numbers and strings: pad the name to\n * a column, pad the meta to a column, give the description whatever is left, and **truncate every field\n * before it can wrap**. `Text` also carries `wrap=\"truncate\"` as a backstop, but a backstop is not a\n * layout — the columns have to add up, or the description gets cut at a width nobody chose.\n */\n\n/** Terminal columns below which the description is dropped rather than shown as three characters. */\nconst NARROW = 60\n/** The name column, wide enough for `create-architectural-decision-record` to be recognisable. */\nconst NAME_MIN = 18\nconst NAME_MAX = 34\n/** `12.3k · 15 scripts` is the widest realistic meta string. */\nconst META = 18\n/** Checkbox plus pointer, both two characters. */\nconst GUTTER = 4\nconst GAP = 2\n\n/** `2284` → `2.3k`. A row is scanned, not audited, and five digits of precision cost a column. */\nexport function compactTokens(tokens: number): string {\n if (tokens < 1000) return String(tokens)\n const thousands = tokens / 1000\n return thousands < 10 ? `${thousands.toFixed(1)}k` : `${Math.round(thousands)}k`\n}\n\nexport function metaOf(tokens: number, scripts: number, installed: boolean): string {\n if (installed) return \"installed\"\n const size = compactTokens(tokens)\n return scripts === 0 ? size : `${size} · ${scripts} script${scripts === 1 ? \"\" : \"s\"}`\n}\n\n/** Cut to `width`, with an ellipsis when anything was lost. Never returns more than `width`. */\nexport function clip(text: string, width: number): string {\n if (width <= 0) return \"\"\n const flat = text.replace(/\\s+/g, \" \").trim()\n if (flat.length <= width) return flat\n if (width === 1) return \"…\"\n return `${flat.slice(0, width - 1)}…`\n}\n\nexport interface RowColumns {\n readonly name: number\n readonly meta: number\n readonly description: number\n}\n\n/**\n * How wide each column is at a given terminal width.\n *\n * The name column flexes with the longest name actually present rather than being fixed: a catalogue of\n * short names should not leave a third of the row empty, and one long name should not push the\n * description off the screen. Clamped at both ends for both reasons.\n */\nexport function columnsFor(\n width: number,\n longestName: number,\n options: { readonly nameMax?: number } = {},\n): RowColumns {\n // Overridden by the plain path, whose names carry a `source/` prefix and which has no cursor to keep\n // near them. Passing a wider name column *without* going through this function is what pushed every\n // piped row twelve characters over the width it was laid out for.\n let name = Math.max(NAME_MIN, Math.min(options.nameMax ?? NAME_MAX, longestName))\n let meta = META\n\n // The name and meta columns shrink before anything else does. Without this the *fixed* part of the row\n // could exceed the terminal on its own — at 40 columns with a 34-character name it came to 60, so every\n // row wrapped no matter what the description did, which is the bug this module exists to remove.\n const chrome = GUTTER + GAP\n if (chrome + name + meta > width) meta = Math.max(6, width - chrome - name)\n if (chrome + name + meta > width) name = Math.max(6, width - chrome - meta)\n\n const description = width - (chrome + name + meta + GAP)\n // Below the threshold the description is dropped entirely. Three characters of a sentence is worse than\n // none: it takes the same column and carries no information.\n if (width < NARROW || description < 24) return { name, meta, description: 0 }\n return { name, meta, description }\n}\n\n/**\n * One row, exactly `width` characters wide or less, in three aligned columns.\n *\n * Returned as one string rather than as fields, because alignment is the whole point and a caller that\n * assembled the parts could get the padding wrong. Colour is applied by the component *around* this — the\n * arithmetic must not know about escape codes, which do not occupy columns and would break every count.\n */\nexport function layoutRow(\n input: {\n readonly name: string\n readonly meta: string\n readonly description: string\n },\n columns: RowColumns,\n): { readonly name: string; readonly meta: string; readonly description: string } {\n return {\n name: clip(input.name, columns.name).padEnd(columns.name),\n meta: clip(input.meta, columns.meta).padEnd(columns.meta),\n description: columns.description === 0 ? \"\" : clip(input.description, columns.description),\n }\n}\n\n/** A heading, drawn as a rule so groups separate without costing a blank line each. */\nexport function headingRule(label: string, width: number): string {\n const text = clip(label, Math.max(0, width - 8))\n const filled = text.length + 3\n return `${text} ${\"─\".repeat(Math.max(0, Math.min(width, 80) - filled))}`\n}\n\n/**\n * Which slice of a longer list to show.\n *\n * Shared by the catalogue list and the input box, which want the same rule for the same reason: both\n * are taller than their allowance and both have a position that must stay visible. It lives here rather\n * than in either component because the second caller is what proved it was layout arithmetic and not a\n * detail of one screen.\n *\n * Originally: Keeps the cursor inside the window rather than paging, because a cursor that jumps a\n * whole viewport loses the reader's place.\n */\nexport function viewport(\n total: number,\n index: number,\n window: number,\n): { readonly from: number; readonly to: number } {\n if (total <= window) return { from: 0, to: total }\n const half = Math.floor(window / 2)\n const from = Math.min(Math.max(0, index - half), total - window)\n return { from, to: from + window }\n}\n",
|
|
7
6
|
"/**\n * Wheel scrolling on the alternate screen. Pure, so a mouse report is arithmetic rather than a guess.\n *\n * ## Why this needs a guard rather than only a parser\n *\n * Ink does not know about mouse reports. Measured against a real pty with tracking on: a wheel notch\n * arrived as the literal text `ESC[<64;10;5M`, fell through the keymap to the insert branch, and was typed\n * into the message — twice, because two notches are two reports. So recognising a report is not an\n * optimisation here; every report a terminal can send has to be claimed, wheel and click alike, or the\n * feature's cost is garbage in somebody's message.\n *\n * A chunk can carry several reports. A fast scroll sends one per notch and the runtime coalesces them, so\n * the count matters: honouring one report per chunk makes a flick of the wheel move a single row and reads\n * as the wheel not working.\n *\n * ## The trade this makes, stated\n *\n * Tracking is what stops the terminal handling the mouse itself, so **drag-selecting text with the mouse\n * stops working while a session is mounted**. Every terminal worth naming lets you hold shift to bypass\n * tracking and select natively, which is why the key list says so rather than leaving it to be discovered.\n *\n * Two encodings are recognised. SGR (`ESC [ < b ; x ; y M`) is what we ask for and what any terminal from\n * the last decade replies with; X10 (`ESC [ M` and three raw bytes) is the fallback a terminal that ignored\n * the SGR request will use, and its bytes are frequently above 127 — so leaving it unclaimed would put\n * unprintable characters into a message on exactly the terminals least able to say why.\n */\n\n/**\n * Button tracking, drag tracking, and SGR encoding.\n *\n * 1000 reports press and release and is the least that reports the wheel at all. **1002 adds motion while a\n * button is held**, and without it a drag is not reported — which is why selecting text was not merely\n * disabled but unreachable: the events never arrived. 1003 (motion with no button) is deliberately absent,\n * because it makes the terminal send a report for every pixel of idle pointer movement and nothing here\n * wants hover.\n *\n * Set low-to-high and reset high-to-low, so a terminal that only understands some of them is left in a\n * state we asked for rather than a partial one.\n */\nexport const ENABLE_MOUSE = \"\\u001B[?1000h\\u001B[?1002h\\u001B[?1006h\"\n/** Reversed on the way out, so a terminal is left handling its own mouse again. */\nexport const DISABLE_MOUSE = \"\\u001B[?1006l\\u001B[?1002l\\u001B[?1000l\"\n\n/**\n * Rows one notch of the wheel moves.\n *\n * Three, which is the line-scroll every desktop uses. One row per notch is technically a scroll and feels\n * like the wheel is broken; a whole page per notch overshoots what somebody is looking for.\n */\nexport const WHEEL_ROWS = 3\n\n/** Wheel-up and wheel-down in SGR's button numbering. 64 is the wheel bit plus button 0. */\nconst WHEEL_UP = 64\nconst WHEEL_DOWN = 65\n\n/** Motion bit — set on every report mode 1002 sends while a button is held. */\nconst MOTION = 32\n/** Shift bit, so shift-clicking can extend a selection rather than starting a new one. */\nconst SHIFT = 4\n\n/**\n * The escape prefix is **optional**, and that is not laxness.\n *\n * Ink strips one leading `ESC` from the chunk before a handler sees it (`use-input.js:97`), so the first\n * report in a chunk arrives bare and every one after it keeps its escape. Requiring the prefix therefore\n * matched none of them, which is exactly how the first version of this let a wheel notch through: measured\n * against a real pty, the composer read `abc[<64;10;5M[<64;10;5M`.\n *\n * Anchored rather than left floating: a bare report is only recognised at the very start of the chunk,\n * which is the one position Ink's stripping can produce. A message that happens to contain the same text\n * in the middle of a sentence is still a message.\n */\n// biome-ignore lint/suspicious/noControlCharactersInRegex: the escape byte is the thing being matched\nconst SGR = /(?:^|\\u001B)\\[<(\\d+);(\\d+);(\\d+)([Mm])/g\n// biome-ignore lint/suspicious/noControlCharactersInRegex: the escape byte is the thing being matched\nconst X10 = /(?:^|\\u001B)\\[M[\\s\\S]{3}/g\n\n/** Which gesture a report describes. */\nexport type MouseKind = \"wheel\" | \"press\" | \"drag\" | \"release\"\n\n/** Where a report happened, in **zero-based** screen cells. */\nexport interface MousePoint {\n readonly column: number\n readonly row: number\n}\n\nexport interface MouseInput {\n /**\n * Rows to move: negative up, positive down, zero for a report that is not the wheel.\n *\n * Zero is *not* \"no report\" — a click is a report with no scroll in it, and it still has to be\n * swallowed. The `undefined` return is what means \"no report\".\n */\n readonly rows: number\n /**\n * The last gesture in the chunk, and where it happened. `undefined` when nothing positional was in it.\n *\n * The *last* rather than every one, because a drag arrives as a stream of motion reports and only the\n * newest position matters — a selection follows the pointer, it does not retrace it. The wheel is the\n * exception and is summed instead, which is why `rows` is separate: a flick coalesces several notches\n * into one chunk and honouring only the last would move a single row.\n */\n readonly at?: MousePoint\n readonly kind?: MouseKind\n /** Held modifiers, from SGR's button bits. Shift is what extends a selection from a click. */\n readonly shift?: boolean\n}\n\n/**\n * What a chunk of input means to the mouse, or `undefined` if it holds no mouse report at all.\n *\n * Returning `undefined` rather than a zero is what keeps a keystroke a keystroke: every other branch of\n * the keymap runs only when this says nothing.\n */\nexport function mouseInput(input: string): MouseInput | undefined {\n // Cheap prefilter. Every report contains one of these two, and almost no keystroke does.\n if (!input.includes(\"[<\") && !input.includes(\"[M\")) return undefined\n let rows = 0\n let seen = false\n let at: MousePoint | undefined\n let kind: MouseKind | undefined\n let shift = false\n for (const match of input.matchAll(SGR)) {\n seen = true\n const button = Number(match[1])\n if (button === WHEEL_UP) {\n rows -= WHEEL_ROWS\n continue\n }\n if (button === WHEEL_DOWN) {\n rows += WHEEL_ROWS\n continue\n }\n // SGR reports 1-based cells; everything downstream indexes from zero, so the conversion happens\n // once, here, rather than at each of the callers that would each have to remember it.\n at = { column: Math.max(0, Number(match[2]) - 1), row: Math.max(0, Number(match[3]) - 1) }\n // `m` is a release whatever the button bits say. Motion is bit 5 (32); the low two bits are the\n // button, and only the left one starts a selection.\n kind = match[4] === \"m\" ? \"release\" : (button & MOTION) !== 0 ? \"drag\" : \"press\"\n shift = (button & SHIFT) !== 0\n }\n for (const match of input.matchAll(X10)) {\n seen = true\n // X10 offsets every field by 32, so the wheel's 64 and 65 arrive as 96 and 97.\n // Three fields follow `[M`, and the escape before it is optional — so the button is found\n // from the end of the match rather than at a fixed offset.\n const button = (match[0].codePointAt(match[0].length - 3) ?? 32) - 32\n if (button === WHEEL_UP) rows -= WHEEL_ROWS\n else if (button === WHEEL_DOWN) rows += WHEEL_ROWS\n }\n if (!seen) return undefined\n return {\n rows,\n ...(at === undefined ? {} : { at }),\n ...(kind === undefined ? {} : { kind }),\n ...(shift ? { shift } : {}),\n }\n}\n"
|
|
8
7
|
],
|
|
9
|
-
"mappings": ";AA2DO,IAAM,EAAe,CACxB,OAAQ,UACR,MAAO,OACP,QAAS,QACT,QAAS,SACT,MAAO,MACP,KAAM,OACN,SAAU,OAGV,UAAW,OACX,OAAQ,OACR,aAAc,UACd,MAAO,SACX,EAGa,GAA2C,CACpD,KAAM,EAAM,QACZ,SAAU,EAAM,QAChB,UAAW,EAAM,OACjB,QAAS,EAAM,KACf,WAAY,EAAM,QACtB,EAGa,GAAyD,CAClE,KAAM,EAAM,OACZ,UAAW,OACX,UAAW,EAAM,MACjB,KAAM,EAAM,MACZ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,EAAU,CAAC,EAAuC,CAE9D,GAAI,CAAC,EAAM,SAAS,IAAI,GAAK,CAAC,EAAM,SAAS,IAAI,EAAG,OACpD,IAAI,EAAO,EACP,EAAO,GACP,EACA,EACA,EAAQ,GACZ,QAAW,KAAS,EAAM,SAAS,CAAG,EAAG,CACrC,EAAO,GACP,IAAM,EAAS,OAAO,EAAM,EAAE,EAC9B,GAAI,IAzEK,GAyEgB,CACrB,GA7Ec,EA8Ed,SAEJ,GAAI,IA5EO,GA4EgB,CACvB,GAjFc,EAkFd,SAIJ,EAAK,CAAE,OAAQ,KAAK,IAAI,EAAG,OAAO,EAAM,EAAE,EAAI,CAAC,EAAG,IAAK,KAAK,IAAI,EAAG,OAAO,EAAM,EAAE,EAAI,CAAC,CAAE,EAGzF,EAAO,EAAM,KAAO,IAAM,WAAa,EAlFhC,MAkFqD,EAAI,OAAS,QACzE,GAAS,EAjFH,KAiFuB,EAEjC,QAAW,KAAS,EAAM,SAAS,CAAG,EAAG,CACrC,EAAO,GAIP,IAAM,GAAU,EAAM,GAAG,YAAY,EAAM,GAAG,OAAS,CAAC,GAAK,IAAM,GACnE,GAAI,IA/FK,GA+FgB,GAlGP,EAmGb,QAAI,IA/FE,GA+FqB,GAnGd,EAqGtB,GAAI,CAAC,EAAM,OACX,MAAO,CACH,UACI,IAAO,OAAY,CAAC,EAAI,CAAE,IAAG,KAC7B,IAAS,OAAY,CAAC,EAAI,CAAE,MAAK,KACjC,EAAQ,CAAE,OAAM,EAAI,CAAC,CAC7B",
|
|
9
|
+
"debugId": "CD7608A2DAF1AE7564756E2164756E21",
|
|
11
10
|
"names": []
|
|
12
11
|
}
|
|
@@ -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 Uo(n){return r(n(6))}function xr(n){return new RegExp("^local:[0123456789abcdefghjkmnpqrstvwxyz]{6}$").test(n)}
|
|
3
|
+
export{Uo,xr};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=539B512F5BCA1A6D64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-rh0meegk.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": "539B512F5BCA1A6D64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t,qe,FA,vA}from"./index-a0h0p20f.js";import{EA,bt}from"./index-e508e0vt.js";import{pn,fn,Re}from"./index-10009hp8.js";import{E,N,f,p}from"./index-qwntpbwe.js";function yt(n){if(n===void 0||n===null)return"(not set)";if(typeof n==="string")return n===""?'""':n;if(typeof n==="boolean"||typeof n==="number")return String(n);return JSON.stringify(n)}function m(n){return n.split(/[.[]/)[0]??n}function Fi(n,e){let o=[`${e}`,""],s=new Map;for(let i of n){let l=m(i.setting.path);s.set(l,[...s.get(l)??[],i])}let r=!0;for(let[i,l]of s){o.push(N(i,r)),r=!1;for(let a of l){let d=a.setting.agentListed?"":" · yours only",h=a.setting.via===void 0?"":` · set with \`${a.setting.via}\``,y=a.setting.confirm===void 0?"":" · asks first";o.push(E([{label:a.setting.path,value:yt(a.value)}]),p(`${a.setting.means}${d}${h}${y}`,4))}}return o.push("","A change takes effect the next time the agent starts. `yours only` marks a field the agent is","refused: what it may do is its to ask for, where it writes and who may reach it are yours."),o.join(`
|
|
3
|
+
`)}function vi(n,e){return[E([{label:n.path,value:yt(e)}]),p(n.means,4),...n.toAgent===void 0?[]:[p(`to the agent: ${n.toAgent}`,4)]].join(`
|
|
4
|
+
`)}function Ui(n,e){if(n.confirm===void 0)return;if(n.path==="tools.untrusted.onMutate"&&String(e).toLowerCase()!=="allow")return;return n.confirm}function Hi(n){let e=[E([{label:"set",value:`${n.path} = ${yt(n.after)}`},{label:"was",value:n.before===void 0?"(not set)":yt(n.before)},{label:"file",value:n.file}])];if(n.reflowed)e.push("",f("the block could not be edited in place, so the file was re-serialised — it is valid, and comments may have moved"));if(n.running!==void 0)e.push("",f(`this agent is running (pid ${n.running.pid}, ${n.running.mode}) and holds its settings for its lifetime — the change applies after ${n.restartHint}`));for(let o of n.pending)e.push(f(`${o.name} is not set — ${o.why}`)),e.push(f(`fill it in with \`config env <agent> ${o.name}\``));return e.join(`
|
|
5
|
+
`)}function Ki(){return vA.filter((n)=>n.via===void 0&&!/[[<]/.test(n.path)).map((n)=>n.path)}function mt(n){if(typeof n!=="object"||n===null)return[];let e=n,o=[],s=(a,d)=>{if(typeof a==="string"&&a!=="")o.push({name:a,why:d})},r=c(e.model);for(let a of["main","selector","compactor"]){let d=c(r?.[a]);s(d?.apiKeyEnv,"the manifest will not load until it is set")}if(Array.isArray(e.channels))for(let a of e.channels){let d=c(a);if(d===void 0||d.enabled===!1)continue;s(d.tokenEnv,`the ${String(d.id??d.type??"channel")} channel is read at boot, so the agent will not start until it is set`)}let i=c(e.server);if(i?.enabled===!0)s(i.tokenEnv,"the HTTP API would accept unauthenticated requests. This does not stop the agent starting");let l=c(c(e.tools)?.providers);for(let[a,d]of Object.entries(l??{}))s(c(d)?.apiKeyEnv,`the ${a} provider's tools will not work until it is set`);return o}function c(n){if(typeof n!=="object"||n===null||Array.isArray(n))return;return n}function ro(n,e){return n.filter((o)=>e[o.name]===void 0||e[o.name]==="")}function u(n,e){let o=[],s=new Map;for(let r of n){if(r.setting.via!==void 0||/[[<]/.test(r.setting.path))continue;let i=r.setting.path.split(".")[0]??r.setting.path;s.set(i,[...s.get(i)??[],r])}for(let[r,i]of s){o.push({kind:"heading",label:r});for(let l of i)o.push({kind:"setting",setting:l.setting,value:l.value})}if(e.channels.length>0){o.push({kind:"heading",label:"who may reach it"});for(let r of e.channels)o.push({kind:"allow",channelId:r.id,channelType:r.type,handles:r.allowFrom})}if(e.secrets.length>0){o.push({kind:"heading",label:"secrets — written to the .env, never shown"});for(let r of e.secrets)o.push({kind:"secret",name:r.name,why:r.why,present:e.present(r.name)})}return o}import{readFileSync as g}from"node:fs";function so(n){let e=g(n,"utf8");return vA.map((o)=>{if(o.path==="channels[].allowFrom"){let s=qe(e,["channels"]);if(!Array.isArray(s))return{setting:o,value:void 0};let r={};for(let i of s){if(typeof i!=="object"||i===null)continue;let l=i;if(typeof l.id!=="string")continue;r[l.id]=l.allowFrom??[]}return{setting:o,value:Object.keys(r).length===0?void 0:r}}if(o.path==="tools.providers.<id>.writeRoots"){let s=qe(e,["tools","providers"]);if(typeof s!=="object"||s===null||Array.isArray(s))return{setting:o,value:void 0};let r={};for(let[i,l]of Object.entries(s)){if(typeof l!=="object"||l===null)continue;let a=l.writeRoots;if(a!==void 0)r[i]=a}return{setting:o,value:Object.keys(r).length===0?void 0:r}}return{setting:o,value:qe(e,o.path.split("."))}})}function zA(n){let e=g(n,"utf8"),o=FA(e),s=EA(n),r=qe(e,["channels"]);return u(so(n),{channels:(Array.isArray(r)?r:[]).filter((i)=>typeof i==="object"&&i!==null&&!Array.isArray(i)).map((i)=>({id:String(i.id??""),type:String(i.type??""),allowFrom:Array.isArray(i.allowFrom)?i.allowFrom.map(String):[]})).filter((i)=>i.id!==""),secrets:mt(o),present:(i)=>bt(s,i)})}async function Vt(n,e,o){switch(e.kind){case"setting":{if(o.trim()==="")throw new t({code:"cli_config_value_missing",message:`No value given for ${e.setting.path}.`,hint:'A bare word, a number, a list as ["a", "b"], or a map as {k: v}.',field:"value"});return(await pn(n,e.setting.path,o)).note}case"allow":{let s=o.trim()===""?[]:o.trim().split(/\s+/);return(await fn(n,e.channelId,s)).note}case"secret":return Re(n,e.name,o).note;case"heading":return""}}
|
|
6
|
+
export{yt,Fi,vi,Ui,Hi,Ki,mt,ro,so,zA,Vt};
|
|
7
|
+
|
|
8
|
+
//# debugId=C2297977DD69BAB864756E2164756E21
|
|
9
|
+
//# sourceMappingURL=index-ryb159ff.js.map
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/lib/config-
|
|
3
|
+
"sources": ["../src/lib/config-view.ts", "../src/lib/config-rows.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * The three writes `config` performs, separated from how any surface prints them.\n *\n * The plain actions and the editor both go through here, which is the same argument the phase made one\n * level down: `editManifest` is the only thing that writes `agent.yaml` because three writers meant the\n * guarantee depended on which caller you were. Two *callers* of that writer would have the same problem\n * one step up — the editor validating a handle differently from `config allow`, or writing a secret\n * without tightening the file's mode.\n *\n * Each function does the effect and returns a sentence. Refusals throw `HarnessError`, so a caller that\n * prints to a terminal and a caller that shows a line in a frame both get the same words.\n */\n\nimport { chmodSync, existsSync, readFileSync, statSync, writeFileSync } from \"node:fs\"\nimport { dirname, join } from \"node:path\"\nimport { editManifest, HarnessError, manifestValueAt, parseSettingValue } from \"@dispach/core\"\nimport { upsertEnv } from \"#lib/dotenv-edit\"\nimport { telegramHandle } from \"#lib/init-flow\"\n\nexport interface Applied {\n /** One line saying what happened, for whichever surface asked. */\n readonly note: string\n /** The source editor could not place the path, so the document was re-serialised. */\n readonly reflowed: boolean\n /** What was there before, so a caller can offer the undo. */\n readonly before: unknown\n}\n\n/** The `.env` beside a manifest. */\nexport function envPathOf(manifestPath: string): string {\n return join(dirname(manifestPath), \".env\")\n}\n\nexport async function applySet(manifestPath: string, path: string, raw: string): Promise<Applied> {\n const value = parseSettingValue(raw)\n const result = await editManifest({ file: manifestPath, path: path.split(\".\"), value })\n return {\n note: `${path} is now ${describe(value)}`,\n reflowed: result.reflowed,\n before: result.before,\n }\n}\n\n/**\n * Add, remove or replace a channel's inbound allowlist.\n *\n * `handles` is the whole list, because the whole list is what gets written: the field lives inside a\n * sequence entry and the source editor matches `key:` at an indent, so one entry's key is not\n * addressable. Every handle is checked against the service that issues it first — an impossible one\n * matches nobody, and the only symptom is a bot that is connected, healthy and silently refusing the\n * person it was set up for.\n */\nexport async function applyAllow(\n manifestPath: string,\n channelId: string,\n handles: readonly string[],\n): Promise<Applied> {\n const source = readFileSync(manifestPath, \"utf8\")\n const channels = manifestValueAt(source, [\"channels\"])\n if (!Array.isArray(channels)) {\n throw new HarnessError({\n code: \"cli_config_no_channels\",\n message: \"This agent has no channels, so there is nobody to allow.\",\n hint: \"`config set <agent> channels '[{type: telegram, id: tg, tokenEnv: TELEGRAM_BOT_TOKEN, mode: longpoll}]'` declares one first.\",\n })\n }\n\n const entries = channels.filter(\n (entry): entry is Record<string, unknown> =>\n typeof entry === \"object\" && entry !== null && !Array.isArray(entry),\n )\n const at = entries.findIndex((entry) => String(entry.id ?? \"\") === channelId)\n if (at === -1) {\n throw new HarnessError({\n code: \"cli_config_channel_unknown\",\n message: `No channel with id \"${channelId}\".`,\n hint: `Declared: ${entries.map((entry) => String(entry.id ?? \"\")).join(\", \")}.`,\n field: \"channel\",\n })\n }\n\n const target = entries[at] as Record<string, unknown>\n const checked = handles.map((handle) => checkedHandle(handle, String(target.type ?? \"\")))\n const unique = [...new Set(checked)]\n const before = Array.isArray(target.allowFrom) ? target.allowFrom.map(String) : []\n\n const result = await editManifest({\n file: manifestPath,\n path: [\"channels\"],\n value: entries.map((entry, index) =>\n index === at ? { ...entry, allowFrom: unique } : entry,\n ),\n })\n return {\n note:\n unique.length === 0\n ? `${channelId} now allows nobody, which refuses every message`\n : `${channelId} now allows ${unique.join(\", \")}`,\n reflowed: result.reflowed,\n before,\n }\n}\n\n/**\n * Put a value in the `.env` beside the manifest, at 0600.\n *\n * Written 0600 whichever way the file arrived: under a service manager this is the *only* path\n * credentials take — launchd hands a job almost no environment and a plist carries none on purpose — so\n * tightening it is right even when this command did not create it. `writeFileSync`'s mode applies only\n * when it creates the file, which is why the check afterwards is not redundant.\n */\nexport function applySecret(manifestPath: string, name: string, value: string): Applied {\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {\n throw new HarnessError({\n code: \"cli_config_env_name_invalid\",\n message: `\"${name}\" is not an environment variable name.`,\n hint: \"Letters, digits and underscores, not starting with a digit — MODEL_API_KEY, TELEGRAM_BOT_TOKEN.\",\n field: \"name\",\n })\n }\n if (value === \"\") {\n throw new HarnessError({\n code: \"cli_config_env_empty\",\n message: `An empty value for ${name} would not start the agent.`,\n hint: \"A variable set to nothing fails the load exactly as a missing one does. Nothing was written.\",\n })\n }\n\n const path = envPathOf(manifestPath)\n const before = existsSync(path) ? readFileSync(path, \"utf8\") : \"\"\n const upsert = upsertEnv(before, name, value)\n writeFileSync(path, upsert.text, { encoding: \"utf8\", mode: 0o600 })\n const loose = (statSync(path).mode & 0o077) !== 0\n if (loose) chmodSync(path, 0o600)\n\n return {\n note: `${name} ${upsert.replaced ? \"replaced\" : \"written\"} in ${path}${loose ? \" (tightened to 0600)\" : \"\"}`,\n reflowed: false,\n before: undefined,\n }\n}\n\n/**\n * A handle, validated against the service that issues it.\n *\n * Telegram's rule is shared with `init` rather than restated, because a check only one surface performs\n * is a check the two disagree about. An unknown channel type passes through: guessing at another\n * service's identifier format would refuse handles that are perfectly valid.\n */\nexport function checkedHandle(raw: string, type: string): string {\n const given = raw.trim()\n if (given === \"\") {\n throw new HarnessError({\n code: \"cli_config_handle_missing\",\n message: \"No handle given.\",\n hint: \"On Telegram that is the username, not the display name.\",\n field: \"handle\",\n })\n }\n if (type !== \"telegram\") return given\n const checked = telegramHandle(given)\n if (!checked.ok) {\n throw new HarnessError({\n code: \"cli_config_handle_invalid\",\n message: `\"${given}\" ${checked.reason}`,\n hint: \"A handle that cannot exist matches nobody, and the only symptom is the bot silently refusing every message from the person it was set up for.\",\n field: \"handle\",\n })\n }\n return checked.value\n}\n\n/** A value as a short phrase, for a one-line note. */\nfunction describe(value: unknown): string {\n if (value === \"\") return \"empty\"\n if (typeof value === \"string\") return value\n return JSON.stringify(value)\n}\n",
|
|
6
|
-
"/**\n * Setting one variable in a `.env` without disturbing the rest of it. Pure: text in, text out.\n *\n * The same argument as `yaml-edit.ts`, for the same file's neighbour. A generated `.env` carries\n * comments naming what each variable is for and where to get it, and rewriting the file from a parsed\n * map would drop every one of them — which matters more here than in the manifest, because this is the\n * file somebody opens six months later wondering which dashboard a key came from.\n *\n * Deliberately not a `.env` *parser*: reading one is `parseDotEnv` in core, and a second implementation\n * of that would be two things that have to agree about quoting. This only ever finds a line and\n * replaces it, so the two meet at exactly one place — how a value is quoted on the way out, which is\n * written to be read back by that parser and asserted against it in the tests.\n */\n\n/** Whether a value needs quoting to survive `parseDotEnv`, and the quoted form if so. */\nexport function renderEnvValue(value: string): string {\n // Unquoted values stop at ` #`, and a leading quote character would be eaten as an opening quote.\n // Everything else round-trips bare, which keeps a generated file readable.\n const needsQuotes =\n value === \"\" ||\n /^[\"']/.test(value) ||\n /\\s/.test(value) ||\n value.includes(\"#\") ||\n value !== value.trim()\n if (!needsQuotes) return value\n const escaped = value\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/\\t/g, \"\\\\t\")\n return `\"${escaped}\"`\n}\n\nexport interface EnvUpsert {\n readonly text: string\n /** True when the variable was already there and its line was replaced. */\n readonly replaced: boolean\n}\n\n/**\n * Set `name` to `value`, replacing an existing assignment in place or appending a new one.\n *\n * Replacing **in place** rather than appending is what stops the file growing a second, shadowing\n * assignment on every edit — `parseDotEnv` takes the last one, so an append-only writer would leave a\n * file whose earlier lines are lies. A commented-out assignment is left alone: it is documentation,\n * and uncommenting it would resurrect a value somebody deliberately disabled.\n */\nexport function upsertEnv(source: string, name: string, value: string): EnvUpsert {\n const assignment = `${name}=${renderEnvValue(value)}`\n const lines = source.split(\"\\n\")\n // `export FOO=` counts, because `parseDotEnv` reads it. A `#` first does not.\n const pattern = new RegExp(`^\\\\s*(?:export\\\\s+)?${name}\\\\s*=`)\n const at = lines.findIndex((line) => pattern.test(line))\n\n if (at !== -1) {\n const existing = lines[at] ?? \"\"\n // The `export ` prefix is preserved: it is there because something sources this file rather\n // than reading it, and dropping it would break that quietly.\n const prefix = /^\\s*export\\s+/.exec(existing)?.[0] ?? \"\"\n return {\n text: [...lines.slice(0, at), `${prefix}${assignment}`, ...lines.slice(at + 1)].join(\n \"\\n\",\n ),\n replaced: true,\n }\n }\n\n // Appended with exactly one trailing newline, whatever the file ended with. A `.env` that gains a\n // blank line on every edit is a file that looks edited by a machine, which it is, but it should not\n // look careless about it.\n const body = source.replace(/\\n+$/, \"\")\n return { text: body === \"\" ? `${assignment}\\n` : `${body}\\n${assignment}\\n`, replaced: false }\n}\n",
|
|
7
5
|
"/**\n * What `config` prints, and what a person has to confirm. Pure, so both are asserted as strings.\n *\n * The policy lives here rather than in the command for the same reason `remove-plan.ts` does: this\n * surface can disable the write gate and open a bind address to the network, and \"which edits need a\n * confirmation\" is exactly the thing that must be checkable without performing one.\n *\n * ## Why the person's policy is not the agent's\n *\n * Decision 11.29: *enabling a capability answers \"what may I do\"; a write root, an allowlist and a\n * bind address answer \"who and where\", and those are the person's by definition.* The agent's floor\n * exists because an agent that could widen its own inbound gate could be **talked into** widening it\n * by the very message it is reading — `config_set` sits in `policy.allow` on a real manifest, so the\n * write gate would not stop that. A person typing at a terminal is not that threat, and refusing them\n * is what left the fields reserved for them with the worst ergonomics in the system.\n *\n * So nothing here is floored. Two edits are confirmed, both from decision 4.50, and only those two:\n * a confirmation that fires on `limits.maxSteps` is one nobody reads by the time it fires on the\n * write gate.\n */\n\nimport { SETTINGS, type Setting } from \"@dispach/core\"\nimport type { EditorRow } from \"#lib/config-editor\"\nimport { bullet, indent, keyValue, section } from \"#lib/render\"\n\n/** A setting with whatever the manifest currently has in it. */\nexport interface SettingValue {\n readonly setting: Setting\n /** Plain JS, or `undefined` when the field is absent from the file. */\n readonly value: unknown\n}\n\n/**\n * How a value appears in a listing.\n *\n * Lists and maps as JSON rather than flattened YAML, which is the lesson from `config_read`: collapsing\n * a block's newlines rendered `[type: telegram id: tg tokenEnv: …]`, one run-on string where the reader\n * needed fields. A sequence of maps went through `String(entry)` and wrote `[object Object]` — the same\n * defect, three times, in three renderers.\n */\nexport function showValue(value: unknown): string {\n if (value === undefined || value === null) return \"(not set)\"\n if (typeof value === \"string\") return value === \"\" ? '\"\"' : value\n if (typeof value === \"boolean\" || typeof value === \"number\") return String(value)\n return JSON.stringify(value)\n}\n\n/** The top-level key a path belongs under, for grouping. */\nfunction group(path: string): string {\n return path.split(/[.[]/)[0] ?? path\n}\n\n/**\n * The whole catalogue, grouped by the block it lives in, each row carrying who owns it.\n *\n * Grouped by manifest block rather than by owner, because the question a reader arrives with is \"what\n * can I change about tools\" far more often than \"what is mine versus the agent's\" — and the ownership\n * still shows on every row that is not the default.\n */\nexport function renderSettings(rows: readonly SettingValue[], file: string): string {\n const out: string[] = [`${file}`, \"\"]\n\n // Collected by block rather than emitted in catalogue order. Printing a heading whenever the block\n // *changes* looks equivalent and is not: the person-only rows sit at the end of the catalogue, so a\n // real listing came out with `server` and `tools` as two sections each, reading as though there\n // were two of them. Grouping here rather than reordering the catalogue keeps the render correct\n // whatever order the rows arrive in, which is the property worth having.\n const blocks = new Map<string, SettingValue[]>()\n for (const row of rows) {\n const block = group(row.setting.path)\n blocks.set(block, [...(blocks.get(block) ?? []), row])\n }\n\n let first = true\n for (const [block, members] of blocks) {\n out.push(section(block, first))\n first = false\n for (const row of members) {\n const owner = row.setting.agentListed ? \"\" : \" · yours only\"\n const via = row.setting.via === undefined ? \"\" : ` · set with \\`${row.setting.via}\\``\n const guard = row.setting.confirm === undefined ? \"\" : \" · asks first\"\n out.push(\n keyValue([{ label: row.setting.path, value: showValue(row.value) }]),\n indent(`${row.setting.means}${owner}${via}${guard}`, 4),\n )\n }\n }\n out.push(\n \"\",\n \"A change takes effect the next time the agent starts. `yours only` marks a field the agent is\",\n \"refused: what it may do is its to ask for, where it writes and who may reach it are yours.\",\n )\n return out.join(\"\\n\")\n}\n\n/** One field, for `config get`. */\nexport function renderOne(setting: Setting, value: unknown): string {\n return [\n keyValue([{ label: setting.path, value: showValue(value) }]),\n indent(setting.means, 4),\n ...(setting.toAgent === undefined ? [] : [indent(`to the agent: ${setting.toAgent}`, 4)]),\n ].join(\"\\n\")\n}\n\n/**\n * What a confirmation says before a guard-weakening edit, or `undefined` when none is needed.\n *\n * The value matters, not only the path: `onMutate: confirm` tightens the gate and `allow` removes it,\n * and asking about both would teach people to agree to the one that matters. Same asymmetry the agent's\n * floor has, where `confirm` is settable and `allow` is refused.\n */\nexport function confirmationFor(setting: Setting, value: unknown): string | undefined {\n if (setting.confirm === undefined) return undefined\n if (setting.path === \"tools.untrusted.onMutate\" && String(value).toLowerCase() !== \"allow\") {\n return undefined\n }\n return setting.confirm\n}\n\n/**\n * The report after a successful set.\n *\n * `reflowed` is surfaced rather than swallowed: the file is correct and its comments have moved, which\n * is a surprise better heard from the command than found later in a diff.\n */\nexport function renderChange(input: {\n readonly path: string\n readonly before: unknown\n readonly after: unknown\n readonly file: string\n readonly reflowed: boolean\n /** A live process holding this agent, if there is one. */\n readonly running?: { readonly pid: number; readonly mode: string }\n /**\n * Env variables this edit has *newly* made load-bearing and that are not set.\n *\n * Newly, not \"all of them\": a note about tokens printed on every `limits.maxSteps` change is a note\n * nobody reads by the time it matters — the same reasoning that makes `config_set` report a pending\n * secret only for a write that could have introduced one. What is already missing is `config list`'s\n * to report, because that is the command whose job is the overview.\n */\n readonly pending: readonly EnvNeed[]\n readonly restartHint: string\n}): string {\n const out: string[] = [\n keyValue([\n { label: \"set\", value: `${input.path} = ${showValue(input.after)}` },\n {\n label: \"was\",\n value: input.before === undefined ? \"(not set)\" : showValue(input.before),\n },\n { label: \"file\", value: input.file },\n ]),\n ]\n if (input.reflowed) {\n out.push(\n \"\",\n bullet(\n \"the block could not be edited in place, so the file was re-serialised — it is valid, and comments may have moved\",\n ),\n )\n }\n if (input.running !== undefined) {\n // Never a refusal. Fixing a misconfiguration while it is running and broken is the main use of\n // this command, so the state it would refuse in is the state somebody is trying to get out of.\n out.push(\n \"\",\n bullet(\n `this agent is running (pid ${input.running.pid}, ${input.running.mode}) and holds its settings for its lifetime — the change applies after ${input.restartHint}`,\n ),\n )\n }\n for (const need of input.pending) {\n out.push(bullet(`${need.name} is not set — ${need.why}`))\n out.push(bullet(`fill it in with \\`config env <agent> ${need.name}\\``))\n }\n return out.join(\"\\n\")\n}\n\n/** Every setting with a real dotted path, in catalogue order. `config set`'s accepted list. */\nexport function settablePaths(): readonly string[] {\n return SETTINGS.filter((entry) => entry.via === undefined && !/[[<]/.test(entry.path)).map(\n (entry) => entry.path,\n )\n}\n\n/** An env variable this manifest depends on, and what actually happens without it. */\nexport interface EnvNeed {\n readonly name: string\n /** The real consequence, which differs per source and is not interchangeable. */\n readonly why: string\n}\n\n/**\n * The env variables a manifest depends on, each with the consequence of it being unset.\n *\n * One message for all of them was wrong, and a live run showed it: the API token variable reported as\n * \"read at boot — the agent will refuse to start until it is filled in\", printed for an agent with\n * `server.enabled: false` that starts perfectly well. Three sources, three different outcomes:\n *\n * - `model.<role>.apiKeyEnv` — a **load failure**. `validateApiKeyEnv` refuses the manifest outright.\n * - an enabled channel's `tokenEnv` — a **boot failure**, because the factory reads it inside\n * `Runtime.create`. A channel with `enabled: false` is never constructed, so it needs nothing.\n * - `server.tokenEnv` — **no failure at all**. The API serves unauthenticated and the banner says so,\n * which is worth telling somebody and is not the same sentence as \"will not start\".\n * - a provider's `apiKeyEnv` — that provider's tools do not work; the agent runs.\n *\n * A disabled block contributes nothing. Claiming a dependency that does not exist is worse than\n * claiming none, because it is the kind of warning that teaches people to ignore this line.\n */\nexport function envNeeds(document: unknown): readonly EnvNeed[] {\n if (typeof document !== \"object\" || document === null) return []\n const doc = document as Record<string, unknown>\n const needs: EnvNeed[] = []\n const add = (name: unknown, why: string) => {\n if (typeof name === \"string\" && name !== \"\") needs.push({ name, why })\n }\n\n const model = asRecord(doc.model)\n for (const role of [\"main\", \"selector\", \"compactor\"]) {\n const config = asRecord(model?.[role])\n add(config?.apiKeyEnv, \"the manifest will not load until it is set\")\n }\n\n if (Array.isArray(doc.channels)) {\n for (const entry of doc.channels) {\n const channel = asRecord(entry)\n if (channel === undefined || channel.enabled === false) continue\n add(\n channel.tokenEnv,\n `the ${String(channel.id ?? channel.type ?? \"channel\")} channel is read at boot, so the agent will not start until it is set`,\n )\n }\n }\n\n const server = asRecord(doc.server)\n if (server?.enabled === true) {\n add(\n server.tokenEnv,\n \"the HTTP API would accept unauthenticated requests. This does not stop the agent starting\",\n )\n }\n\n const providers = asRecord(asRecord(doc.tools)?.providers)\n for (const [id, config] of Object.entries(providers ?? {})) {\n add(asRecord(config)?.apiKeyEnv, `the ${id} provider's tools will not work until it is set`)\n }\n\n return needs\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined\n return value as Record<string, unknown>\n}\n\n/** Those of `needs` the environment does not supply. */\nexport function unmet(\n needs: readonly EnvNeed[],\n env: Readonly<Record<string, string | undefined>>,\n): readonly EnvNeed[] {\n return needs.filter((need) => env[need.name] === undefined || env[need.name] === \"\")\n}\n\n/**\n * The editor's rows for a manifest: every setting, one `allowFrom` per channel, and every secret.\n *\n * Here rather than in the component because it is the whole shape of the surface and it is pure — what\n * appears, in what order, under which heading — and because both hosts build it the same way.\n *\n * The two catalogue rows that are not dotted paths are *replaced* by their expansions rather than shown\n * beside them: `channels[].allowFrom` becomes one row per declared channel, and\n * `tools.providers.<id>.writeRoots` is left as a listing-only row, because writing it means naming a\n * provider and the editor has no way to ask which. A row nobody can act on would be the dead end this\n * surface exists to remove, so it is not offered at all — `config list` still shows it.\n */\nexport function editorRows(\n settings: readonly SettingValue[],\n input: {\n readonly channels: readonly {\n readonly id: string\n readonly type: string\n readonly allowFrom: readonly string[]\n }[]\n readonly secrets: readonly EnvNeed[]\n readonly present: (name: string) => boolean\n },\n): readonly EditorRow[] {\n const out: EditorRow[] = []\n\n // Collected by block, not emitted when the block *changes* — the same distinction `renderSettings`\n // records above, which this renderer had never been given. The two are not equivalent: the\n // person-only rows sit at the end of the catalogue, so `server.host` and `server.tokenEnv` were\n // already a second `server` section here, and inserting any row between `server.port` and them\n // made it visible. `schedules` was that row. Grouping keeps the render correct whatever order the\n // catalogue arrives in, which is the property worth having and the reason not to fix it by\n // reordering the table.\n const blocks = new Map<string, SettingValue[]>()\n for (const row of settings) {\n if (row.setting.via !== undefined || /[[<]/.test(row.setting.path)) continue\n const key = row.setting.path.split(\".\")[0] ?? row.setting.path\n blocks.set(key, [...(blocks.get(key) ?? []), row])\n }\n for (const [label, members] of blocks) {\n out.push({ kind: \"heading\", label })\n for (const row of members) {\n out.push({ kind: \"setting\", setting: row.setting, value: row.value })\n }\n }\n\n if (input.channels.length > 0) {\n out.push({ kind: \"heading\", label: \"who may reach it\" })\n for (const channel of input.channels) {\n out.push({\n kind: \"allow\",\n channelId: channel.id,\n channelType: channel.type,\n handles: channel.allowFrom,\n })\n }\n }\n\n if (input.secrets.length > 0) {\n out.push({ kind: \"heading\", label: \"secrets — written to the .env, never shown\" })\n for (const need of input.secrets) {\n out.push({\n kind: \"secret\",\n name: need.name,\n why: need.why,\n present: input.present(need.name),\n })\n }\n }\n\n return out\n}\n",
|
|
8
6
|
"/**\n * What the config editor shows, and what one confirmed row does. Reads files; no Ink.\n *\n * Its own module because **both hosts import it statically** — `config.ts` for the standalone editor and\n * `App.tsx` for the pane — while `index.ts` imports `config.ts` *dynamically* to keep Ink off the\n * startup path. A module reached both ways makes `bun build --splitting` emit its exports twice and the\n * binary refuses to parse, and `bun test` sails straight through it because tests import source. So the\n * shared half lives where nothing has to be lazy about it.\n */\n\nimport { readFileSync } from \"node:fs\"\nimport { HarnessError, manifestDocument, manifestValueAt, SETTINGS } from \"@dispach/core\"\nimport { applyAllow, applySecret, applySet } from \"#lib/config-apply\"\nimport type { EditorRow } from \"#lib/config-editor\"\nimport { agentEnv, isSet } from \"#lib/config-env\"\nimport { editorRows, envNeeds, type SettingValue } from \"#lib/config-view\"\n\n/**\n * Every setting with whatever the file currently holds.\n *\n * Two rows do not have a readable dotted path — `allowFrom` lives inside a list entry and `writeRoots`\n * inside a provider — so they are gathered by walking the block instead. Shown rather than omitted: a\n * field missing from a listing reads as \"no such concept\", which is the same reasoning that puts a\n * `none` row in slot 2 instead of leaving the line out.\n */\nexport function currentValues(manifestPath: string): readonly SettingValue[] {\n const source = readFileSync(manifestPath, \"utf8\")\n return SETTINGS.map((setting) => {\n if (setting.path === \"channels[].allowFrom\") {\n const channels = manifestValueAt(source, [\"channels\"])\n if (!Array.isArray(channels)) return { setting, value: undefined }\n const byId: Record<string, unknown> = {}\n for (const entry of channels) {\n if (typeof entry !== \"object\" || entry === null) continue\n const row = entry as { id?: unknown; allowFrom?: unknown }\n if (typeof row.id !== \"string\") continue\n byId[row.id] = row.allowFrom ?? []\n }\n return { setting, value: Object.keys(byId).length === 0 ? undefined : byId }\n }\n if (setting.path === \"tools.providers.<id>.writeRoots\") {\n const providers = manifestValueAt(source, [\"tools\", \"providers\"])\n if (typeof providers !== \"object\" || providers === null || Array.isArray(providers)) {\n return { setting, value: undefined }\n }\n const roots: Record<string, unknown> = {}\n for (const [id, config] of Object.entries(providers as Record<string, unknown>)) {\n if (typeof config !== \"object\" || config === null) continue\n const found = (config as { writeRoots?: unknown }).writeRoots\n if (found !== undefined) roots[id] = found\n }\n return { setting, value: Object.keys(roots).length === 0 ? undefined : roots }\n }\n return { setting, value: manifestValueAt(source, setting.path.split(\".\")) }\n })\n}\n\n/**\n * The rows the editor shows, read fresh from the manifest and its `.env`.\n *\n * Exported because both hosts build them: this command mounts the editor standalone, and the chat opens\n * it as a pane. Two builders would drift on the first row either one grew.\n */\nexport function editorRowsFor(manifestPath: string): readonly EditorRow[] {\n const source = readFileSync(manifestPath, \"utf8\")\n const document = manifestDocument(source)\n const env = agentEnv(manifestPath)\n const channels = manifestValueAt(source, [\"channels\"])\n\n return editorRows(currentValues(manifestPath), {\n channels: (Array.isArray(channels) ? channels : [])\n .filter(\n (entry): entry is Record<string, unknown> =>\n typeof entry === \"object\" && entry !== null && !Array.isArray(entry),\n )\n .map((entry) => ({\n id: String(entry.id ?? \"\"),\n type: String(entry.type ?? \"\"),\n allowFrom: Array.isArray(entry.allowFrom) ? entry.allowFrom.map(String) : [],\n }))\n .filter((entry) => entry.id !== \"\"),\n secrets: envNeeds(document),\n // The agent's layered environment, not this process's — `ambientEnv` alone never adds the file\n // beside the manifest, which made a row read `(not set)` right after somebody set it.\n present: (name: string) => isSet(env, name),\n })\n}\n\n/**\n * Perform one row's edit. The editor's only asynchronous part, and the plain commands' path too.\n *\n * A blank buffer means different things per row and each is the useful reading: no handles is \"allow\n * nobody\", which is a real thing to want; an empty *setting* would be a value nobody typed on purpose;\n * and an empty secret is refused by `applySecret`, because a variable set to nothing fails the load\n * exactly as a missing one does.\n */\nexport async function applyEditorRow(\n manifestPath: string,\n row: EditorRow,\n raw: string,\n): Promise<string> {\n switch (row.kind) {\n case \"setting\": {\n if (raw.trim() === \"\") {\n throw new HarnessError({\n code: \"cli_config_value_missing\",\n message: `No value given for ${row.setting.path}.`,\n hint: 'A bare word, a number, a list as [\"a\", \"b\"], or a map as {k: v}.',\n field: \"value\",\n })\n }\n return (await applySet(manifestPath, row.setting.path, raw)).note\n }\n case \"allow\": {\n const handles = raw.trim() === \"\" ? [] : raw.trim().split(/\\s+/)\n return (await applyAllow(manifestPath, row.channelId, handles)).note\n }\n case \"secret\":\n return applySecret(manifestPath, row.name, raw).note\n case \"heading\":\n return \"\"\n }\n}\n"
|
|
9
7
|
],
|
|
10
|
-
"mappings": ";
|
|
11
|
-
"debugId": "
|
|
8
|
+
"mappings": ";sKAwCO,SAAS,EAAS,CAAC,EAAwB,CAC9C,GAAI,IAAU,QAAa,IAAU,KAAM,MAAO,YAClD,GAAI,OAAO,IAAU,SAAU,OAAO,IAAU,GAAK,KAAO,EAC5D,GAAI,OAAO,IAAU,WAAa,OAAO,IAAU,SAAU,OAAO,OAAO,CAAK,EAChF,OAA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Ac,EAAI,QAAQ,KAAM,CAAG,GAAG,IACjE,KACK,QAAS,CACV,IAAM,EAAU,EAAI,KAAK,IAAM,GAAK,CAAC,EAAI,EAAI,KAAK,EAAE,MAAM,KAAK,EAC/D,OAAQ,MAAM,GAAW,EAAc,EAAI,UAAW,CAAO,GAAG,IACpE,KACK,SACD,OAAO,GAAY,EAAc,EAAI,KAAM,CAAG,EAAE,SAC/C,UACD,MAAO",
|
|
9
|
+
"debugId": "C2297977DD69BAB864756E2164756E21",
|
|
12
10
|
"names": []
|
|
13
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 it(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 tr(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 Bn(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{it,tr,Bn};
|
|
8
8
|
|
|
9
|
-
//# debugId=
|
|
10
|
-
//# sourceMappingURL=index-
|
|
9
|
+
//# debugId=5C23E97A4B34623764756E2164756E21
|
|
10
|
+
//# sourceMappingURL=index-s6zfpyqa.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,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