dispach 0.2.4 → 0.2.13
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 +32 -33
- package/dist/APEv2Parser-rt8hyadd.js +5 -0
- package/dist/{FlacParser-8xprykrh.js.map → APEv2Parser-rt8hyadd.js.map} +1 -1
- package/dist/{AiffParser-ns1y9f0g.js → AiffParser-gvpmtb2e.js} +3 -3
- package/dist/{AiffParser-ns1y9f0g.js.map → AiffParser-gvpmtb2e.js.map} +1 -1
- package/dist/{App-wkpkwgjt.js → App-18dvbyev.js} +8 -8
- package/dist/{App-wkpkwgjt.js.map → App-18dvbyev.js.map} +1 -1
- package/dist/{AsfParser-bae2a1yf.js → AsfParser-h9zyh6cx.js} +3 -3
- package/dist/{AsfParser-bae2a1yf.js.map → AsfParser-h9zyh6cx.js.map} +1 -1
- package/dist/{ConfigEditor-hy9jtas3.js → ConfigEditor-444m13ta.js} +3 -3
- package/dist/{ConfigEditor-hy9jtas3.js.map → ConfigEditor-444m13ta.js.map} +1 -1
- package/dist/{DsdiffParser-s0zvxnfa.js → DsdiffParser-gxqv4gn1.js} +3 -3
- package/dist/{DsdiffParser-s0zvxnfa.js.map → DsdiffParser-gxqv4gn1.js.map} +1 -1
- package/dist/{DsfParser-90mvzt4v.js → DsfParser-sndt4jbk.js} +3 -3
- package/dist/{DsfParser-90mvzt4v.js.map → DsfParser-sndt4jbk.js.map} +1 -1
- package/dist/FlacParser-rmkpvf9e.js +5 -0
- package/dist/{APEv2Parser-x13n424p.js.map → FlacParser-rmkpvf9e.js.map} +1 -1
- package/dist/{KeyProbe-fk5krzks.js → KeyProbe-6t531sy6.js} +3 -3
- package/dist/{KeyProbe-fk5krzks.js.map → KeyProbe-6t531sy6.js.map} +1 -1
- package/dist/{MP4Parser-nmvbkq21.js → MP4Parser-87xfsck4.js} +3 -3
- package/dist/{MP4Parser-nmvbkq21.js.map → MP4Parser-87xfsck4.js.map} +1 -1
- package/dist/{MatroskaParser-tsmz2qfq.js → MatroskaParser-7krspfgx.js} +3 -3
- package/dist/{MatroskaParser-tsmz2qfq.js.map → MatroskaParser-7krspfgx.js.map} +1 -1
- package/dist/{MpegParser-y5fjpaz9.js → MpegParser-jcs35q0h.js} +3 -3
- package/dist/{MpegParser-y5fjpaz9.js.map → MpegParser-jcs35q0h.js.map} +1 -1
- package/dist/{MusepackParser-544q0byg.js → MusepackParser-d4zfnzk3.js} +3 -3
- package/dist/{MusepackParser-544q0byg.js.map → MusepackParser-d4zfnzk3.js.map} +1 -1
- package/dist/{OggParser-v77rbjnt.js → OggParser-fbspjs7v.js} +3 -3
- package/dist/{OggParser-v77rbjnt.js.map → OggParser-fbspjs7v.js.map} +1 -1
- package/dist/{Picker-32m79nmp.js → Picker-x6aj42tc.js} +3 -3
- package/dist/{Picker-32m79nmp.js.map → Picker-x6aj42tc.js.map} +1 -1
- package/dist/{SessionPicker-9p06npt5.js → SessionPicker-pngdv97x.js} +3 -3
- package/dist/{SessionPicker-9p06npt5.js.map → SessionPicker-pngdv97x.js.map} +1 -1
- package/dist/{SkillBrowser-ezdx3xsh.js → SkillBrowser-3mnzkakr.js} +3 -3
- package/dist/{SkillBrowser-ezdx3xsh.js.map → SkillBrowser-3mnzkakr.js.map} +1 -1
- package/dist/{WavPackParser-k623m0hk.js → WavPackParser-0x9z4466.js} +3 -3
- package/dist/{WavPackParser-k623m0hk.js.map → WavPackParser-0x9z4466.js.map} +1 -1
- package/dist/{WaveParser-nj4p1vx8.js → WaveParser-31b6qtef.js} +3 -3
- package/dist/{WaveParser-nj4p1vx8.js.map → WaveParser-31b6qtef.js.map} +1 -1
- package/dist/{WizardApp-p350qspw.js → WizardApp-c42wc116.js} +3 -3
- package/dist/{WizardApp-p350qspw.js.map → WizardApp-c42wc116.js.map} +1 -1
- package/dist/{channels-a9zx9yba.js → channels-nf6d8fvx.js} +14 -14
- package/dist/{channels-a9zx9yba.js.map → channels-nf6d8fvx.js.map} +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +11 -11
- package/dist/client.js.map +4 -4
- package/dist/{config-3mz4zwsf.js → config-sx40rg8m.js} +21 -21
- package/dist/{config-3mz4zwsf.js.map → config-sx40rg8m.js.map} +1 -1
- package/dist/{credential-ja7zmd4c.js → credential-vdbkfk65.js} +5 -5
- package/dist/{credential-ja7zmd4c.js.map → credential-vdbkfk65.js.map} +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/{index-dcy14zdn.js → index-0dcpsfet.js} +5 -5
- package/dist/{index-dcy14zdn.js.map → index-0dcpsfet.js.map} +1 -1
- package/dist/{index-a1axc952.js → index-1h8s50d9.js} +4 -4
- package/dist/{index-a1axc952.js.map → index-1h8s50d9.js.map} +1 -1
- package/dist/{index-ayhdn87b.js → index-1hbvhrsj.js} +4 -4
- package/dist/{index-ayhdn87b.js.map → index-1hbvhrsj.js.map} +1 -1
- package/dist/{index-5gn74n56.js → index-1hfece7s.js} +7 -7
- package/dist/{index-5gn74n56.js.map → index-1hfece7s.js.map} +1 -1
- package/dist/{index-0dvs3a06.js → index-2h566rtg.js} +4 -4
- package/dist/{index-0dvs3a06.js.map → index-2h566rtg.js.map} +1 -1
- package/dist/{index-zzpgsbn3.js → index-4fj1k64j.js} +4 -4
- package/dist/{index-zzpgsbn3.js.map → index-4fj1k64j.js.map} +1 -1
- package/dist/{index-gezqawvw.js → index-4g4smpkk.js} +5 -5
- package/dist/{index-gezqawvw.js.map → index-4g4smpkk.js.map} +1 -1
- package/dist/index-4gfsf9n8.js +6 -0
- package/dist/{index-tc054tcb.js.map → index-4gfsf9n8.js.map} +1 -1
- package/dist/{index-mgef1n4e.js → index-5ptbytze.js} +9 -9
- package/dist/{index-mgef1n4e.js.map → index-5ptbytze.js.map} +1 -1
- package/dist/{index-f6r3h2yh.js → index-5s1cq8np.js} +5 -5
- package/dist/{index-f6r3h2yh.js.map → index-5s1cq8np.js.map} +1 -1
- package/dist/{index-rqfwd7j5.js → index-659ggfbf.js} +4 -4
- package/dist/{index-rqfwd7j5.js.map → index-659ggfbf.js.map} +1 -1
- package/dist/index-6ebppx3t.js +6 -0
- package/dist/{index-x9nn57kk.js.map → index-6ebppx3t.js.map} +1 -1
- package/dist/{index-4j65jp20.js → index-6pym9p8h.js} +6 -6
- package/dist/{index-4j65jp20.js.map → index-6pym9p8h.js.map} +1 -1
- package/dist/index-9ejax6hp.js +6 -0
- package/dist/{index-s0t15ndj.js.map → index-9ejax6hp.js.map} +1 -1
- package/dist/{index-86rb86nr.js → index-9hw9j1qg.js} +4 -4
- package/dist/{index-86rb86nr.js.map → index-9hw9j1qg.js.map} +1 -1
- package/dist/{index-yz0fcxky.js → index-9xhresrg.js} +4 -4
- package/dist/{index-yz0fcxky.js.map → index-9xhresrg.js.map} +1 -1
- package/dist/{index-2td5h856.js → index-abm0zyc0.js} +6 -6
- package/dist/{index-2td5h856.js.map → index-abm0zyc0.js.map} +1 -1
- package/dist/{index-8k8y7edx.js → index-ar5c9d2f.js} +5 -5
- package/dist/{index-8k8y7edx.js.map → index-ar5c9d2f.js.map} +1 -1
- package/dist/index-bhj4pmrx.js +74 -0
- package/dist/index-bhj4pmrx.js.map +13 -0
- package/dist/{index-brh25jhq.js → index-brt17yfr.js} +3 -3
- package/dist/{index-brh25jhq.js.map → index-brt17yfr.js.map} +1 -1
- package/dist/index-bysnsdkd.js +6 -0
- package/dist/{index-c6qrcweh.js.map → index-bysnsdkd.js.map} +1 -1
- package/dist/{index-kz01jz58.js → index-c74wx9pv.js} +4 -4
- package/dist/{index-kz01jz58.js.map → index-c74wx9pv.js.map} +1 -1
- package/dist/{index-qj4adnfe.js → index-cm3g4t3r.js} +9 -9
- package/dist/{index-qj4adnfe.js.map → index-cm3g4t3r.js.map} +1 -1
- package/dist/{index-8mkatm20.js → index-dzp6mc5h.js} +4 -4
- package/dist/{index-8mkatm20.js.map → index-dzp6mc5h.js.map} +1 -1
- package/dist/{index-b8bfzbfe.js → index-fad09b8c.js} +4 -4
- package/dist/{index-b8bfzbfe.js.map → index-fad09b8c.js.map} +1 -1
- package/dist/{index-2fw9e5gg.js → index-fvb2dxzn.js} +4 -4
- package/dist/{index-2fw9e5gg.js.map → index-fvb2dxzn.js.map} +1 -1
- package/dist/index-gpq4agva.js +5 -0
- package/dist/{index-635wcsh1.js.map → index-gpq4agva.js.map} +1 -1
- package/dist/index-hcpvk5de.js +5 -0
- package/dist/{index-7zgjkbb0.js.map → index-hcpvk5de.js.map} +1 -1
- package/dist/{index-s0f0s6n5.js → index-jv5t63tp.js} +4 -4
- package/dist/{index-s0f0s6n5.js.map → index-jv5t63tp.js.map} +1 -1
- package/dist/{index-60h4knj6.js → index-kyz4t0j0.js} +59 -59
- package/dist/{index-60h4knj6.js.map → index-kyz4t0j0.js.map} +1 -1
- package/dist/{index-7p8d1gf0.js → index-m6r2sxcw.js} +23 -23
- package/dist/{index-7p8d1gf0.js.map → index-m6r2sxcw.js.map} +1 -1
- package/dist/{index-4fajxhdv.js → index-mhw3d7af.js} +4 -4
- package/dist/{index-4fajxhdv.js.map → index-mhw3d7af.js.map} +1 -1
- package/dist/{index-h787rq0h.js → index-mk7hrzq7.js} +10 -10
- package/dist/{index-h787rq0h.js.map → index-mk7hrzq7.js.map} +1 -1
- package/dist/{index-r83jpct7.js → index-n0hqgwad.js} +4 -4
- package/dist/{index-r83jpct7.js.map → index-n0hqgwad.js.map} +1 -1
- package/dist/{index-k6wq0j4q.js → index-ncb840sk.js} +4 -4
- package/dist/{index-k6wq0j4q.js.map → index-ncb840sk.js.map} +1 -1
- package/dist/{index-8jejze0z.js → index-ntczmwnf.js} +3 -3
- package/dist/{index-8jejze0z.js.map → index-ntczmwnf.js.map} +1 -1
- package/dist/{index-ts8a1sdn.js → index-p5gy5s7p.js} +6 -6
- package/dist/{index-ts8a1sdn.js.map → index-p5gy5s7p.js.map} +1 -1
- package/dist/index-p86w0qjw.js +5 -0
- package/dist/{index-pz92ksp8.js.map → index-p86w0qjw.js.map} +1 -1
- package/dist/{index-cb45233h.js → index-qhh30m9p.js} +4 -4
- package/dist/{index-cb45233h.js.map → index-qhh30m9p.js.map} +1 -1
- package/dist/{index-z4adxmzm.js → index-rerdsr3d.js} +5 -5
- package/dist/{index-z4adxmzm.js.map → index-rerdsr3d.js.map} +1 -1
- package/dist/{index-67sfck4d.js → index-s0mfq8t7.js} +18 -18
- package/dist/index-s0mfq8t7.js.map +11 -0
- package/dist/{index-9k6qa50r.js → index-s9ybp2r1.js} +6 -6
- package/dist/{index-9k6qa50r.js.map → index-s9ybp2r1.js.map} +1 -1
- package/dist/index-ss77hvwy.js +1246 -0
- package/dist/{index-tv52jhac.js.map → index-ss77hvwy.js.map} +32 -31
- package/dist/{index-yy4v9kca.js → index-t9bnt6a1.js} +4 -4
- package/dist/{index-yy4v9kca.js.map → index-t9bnt6a1.js.map} +1 -1
- package/dist/{index-5zpfz4kb.js → index-w2ss9hn5.js} +7 -7
- package/dist/{index-5zpfz4kb.js.map → index-w2ss9hn5.js.map} +1 -1
- package/dist/{index-1cagdzqe.js → index-w80shmpv.js} +2 -2
- package/dist/index-w8e8qxd4.js +337 -0
- package/dist/index-w8e8qxd4.js.map +21 -0
- package/dist/{index-xyh98x7p.js → index-z9r4e0yq.js} +4 -4
- package/dist/{index-xyh98x7p.js.map → index-z9r4e0yq.js.map} +1 -1
- package/dist/{index-039ew35r.js → index-zj87j4j2.js} +4 -4
- package/dist/{index-039ew35r.js.map → index-zj87j4j2.js.map} +1 -1
- package/dist/{index-446exxcb.js → index-zmerx9rc.js} +7 -7
- package/dist/{index-446exxcb.js.map → index-zmerx9rc.js.map} +1 -1
- package/dist/{index-nndwx2wp.js → index-zqjtjs7c.js} +39 -39
- package/dist/{index-nndwx2wp.js.map → index-zqjtjs7c.js.map} +1 -1
- package/dist/index.js +318 -305
- package/dist/index.js.map +6 -5
- package/dist/lib/launchd.d.ts.map +1 -1
- package/dist/lib/service-env.d.ts.map +1 -1
- package/dist/lib/templates.d.ts.map +1 -1
- package/dist/lib/theme.d.ts.map +1 -1
- package/dist/lib/watchdog.d.ts +20 -0
- package/dist/lib/watchdog.d.ts.map +1 -0
- package/dist/serve.d.ts.map +1 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/sources.d.ts.map +1 -1
- package/dist/{web-7mdrcb8a.js → web-zvf80ns1.js} +5 -5
- package/dist/{web-7mdrcb8a.js.map → web-zvf80ns1.js.map} +1 -1
- package/dist/wire.js +11 -11
- package/dist/wire.js.map +4 -4
- package/dist/wrapper-5zhcdmnk.js +5 -0
- package/dist/{wrapper-4hdmdwft.js.map → wrapper-5zhcdmnk.js.map} +1 -1
- package/package.json +4 -4
- package/dist/APEv2Parser-x13n424p.js +0 -5
- package/dist/FlacParser-8xprykrh.js +0 -5
- package/dist/index-635wcsh1.js +0 -5
- package/dist/index-67sfck4d.js.map +0 -13
- package/dist/index-7zgjkbb0.js +0 -5
- package/dist/index-c6qrcweh.js +0 -6
- package/dist/index-hd5nkwd7.js +0 -74
- package/dist/index-hd5nkwd7.js.map +0 -13
- package/dist/index-n197qdw1.js +0 -308
- package/dist/index-n197qdw1.js.map +0 -21
- package/dist/index-pz92ksp8.js +0 -5
- package/dist/index-s0t15ndj.js +0 -6
- package/dist/index-tc054tcb.js +0 -6
- package/dist/index-tv52jhac.js +0 -1252
- package/dist/index-x9nn57kk.js +0 -6
- package/dist/wrapper-4hdmdwft.js +0 -5
- /package/dist/{index-1cagdzqe.js.map → index-w80shmpv.js.map} +0 -0
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * A labelled text input for wizard questions: label, caret, LineCursor, optional error line.\n *\n * The editing itself lives upstream — the screen root routes keys through `keyToIntent` into\n * `applyIntent` and hands the resulting `EditorState` down — so every editing nicety the chat\n * input has (^A/^E, ^W, code-point cursor) works here without a second implementation.\n */\n\nimport { Box, Text } from \"ink\"\nimport { LineCursor } from \"#components/LineCursor\"\nimport { GLYPH, THEME } from \"#lib/theme\"\nimport type { EditorState } from \"#lib/types\"\n\nexport interface TextFieldProps {\n readonly label: string\n readonly editor: EditorState\n /** The question's default, shown dim when the buffer is empty; enter accepts it. */\n readonly placeholder?: string\n /** A validation failure, rendered beneath in the error colour. Cleared upstream on edit. */\n readonly error?: string\n /** Mask the value as it is typed. Passed straight through to the cursor. */\n readonly secret?: boolean\n /**\n * Columns available for the value. **Not optional in practice.**\n *\n * `LineCursor`'s own docstring says it: omitted, nothing wraps and a line wider than whatever draws\n * this is truncated by Ink at a width nobody chose. This component never passed it, and in the\n * settings editor — which draws the field into an unbordered column — a value longer than the\n * terminal was clipped at the right edge with the caret *past* the clip. You could not see what you\n * were typing, and `tools.pinned` is 92 characters in a generated manifest, so it was the first long\n * value anybody opened.\n *\n * **The wizard was not affected, and checking that mattered**: its bordered frame gives the `<Text>`\n * a bounded width, so Ink wrapped it anyway. Measured, after the assumption that it must be broken\n * too — the guard that would have \"proved\" it passed with the fix reverted. It is passed there now\n * regardless, because whoever owns a bounded window should wrap the text itself rather than leave it\n * to whatever happens to enclose it, and because `maxRows` genuinely bounds the height.\n */\n readonly columns?: number\n /** Rows the value may take before the view scrolls to follow the cursor. */\n readonly maxRows?: number\n}\n\nexport function TextField({\n label,\n editor,\n placeholder,\n error,\n secret,\n columns,\n maxRows,\n}: TextFieldProps) {\n return (\n <Box flexDirection=\"column\">\n <Text>{label}</Text>\n {/*\n * The prompt glyph is the cursor's `gutter` rather than a sibling `<Text>`. Two reasons, and\n * the second is not optional: it keeps a wrapped or multi-line value in one column, and\n * `LineCursor` renders a `<Box>`, which inside a `<Text>` produces an empty frame — no error,\n * nothing on screen. A frame test caught that; nothing else would have.\n */}\n <LineCursor\n editor={editor}\n gutter={GLYPH.prompt}\n {...(placeholder === undefined ? {} : { placeholder })}\n {...(secret === true ? { secret: true } : {})}\n {...(columns === undefined ? {} : { columns })}\n {...(maxRows === undefined ? {} : { maxRows })}\n />\n {error === undefined ? null : (\n <Text color={THEME.error}>\n {GLYPH.error}\n {error}\n </Text>\n )}\n </Box>\n )\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";yEAQA,cAAS,UAAK,8DAmCP,SAAS,EAAS,EACrB,QACA,SACA,cACA,QACA,SACA,UACA,WACe,CACf,OACI,EAAC,EAAD,CAAK,cAAc,SAAnB,SAsBE,CArBE,EAAC,EAAD,UAAO,EAAQ,EAOf,EAAC,GAAD,CACI,OAAQ,EACR,OAAQ,EAAM,UACT,IAAgB,OAAY,CAAC,EAAI,CAAE,aAAY,KAC/C,IAAW,GAAO,CAAE,OAAQ,EAAK,EAAI,CAAC,KACtC,IAAY,OAAY,CAAC,EAAI,CAAE,SAAQ,KACvC,IAAY,OAAY,CAAC,EAAI,CAAE,SAAQ,EAChD,EACC,IAAU,OAAY,KACnB,EAAC,EAAD,CAAM,MAAO,EAAM,MAAnB,SAGE,CAFG,EAAM,MACN,GACH,GAER",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "F6658B75CD06C23F64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{spawn as s,spawnSync as f}from"node:child_process";function
|
|
3
|
-
export{
|
|
2
|
+
import{spawn as s,spawnSync as f}from"node:child_process";function hs(n){let e=f(n.command,[...n.args],{encoding:"utf8",...n.input===void 0?{}:{input:n.input},...n.cwd===void 0?{}:{cwd:n.cwd},...n.env===void 0?{}:{env:n.env},...n.timeoutMs===void 0?{}:{timeout:n.timeoutMs},...n.maxBuffer===void 0?{}:{maxBuffer:n.maxBuffer}}),d=e.error?.code;return{code:e.status??1,stdout:e.stdout??"",stderr:e.stderr??"",signalled:e.signal!==null,notFound:d==="ENOENT"}}function Dt(n){return new Promise((e)=>{let d=s(n.command,[...n.args],{...n.cwd===void 0?{}:{cwd:n.cwd},...n.env===void 0?{}:{env:n.env},stdio:[n.input===void 0?"ignore":"pipe","pipe","pipe"]});if(n.input!==void 0)d.stdin?.end(n.input);let t="",a="",r=!1,u=n.maxBuffer??33554432;d.stdout?.on("data",(o)=>{if(t.length<u)t+=o.toString("utf8")}),d.stderr?.on("data",(o)=>{if(a.length<u)a+=o.toString("utf8")});let i=n.timeoutMs===void 0?void 0:setTimeout(()=>{r=!0,d.kill("SIGTERM")},n.timeoutMs);d.on("error",(o)=>{if(i!==void 0)clearTimeout(i);e({code:1,stdout:t,stderr:o.message,signalled:r,notFound:o.code==="ENOENT"})}),d.on("close",(o,l)=>{if(i!==void 0)clearTimeout(i);e({code:o??1,stdout:t,stderr:a,signalled:r||l!==null,notFound:!1})})})}
|
|
3
|
+
export{hs,Dt};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=126256B17175C65564756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-9hw9j1qg.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * The one place in this package that starts a process.\n *\n * There were two callers before this file existed and the second one is what created it: `lib/service.ts`\n * ran `launchctl`, and fetching a skill source needs `git`. The rule the boundaries test enforces is\n * \"exactly one module imports `node:child_process`\", and its stated reason is that a second call site is a\n * second place a test has to intercept — the first one that forgets reaches somebody's real machine. Two\n * callers of one seam keeps that property; an allowlist with two entries in it loses it, and would go on\n * losing it once per phase.\n *\n * Deliberately thin, and deliberately not clever. Everything specific to a tool — git's four ways of\n * being told not to prompt, launchd's exit-status decoding — belongs to the caller that knows about it.\n * What lives here is \"run this, capture what it said, and tell me honestly how it ended\".\n *\n * `notFound` is a field rather than an exception because the two callers want different sentences for it:\n * a missing `git` has a remedy the person can act on, and a missing `launchctl` means this is not the\n * operating system the caller thought it was. A shared error message would be wrong for both.\n */\n\nimport { spawn, spawnSync } from \"node:child_process\"\n\nexport interface SpawnRequest {\n readonly command: string\n readonly args: readonly string[]\n readonly cwd?: string\n /** Replaces the environment entirely when given. Callers spread `process.env` themselves. */\n readonly env?: Readonly<Record<string, string | undefined>>\n readonly timeoutMs?: number\n readonly maxBuffer?: number\n /**\n * Text to write to the child's stdin, which is then closed.\n *\n * Added for the clipboard: `pbcopy` reads what it copies from stdin and there is no argument form. The\n * alternative was a temporary file, which puts whatever was selected on disk — and a selection is\n * routinely the most sensitive thing on the screen. The seam grows rather than the caller working\n * around it, per the rule about first-party code not getting private escape hatches.\n */\n readonly input?: string\n}\n\nexport interface SpawnResult {\n readonly code: number\n readonly stdout: string\n readonly stderr: string\n /** True when a timeout or a signal ended it, rather than the process choosing to exit. */\n readonly signalled: boolean\n /** True when the command is not on PATH at all. */\n readonly notFound: boolean\n}\n\nexport function spawnCapture(request: SpawnRequest): SpawnResult {\n const result = spawnSync(request.command, [...request.args], {\n encoding: \"utf8\",\n ...(request.input === undefined ? {} : { input: request.input }),\n ...(request.cwd === undefined ? {} : { cwd: request.cwd }),\n ...(request.env === undefined ? {} : { env: request.env as NodeJS.ProcessEnv }),\n ...(request.timeoutMs === undefined ? {} : { timeout: request.timeoutMs }),\n ...(request.maxBuffer === undefined ? {} : { maxBuffer: request.maxBuffer }),\n })\n const code = (result.error as NodeJS.ErrnoException | undefined)?.code\n return {\n code: result.status ?? 1,\n stdout: result.stdout ?? \"\",\n stderr: result.stderr ?? \"\",\n signalled: result.signal !== null,\n notFound: code === \"ENOENT\",\n }\n}\n\n/**\n * The same thing, without blocking the event loop.\n *\n * Exists because `spawnSync` inside an Ink app freezes the whole terminal: no spinner frame advances, and\n * the keypresses that arrive during a twenty-second `git clone` are echoed by the tty instead of being\n * consumed by the app — which is how `^[[B^[[A` ended up printed in the middle of a fetch progress line.\n * Anything a rendered screen waits on has to be awaited, not blocked on.\n */\nexport function spawnCaptureAsync(request: SpawnRequest): Promise<SpawnResult> {\n return new Promise((resolve) => {\n const child = spawn(request.command, [...request.args], {\n ...(request.cwd === undefined ? {} : { cwd: request.cwd }),\n ...(request.env === undefined ? {} : { env: request.env as NodeJS.ProcessEnv }),\n // Never inherit: a child that writes to the terminal would paint over the rendered frame, and\n // one that reads from it would steal the keys the app is listening for.\n // A pipe only when there is something to write. `ignore` otherwise, for the reason below.\n stdio: [request.input === undefined ? \"ignore\" : \"pipe\", \"pipe\", \"pipe\"],\n })\n if (request.input !== undefined) {\n // Ended immediately: a child reading stdin waits for EOF, so a pipe left open is a process\n // that never exits and a promise that never settles.\n child.stdin?.end(request.input)\n }\n let stdout = \"\"\n let stderr = \"\"\n let signalled = false\n const cap = request.maxBuffer ?? 32 * 1024 * 1024\n child.stdout?.on(\"data\", (chunk: Buffer) => {\n if (stdout.length < cap) stdout += chunk.toString(\"utf8\")\n })\n child.stderr?.on(\"data\", (chunk: Buffer) => {\n if (stderr.length < cap) stderr += chunk.toString(\"utf8\")\n })\n const timer =\n request.timeoutMs === undefined\n ? undefined\n : setTimeout(() => {\n signalled = true\n // The group, not the pid: `git clone` spawns helpers, and killing only the parent\n // leaves them running with nothing referencing them.\n child.kill(\"SIGTERM\")\n }, request.timeoutMs)\n child.on(\"error\", (error: NodeJS.ErrnoException) => {\n if (timer !== undefined) clearTimeout(timer)\n resolve({\n code: 1,\n stdout,\n stderr: error.message,\n signalled,\n notFound: error.code === \"ENOENT\",\n })\n })\n child.on(\"close\", (code, signal) => {\n if (timer !== undefined) clearTimeout(timer)\n resolve({\n code: code ?? 1,\n stdout,\n stderr,\n signalled: signalled || signal !== null,\n notFound: false,\n })\n })\n })\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAmBA,gBAAS,eAAO,2BA+BT,SAAS,EAAY,CAAC,EAAoC,CAC7D,IAAM,EAAS,EAAU,EAAQ,QAAS,CAAC,GAAG,EAAQ,IAAI,EAAG,CACzD,SAAU,UACN,EAAQ,QAAU,OAAY,CAAC,EAAI,CAAE,MAAO,EAAQ,KAAM,KAC1D,EAAQ,MAAQ,OAAY,CAAC,EAAI,CAAE,IAAK,EAAQ,GAAI,KACpD,EAAQ,MAAQ,OAAY,CAAC,EAAI,CAAE,IAAK,EAAQ,GAAyB,KACzE,EAAQ,YAAc,OAAY,CAAC,EAAI,CAAE,QAAS,EAAQ,SAAU,KACpE,EAAQ,YAAc,OAAY,CAAC,EAAI,CAAE,UAAW,EAAQ,SAAU,CAC9E,CAAC,EACK,EAAQ,EAAO,OAA6C,KAClE,MAAO,CACH,KAAM,EAAO,QAAU,EACvB,OAAQ,EAAO,QAAU,GACzB,OAAQ,EAAO,QAAU,GACzB,UAAW,EAAO,SAAW,KAC7B,SAAU,IAAS,QACvB,EAWG,SAAS,EAAiB,CAAC,EAA6C,CAC3E,OAAO,IAAI,QAAQ,CAAC,IAAY,CAC5B,IAAM,EAAQ,EAAM,EAAQ,QAAS,CAAC,GAAG,EAAQ,IAAI,EAAG,IAChD,EAAQ,MAAQ,OAAY,CAAC,EAAI,CAAE,IAAK,EAAQ,GAAI,KACpD,EAAQ,MAAQ,OAAY,CAAC,EAAI,CAAE,IAAK,EAAQ,GAAyB,EAI7E,MAAO,CAAC,EAAQ,QAAU,OAAY,SAAW,OAAQ,OAAQ,MAAM,CAC3E,CAAC,EACD,GAAI,EAAQ,QAAU,OAGlB,EAAM,OAAO,IAAI,EAAQ,KAAK,EAElC,IAAI,EAAS,GACT,EAAS,GACT,EAAY,GACV,EAAM,EAAQ,WAAa,SACjC,EAAM,QAAQ,GAAG,OAAQ,CAAC,IAAkB,CACxC,GAAI,EAAO,OAAS,EAAK,GAAU,EAAM,SAAS,MAAM,EAC3D,EACD,EAAM,QAAQ,GAAG,OAAQ,CAAC,IAAkB,CACxC,GAAI,EAAO,OAAS,EAAK,GAAU,EAAM,SAAS,MAAM,EAC3D,EACD,IAAM,EACF,EAAQ,YAAc,OAChB,OACA,WAAW,IAAM,CACb,EAAY,GAGZ,EAAM,KAAK,SAAS,GACrB,EAAQ,SAAS,EAC9B,EAAM,GAAG,QAAS,CAAC,IAAiC,CAChD,GAAI,IAAU,OAAW,aAAa,CAAK,EAC3C,EAAQ,CACJ,KAAM,EACN,SACA,OAAQ,EAAM,QACd,YACA,SAAU,EAAM,OAAS,QAC7B,CAAC,EACJ,EACD,EAAM,GAAG,QAAS,CAAC,EAAM,IAAW,CAChC,GAAI,IAAU,OAAW,aAAa,CAAK,EAC3C,EAAQ,CACJ,KAAM,GAAQ,EACd,SACA,SACA,UAAW,GAAa,IAAW,KACnC,SAAU,EACd,CAAC,EACJ,EACJ",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "126256B17175C65564756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
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 $o(n){return r(n(6))}function xi(n){return new RegExp("^local:[0123456789abcdefghjkmnpqrstvwxyz]{6}$").test(n)}
|
|
3
|
+
export{$o,xi};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=4CEEABA2773BBC1264756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-9xhresrg.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": "4CEEABA2773BBC1264756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|