dispach 0.1.2 → 0.1.3
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 +134 -85
- package/dist/App-qfqvx9c7.js +11 -0
- package/dist/{App-b1yrwrcq.js.map → App-qfqvx9c7.js.map} +6 -7
- package/dist/ConfigEditor-apcnj4nj.js +6 -0
- package/dist/{ConfigEditor-n8hdw6r7.js.map → ConfigEditor-apcnj4nj.js.map} +2 -2
- package/dist/KeyProbe-ya5t3v3v.js +5 -0
- package/dist/{KeyProbe-9jjeze5r.js.map → KeyProbe-ya5t3v3v.js.map} +2 -2
- package/dist/Picker-b7mn0mjg.js +5 -0
- package/dist/{Picker-hfeh1g6m.js.map → Picker-b7mn0mjg.js.map} +1 -1
- package/dist/SessionPicker-vacfwczg.js +5 -0
- package/dist/{SessionPicker-zyqkg4dn.js.map → SessionPicker-vacfwczg.js.map} +2 -2
- package/dist/SkillBrowser-66ntwaa9.js +5 -0
- package/dist/{SkillBrowser-3qdp8080.js.map → SkillBrowser-66ntwaa9.js.map} +1 -1
- package/dist/WizardApp-123998yh.js +5 -0
- package/dist/{WizardApp-vzpbydy3.js.map → WizardApp-123998yh.js.map} +3 -3
- package/dist/agents.d.ts +19 -3
- package/dist/agents.d.ts.map +1 -1
- package/dist/channels-q4fwqq87.js +31 -0
- package/dist/channels-q4fwqq87.js.map +10 -0
- package/dist/channels.d.ts +26 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/client.js +10 -10
- package/dist/client.js.map +3 -3
- package/dist/config-64q4mgxc.js +24 -0
- package/dist/{config-g7za9x13.js.map → config-64q4mgxc.js.map} +2 -2
- package/dist/{credential-npr6z8c8.js → credential-2sj7vsmw.js} +5 -5
- package/dist/{credential-npr6z8c8.js.map → credential-2sj7vsmw.js.map} +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/index-0k3w2mxf.js +6 -0
- package/dist/{index-hwpvhaza.js.map → index-0k3w2mxf.js.map} +1 -1
- package/dist/index-1s81qstp.js +6 -0
- package/dist/{index-v8e92nfw.js.map → index-1s81qstp.js.map} +1 -1
- package/dist/index-2rycma8x.js +12 -0
- package/dist/{index-258d8bzg.js.map → index-2rycma8x.js.map} +4 -3
- package/dist/index-2zye08c4.js +6 -0
- package/dist/{index-vgc3y3rm.js.map → index-2zye08c4.js.map} +2 -2
- package/dist/{index-gme2egyq.js → index-3km1jwh7.js} +4 -4
- package/dist/{index-gme2egyq.js.map → index-3km1jwh7.js.map} +1 -1
- package/dist/index-3mtgcvkq.js +429 -0
- package/dist/index-3mtgcvkq.js.map +11 -0
- package/dist/index-4knb5vjm.js +90 -0
- package/dist/index-4knb5vjm.js.map +13 -0
- package/dist/{index-3g3ny01d.js → index-5nwwekk0.js} +4 -4
- package/dist/{index-3g3ny01d.js.map → index-5nwwekk0.js.map} +1 -1
- package/dist/index-5rm7dwq4.js +6 -0
- package/dist/index-5rm7dwq4.js.map +11 -0
- package/dist/index-79epttpm.js +6 -0
- package/dist/index-79epttpm.js.map +10 -0
- package/dist/{index-4cf6v9nb.js → index-7yk1zvds.js} +4 -4
- package/dist/{index-4cf6v9nb.js.map → index-7yk1zvds.js.map} +1 -1
- package/dist/index-81gb4ey4.js +6 -0
- package/dist/{index-4z7axw4r.js.map → index-81gb4ey4.js.map} +1 -1
- package/dist/index-8a5d8sfe.js +6 -0
- package/dist/{index-0d93hyfc.js.map → index-8a5d8sfe.js.map} +1 -1
- package/dist/index-a21zyy54.js +6 -0
- package/dist/index-a21zyy54.js.map +9 -0
- package/dist/index-b6da6c16.js +92 -0
- package/dist/index-b6da6c16.js.map +15 -0
- package/dist/index-byxrc961.js +903 -0
- package/dist/{index-tv4yv7d2.js.map → index-byxrc961.js.map} +16 -15
- package/dist/{index-ammv5st7.js → index-cgfg6t5a.js} +6 -6
- package/dist/{index-ammv5st7.js.map → index-cgfg6t5a.js.map} +1 -1
- package/dist/{index-s9mbq7h6.js → index-ehzwdnc3.js} +4 -4
- package/dist/{index-s9mbq7h6.js.map → index-ehzwdnc3.js.map} +1 -1
- package/dist/index-fzmmhmk2.js +7 -0
- package/dist/index-fzmmhmk2.js.map +11 -0
- package/dist/index-g3pk0kc0.js +6 -0
- package/dist/{index-9r0wyj6w.js.map → index-g3pk0kc0.js.map} +2 -2
- package/dist/index-h828nk24.js +153 -0
- package/dist/index-h828nk24.js.map +20 -0
- package/dist/{index-02dn6m2j.js → index-jq999vcw.js} +5 -5
- package/dist/{index-02dn6m2j.js.map → index-jq999vcw.js.map} +2 -2
- package/dist/index-k2aq5bg0.js +9 -0
- package/dist/{index-6p999cx4.js.map → index-k2aq5bg0.js.map} +4 -6
- package/dist/{index-cqqb6gaq.js → index-k3y8y3wj.js} +5 -5
- package/dist/{index-cqqb6gaq.js.map → index-k3y8y3wj.js.map} +1 -1
- package/dist/index-k59wwdgz.js +9 -0
- package/dist/{index-ff514z3y.js.map → index-k59wwdgz.js.map} +3 -5
- package/dist/index-nmnnwa02.js +6 -0
- package/dist/{index-6q4wf8e3.js.map → index-nmnnwa02.js.map} +1 -1
- package/dist/index-nn3tk25c.js +6 -0
- package/dist/{index-d4x6yvqh.js.map → index-nn3tk25c.js.map} +3 -4
- package/dist/index-q0hxh57v.js +126 -0
- package/dist/index-q0hxh57v.js.map +14 -0
- package/dist/index-srmhk9g5.js +11 -0
- package/dist/index-srmhk9g5.js.map +11 -0
- package/dist/index-swtyfhha.js +6 -0
- package/dist/{index-fex44816.js.map → index-swtyfhha.js.map} +2 -2
- package/dist/index-whq42sat.js +6 -0
- package/dist/{index-h9mw7b9d.js.map → index-whq42sat.js.map} +1 -1
- package/dist/{index-j7gyr5nx.js → index-wzsmh5j0.js} +7 -7
- package/dist/{index-j7gyr5nx.js.map → index-wzsmh5j0.js.map} +1 -1
- package/dist/{index-j55s3ehk.js → index-x7v1zq89.js} +7 -7
- package/dist/{index-j55s3ehk.js.map → index-x7v1zq89.js.map} +2 -2
- package/dist/index-xhzmv4dh.js +66 -0
- package/dist/index-xhzmv4dh.js.map +12 -0
- package/dist/index-xmv47vs0.js +6 -0
- package/dist/{index-gz9x25tz.js.map → index-xmv47vs0.js.map} +2 -2
- package/dist/index-y4c32wn7.js +6 -0
- package/dist/{index-qdbq8crg.js.map → index-y4c32wn7.js.map} +2 -2
- package/dist/index-yjcdp72k.js +6 -0
- package/dist/{index-tf71ap9v.js.map → index-yjcdp72k.js.map} +1 -1
- package/dist/index-zn24991r.js +6 -0
- package/dist/index-zn24991r.js.map +10 -0
- package/dist/index.js +374 -443
- package/dist/index.js.map +23 -27
- package/dist/init.d.ts.map +1 -1
- 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/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.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 +15 -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-923c7f5e.js +14 -0
- package/dist/{web-vkb16r62.js.map → web-923c7f5e.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-0w9b3my0.js +11 -0
- package/dist/wrapper-0w9b3my0.js.map +23 -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/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-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,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
function
|
|
3
|
-
export{
|
|
2
|
+
function hi(t){let e=[],r=/\[(\d+);(\d+)(?::(\d+))?([A-Za-z~])/g;for(let s of t.matchAll(r)){let a=Number(s[1]),n=Number(s[2]),i=s[3],o=s[4]??"";if(!Number.isFinite(a)||!Number.isFinite(n)||n<1)continue;e.push({modifier:n,final:o,param:a,eventType:i===void 0?void 0:i==="3"?"release":i==="2"?"repeat":"press"})}return e}function yi(t){let e=t.codePointAt(0)===27?t.slice(1):t;return/^\[\?\d*u$/.test(e)}function u(t,e,r){switch(t.final){case"A":return e.upArrow;case"B":return e.downArrow;case"C":return e.rightArrow;case"D":return e.leftArrow;case"H":return e.home;case"F":return e.end;case"~":switch(t.param){case 1:case 7:return e.home;case 3:return e.delete;case 4:case 8:return e.end;case 5:return e.pageUp;case 6:return e.pageDown;default:return!1}case"u":if(t.param===13)return e.return;if(t.param===127)return e.backspace;if(t.param===27)return e.escape;return r!==""&&r===String.fromCodePoint(t.param).toLowerCase();default:return!1}}function wi(t,e,r){let s=r.findIndex((i)=>u(i,t,e));if(s===-1)return t;let[a]=r.splice(s,1);if(a===void 0)return t;let n=a.modifier-1;return{...t,shift:(n&1)!==0,meta:(n&2)!==0,ctrl:(n&4)!==0,super:(n&8)!==0,...a.eventType===void 0?{}:{eventType:a.eventType}}}
|
|
3
|
+
export{hi,yi,wi};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=262F00FBC3C84E9364756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-5nwwekk0.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * Reading a modifier off the bytes, because Ink's reading of it is lossy.\n *\n * ## The defect this exists for\n *\n * Warp sends `cmd+left` as `CSI 1;9D` — modifier 9, which decodes to the super bit — and **omits the\n * event-type field**. Ink's kitty branch for special keys requires that field (its regex demands a\n * `:<event>` group), so the sequence falls through to its legacy branch, which does:\n *\n * key.meta = key.meta || !!(modifier & 10)\n *\n * `10` is `alt | super`. With modifier 8 that is `8 & 10 === 8`, truthy — so **super arrives as meta**,\n * and `cmd+left` becomes indistinguishable from `option+left` before our keymap is called at all.\n * Reported from a real session: both chords navigated by word, which is the only symptom this can have.\n *\n * Negotiating `reportEventTypes` was supposed to avoid this by making Warp include the field. It does not\n * — measured by the symptom, not assumed — and a fix that depends on a terminal populating an optional\n * field is a fix that works on some terminals. So the modifier is decoded here, from the bytes, where it\n * is unambiguous: bit 8 is super whether or not an event type follows it.\n *\n * ## Why this is not a second parser\n *\n * It reads *one* field. Key identity still comes from Ink — `leftArrow`, `home`, `input` — and this only\n * overrides the four modifier flags, and only when a sequence was actually found and matched to the key\n * Ink reported. Anything unrecognised leaves the key exactly as it arrived, so the worst case is today's\n * behaviour rather than a new class of wrong.\n */\n\nimport type { KeyState } from \"#lib/types\"\n\n/** Modifier bits, per the xterm and kitty encodings: the wire value is `1 + these`. */\nconst SHIFT = 1\nconst ALT = 2\nconst CTRL = 4\nconst SUPER = 8\n\n/** One modified key found in a chunk. `final` identifies the key for CSI forms, `param` for `u`. */\nexport interface CsiKey {\n readonly modifier: number\n readonly final: string\n /** The first parameter: a key number for `~` forms, a codepoint for `u`, else 1. */\n readonly param: number\n readonly eventType: \"press\" | \"repeat\" | \"release\" | undefined\n}\n\n/**\n * Every modified key in a chunk, oldest first.\n *\n * Matches `CSI <param> ; <modifier> [: <event>] <final>`, which covers the arrows (`A`-`D`), Home and End\n * (`H`/`F`), the tilde forms (`1~` `3~` `4~` `5~` `6~` `7~` `8~`) and kitty's letter form (`u`) in one\n * expression, because they differ only in the final byte. A sequence with no modifier parameter is skipped\n * — there is nothing to correct on an unmodified key. The leading escape is not required: Ink strips one\n * from the front of a chunk before a handler sees it, the same reason `lib/mouse.ts` anchors instead.\n */\nexport function csiKeys(chunk: string): readonly CsiKey[] {\n const found: CsiKey[] = []\n const pattern = /\\[(\\d+);(\\d+)(?::(\\d+))?([A-Za-z~])/g\n for (const match of chunk.matchAll(pattern)) {\n const param = Number(match[1])\n const modifier = Number(match[2])\n const event = match[3]\n const final = match[4] ?? \"\"\n if (!Number.isFinite(param) || !Number.isFinite(modifier) || modifier < 1) continue\n found.push({\n modifier,\n final,\n param,\n eventType:\n event === undefined\n ? undefined\n : event === \"3\"\n ? \"release\"\n : event === \"2\"\n ? \"repeat\"\n : \"press\",\n })\n }\n return found\n}\n\n/**\n * A terminal *reply*, not a keystroke: `CSI ? <flags> u`.\n *\n * Ink asks the terminal for its kitty-keyboard flags at mount, waits 200 ms, and strips the answer out of\n * stdin if one arrives in time. Measured in a real Warp session: it arrived **late**, the window had\n * closed, and the bytes fell through to `useInput` as ordinary text — `input \"[?0u\"`, resolving to an\n * insert. Left unclaimed that types `[?0u` into somebody's first message, which is the same class of\n * defect as a mouse report reaching the buffer and is claimed here for the same reason.\n *\n * Deliberately narrow. Only this one reply is recognised, because it is the only one this runtime *asks*\n * for — and the finals it would be tempting to generalise to are dangerous: `CSI 1;2R` is a real modified\n * F3 key, so claiming `R` would swallow a keystroke to catch a reply nobody requested.\n */\nexport function isTerminalReply(input: string): boolean {\n // The optional escape is stripped by code point rather than matched in the pattern: a control\n // character written into a regex is invisible in the source, which is a lint error for good reason —\n // `lib/keys-view.ts` draws the same line for the same reason.\n const body = input.codePointAt(0) === 0x1b ? input.slice(1) : input\n return /^\\[\\?\\d*u$/.test(body)\n}\n\n/** Which Ink flag a CSI final byte identifies, so a record can be matched to the key Ink reported. */\nfunction identifies(record: CsiKey, key: KeyState, input: string): boolean {\n switch (record.final) {\n case \"A\":\n return key.upArrow\n case \"B\":\n return key.downArrow\n case \"C\":\n return key.rightArrow\n case \"D\":\n return key.leftArrow\n case \"H\":\n return key.home\n case \"F\":\n return key.end\n case \"~\":\n switch (record.param) {\n case 1:\n case 7:\n return key.home\n case 3:\n return key.delete\n case 4:\n case 8:\n return key.end\n case 5:\n return key.pageUp\n case 6:\n return key.pageDown\n default:\n return false\n }\n case \"u\":\n // Kitty's letter form. Ink already decodes these correctly, so matching them is only about\n // not consuming a record that belongs to a later keystroke.\n if (record.param === 13) return key.return\n if (record.param === 127) return key.backspace\n if (record.param === 27) return key.escape\n return input !== \"\" && input === String.fromCodePoint(record.param).toLowerCase()\n default:\n return false\n }\n}\n\n/**\n * The key Ink reported, with its modifiers taken from the bytes when they can be.\n *\n * `records` is consumed: the matched entry is removed, so two keys in one chunk stay in step. Matching by\n * identity rather than by position is what makes that safe — a record that does not correspond to the key\n * Ink is reporting is left in the queue for whichever keystroke it belongs to, instead of being applied to\n * this one.\n */\nexport function withRealModifiers(key: KeyState, input: string, records: CsiKey[]): KeyState {\n const at = records.findIndex((record) => identifies(record, key, input))\n if (at === -1) return key\n const [record] = records.splice(at, 1)\n if (record === undefined) return key\n const bits = record.modifier - 1\n return {\n ...key,\n shift: (bits & SHIFT) !== 0,\n // `meta` is Alt/Option only. This is the whole correction: Ink merges super into it and we do not.\n meta: (bits & ALT) !== 0,\n ctrl: (bits & CTRL) !== 0,\n super: (bits & SUPER) !== 0,\n ...(record.eventType === undefined ? {} : { eventType: record.eventType }),\n }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAsDO,SAAS,EAAO,CAAC,EAAkC,CACtD,IAA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O,EACtB,IAAO,GAAU,EAAQ,OAAO,EAAI,CAAC,EACrC,GAAI,IAAW,OAAW,OAAO,EACjC,IAAM,EAAO,EAAO,SAAW,EAC/B,MAAO,IACA,EACH,OAAQ,EAlIF,KAkIoB,EAE1B,MAAO,EAnIH,KAmImB,EACvB,MAAO,EAnIF,KAmImB,EACxB,OAAQ,EAnIF,KAmIoB,KACtB,EAAO,YAAc,OAAY,CAAC,EAAI,CAAE,UAAW,EAAO,SAAU,CAC5E",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "262F00FBC3C84E9364756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{qo}from"./index-k2aq5bg0.js";import{Fe}from"./index-fzmmhmk2.js";function X(e){if(e??Fe().noEnhancedKeys)return{};return qo(),{kittyKeyboard:{mode:"enabled",flags:["disambiguateEscapeCodes","reportEventTypes"]}}}function o(e){if(e.json)return{mode:"json",because:"--json was passed"};if(e.plain)return{mode:"plain",because:"--plain was passed"};if(e.oneShot)return{mode:"plain",because:"--input is always plain"};if(!e.stdoutIsTTY)return{mode:"plain",because:"stdout is not a terminal"};if(!e.stdinIsTTY)return{mode:"plain",because:"stdin is not a terminal"};if(e.env.noColor)return{mode:"plain",because:"NO_COLOR is set"};if(e.env.dumbTerminal)return{mode:"plain",because:"TERM is dumb"};if(e.env.ci)return{mode:"plain",because:"CI is set"};return{mode:"rich",because:"stdout and stdin are both terminals"}}function ue(e){return o({...e,stdinIsTTY:process.stdin.isTTY===!0,stdoutIsTTY:process.stdout.isTTY===!0,env:Fe()})}
|
|
3
|
+
export{X,ue};
|
|
4
|
+
|
|
5
|
+
//# debugId=A8DC89210998FB5B64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-5rm7dwq4.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/keyboard.ts", "../src/lib/output.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * Whether this process asks the terminal for enhanced keys, and what it asks for.\n *\n * ## Why there is anything to ask for\n *\n * Ink 7.1 ships a complete kitty-keyboard-protocol parser — `parse-keypress.js` decodes `CSI u`, and\n * `Key` carries `super`, `hyper`, `home` and `end` — and **none of it runs unless a caller opts in**:\n *\n * initKittyKeyboard() {\n * // Protocol is opt-in: if kittyKeyboard is not specified, do nothing\n * if (!this.options.kittyKeyboard) return\n *\n * That single `return` is why `⌥r` typed `®` into the message instead of unfolding the reasoning block,\n * and why `cmd+←` word-moved instead of jumping to the start of the line: without the protocol, `⌥`\n * depends on a terminal setting that is off by default in Warp, and `super` cannot be expressed by any\n * legacy escape sequence at all — Ink's legacy branch folds it into `meta` (`modifier & 10`, bit 8 being\n * super and bit 2 alt), so the two chords become the same keystroke.\n *\n * ## Why both flags\n *\n * `disambiguateEscapeCodes` alone fixes the letter chords: `⌥r` arrives as `CSI 114;3u`, which Ink reports\n * as `input \"r\"` with `meta` set — exactly the shape `keymap.ts` already matched, which is why turning\n * this on required no change to a single binding. It is **not** enough for `cmd+←`: an arrow with a\n * modifier comes back as `CSI 1;9D`, and Ink's kitty branch for special keys (`kittySpecialKeyRe`)\n * *requires* the `:eventType` field, so without `reportEventTypes` the sequence falls through to the\n * legacy path and the super bit is folded away again.\n *\n * The cost of that second flag is stated where it is paid: Ink passes `eventType` through untouched and\n * filters nothing, so `keymap.ts` drops `release` or every enhanced chord fires twice.\n *\n * ## Why `enabled` rather than `auto`, measured\n *\n * `auto` is the careful-looking option: Ink writes `CSI ? u`, waits **200 ms**, and enables only if the\n * terminal answers. It was the first choice here and it loses the race. In a real Warp session the reply\n * arrived *after* the window closed — visible in `keys` as `bytes 1b 5b 3f 30 75` resolving to an insert,\n * because Ink strips the answer only while it is still listening. So the protocol stayed **off** on a\n * terminal that plainly supports it, and every option-letter chord went on depending on Warp's\n * *Left/Right Option Key is Meta* setting, which is off by default. That is the reported bug, one layer\n * down from where it looked like it was.\n *\n * `enabled` pushes `CSI > flags u` without asking. The cost is bounded by how terminals treat private-mode\n * sequences they do not know — they discard them — and the pop on the way out is the same shape. It is\n * also no longer load-bearing: `lib/csi.ts` reads modifiers off the bytes, so a terminal that ignores the\n * push still gets working cmd chords. The protocol now buys the *letter* chords, and losing it silently\n * costs those rather than everything.\n *\n * The override stays for the case neither argument covers: a terminal that accepts the push and then\n * implements it badly. The reference CLI carries the same hatch (`CLAUDE_CODE_DISABLE_MOUSE`), and a\n * switch nobody can reach is not a hatch.\n */\n\nimport { readEnv } from \"#lib/env\"\n/**\n * The render options fragment, shaped structurally rather than imported from Ink.\n *\n * Declared here for the same reason `KeyState` is declared in `lib/types.ts` rather than imported: this\n * module sits on a path every command touches, and Ink costs ~170-210 ms to load under Node — more than\n * the entire runtime of `validate --json`. TypeScript checks it structurally against `RenderOptions` at\n * each call site, so a drift in Ink's own type is still a compile error.\n */\nimport { markEnhancedKeys } from \"#lib/exit\"\n\nexport interface KeyboardOptions {\n readonly kittyKeyboard?: {\n readonly mode: \"auto\" | \"enabled\" | \"disabled\"\n /**\n * The property is readonly; the array is not, because Ink's own `flags` is a mutable\n * `KittyFlagName[]` and under `exactOptionalPropertyTypes` a `readonly` array does not satisfy\n * it. Nothing is shared as a result — `keyboardOptions` builds a fresh array on every call, which\n * is what makes the mutable type harmless rather than a hole.\n */\n readonly flags: (\"disambiguateEscapeCodes\" | \"reportEventTypes\")[]\n }\n}\n\n/**\n * One answer for every surface that mounts Ink, and the teardown registered with it.\n *\n * Every one of them reads keys, so a per-surface decision would mean the chat honoured `cmd+←` and the\n * settings editor did not — and the *next* surface would forget entirely. `inSession` on `CommandSpec` is\n * the same shape: derived once so a new caller cannot drift.\n *\n * It marks rather than merely returning, which is why it is not called `keyboardOptions`: asking for the\n * protocol and arranging to withdraw it are one decision, and six call sites each remembering to do the\n * second is six chances to leave a terminal reporting `CSI u` at somebody's shell. Ink withdraws it on\n * unmount by itself; the mark covers the signal path, which is the one Ink cannot see.\n */\nexport function negotiateKeyboard(disabled?: boolean): KeyboardOptions {\n // `??` rather than a default parameter: a default fires on an explicitly passed `undefined` too, and\n // this repo has already lost a debugging round to that (`load(dir, undefined)` used the runner it was\n // meant to omit). Written this way, \"no opinion\" and \"not passed\" are deliberately the same case.\n if (disabled ?? readEnv().noEnhancedKeys) return {}\n markEnhancedKeys()\n return {\n kittyKeyboard: {\n // Not \"auto\" — see above. Ink's 200 ms detection window loses the race in Warp, measured.\n mode: \"enabled\",\n flags: [\"disambiguateEscapeCodes\", \"reportEventTypes\"],\n },\n }\n}\n",
|
|
6
|
+
"/**\n * How output is rendered, resolved once per process.\n *\n * This mirrors the reasoning behind decision 3.5, which forbids the tool dialect from changing with\n * the model: behaviour that shifts silently with the environment cannot be reasoned about. So the\n * resolution is total and ordered, and it returns *why* it chose — the reason is printable, which is\n * what turns \"it wasn't interactive and I don't know why\" into a question with an answer.\n *\n * Measured, not assumed: importing Ink and React costs ~65 ms under Bun and ~170-210 ms under Node,\n * against a ~70 ms total runtime for `validate --json`. Nothing on a non-rich path may import them,\n * which is why this returns a mode rather than a renderer.\n */\n\nimport { readEnv } from \"#lib/env\"\nimport type { ModeDecision, ModeInputs } from \"#lib/schema\"\n\n/**\n * Total and ordered. Every branch is reachable and every input is consulted, so no combination of\n * flags and environment lands somewhere undocumented.\n */\nexport function resolveMode(inputs: ModeInputs): ModeDecision {\n if (inputs.json) return { mode: \"json\", because: \"--json was passed\" }\n if (inputs.plain) return { mode: \"plain\", because: \"--plain was passed\" }\n\n // A one-shot is a scripting affordance. Its output must not depend on whether a human happened\n // to be at a terminal, or `--input` would mean two different things in a shell script and in a\n // shell.\n if (inputs.oneShot) return { mode: \"plain\", because: \"--input is always plain\" }\n\n if (!inputs.stdoutIsTTY) return { mode: \"plain\", because: \"stdout is not a terminal\" }\n // A live transcript with no way to type into it is a worse plain renderer, not a better one.\n if (!inputs.stdinIsTTY) return { mode: \"plain\", because: \"stdin is not a terminal\" }\n\n if (inputs.env.noColor) return { mode: \"plain\", because: \"NO_COLOR is set\" }\n if (inputs.env.dumbTerminal) return { mode: \"plain\", because: \"TERM is dumb\" }\n // CI logs are files that happen to scroll. Cursor movement in one is noise forever.\n if (inputs.env.ci) return { mode: \"plain\", because: \"CI is set\" }\n\n return { mode: \"rich\", because: \"stdout and stdin are both terminals\" }\n}\n\n/**\n * Deliberately not consulted: `FORCE_COLOR`. It says how much colour a stream can carry, not\n * whether a human is watching, and honouring it here would turn a CI job that wanted coloured logs\n * into one driving a cursor around a file. Ink's own colour depth still respects it.\n */\nexport function resolveModeFromProcess(flags: {\n readonly json: boolean\n readonly plain: boolean\n readonly oneShot: boolean\n}): ModeDecision {\n return resolveMode({\n ...flags,\n stdinIsTTY: process.stdin.isTTY === true,\n stdoutIsTTY: process.stdout.isTTY === true,\n env: readEnv(),\n })\n}\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";wEAuFO,SAAS,CAAiB,CAAC,EAAqC,CAInE,GAAI,GAAY,GAAQ,EAAE,eAAgB,MAAO,CAAC,EAElD,OADA,GAAiB,EACV,CACH,cAAe,CAEX,KAAM,UACN,MAAO,CAAC,0BAA2B,kBAAkB,CACzD,CACJ,EC/EG,SAAS,CAAW,CAAC,EAAkC,CAC1D,GAAI,EAAO,KAAM,MAAO,CAAE,KAAM,OAAQ,QAAS,mBAAoB,EACrE,GAAI,EAAO,MAAO,MAAO,CAAE,KAAM,QAAS,QAAS,oBAAqB,EAKxE,GAAI,EAAO,QAAS,MAAO,CAAE,KAAM,QAAS,QAAS,yBAA0B,EAE/E,GAAI,CAAC,EAAO,YAAa,MAAO,CAAE,KAAM,QAAS,QAAS,0BAA2B,EAErF,GAAI,CAAC,EAAO,WAAY,MAAO,CAAE,KAAM,QAAS,QAAS,yBAA0B,EAEnF,GAAI,EAAO,IAAI,QAAS,MAAO,CAAE,KAAM,QAAS,QAAS,iBAAkB,EAC3E,GAAI,EAAO,IAAI,aAAc,MAAO,CAAE,KAAM,QAAS,QAAS,cAAe,EAE7E,GAAI,EAAO,IAAI,GAAI,MAAO,CAAE,KAAM,QAAS,QAAS,WAAY,EAEhE,MAAO,CAAE,KAAM,OAAQ,QAAS,qCAAsC,EAQnE,SAAS,EAAsB,CAAC,EAItB,CACb,OAAO,EAAY,IACZ,EACH,WAAY,QAAQ,MAAM,QAAU,GACpC,YAAa,QAAQ,OAAO,QAAU,GACtC,IAAK,GAAQ,CACjB,CAAC",
|
|
9
|
+
"debugId": "A8DC89210998FB5B64756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{e}from"./index-byxrc961.js";import{Qe}from"./index-3mtgcvkq.js";import{sn,Ki}from"./index-2zye08c4.js";var HA=[{name:"plain",kind:"boolean",help:"force plain text — no interactive rendering, no colour"},{name:"help",short:"h",kind:"boolean",help:"show this help and exit"},{name:"version",short:"v",kind:"boolean",help:"print the version and exit"},{name:"no-bootstrap",kind:"boolean",help:"never start a background server on this run"}],a={name:"manifest",required:!0,help:"path to an agent.yaml, or the name of a sandbox agent"},t={name:"store",kind:"string",placeholder:"path",help:"session database",defaultHelp:`~/${e.stateDir}/store.db`},d={name:"session",kind:"string",placeholder:"key",help:"session key",bare:""},n={name:"json",kind:"boolean",help:"machine-readable output"},Ie=[{name:"init",inSession:"hidden",needsServer:!1,summary:"create a new agent: manifest, workspace, and env files",args:[],unexpectedArgHint:"init takes no positional argument. To name the agent, --name <name>; to place it somewhere other than the sandbox, --dir <path>.",flags:[{name:"user",kind:"string",placeholder:"name",help:"your name"},{name:"name",kind:"string",placeholder:"name",help:"the agent's name"},{name:"purpose",kind:"string",placeholder:"text",help:"one line: what the agent is for"},{name:"preset",kind:"string",placeholder:"id",help:`model endpoint: ${Qe.map((s)=>s.id).join(" | ")}`,defaultHelp:"openai"},{name:"model",kind:"string",placeholder:"id",help:"model id"},{name:"base-url",kind:"string",placeholder:"url",help:"endpoint base URL"},{name:"api-key-env",kind:"string",placeholder:"VAR",help:"env var that will hold the key; omitted for ollama",defaultHelp:"MODEL_API_KEY"},{name:"system",kind:"string",placeholder:"level",help:"what it may touch on this machine: none | read | write | full",defaultHelp:"none"},{name:"web",kind:"string",placeholder:"level",help:"internet access: none | fetch | search",defaultHelp:"none"},{name:"web-backend",kind:"string",placeholder:"id",help:"search backend when --web search: tavily | brave | exa",defaultHelp:"tavily"},{name:"composio",kind:"string",placeholder:"level",help:"your other apps via Composio: none | connected",defaultHelp:"none"},{name:"telegram",kind:"string",placeholder:"level",help:"reachable on Telegram: none | connected",defaultHelp:"none"},{name:"telegram-allow",kind:"string",placeholder:"@handle",help:"who may message it — empty permits nobody, which is the safe default"},{name:"whatsapp",kind:"string",placeholder:"level",help:"reachable on WhatsApp: none | connected — unofficial, and an opt-in plugin",defaultHelp:"none"},{name:"whatsapp-number",kind:"string",placeholder:"digits",help:"whose number may message it — digits with no +, empty permits nobody"},{name:"server",kind:"string",placeholder:"level",help:"serve the HTTP API: none | local",defaultHelp:"local"},{name:"schedules",kind:"string",placeholder:"what",help:"run something on a schedule: none | daily | hourly",defaultHelp:"none"},{name:"skills",kind:"string",placeholder:"level",help:'none | starter, or words to search the catalogues for — --skills "pdf tables"',defaultHelp:"starter"},{name:"daemon",kind:"string",placeholder:"level",help:"keep it running in the background: none | service",defaultHelp:"none"},{name:"dir",kind:"string",placeholder:"path",help:"write the agent here instead of the sandbox",defaultHelp:`~/${e.stateDir}/agents/<agent-name-slug>`},{name:"yes",kind:"boolean",help:"take every default; never ask, even at a terminal"}]},{name:"run",inSession:"hidden",needsServer:!0,summary:"start an interactive session — bare `run` picks from the sandbox",args:[{...a,required:!1,help:"path or sandbox agent name (omit to pick from the sandbox)"}],flags:[{...d,defaultHelp:"a new one each run; bare --session picks from the list"},{name:"continue",short:"c",kind:"boolean",help:"pick up the most recent conversation with this agent"},{name:"input",kind:"string",placeholder:"text",help:"run one turn, print the reply, exit"},t,{name:"ephemeral",kind:"boolean",help:"keep this session in memory only; nothing is written"},{name:"quiet",kind:"boolean",help:"suppress the banner and per-turn stats"},{name:"no-enhanced-keys",kind:"boolean",help:"do not negotiate the kitty keyboard protocol (cmd chords stop arriving)"},{name:"no-reasoning",kind:"boolean",help:"hide the thinking a reasoning model streams (shown by default)"},{name:"show-reasoning",kind:"boolean",help:"no-op: reasoning is shown by default when the model has any"}]},{name:"schedules",inSession:"view",needsServer:!0,summary:"list schedules, when they next fire, and how the last run went",args:[a],flags:[{name:"id",kind:"string",placeholder:"schedule",help:"show one schedule in full instead of the list"},{name:"enable",kind:"string",placeholder:"schedule",help:"switch an API-created schedule on; a manifest one is enabled in agent.yaml"},{name:"disable",kind:"string",placeholder:"schedule",help:"switch an API-created schedule off; a manifest one is disabled in agent.yaml"},{name:"recipients",kind:"boolean",help:"list the addresses this agent can deliver to — what deliver.to takes"},t,n]},{name:"sessions",inSession:"view",needsServer:!1,summary:"list stored sessions, or inspect one",args:[a],flags:[{...d,help:"show one session instead of the list"},{name:"turns",kind:"boolean",help:"show turn records instead of messages"},{name:"clear",kind:"boolean",help:"delete the named session's history; memory files are untouched"},{name:"limit",kind:"number",placeholder:"n",help:"rows to show",defaultHelp:String(sn),min:Ki,integer:!0},t,n]},{name:"memory",inSession:"view",needsServer:!1,summary:"search what the agent remembers, or rebuild the index from the files",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"search",help:"rank the corpus against a query, exactly as a turn would"},{value:"rebuild",help:"forget the index and re-read every file — for an edit that kept the mtime"}]},{...a,required:!0},{name:"query",required:!1,help:"the words to search for (search only); quote a phrase"}],flags:[t,{name:"limit",kind:"number",placeholder:"n",help:"passages to show",defaultHelp:"10",min:1,integer:!0},{name:"all",kind:"boolean",help:"show passages below the manifest's threshold too, marked"},n]},{name:"config",inSession:"view",needsServer:!1,summary:"read and change an agent's settings, and fill in its secrets",args:[{name:"action",required:!1,help:"what to do (default: edit)",choices:[{value:"edit",help:"the full-screen editor — also what bare `config <agent>` opens"},{value:"list",help:"every setting, its current value, and who may set it"},{value:"get",help:"one setting"},{value:"set",help:"change one setting"},{value:"env",help:"put a secret in the .env beside the manifest, prompted and not echoed"},{value:"allow",help:"add or remove a handle a channel accepts messages from"}]},{...a,required:!1},{name:"name",required:!1,help:"the setting's dotted path, an env variable name, or a handle"},{name:"value",required:!1,help:"the new value (set only)"}],flags:[t,{name:"channel",kind:"string",placeholder:"id",help:"which channel to allow on, when there is more than one"},{name:"remove",kind:"boolean",help:"take the handle off instead of adding it (allow only)"},{name:"yes",kind:"boolean",help:"skip the confirmation on an edit that weakens a check"}]},{name:"validate",inSession:"output",needsServer:!1,summary:"load and validate a manifest, then exit",args:[a],flags:[n]},{name:"workspace",inSession:"output",needsServer:!1,summary:"check the workspace files against the authoring rules",args:[a],flags:[{name:"strict",kind:"boolean",help:"exit non-zero when any authoring warning is reported"},n]},{name:"soul",inSession:"output",needsServer:!1,summary:"scaffold a hand-edited compact identity from a long-form document",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"distill",help:"scaffold a compact identity beside the source"}]},{name:"file",required:!0,help:"path to the long-form identity document"}],flags:[{name:"out",kind:"string",placeholder:"path",help:"where to write the scaffold",defaultHelp:"<file>.compact.md beside the source"}]},{name:"skills",inSession:"view",needsServer:!1,summary:"browse the catalogue and install — or list, scaffold, check one agent's skills",args:[{name:"action",required:!1,help:"what to do — omit to browse the catalogue and tick what you want",choices:[{value:"list",help:"every skill, its size, and whether it ships scripts"},{value:"show",help:"one skill in full, including what the model never sees"},{value:"new",help:"scaffold a skill, turning skills on for this agent if they are not"},{value:"install",help:"install one by name — anthropic/pdf — or copy from a local path (see `sources`)"},{value:"remove",help:"delete a skill's directory and everything in it"},{value:"validate",help:"authoring warnings — never a refusal"}]},{...a,required:!1,help:"path or sandbox agent name (not used when browsing)"},{name:"name",required:!1,help:"the skill for show, new and remove — for install, <source>/<skill> or a local path"}],flags:[{name:"strict",kind:"boolean",help:"exit non-zero when any authoring warning is reported"},n]},{name:"sources",inSession:"view",needsServer:!1,summary:"the repositories skills come from: list, add, search",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"list",help:"every source, and whether it has been fetched"},{value:"add",help:"add a repository — a URL, or a name and a URL"},{value:"remove",help:"stop searching a source; built-ins included"},{value:"update",help:"re-fetch every source, or the ones named"},{value:"search",help:"find a skill across every source; fetches on first use"}]},{name:"rest",required:!1,variadic:!0,help:"a name and URL for add, a name for remove or update, words for search"}],flags:[{name:"path",kind:"string",placeholder:"dir",help:"subdirectory holding the skills (add)",defaultHelp:"the whole repository"},{name:"ref",kind:"string",placeholder:"branch",help:"branch or tag to track (add)",defaultHelp:"the remote's default branch"},n]},{name:"channels",inSession:"output",needsServer:!1,summary:"what an agent is reachable on: connect, disconnect, set a credential, unpair",args:[{name:"action",required:!1,help:"what to do — omit for the listing",choices:[{value:"list",help:"every channel, whether it is on, and whether its credential is filled in"},{value:"connect",help:"switch a channel on; it starts at the agent's next start"},{value:"disconnect",help:"switch it off — a disabled channel is never constructed"},{value:"credential",help:"set the channel's token in the .env, prompted and not echoed"},{value:"pair",help:"connect it the way that channel needs — a code for WhatsApp, a token for Telegram"},{value:"unpair",help:"forget a scanned pairing, so the next start offers a new code"}]},{...a,required:!1,help:"path or sandbox agent name"},{name:"channel",required:!1,help:"which channel — its id, not its type. Optional when the agent has exactly one"}],flags:[n]},{name:"plugins",inSession:"output",needsServer:!1,summary:"install a plugin, list what an agent loaded, or remove one",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"list",help:"what this agent loaded, from where, and what it asked for"},{value:"add",help:"fetch a plugin from git and name it in this agent"},{value:"remove",help:"drop the entry, and the directory when no agent needs it"}]},a,{name:"rest",required:!1,variadic:!0,help:"a repository for add — owner/repo, a clone URL, or a page URL — or a name for remove"}],flags:[{name:"ref",kind:"string",placeholder:"tag",help:"branch, tag or commit to fetch (add) — the only thing that pins the code",defaultHelp:"the remote's default branch"},{name:"name",kind:"string",placeholder:"name",help:"install under this name (add), which is what the `plugins:` entry will say",defaultHelp:"the repository or subdirectory name"},n]},{name:"agents",inSession:"output",needsServer:!1,summary:"the agents in the sandbox, and whether anything is serving them",args:[{...a,required:!1,variadic:!0,help:"paths or sandbox names to describe in full — bare, lists the sandbox"}],flags:[t,n]},{name:"restart",inSession:"hidden",needsServer:!1,summary:"reload one agent on the running host, or restart the whole service",args:[{...a,required:!1,help:"path or sandbox agent name — bare, restarts the background service"}],flags:[t,n]},{name:"status",inSession:"output",needsServer:!1,summary:"the service, the hosts, every agent and its channels — one screen",args:[],flags:[t,n]},{name:"logs",inSession:"hidden",needsServer:!1,summary:"the server's stderr tail — the same as `daemon logs`",args:[{...a,required:!1,help:"path or sandbox agent name — bare, the server's own log"}],flags:[{name:"lines",kind:"number",placeholder:"n",integer:!0,min:1,help:"how much of the log to show",defaultHelp:"40"},{name:"follow",short:"f",kind:"boolean",help:"keep printing new lines until interrupted"},{name:"truncate",kind:"boolean",help:"empty the log first, in place"},t,n]},{name:"tools",inSession:"output",needsServer:!1,summary:"show the resolved tool catalogue, or fetch a remote provider's schemas into the cache",args:[a],flags:[{name:"warm",kind:"boolean",help:"fetch every pinned slug from the provider and write the resolution cache"},n]},{name:"serve",inSession:"hidden",needsServer:!1,summary:"run the HTTP API and connect the agents' channels",args:[{...a,required:!1,variadic:!0,help:"paths to an agent.yaml, or sandbox agent names (omit for every enabled agent)"}],flags:[{name:"port",kind:"number",placeholder:"n",help:"port to bind",defaultHelp:"server.port, or 7420"},{name:"host",kind:"string",placeholder:"addr",help:"address to bind — a non-loopback host requires an API token",defaultHelp:"server.host, or 127.0.0.1"},{name:"claim",kind:"boolean",help:"print a one-time claim even when a key already exists"},t,n]},{name:"credential",inSession:"hidden",needsServer:!0,summary:"mint, list and revoke operator credentials, optionally scoped",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"create",help:"mint one and print the secret, once"},{value:"list",help:"every credential, live and revoked, with its scope"},{value:"revoke",help:"kill one permanently"}]},{name:"keyId",required:!1,help:"which credential, for revoke (`credential list` prints the ids)"}],flags:[{name:"label",kind:"string",placeholder:"text",help:"how it is shown in a listing — required for create"},{name:"agents",kind:"string",placeholder:"a,b",help:"narrow it to these agents",defaultHelp:"every agent"},{name:"sessions",kind:"string",placeholder:"prefix",help:"narrow it to session keys starting with this",defaultHelp:"every session"},{name:"can",kind:"string",placeholder:"list",help:"narrow it to these capabilities: read | chat | write | admin",defaultHelp:"all four"},{name:"expires",kind:"string",placeholder:"dur",help:"how long it lives: 30s, 15m, 2h, 7d, or seconds",defaultHelp:"never"},t,n]},{name:"keys",inSession:"hidden",needsServer:!1,summary:"press a chord and see the bytes, Ink's reading of them, and the intent",args:[],flags:[{name:"no-enhanced-keys",kind:"boolean",help:"do not negotiate the kitty keyboard protocol"}]},{name:"terminal-setup",inSession:"hidden",needsServer:!1,summary:"teach this terminal to send shift+enter as a new line",args:[],flags:[{name:"dry-run",kind:"boolean",help:"print the change and write nothing"},{name:"yes",kind:"boolean",help:"write it without asking"},n]},{name:"remove",inSession:"hidden",needsServer:!1,summary:"delete a sandbox agent: its directory, sessions, memory, logs and service",args:[{name:"agent",required:!1,help:"sandbox agent name (a path is refused — remove only manages agents `init` made)"}],flags:[{name:"dry-run",kind:"boolean",help:"show exactly what would go; delete nothing"},{name:"files-only",kind:"boolean",help:"delete the directory and keep the sessions, memory and logs"},{name:"prune",kind:"boolean",help:"delete sessions, memory and logs that no sandbox agent claims any more"},{name:"all",kind:"boolean",help:"remove every agent in the sandbox"},{name:"yes",kind:"boolean",help:"skip the typed confirmation (required to delete anything non-interactively)"},t,n]},{name:"stop",inSession:"hidden",needsServer:!1,summary:"stop one agent for good, or everything — named, it stays stopped across restarts",args:[{name:"agent",required:!1,help:"path or sandbox agent name (omit to stop the whole host)"}],flags:[{name:"dry-run",kind:"boolean",help:"list what would be stopped; stop nothing"},{name:"reason",kind:"string",help:"why — recorded, and shown wherever the agent is reported as off"},t,n]},{name:"start",inSession:"hidden",needsServer:!0,summary:"switch an agent back on, and have a running host adopt it now",args:[a],flags:[t,n]},{name:"model",inSession:"output",needsServer:!1,summary:"ask the endpoint what it can actually do — window, output cap, prompt caching",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"probe",help:"measure every configured role against its own endpoint"}]},{name:"agent",required:!0,help:"path or sandbox agent name"}],flags:[{name:"window",kind:"boolean",help:"search for the window by growing a prompt until it is refused — costs real tokens, and prints the estimate first"},{name:"price",kind:"number",placeholder:"usd",help:"dollars per million input tokens, if you want --window's estimate in money"},{name:"write",kind:"boolean",help:"record a measured ceiling in the manifest; a floor is refused, because a floor is not a window"},{name:"yes",kind:"boolean",help:"answer the --window spend prompt; nothing else is affected"},{name:"json",kind:"boolean",help:"machine-readable findings"}]},{name:"web",inSession:"output",needsServer:!0,summary:"open the browser view of a running agent",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"run",help:"start a server if needed, then open the page"},{value:"open",help:"open the page of a server already running"},{value:"url",help:"print the address and open nothing — the form a pipe reads"}]},{name:"agent",required:!1,help:"path or sandbox agent name (omit to open the page itself)"}],flags:[{name:"no-open",kind:"boolean",help:"print the URL instead of opening it"},t,n]},{name:"daemon",inSession:"output",needsServer:!1,summary:"keep an agent serving in the background — starts at login, restarts on crash",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"install",help:"check it will boot, write the service, load it, and watch it start"},{value:"uninstall",help:"unload it and remove the service definition"},{value:"start",help:"load it again after a stop"},{value:"stop",help:"unload it, and keep it stopped across a login"},{value:"restart",help:"what you run after editing agent.yaml or .env"},{value:"status",help:"running? how many restarts? why did it stop? — bare, reports every agent"},{value:"logs",help:"the tail of stderr; --lines, --follow, --truncate"}]},{name:"agent",required:!1,help:"path or sandbox agent name (omit only for status)"}],flags:[{name:"lines",kind:"number",placeholder:"n",integer:!0,min:1,help:"how much of the log to show",defaultHelp:"40"},{name:"follow",short:"f",kind:"boolean",help:"keep printing as the service writes — both streams; ctrl-C stops (logs)"},{name:"truncate",kind:"boolean",help:"empty the log files (logs)"},{name:"dry-run",kind:"boolean",help:"print the service definition and the checks; write nothing"},t,n]}];function BA(s){return Ie.find((o)=>o.name===s)}function xA(s){return[...s.flags,...HA]}function Uo(s,o){return Ie.filter((r)=>r.name!==o&&r.flags.some((l)=>l.name===s)).map((r)=>r.name)}function Ko(s,o){let r=(o??"").trim();if(r==="")return{action:void 0,ref:void 0};return(BA(s)?.args??[]).find((i)=>i.name==="action")?.choices?.map((i)=>i.value)?.includes(r)===!0?{action:r,ref:void 0}:{action:void 0,ref:r}}
|
|
3
|
+
export{HA,Ie,BA,xA,Uo,Ko};
|
|
4
|
+
|
|
5
|
+
//# debugId=0B84D1BFEF4E043E64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-79epttpm.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/commands.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * The command table — data only, no rendering and no parsing.\n *\n * One source of truth for three consumers: `args.ts` parses against it, `help.ts` renders from it,\n * and error messages look flags up in it to say which command *does* accept a flag. Before this\n * existed the usage text was a hand-maintained string with no link to the parser, and it had\n * already drifted — `agents` accepted flags it never documented.\n *\n * Nothing here contains the product name. Command names come from `BRAND.slug`, so a rename stays\n * the one-commit operation hard rule 3 requires.\n */\n\nimport { BRAND } from \"@dispach/core\"\nimport { DEFAULT_ROW_LIMIT, MIN_ROW_LIMIT } from \"#lib/const\"\nimport { PRESETS } from \"#lib/init-flow\"\nimport type { ArgSpec, CommandSpec, FlagSpec } from \"#lib/schema\"\n\n/** Accepted by every command, so the render mode is answered the same way everywhere. */\nexport const GLOBAL_FLAGS: readonly FlagSpec[] = [\n {\n name: \"plain\",\n kind: \"boolean\",\n help: \"force plain text — no interactive rendering, no colour\",\n },\n { name: \"help\", short: \"h\", kind: \"boolean\", help: \"show this help and exit\" },\n { name: \"version\", short: \"v\", kind: \"boolean\", help: \"print the version and exit\" },\n {\n // Global rather than per command, because the first-run bootstrap is checked before any\n // `case` block runs — and because somebody who does not want it does not want it once.\n // `<PREFIX>NO_BOOTSTRAP` is the same switch for a script that cannot add a flag.\n name: \"no-bootstrap\",\n kind: \"boolean\",\n help: \"never start a background server on this run\",\n },\n]\n\nconst MANIFEST: ArgSpec = {\n name: \"manifest\",\n required: true,\n help: \"path to an agent.yaml, or the name of a sandbox agent\",\n}\n\nconst STORE: FlagSpec = {\n name: \"store\",\n kind: \"string\",\n placeholder: \"path\",\n help: \"session database\",\n defaultHelp: `~/${BRAND.stateDir}/store.db`,\n}\n\nconst SESSION: FlagSpec = {\n name: \"session\",\n kind: \"string\",\n placeholder: \"key\",\n help: \"session key\",\n // Written on its own, it means \"ask me which one\" — the interactive twin of `--continue`. Safe as a\n // bare form because a session key cannot start with a dash, which is the condition `FlagSpec.bare`\n // documents; `run` opens the picker and every other command reports that it needs a key.\n bare: \"\",\n}\n\nconst JSON_FLAG: FlagSpec = { name: \"json\", kind: \"boolean\", help: \"machine-readable output\" }\n\nexport const COMMANDS: readonly CommandSpec[] = [\n {\n // Interactive at a terminal; every question also has a flag so scripts and CI can run it.\n // It never asks for the API key itself — a prompt invites shoulder-surfing and a flag\n // writes the secret into shell history — so the generated .env has an empty line to fill.\n name: \"init\",\n\n inSession: \"hidden\",\n // Not the bootstrap's: `init` asks whether to keep a server running, and a bootstrap that\n // installed one before the question was asked made the answer decorative. `init` starts\n // the host itself, after the files exist, when the answer is `service`.\n needsServer: false,\n summary: \"create a new agent: manifest, workspace, and env files\",\n // No positional. It used to be the target *directory*, which read as the agent's name and\n // was not — `init milo` silently wrote ./milo into whatever checkout you were standing in,\n // and an agent outside the sandbox has no bare name, so every later command needed a path.\n args: [],\n unexpectedArgHint:\n \"init takes no positional argument. To name the agent, --name <name>; to place it somewhere other than the sandbox, --dir <path>.\",\n flags: [\n { name: \"user\", kind: \"string\", placeholder: \"name\", help: \"your name\" },\n { name: \"name\", kind: \"string\", placeholder: \"name\", help: \"the agent's name\" },\n {\n name: \"purpose\",\n kind: \"string\",\n placeholder: \"text\",\n help: \"one line: what the agent is for\",\n },\n {\n name: \"preset\",\n kind: \"string\",\n placeholder: \"id\",\n // Derived, not written down. This list said \"openai | anthropic | deepseek |\n // ollama | custom\" while `PRESETS` had grown to nine — a hand-kept copy beside a\n // real table, which is the drift this repo keeps paying for and which `--help`\n // exists to be the authority on.\n help: `model endpoint: ${PRESETS.map((preset) => preset.id).join(\" | \")}`,\n defaultHelp: \"openai\",\n },\n { name: \"model\", kind: \"string\", placeholder: \"id\", help: \"model id\" },\n { name: \"base-url\", kind: \"string\", placeholder: \"url\", help: \"endpoint base URL\" },\n {\n name: \"api-key-env\",\n kind: \"string\",\n placeholder: \"VAR\",\n help: \"env var that will hold the key; omitted for ollama\",\n defaultHelp: \"MODEL_API_KEY\",\n },\n {\n name: \"system\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"what it may touch on this machine: none | read | write | full\",\n defaultHelp: \"none\",\n },\n {\n name: \"web\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"internet access: none | fetch | search\",\n defaultHelp: \"none\",\n },\n {\n name: \"web-backend\",\n kind: \"string\",\n placeholder: \"id\",\n help: \"search backend when --web search: tavily | brave | exa\",\n defaultHelp: \"tavily\",\n },\n {\n name: \"composio\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"your other apps via Composio: none | connected\",\n defaultHelp: \"none\",\n },\n {\n name: \"telegram\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"reachable on Telegram: none | connected\",\n defaultHelp: \"none\",\n },\n {\n name: \"telegram-allow\",\n kind: \"string\",\n placeholder: \"@handle\",\n help: \"who may message it — empty permits nobody, which is the safe default\",\n },\n {\n name: \"whatsapp\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"reachable on WhatsApp: none | connected — unofficial, and an opt-in plugin\",\n defaultHelp: \"none\",\n },\n {\n // A number, not a secret: unlike a bot token there is nothing here worth keeping out\n // of shell history, so this one gets a flag and `--telegram-allow`'s twin does not\n // need explaining twice.\n name: \"whatsapp-number\",\n kind: \"string\",\n placeholder: \"digits\",\n help: \"whose number may message it — digits with no +, empty permits nobody\",\n },\n {\n name: \"server\",\n kind: \"string\",\n placeholder: \"level\",\n // No wizard step since 0.1.2 — flag-only, like `--schedules`. An always-on server is\n // the product, so `local` is the default and `none` is the deliberate opt-out.\n help: \"serve the HTTP API: none | local\",\n defaultHelp: \"local\",\n },\n {\n name: \"schedules\",\n kind: \"string\",\n placeholder: \"what\",\n help: \"run something on a schedule: none | daily | hourly\",\n defaultHelp: \"none\",\n },\n {\n name: \"skills\",\n kind: \"string\",\n placeholder: \"level\",\n // A phrase as well as a level, because the interesting answer is \"find me one\". The\n // default stays `starter` so a scripted run reaches no network.\n help: 'none | starter, or words to search the catalogues for — --skills \"pdf tables\"',\n defaultHelp: \"starter\",\n },\n {\n name: \"daemon\",\n kind: \"string\",\n placeholder: \"level\",\n help: \"keep it running in the background: none | service\",\n defaultHelp: \"none\",\n },\n {\n name: \"dir\",\n kind: \"string\",\n placeholder: \"path\",\n help: \"write the agent here instead of the sandbox\",\n defaultHelp: `~/${BRAND.stateDir}/agents/<agent-name-slug>`,\n },\n {\n name: \"yes\",\n kind: \"boolean\",\n help: \"take every default; never ask, even at a terminal\",\n },\n ],\n },\n {\n name: \"run\",\n\n inSession: \"hidden\",\n needsServer: true,\n summary: \"start an interactive session — bare `run` picks from the sandbox\",\n args: [\n {\n ...MANIFEST,\n required: false,\n help: \"path or sandbox agent name (omit to pick from the sandbox)\",\n },\n ],\n flags: [\n { ...SESSION, defaultHelp: \"a new one each run; bare --session picks from the list\" },\n {\n name: \"continue\",\n short: \"c\",\n kind: \"boolean\",\n help: \"pick up the most recent conversation with this agent\",\n },\n {\n name: \"input\",\n kind: \"string\",\n placeholder: \"text\",\n help: \"run one turn, print the reply, exit\",\n },\n STORE,\n {\n name: \"ephemeral\",\n kind: \"boolean\",\n help: \"keep this session in memory only; nothing is written\",\n },\n { name: \"quiet\", kind: \"boolean\", help: \"suppress the banner and per-turn stats\" },\n {\n // The same override `keys` carries, on the command that actually holds a session. The env\n // form works everywhere; a flag exists because the case this covers is \"try it without,\n // once\" and reaching for a variable to answer a one-off question is friction.\n name: \"no-enhanced-keys\",\n kind: \"boolean\",\n help: \"do not negotiate the kitty keyboard protocol (cmd chords stop arriving)\",\n },\n {\n name: \"no-reasoning\",\n kind: \"boolean\",\n help: \"hide the thinking a reasoning model streams (shown by default)\",\n },\n {\n // Kept so existing scripts keep working. Reasoning is on by default now, so this\n // asks for what already happens — harmless, and cheaper than breaking a flag people\n // have in their shell history.\n name: \"show-reasoning\",\n kind: \"boolean\",\n help: \"no-op: reasoning is shown by default when the model has any\",\n },\n ],\n },\n {\n // Reading, enabling and disabling — but never *writing* a schedule.\n //\n // Creating one from the CLI would be a third writer beside the manifest and the API, each\n // with its own idea of what a valid expression is; the manifest is where a schedule belongs,\n // because it is the thing that survives a rebuild and shows up in a diff. What the CLI adds\n // is the two questions a file cannot answer: when does this actually fire next, and did the\n // last run work.\n name: \"schedules\",\n\n // A view: a list somebody reads and then acts on, like `sessions`.\n inSession: \"view\",\n needsServer: true,\n summary: \"list schedules, when they next fire, and how the last run went\",\n args: [MANIFEST],\n flags: [\n {\n name: \"id\",\n kind: \"string\",\n placeholder: \"schedule\",\n help: \"show one schedule in full instead of the list\",\n },\n {\n name: \"enable\",\n kind: \"string\",\n placeholder: \"schedule\",\n help: \"switch an API-created schedule on; a manifest one is enabled in agent.yaml\",\n },\n {\n name: \"disable\",\n kind: \"string\",\n placeholder: \"schedule\",\n help: \"switch an API-created schedule off; a manifest one is disabled in agent.yaml\",\n },\n {\n name: \"recipients\",\n kind: \"boolean\",\n // The question a manifest cannot answer and this command is already holding the\n // store to answer: what do I put in `deliver.to`. A handle is the form a person\n // knows and the form that fails.\n help: \"list the addresses this agent can deliver to — what deliver.to takes\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n name: \"sessions\",\n\n // A view rather than an output pane: the list is a *choice*, and reading it read-only was the one\n // thing you could already do by exiting and passing `--session`. Enter switches.\n inSession: \"view\",\n needsServer: false,\n summary: \"list stored sessions, or inspect one\",\n args: [MANIFEST],\n flags: [\n { ...SESSION, help: \"show one session instead of the list\" },\n { name: \"turns\", kind: \"boolean\", help: \"show turn records instead of messages\" },\n {\n name: \"clear\",\n kind: \"boolean\",\n help: \"delete the named session's history; memory files are untouched\",\n },\n {\n name: \"limit\",\n kind: \"number\",\n placeholder: \"n\",\n help: \"rows to show\",\n defaultHelp: String(DEFAULT_ROW_LIMIT),\n min: MIN_ROW_LIMIT,\n integer: true,\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n // Two questions, and they are asked of the *index* rather than of the files. `search` is what\n // makes a ranking explicable — it prints the lexical score beside the boosted one, so \"retrieved\n // because it is about your question\" and \"retrieved because it is recent\" are distinguishable\n // without reading the code. `rebuild` exists because staleness detection is mtime plus size, and\n // an edit that preserves both is a real blind spot rather than a hypothetical one.\n name: \"memory\",\n\n // A view: the result is a list somebody reads and then wants to act on. Read-only for now —\n // deleting a memory means editing the file, which is the point of files being canonical.\n inSession: \"view\",\n needsServer: false,\n summary: \"search what the agent remembers, or rebuild the index from the files\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n {\n value: \"search\",\n help: \"rank the corpus against a query, exactly as a turn would\",\n },\n {\n value: \"rebuild\",\n help: \"forget the index and re-read every file — for an edit that kept the mtime\",\n },\n ],\n },\n { ...MANIFEST, required: true },\n {\n name: \"query\",\n required: false,\n help: \"the words to search for (search only); quote a phrase\",\n },\n ],\n flags: [\n STORE,\n {\n name: \"limit\",\n kind: \"number\",\n placeholder: \"n\",\n help: \"passages to show\",\n defaultHelp: \"10\",\n min: 1,\n integer: true,\n },\n {\n // The manifest's `memory.threshold` is what a *turn* applies. A search is a person\n // asking what is in there, and a floor that hid the near-misses would make the command\n // useless for the question it exists to answer — \"why did it not recall that?\"\n name: \"all\",\n kind: \"boolean\",\n help: \"show passages below the manifest's threshold too, marked\",\n },\n JSON_FLAG,\n ],\n },\n {\n // A person's editor for the manifest. `config_read`/`config_set` are the *agent's*, and they\n // are deliberately floored on the fields decision 11.29 reserves for a person — which left\n // those fields with no editor at all until this existed.\n //\n // `view`, because bare `/config` opens the editor — a surface somebody navigates — while every\n // other action is a listing or a one-line report and falls through to an output pane. That\n // fallthrough is the existing contract for a view: \"a view named in the table with nothing built\n // yet falls back to its own output\".\n name: \"config\",\n\n inSession: \"view\",\n needsServer: false,\n summary: \"read and change an agent's settings, and fill in its secrets\",\n args: [\n {\n name: \"action\",\n // Optional, because `config <agent>` with no action opens the editor. `readAction`\n // decides which of the two the first positional is; the six action words win.\n required: false,\n help: \"what to do (default: edit)\",\n choices: [\n {\n value: \"edit\",\n help: \"the full-screen editor — also what bare `config <agent>` opens\",\n },\n { value: \"list\", help: \"every setting, its current value, and who may set it\" },\n { value: \"get\", help: \"one setting\" },\n { value: \"set\", help: \"change one setting\" },\n {\n value: \"env\",\n help: \"put a secret in the .env beside the manifest, prompted and not echoed\",\n },\n {\n value: \"allow\",\n help: \"add or remove a handle a channel accepts messages from\",\n },\n ],\n },\n // Not required: `config <agent>` puts the agent in positional 0, and `readAction` moves it.\n // Declaring it required would fail on arity before that ever ran.\n { ...MANIFEST, required: false },\n {\n name: \"name\",\n required: false,\n help: \"the setting's dotted path, an env variable name, or a handle\",\n },\n { name: \"value\", required: false, help: \"the new value (set only)\" },\n ],\n flags: [\n STORE,\n {\n name: \"channel\",\n kind: \"string\",\n placeholder: \"id\",\n help: \"which channel to allow on, when there is more than one\",\n },\n {\n name: \"remove\",\n kind: \"boolean\",\n help: \"take the handle off instead of adding it (allow only)\",\n },\n {\n // Only reaches the two edits that stop a check running. Everything else applies\n // without asking, so this is not the flag people learn to type by reflex.\n name: \"yes\",\n kind: \"boolean\",\n help: \"skip the confirmation on an edit that weakens a check\",\n },\n ],\n },\n {\n name: \"validate\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"load and validate a manifest, then exit\",\n args: [MANIFEST],\n flags: [JSON_FLAG],\n },\n {\n // Distinct from `validate`, which asks whether the manifest loads. This asks whether the\n // *writing* is any good — the authoring rules of 07-SPEC-WORKSPACE.md, which are judgements\n // rather than facts and are therefore warnings that never fail the command.\n name: \"workspace\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"check the workspace files against the authoring rules\",\n args: [MANIFEST],\n flags: [\n {\n name: \"strict\",\n kind: \"boolean\",\n help: \"exit non-zero when any authoring warning is reported\",\n },\n JSON_FLAG,\n ],\n },\n {\n // A scaffold, never a summary: headings and <rules> blocks survive verbatim, prose becomes\n // placeholders a person fills. Automatic distillation of an identity document drops exactly\n // the parts that produce voice, which is why this is a command and not something load does.\n name: \"soul\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"scaffold a hand-edited compact identity from a long-form document\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n { value: \"distill\", help: \"scaffold a compact identity beside the source\" },\n ],\n },\n { name: \"file\", required: true, help: \"path to the long-form identity document\" },\n ],\n flags: [\n {\n name: \"out\",\n kind: \"string\",\n placeholder: \"path\",\n help: \"where to write the scaffold\",\n defaultHelp: \"<file>.compact.md beside the source\",\n },\n ],\n },\n {\n // Three questions rather than one. `validate` warns and exits 0 like `workspace` does, because\n // everything it reports is a judgement — a skill that does not load has already failed by then.\n name: \"skills\",\n\n inSession: \"view\",\n needsServer: false,\n summary: \"browse the catalogue and install — or list, scaffold, check one agent's skills\",\n args: [\n {\n name: \"action\",\n // Optional, so bare `skills` is the browse screen. That is the entry point somebody who\n // wants a skill actually has: every other form needs an agent, a query or a slug they\n // have not seen yet.\n required: false,\n help: \"what to do — omit to browse the catalogue and tick what you want\",\n choices: [\n { value: \"list\", help: \"every skill, its size, and whether it ships scripts\" },\n {\n value: \"show\",\n help: \"one skill in full, including what the model never sees\",\n },\n {\n value: \"new\",\n help: \"scaffold a skill, turning skills on for this agent if they are not\",\n },\n {\n value: \"install\",\n help: \"install one by name — anthropic/pdf — or copy from a local path (see `sources`)\",\n },\n { value: \"remove\", help: \"delete a skill's directory and everything in it\" },\n { value: \"validate\", help: \"authoring warnings — never a refusal\" },\n ],\n },\n {\n ...MANIFEST,\n required: false,\n help: \"path or sandbox agent name (not used when browsing)\",\n },\n {\n name: \"name\",\n required: false,\n help: \"the skill for show, new and remove — for install, <source>/<skill> or a local path\",\n },\n ],\n flags: [\n {\n name: \"strict\",\n kind: \"boolean\",\n help: \"exit non-zero when any authoring warning is reported\",\n },\n JSON_FLAG,\n ],\n },\n {\n // Machine-level, so it takes no manifest — the split from `skills` that keeps every positional\n // here meaning one thing. A source is a place the person trusts; a skill is one agent's.\n name: \"sources\",\n\n inSession: \"view\",\n needsServer: false,\n summary: \"the repositories skills come from: list, add, search\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n { value: \"list\", help: \"every source, and whether it has been fetched\" },\n { value: \"add\", help: \"add a repository — a URL, or a name and a URL\" },\n { value: \"remove\", help: \"stop searching a source; built-ins included\" },\n { value: \"update\", help: \"re-fetch every source, or the ones named\" },\n {\n value: \"search\",\n help: \"find a skill across every source; fetches on first use\",\n },\n ],\n },\n {\n name: \"rest\",\n required: false,\n variadic: true,\n help: \"a name and URL for add, a name for remove or update, words for search\",\n },\n ],\n flags: [\n {\n name: \"path\",\n kind: \"string\",\n placeholder: \"dir\",\n help: \"subdirectory holding the skills (add)\",\n defaultHelp: \"the whole repository\",\n },\n {\n name: \"ref\",\n kind: \"string\",\n placeholder: \"branch\",\n help: \"branch or tag to track (add)\",\n defaultHelp: \"the remote's default branch\",\n },\n JSON_FLAG,\n ],\n },\n {\n // Action first, manifest second, like `config`, `memory` and `plugins`. The action is\n // *optional* here because bare `channels <agent>` is the question people actually have —\n // \"what is this reachable on, and is it set up\" — and making them type `list` for it would\n // be ceremony. That is `skills`'s shape rather than `plugins`'s, and the difference is real:\n // `plugins` has no useful bare form, since a plugin is named in one place.\n name: \"channels\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"what an agent is reachable on: connect, disconnect, set a credential, unpair\",\n args: [\n {\n name: \"action\",\n required: false,\n help: \"what to do — omit for the listing\",\n choices: [\n {\n value: \"list\",\n help: \"every channel, whether it is on, and whether its credential is filled in\",\n },\n {\n value: \"connect\",\n help: \"switch a channel on; it starts at the agent's next start\",\n },\n {\n value: \"disconnect\",\n help: \"switch it off — a disabled channel is never constructed\",\n },\n {\n value: \"credential\",\n help: \"set the channel's token in the .env, prompted and not echoed\",\n },\n {\n value: \"pair\",\n help: \"connect it the way that channel needs — a code for WhatsApp, a token for Telegram\",\n },\n {\n value: \"unpair\",\n help: \"forget a scanned pairing, so the next start offers a new code\",\n },\n ],\n },\n { ...MANIFEST, required: false, help: \"path or sandbox agent name\" },\n {\n name: \"channel\",\n required: false,\n help: \"which channel — its id, not its type. Optional when the agent has exactly one\",\n },\n ],\n flags: [JSON_FLAG],\n },\n {\n // Action first, manifest second — the shape `config` and `memory` already use. `plugins <agent>`\n // was the whole command until there was something to install, and a bare positional cannot stay\n // the agent once `add` and `remove` exist: an agent may legitimately be named `add`.\n name: \"plugins\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"install a plugin, list what an agent loaded, or remove one\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n {\n value: \"list\",\n help: \"what this agent loaded, from where, and what it asked for\",\n },\n { value: \"add\", help: \"fetch a plugin from git and name it in this agent\" },\n {\n value: \"remove\",\n help: \"drop the entry, and the directory when no agent needs it\",\n },\n ],\n },\n MANIFEST,\n {\n name: \"rest\",\n required: false,\n variadic: true,\n help: \"a repository for add — owner/repo, a clone URL, or a page URL — or a name for remove\",\n },\n ],\n flags: [\n {\n name: \"ref\",\n kind: \"string\",\n placeholder: \"tag\",\n help: \"branch, tag or commit to fetch (add) — the only thing that pins the code\",\n defaultHelp: \"the remote's default branch\",\n },\n {\n name: \"name\",\n kind: \"string\",\n placeholder: \"name\",\n help: \"install under this name (add), which is what the `plugins:` entry will say\",\n defaultHelp: \"the repository or subdirectory name\",\n },\n JSON_FLAG,\n ],\n },\n {\n name: \"agents\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"the agents in the sandbox, and whether anything is serving them\",\n args: [\n {\n ...MANIFEST,\n required: false,\n variadic: true,\n help: \"paths or sandbox names to describe in full — bare, lists the sandbox\",\n },\n ],\n flags: [STORE, JSON_FLAG],\n },\n {\n // `daemon restart` restarts the *service* — every agent it hosts. This reloads one agent in\n // place, which is what a person wants after pairing a channel or editing agent.yaml, and it\n // was reachable only as `/restart` inside a session or as `POST /v1/agents/:id/reload`.\n name: \"restart\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"reload one agent on the running host, or restart the whole service\",\n args: [\n {\n ...MANIFEST,\n required: false,\n help: \"path or sandbox agent name — bare, restarts the background service\",\n },\n ],\n flags: [STORE, JSON_FLAG],\n },\n {\n // One screen for the question people actually have — \"is it running and is it working?\" —\n // which `daemon status`, `agents` and `/status` each answered a third of.\n name: \"status\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"the service, the hosts, every agent and its channels — one screen\",\n args: [],\n flags: [STORE, JSON_FLAG],\n },\n {\n name: \"logs\",\n\n // Hidden from the session palette, where `/daemon logs` already is: two rows for one log\n // would spend a landing row on a duplicate.\n inSession: \"hidden\",\n needsServer: false,\n summary: \"the server's stderr tail — the same as `daemon logs`\",\n args: [\n {\n ...MANIFEST,\n required: false,\n help: \"path or sandbox agent name — bare, the server's own log\",\n },\n ],\n flags: [\n {\n name: \"lines\",\n kind: \"number\",\n placeholder: \"n\",\n integer: true,\n min: 1,\n help: \"how much of the log to show\",\n defaultHelp: \"40\",\n },\n {\n name: \"follow\",\n short: \"f\",\n kind: \"boolean\",\n help: \"keep printing new lines until interrupted\",\n },\n { name: \"truncate\", kind: \"boolean\", help: \"empty the log first, in place\" },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n // The one command whose whole purpose is to make a network call, which is why it is a command\n // rather than something boot does: boot resolves a remote catalogue from disk so that nothing\n // touches the network before readiness, and an empty cache would otherwise deadlock — the load\n // fails on unresolved slugs, so the post-readiness refresh that would have filled it never runs.\n name: \"tools\",\n\n inSession: \"output\",\n needsServer: false,\n summary:\n \"show the resolved tool catalogue, or fetch a remote provider's schemas into the cache\",\n args: [MANIFEST],\n flags: [\n {\n name: \"warm\",\n kind: \"boolean\",\n help: \"fetch every pinned slug from the provider and write the resolution cache\",\n },\n JSON_FLAG,\n ],\n },\n {\n // The only command that opens a listening socket, and the only one that starts channels.\n // `run` builds the same runtime without them: a REPL that quietly began answering Telegram\n // while you typed at it would be a surprise.\n name: \"serve\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"run the HTTP API and connect the agents' channels\",\n // Variadic since 16.2a. One process hosts N agents — decision 8.5 has said so since the\n // beginning, and only this line pinned the product to one. The bind is process-level, so a\n // second manifest declaring a *different* `server.port`, `host` or `tokenEnv` is refused\n // rather than silently ignored.\n //\n // **Optional since 16.3**, which is what makes the product always-on: naming nothing hosts\n // the sandbox's enabled agents, so a host does not have to be told which agents to serve —\n // and one that did could never serve an agent provisioned after it started. Naming\n // manifests is the container's shape, where the agent arrives on a mount.\n args: [\n {\n ...MANIFEST,\n required: false,\n variadic: true,\n help: \"paths to an agent.yaml, or sandbox agent names (omit for every enabled agent)\",\n },\n ],\n flags: [\n {\n name: \"port\",\n kind: \"number\",\n placeholder: \"n\",\n help: \"port to bind\",\n defaultHelp: \"server.port, or 7420\",\n },\n {\n name: \"host\",\n kind: \"string\",\n placeholder: \"addr\",\n help: \"address to bind — a non-loopback host requires an API token\",\n defaultHelp: \"server.host, or 127.0.0.1\",\n },\n {\n // The escape from a lockout, and the reason it needs to exist: a claim is printed\n // only while no operator key is live, so an operator who loses the only key on a\n // server with no configured token has no route back in. A person able to run\n // `serve` on that machine already holds the store file, so the flag confers nothing\n // they could not get with sqlite3 — it just makes the recovery nameable.\n name: \"claim\",\n kind: \"boolean\",\n help: \"print a one-time claim even when a key already exists\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n /**\n * Operator credentials, from a terminal.\n *\n * **Not `keys`**, which is taken by the keyboard diagnostic below — two unrelated meanings\n * under one verb costs somebody a confused minute every time they reach for either. `token`\n * loses to `server.tokenEnv`, a different credential this command can neither mint nor\n * revoke. `credential` is the word the spec and the store already use.\n *\n * `needsServer` is **true**: a credential belongs to a server rather than to a file, and\n * this is an HTTP client. Writing the store directly would bypass the label rule, the scope\n * validation and the refusal of a scope naming an agent that does not exist — the two\n * surfaces would then disagree about what a valid credential is.\n */\n name: \"credential\",\n // Minting a credential from inside a chat would print a secret into a transcript that is\n // then stored, indexed and retrievable. The one place it must not appear.\n inSession: \"hidden\",\n needsServer: true,\n summary: \"mint, list and revoke operator credentials, optionally scoped\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n { value: \"create\", help: \"mint one and print the secret, once\" },\n { value: \"list\", help: \"every credential, live and revoked, with its scope\" },\n { value: \"revoke\", help: \"kill one permanently\" },\n ],\n },\n {\n name: \"keyId\",\n required: false,\n help: \"which credential, for revoke (`credential list` prints the ids)\",\n },\n ],\n flags: [\n {\n name: \"label\",\n kind: \"string\",\n placeholder: \"text\",\n help: \"how it is shown in a listing — required for create\",\n },\n {\n name: \"agents\",\n kind: \"string\",\n placeholder: \"a,b\",\n help: \"narrow it to these agents\",\n defaultHelp: \"every agent\",\n },\n {\n name: \"sessions\",\n kind: \"string\",\n placeholder: \"prefix\",\n help: \"narrow it to session keys starting with this\",\n defaultHelp: \"every session\",\n },\n {\n name: \"can\",\n kind: \"string\",\n placeholder: \"list\",\n help: \"narrow it to these capabilities: read | chat | write | admin\",\n defaultHelp: \"all four\",\n },\n {\n name: \"expires\",\n kind: \"string\",\n placeholder: \"dur\",\n help: \"how long it lives: 30s, 15m, 2h, 7d, or seconds\",\n defaultHelp: \"never\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n // The instrument, not a setting. `terminal-setup` below changes a terminal's configuration; this\n // one only reports what the current terminal already does, which is the question that has to be\n // answered first and could not be until now.\n name: \"keys\",\n inSession: \"hidden\",\n needsServer: false,\n summary: \"press a chord and see the bytes, Ink's reading of them, and the intent\",\n args: [],\n flags: [\n {\n name: \"no-enhanced-keys\",\n kind: \"boolean\",\n help: \"do not negotiate the kitty keyboard protocol\",\n },\n ],\n },\n {\n // The only command that edits a file outside the workspace, which is why it prints the change\n // first and asks. ⌥⏎ needs none of it — this is for people who want shift+⏎ as well.\n name: \"terminal-setup\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"teach this terminal to send shift+enter as a new line\",\n args: [],\n flags: [\n { name: \"dry-run\", kind: \"boolean\", help: \"print the change and write nothing\" },\n { name: \"yes\", kind: \"boolean\", help: \"write it without asking\" },\n JSON_FLAG,\n ],\n },\n {\n // The switch that turns everything off. Separate from `daemon stop`, which needs you to\n // know the agent: this one finds the services *and* a `serve` left in a forgotten tab.\n // The mirror of `init`: it created a directory, a manifest and a workspace, and everything since\n // has scattered into a shared store keyed by manifest id, a log pair, and possibly a LaunchAgent.\n // `hidden` for the same reason `stop` is — removing the agent you are talking to is worse than\n // stopping it.\n name: \"remove\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"delete a sandbox agent: its directory, sessions, memory, logs and service\",\n args: [\n {\n name: \"agent\",\n required: false,\n help: \"sandbox agent name (a path is refused — remove only manages agents `init` made)\",\n },\n ],\n flags: [\n {\n name: \"dry-run\",\n kind: \"boolean\",\n help: \"show exactly what would go; delete nothing\",\n },\n {\n name: \"files-only\",\n kind: \"boolean\",\n help: \"delete the directory and keep the sessions, memory and logs\",\n },\n {\n name: \"prune\",\n kind: \"boolean\",\n help: \"delete sessions, memory and logs that no sandbox agent claims any more\",\n },\n { name: \"all\", kind: \"boolean\", help: \"remove every agent in the sandbox\" },\n {\n name: \"yes\",\n kind: \"boolean\",\n help: \"skip the typed confirmation (required to delete anything non-interactively)\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n name: \"stop\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"stop one agent for good, or everything — named, it stays stopped across restarts\",\n args: [\n {\n name: \"agent\",\n required: false,\n help: \"path or sandbox agent name (omit to stop the whole host)\",\n },\n ],\n flags: [\n {\n name: \"dry-run\",\n kind: \"boolean\",\n help: \"list what would be stopped; stop nothing\",\n },\n {\n name: \"reason\",\n kind: \"string\",\n help: \"why — recorded, and shown wherever the agent is reported as off\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n // The other half of `stop <agent>`. Not `daemon start`, which starts a *process*: this\n // decides what a running process holds, which since 16.2a is a different question.\n name: \"start\",\n\n inSession: \"hidden\",\n needsServer: true,\n summary: \"switch an agent back on, and have a running host adopt it now\",\n args: [MANIFEST],\n flags: [STORE, JSON_FLAG],\n },\n {\n // `serve` stays up only as long as its terminal, which makes an agent configured for a\n // channel answer only while a window is open. This installs it as a supervised service.\n //\n name: \"model\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"ask the endpoint what it can actually do — window, output cap, prompt caching\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n {\n value: \"probe\",\n help: \"measure every configured role against its own endpoint\",\n },\n ],\n },\n { name: \"agent\", required: true, help: \"path or sandbox agent name\" },\n ],\n flags: [\n {\n name: \"window\",\n kind: \"boolean\",\n help: \"search for the window by growing a prompt until it is refused — costs real tokens, and prints the estimate first\",\n },\n {\n name: \"price\",\n kind: \"number\",\n placeholder: \"usd\",\n help: \"dollars per million input tokens, if you want --window's estimate in money\",\n },\n {\n name: \"write\",\n kind: \"boolean\",\n help: \"record a measured ceiling in the manifest; a floor is refused, because a floor is not a window\",\n },\n {\n name: \"yes\",\n kind: \"boolean\",\n help: \"answer the --window spend prompt; nothing else is affected\",\n },\n { name: \"json\", kind: \"boolean\", help: \"machine-readable findings\" },\n ],\n },\n {\n name: \"web\",\n\n // A pane runs a command as a child and shows its output, which is right here: the effect is\n // a browser window, and one line saying where it went is all a session needs to report.\n inSession: \"output\",\n // `run` needs a host to point a browser at, and the first-run bootstrap is what makes\n // \"install, then open the page\" one step. `open` and `url` are read-only and say so when\n // nothing is running, rather than starting something on a machine that did not ask for it.\n needsServer: true,\n summary: \"open the browser view of a running agent\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n { value: \"run\", help: \"start a server if needed, then open the page\" },\n { value: \"open\", help: \"open the page of a server already running\" },\n {\n value: \"url\",\n help: \"print the address and open nothing — the form a pipe reads\",\n },\n ],\n },\n {\n name: \"agent\",\n // Optional: a bare `web open` points at the page, which lists what the host has.\n // Naming an agent is what puts `?agent=` in the URL for the page to read.\n required: false,\n help: \"path or sandbox agent name (omit to open the page itself)\",\n },\n ],\n flags: [\n {\n name: \"no-open\",\n kind: \"boolean\",\n help: \"print the URL instead of opening it\",\n },\n STORE,\n JSON_FLAG,\n ],\n },\n {\n // Second action-as-positional command after `soul` — and the reason `ArgSpec.choices`\n // exists, since seven verbs hidden inside a prose help string is a set nothing can check.\n name: \"daemon\",\n\n inSession: \"output\",\n needsServer: false,\n summary: \"keep an agent serving in the background — starts at login, restarts on crash\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n {\n value: \"install\",\n help: \"check it will boot, write the service, load it, and watch it start\",\n },\n { value: \"uninstall\", help: \"unload it and remove the service definition\" },\n { value: \"start\", help: \"load it again after a stop\" },\n { value: \"stop\", help: \"unload it, and keep it stopped across a login\" },\n { value: \"restart\", help: \"what you run after editing agent.yaml or .env\" },\n {\n value: \"status\",\n help: \"running? how many restarts? why did it stop? — bare, reports every agent\",\n },\n {\n value: \"logs\",\n help: \"the tail of stderr; --lines, --follow, --truncate\",\n },\n ],\n },\n {\n name: \"agent\",\n // Optional so a bare `daemon status` can answer \"is anything running?\" — the\n // question people actually have, and one that should not require naming an agent.\n required: false,\n help: \"path or sandbox agent name (omit only for status)\",\n },\n ],\n flags: [\n {\n name: \"lines\",\n kind: \"number\",\n placeholder: \"n\",\n integer: true,\n min: 1,\n help: \"how much of the log to show\",\n defaultHelp: \"40\",\n },\n {\n name: \"follow\",\n short: \"f\",\n kind: \"boolean\",\n help: \"keep printing as the service writes — both streams; ctrl-C stops (logs)\",\n },\n { name: \"truncate\", kind: \"boolean\", help: \"empty the log files (logs)\" },\n {\n name: \"dry-run\",\n kind: \"boolean\",\n help: \"print the service definition and the checks; write nothing\",\n },\n // The server preflight reads the lease table to report agents another process holds,\n // so this command has a store to point at like the others do.\n STORE,\n JSON_FLAG,\n ],\n },\n]\n\nexport function findCommand(name: string): CommandSpec | undefined {\n return COMMANDS.find((command) => command.name === name)\n}\n\n/** Every flag a command accepts: its own plus the global ones. */\nexport function flagsFor(command: CommandSpec): readonly FlagSpec[] {\n return [...command.flags, ...GLOBAL_FLAGS]\n}\n\n/**\n * Commands other than `exclude` that declare `flag`.\n *\n * Turns \"unknown flag --json\" — true but useless, since `--json` plainly exists — into a message\n * that names where it does work.\n */\nexport function commandsAccepting(flag: string, exclude: string): readonly string[] {\n return COMMANDS.filter(\n (command) => command.name !== exclude && command.flags.some((f) => f.name === flag),\n ).map((command) => command.name)\n}\n\n/**\n * Split \"an action word, or an agent\" for a command whose action is optional.\n *\n * `channels <agent>` and `channels list <agent>` are both meant, so the first positional is one or\n * the other and only its *value* says which. The action words win, exactly as a slash command\n * resolves and as `config`'s own reader does — the difference being that this one reads the\n * **command's spec** for the words rather than holding a second copy of them, so an action added to\n * the table is covered with nothing to remember.\n */\nexport function actionOrRef(\n command: string,\n first: string | undefined,\n): { readonly action: string | undefined; readonly ref: string | undefined } {\n const given = (first ?? \"\").trim()\n if (given === \"\") return { action: undefined, ref: undefined }\n const actions = (findCommand(command)?.args ?? [])\n .find((arg) => arg.name === \"action\")\n ?.choices?.map((choice) => choice.value)\n return actions?.includes(given) === true\n ? { action: given, ref: undefined }\n : { action: undefined, ref: given }\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";8GAkBO,IAAM,GAAoC,CAC7C,CACI,KAA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A,CACI,KAAM,cACN,KAAM,SACN,YAAa,KACb,KAAM,yDACN,YAAa,QACjB,EACA,CACI,KAAM,WACN,KAAM,SACN,YAAa,QACb,KAAM,iDACN,YAAa,MACjB,EACA,CACI,KAAM,WACN,KAAM,SACN,YAAa,QACb,KAAM,0CACN,YAAa,MACjB,EACA,CACI,KAAM,iBACN,KAAM,SACN,YAAa,UACb,KAAM,sEACV,EACA,CACI,KAAM,WACN,KAAM,SACN,YAAa,QACb,KAAM,6EACN,YAAa,MACjB,EACA,CAII,KAAM,kBACN,KAAM,SACN,YAAa,SACb,KAAM,sEACV,EACA,CACI,KAAM,SACN,KAAM,SACN,YAAa,QAGb,KAAM,mCACN,YAAa,OACjB,EACA,CACI,KAAM,YACN,KAAM,SACN,YAAa,OACb,KAAM,qDACN,YAAa,MACjB,EACA,CACI,KAAM,SACN,KAAM,SACN,YAAa,QAGb,KAAM,gFACN,YAAa,SACjB,EACA,CACI,KAAM,SACN,KAAM,SACN,YAAa,QACb,KAAM,oDACN,YAAa,MACjB,EACA,CACI,KAAM,MACN,KAAM,SACN,YAAa,OACb,KAAM,8CACN,YAAa,KAAK,EAAM,mCAC5B,EACA,CACI,KAAM,MACN,KAAM,UACN,KAAM,mDACV,CACJ,CACJ,EACA,CACI,KAAM,MAEN,UAAW,SACX,YAAa,GACb,QAAS,mEACT,KAAM,CACF,IACO,EACH,SAAU,GACV,KAAM,4DACV,CACJ,EACA,MAAO,CACH,IAAK,EAAS,YAAa,wDAAyD,EACpF,CACI,KAAM,WACN,MAAO,IACP,KAAM,UACN,KAAM,sDACV,EACA,CACI,KAAM,QACN,KAAM,SACN,YAAa,OACb,KAAM,qCACV,EACA,EACA,CACI,KAAM,YACN,KAAM,UACN,KAAM,sDACV,EACA,CAAE,KAAM,QAAS,KAAM,UAAW,KAAM,wCAAyC,EACjF,CAII,KAAM,mBACN,KAAM,UACN,KAAM,yEACV,EACA,CACI,KAAM,eACN,KAAM,UACN,KAAM,gEACV,EACA,CAII,KAA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,KAAM,4BAA6B,EACnE,CACI,KAAM,UACN,SAAU,GACV,KAAM,+EACV,CACJ,EACA,MAAO,CAAC,CAAS,CACrB,EACA,CAII,KAAM,UAEN,UAAW,SACX,YAAa,GACb,QAAS,6DACT,KAAM,CACF,CACI,KAAM,SACN,SAAU,GACV,KAAM,aACN,QAAS,CACL,CACI,MAAO,OACP,KAAM,2DACV,EACA,CAAE,MAAO,MAAO,KAAM,mDAAoD,EAC1E,CACI,MAAO,SACP,KAAM,0DACV,CACJ,CACJ,EACA,EACA,CACI,KAAM,OACN,SAAU,GACV,SAAU,GACV,KAAM,sFACV,CACJ,EACA,MAAO,CACH,CACI,KAAM,MACN,KAAM,SACN,YAAa,MACb,KAAM,2EACN,YAAa,6BACjB,EACA,CACI,KAAM,OACN,KAAM,SACN,YAAa,OACb,KAAM,6EACN,YAAa,qCACjB,EACA,CACJ,CACJ,EACA,CACI,KAAM,SAEN,UAAW,SACX,YAAa,GACb,QAAS,kEACT,KAAM,CACF,IACO,EACH,SAAU,GACV,SAAU,GACV,KAAM,sEACV,CACJ,EACA,MAAO,CAAC,EAAO,CAAS,CAC5B,EACA,CAII,KAAM,UAEN,UAAW,SACX,YAAa,GACb,QAAS,qEACT,KAAM,CACF,IACO,EACH,SAAU,GACV,KAAM,oEACV,CACJ,EACA,MAAO,CAAC,EAAO,CAAS,CAC5B,EACA,CAGI,KAAM,SAEN,UAAW,SACX,YAAa,GACb,QAAS,oEACT,KAAM,CAAC,EACP,MAAO,CAAC,EAAO,CAAS,CAC5B,EACA,CACI,KAAM,OAIN,UAAW,SACX,YAAa,GACb,QAAS,uDACT,KAAM,CACF,IACO,EACH,SAAU,GACV,KAAM,yDACV,CACJ,EACA,MAAO,CACH,CACI,KAAM,QACN,KAAM,SACN,YAAa,IACb,QAAS,GACT,IAAK,EACL,KAAM,8BACN,YAAa,IACjB,EACA,CACI,KAAM,SACN,MAAO,IACP,KAAM,UACN,KAAM,2CACV,EACA,CAAE,KAAM,WAAY,KAAM,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AM,4DACV,EAGA,EACA,CACJ,CACJ,CACJ,EAEO,SAAS,EAAW,CAAC,EAAuC,CAC/D,OAAO,GAAS,KAAK,CAAC,IAAY,EAAQ,OAAS,CAAI,EAIpD,SAAS,EAAQ,CAAC,EAA2C,CAChE,MAAO,CAAC,GAAG,EAAQ,MAAO,GAAG,EAAY,EAStC,SAAS,EAAiB,CAAC,EAAc,EAAoC,CAChF,OAAO,GAAS,OACZ,CAAC,IAAY,EAAQ,OAAS,GAAW,EAAQ,MAAM,KAAK,CAAC,IAAM,EAAE,OAAS,CAAI,CACtF,EAAE,IAAI,CAAC,IAAY,EAAQ,IAAI,EAY5B,SAAS,EAAW,CACvB,EACA,EACyE,CACzE,IAAM,GAAS,GAAS,IAAI,KAAK,EACjC,GAAI,IAAU,GAAI,MAAO,CAAE,OAAQ,OAAW,IAAK,MAAU,EAI7D,OAHiB,GAAY,CAAO,GAAG,MAAQ,CAAC,GAC3C,KAAK,CAAC,IAAQ,EAAI,OAAS,QAAQ,GAClC,SAAS,IAAI,CAAC,IAAW,EAAO,KAAK,GAC3B,SAAS,CAAK,IAAM,GAC9B,CAAE,OAAQ,EAAO,IAAK,MAAU,EAChC,CAAE,OAAQ,OAAW,IAAK,CAAM",
|
|
8
|
+
"debugId": "0B84D1BFEF4E043E64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -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 Pn(n){return r(n(6))}function Ei(n){return new RegExp("^local:[0123456789abcdefghjkmnpqrstvwxyz]{6}$").test(n)}
|
|
3
|
+
export{Pn,Ei};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=1361EA6084072CC264756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-7yk1zvds.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": "1361EA6084072CC264756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{o,ce}from"./index-nn3tk25c.js";import{Box as l,Text as e}from"ink";import{jsx as n,jsxs as d}from"react/jsx-runtime";function RA({title:t,lines:i}){return d(l,{flexDirection:"column",borderStyle:ce,borderColor:o.borderActive,paddingX:1,children:[n(e,{bold:!0,color:o.accent,children:t}),i.map((r)=>n(e,{dimColor:!0,children:r},r))]})}
|
|
3
|
+
export{RA};
|
|
4
|
+
|
|
5
|
+
//# debugId=BE58A3AAC21A9FA464756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-81gb4ey4.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * The welcome box: product identity in a rounded frame, context lines dim beneath it.\n *\n * Purely presentational — the caller supplies the title (usually `BRAND.name + version`) and the\n * lines, so this renders identically at the top of a chat session, a wizard, or the picker.\n *\n * Every boxed surface stretches to the full terminal width — no `alignSelf`. Content-fit boxes\n * next to full-width ones read as different components; one rule everywhere is what makes the\n * screens look like one product.\n */\n\nimport { Box, Text } from \"ink\"\nimport { BORDER_STYLE, THEME } from \"#lib/theme\"\n\nexport interface BannerProps {\n readonly title: string\n readonly lines: readonly string[]\n}\n\nexport function Banner({ title, lines }: BannerProps) {\n return (\n <Box\n flexDirection=\"column\"\n borderStyle={BORDER_STYLE}\n borderColor={THEME.borderActive}\n paddingX={1}\n >\n <Text bold color={THEME.accent}>\n {title}\n </Text>\n {lines.map((line) => (\n <Text key={line} dimColor>\n {line}\n </Text>\n ))}\n </Box>\n )\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";sCAWA,cAAS,UAAK,8DAQP,SAAS,EAAM,EAAG,QAAO,SAAsB,CAClD,OACI,EAcE,EAdF,CACI,cAAc,SACd,YAAa,GACb,YAAa,EAAM,aACnB,SAAU,EAJd,SAcE,CARE,EAEE,EAFF,CAAM,KAAI,GAAC,MAAO,EAAM,OAAxB,SACK,EACH,EACD,EAAM,IAAI,CAAC,IACR,EAEE,EAFF,CAAiB,SAAQ,GAAzB,SACK,GADM,CAET,CACL,GACH",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "BE58A3AAC21A9FA464756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{J,$t}from"./index-2zye08c4.js";import{useStdout as u}from"ink";import{useEffect as i,useState as t}from"react";function s(e){let n=e?.columns,o=e?.rows;return{columns:n===void 0||n<=0?J:n,rows:o===void 0||o<=0?$t:o}}function ge(){let{stdout:e}=u(),[n,o]=t(()=>s(e));return i(()=>{if(e===void 0)return;let r=()=>o(s(e));return e.on("resize",r),()=>void e.off("resize",r)},[e]),n}
|
|
3
|
+
export{ge};
|
|
4
|
+
|
|
5
|
+
//# debugId=690A8CBCECABD08F64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-8a5d8sfe.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * Terminal width, kept current across resizes.\n *\n * `columns` can genuinely be 0 — measured, under a pty allocated by `script -q`, which is how a real\n * TTY gets driven in a test harness. Anything dividing by the width has to survive that, so the\n * fallback is applied here rather than at each call site.\n */\n\nimport { useStdout } from \"ink\"\nimport { useEffect, useState } from \"react\"\nimport { FALLBACK_COLUMNS, FALLBACK_ROWS } from \"#lib/const\"\n\ninterface Size {\n readonly columns: number\n readonly rows: number\n}\n\n/**\n * Module-level and pure, so the resize listener has a stable identity. A reader defined inside the\n * hook would be a new function every render, which means either a stale listener or re-subscribing\n * on every frame.\n */\nfunction readSize(stdout: { columns?: number; rows?: number } | undefined): Size {\n const columns = stdout?.columns\n const rows = stdout?.rows\n return {\n columns: columns === undefined || columns <= 0 ? FALLBACK_COLUMNS : columns,\n rows: rows === undefined || rows <= 0 ? FALLBACK_ROWS : rows,\n }\n}\n\nexport function useTerminalSize(): Size {\n const { stdout } = useStdout()\n const [size, setSize] = useState(() => readSize(stdout))\n\n useEffect(() => {\n if (stdout === undefined) return\n const onResize = () => setSize(readSize(stdout))\n stdout.on(\"resize\", onResize)\n return () => void stdout.off(\"resize\", onResize)\n }, [stdout])\n\n return size\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";sCAQA,oBAAS,YACT,oBAAS,cAAW,cAapB,SAAS,CAAQ,CAAC,EAA+D,CAC7E,IAAM,EAAU,GAAQ,QAClB,EAAO,GAAQ,KACrB,MAAO,CACH,QAAS,IAAY,QAAa,GAAW,EAAI,EAAmB,EACpE,KAAM,IAAS,QAAa,GAAQ,EAAI,GAAgB,CAC5D,EAGG,SAAS,EAAe,EAAS,CACpC,IAAQ,UAAW,EAAU,GACtB,EAAM,GAAW,EAAS,IAAM,EAAS,CAAM,CAAC,EASvD,OAPA,EAAU,IAAM,CACZ,GAAI,IAAW,OAAW,OAC1B,IAAM,EAAW,IAAM,EAAQ,EAAS,CAAM,CAAC,EAE/C,OADA,EAAO,GAAG,SAAU,CAAQ,EACrB,IAAM,KAAK,EAAO,IAAI,SAAU,CAAQ,GAChD,CAAC,CAAM,CAAC,EAEJ",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "690A8CBCECABD08F64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire as q}from"node:module";var k=Object.create;var{getPrototypeOf:l,defineProperty:i,getOwnPropertyNames:m}=Object;var j=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,oA=(a,b,d)=>{var f=a!=null&&typeof a==="object";if(f){var g=b?o??=new WeakMap:p??=new WeakMap,h=g.get(a);if(h)return h}d=a!=null?k(l(a)):{};let c=b||!a||!a.__esModule||!j.call(a,"default")?i(d,"default",{value:a,enumerable:!0}):d;if(a&&typeof a==="object"||typeof a==="function"){for(let e of m(a))if(!j.call(c,e))i(c,e,{get:n.bind(a,e),enumerable:!0})}if(f)g.set(a,c);return c};var r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var w=q(import.meta.url);
|
|
3
|
+
export{oA,r,w};
|
|
4
|
+
|
|
5
|
+
//# debugId=7C57EEDD70A851C364756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-a21zyy54.js.map
|