dispach 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/README.md +29 -25
  2. package/dist/APEv2Parser-x13n424p.js +5 -0
  3. package/dist/{FlacParser-drm5wq0p.js.map → APEv2Parser-x13n424p.js.map} +1 -1
  4. package/dist/{AiffParser-9hj6fpmy.js → AiffParser-ns1y9f0g.js} +3 -3
  5. package/dist/{AiffParser-9hj6fpmy.js.map → AiffParser-ns1y9f0g.js.map} +1 -1
  6. package/dist/App-wkpkwgjt.js +11 -0
  7. package/dist/{App-2f72vhjv.js.map → App-wkpkwgjt.js.map} +1 -1
  8. package/dist/AsfParser-bae2a1yf.js +5 -0
  9. package/dist/{AsfParser-7emspn04.js.map → AsfParser-bae2a1yf.js.map} +1 -1
  10. package/dist/ConfigEditor-hy9jtas3.js +6 -0
  11. package/dist/{ConfigEditor-vk7vxaa6.js.map → ConfigEditor-hy9jtas3.js.map} +1 -1
  12. package/dist/DsdiffParser-s0zvxnfa.js +5 -0
  13. package/dist/{DsdiffParser-dz88pnnr.js.map → DsdiffParser-s0zvxnfa.js.map} +1 -1
  14. package/dist/{DsfParser-qgh63tbs.js → DsfParser-90mvzt4v.js} +3 -3
  15. package/dist/{DsfParser-qgh63tbs.js.map → DsfParser-90mvzt4v.js.map} +1 -1
  16. package/dist/FlacParser-8xprykrh.js +5 -0
  17. package/dist/{APEv2Parser-ysjr6adv.js.map → FlacParser-8xprykrh.js.map} +1 -1
  18. package/dist/{KeyProbe-5anphmb7.js → KeyProbe-fk5krzks.js} +3 -3
  19. package/dist/{KeyProbe-5anphmb7.js.map → KeyProbe-fk5krzks.js.map} +1 -1
  20. package/dist/MP4Parser-nmvbkq21.js +5 -0
  21. package/dist/{MP4Parser-yr7p3z12.js.map → MP4Parser-nmvbkq21.js.map} +2 -2
  22. package/dist/{MatroskaParser-jkbsbsk3.js → MatroskaParser-tsmz2qfq.js} +3 -3
  23. package/dist/{MatroskaParser-jkbsbsk3.js.map → MatroskaParser-tsmz2qfq.js.map} +1 -1
  24. package/dist/{MpegParser-t93vwnew.js → MpegParser-y5fjpaz9.js} +3 -3
  25. package/dist/{MpegParser-t93vwnew.js.map → MpegParser-y5fjpaz9.js.map} +1 -1
  26. package/dist/MusepackParser-544q0byg.js +5 -0
  27. package/dist/{MusepackParser-6e8kbh2d.js.map → MusepackParser-544q0byg.js.map} +2 -2
  28. package/dist/OggParser-v77rbjnt.js +5 -0
  29. package/dist/{OggParser-ggcypmag.js.map → OggParser-v77rbjnt.js.map} +1 -1
  30. package/dist/Picker-32m79nmp.js +5 -0
  31. package/dist/{Picker-j7txnm7w.js.map → Picker-32m79nmp.js.map} +1 -1
  32. package/dist/SessionPicker-9p06npt5.js +5 -0
  33. package/dist/{SessionPicker-hpv2ncsb.js.map → SessionPicker-9p06npt5.js.map} +1 -1
  34. package/dist/SkillBrowser-ezdx3xsh.js +5 -0
  35. package/dist/{SkillBrowser-qc542n71.js.map → SkillBrowser-ezdx3xsh.js.map} +1 -1
  36. package/dist/WavPackParser-k623m0hk.js +5 -0
  37. package/dist/{WavPackParser-jw9stzqp.js.map → WavPackParser-k623m0hk.js.map} +1 -1
  38. package/dist/WaveParser-nj4p1vx8.js +5 -0
  39. package/dist/{WaveParser-epmncs9w.js.map → WaveParser-nj4p1vx8.js.map} +1 -1
  40. package/dist/WizardApp-p350qspw.js +5 -0
  41. package/dist/{WizardApp-pgzcz9zq.js.map → WizardApp-p350qspw.js.map} +1 -1
  42. package/dist/channels-a9zx9yba.js +31 -0
  43. package/dist/{channels-m8nambmm.js.map → channels-a9zx9yba.js.map} +1 -1
  44. package/dist/config-3mz4zwsf.js +24 -0
  45. package/dist/{config-hmgrqgf2.js.map → config-3mz4zwsf.js.map} +2 -2
  46. package/dist/credential-ja7zmd4c.js +19 -0
  47. package/dist/{credential-nkb2ya59.js.map → credential-ja7zmd4c.js.map} +1 -1
  48. package/dist/index-039ew35r.js +6 -0
  49. package/dist/index-039ew35r.js.map +10 -0
  50. package/dist/index-0dvs3a06.js +6 -0
  51. package/dist/{index-jc4kmfwa.js.map → index-0dvs3a06.js.map} +1 -1
  52. package/dist/{index-pszmnhgq.js → index-1cagdzqe.js} +9 -9
  53. package/dist/{index-pszmnhgq.js.map → index-1cagdzqe.js.map} +1 -1
  54. package/dist/index-2fw9e5gg.js +6 -0
  55. package/dist/{index-0444sh6x.js.map → index-2fw9e5gg.js.map} +1 -1
  56. package/dist/{index-hgm2gchq.js → index-2td5h856.js} +12 -12
  57. package/dist/{index-hgm2gchq.js.map → index-2td5h856.js.map} +1 -1
  58. package/dist/{index-m6fqx0ch.js → index-446exxcb.js} +7 -7
  59. package/dist/{index-m6fqx0ch.js.map → index-446exxcb.js.map} +1 -1
  60. package/dist/{index-snz49ndn.js → index-4fajxhdv.js} +4 -4
  61. package/dist/{index-snz49ndn.js.map → index-4fajxhdv.js.map} +1 -1
  62. package/dist/index-4j65jp20.js +9 -0
  63. package/dist/{index-38gs9anh.js.map → index-4j65jp20.js.map} +1 -1
  64. package/dist/index-5gn74n56.js +10 -0
  65. package/dist/{index-22fzzn7z.js.map → index-5gn74n56.js.map} +2 -2
  66. package/dist/index-5zpfz4kb.js +9 -0
  67. package/dist/{index-eztfverw.js.map → index-5zpfz4kb.js.map} +1 -1
  68. package/dist/index-60h4knj6.js +126 -0
  69. package/dist/{index-ry6a4bqh.js.map → index-60h4knj6.js.map} +2 -2
  70. package/dist/index-635wcsh1.js +5 -0
  71. package/dist/{index-2bsardvh.js.map → index-635wcsh1.js.map} +1 -1
  72. package/dist/{index-k8e9f466.js → index-67sfck4d.js} +19 -19
  73. package/dist/index-67sfck4d.js.map +13 -0
  74. package/dist/index-7p8d1gf0.js +63 -0
  75. package/dist/{index-ytxbw8py.js.map → index-7p8d1gf0.js.map} +1 -1
  76. package/dist/index-7zgjkbb0.js +5 -0
  77. package/dist/{index-qgsdgbk8.js.map → index-7zgjkbb0.js.map} +1 -1
  78. package/dist/{index-zw6wyas6.js → index-86rb86nr.js} +4 -4
  79. package/dist/{index-zw6wyas6.js.map → index-86rb86nr.js.map} +1 -1
  80. package/dist/{index-fbsrhcga.js → index-8jejze0z.js} +4 -4
  81. package/dist/{index-fbsrhcga.js.map → index-8jejze0z.js.map} +1 -1
  82. package/dist/index-8k8y7edx.js +7 -0
  83. package/dist/{index-3826kf9t.js.map → index-8k8y7edx.js.map} +1 -1
  84. package/dist/index-8mkatm20.js +6 -0
  85. package/dist/{index-42e29zs4.js.map → index-8mkatm20.js.map} +1 -1
  86. package/dist/{index-3vzf253k.js → index-9k6qa50r.js} +7 -7
  87. package/dist/{index-3vzf253k.js.map → index-9k6qa50r.js.map} +1 -1
  88. package/dist/{index-yw3fby4n.js → index-a1axc952.js} +4 -4
  89. package/dist/{index-yw3fby4n.js.map → index-a1axc952.js.map} +1 -1
  90. package/dist/index-ayhdn87b.js +6 -0
  91. package/dist/{index-dzy19wtf.js.map → index-ayhdn87b.js.map} +1 -1
  92. package/dist/index-b8bfzbfe.js +6 -0
  93. package/dist/{index-836hc2h1.js.map → index-b8bfzbfe.js.map} +2 -2
  94. package/dist/index-brh25jhq.js +6 -0
  95. package/dist/{index-hrwakb11.js.map → index-brh25jhq.js.map} +2 -2
  96. package/dist/index-c6qrcweh.js +6 -0
  97. package/dist/{index-nxhqf597.js.map → index-c6qrcweh.js.map} +1 -1
  98. package/dist/index-cb45233h.js +6 -0
  99. package/dist/{index-nvc24414.js.map → index-cb45233h.js.map} +1 -1
  100. package/dist/{index-51x0n5z0.js → index-dcy14zdn.js} +5 -5
  101. package/dist/{index-51x0n5z0.js.map → index-dcy14zdn.js.map} +1 -1
  102. package/dist/index-f6r3h2yh.js +8 -0
  103. package/dist/{index-9t4dz145.js.map → index-f6r3h2yh.js.map} +1 -1
  104. package/dist/index-gezqawvw.js +11 -0
  105. package/dist/{index-sh44ymqz.js.map → index-gezqawvw.js.map} +1 -1
  106. package/dist/{index-1mbdz3f7.js → index-h787rq0h.js} +10 -10
  107. package/dist/{index-1mbdz3f7.js.map → index-h787rq0h.js.map} +1 -1
  108. package/dist/index-hd5nkwd7.js +74 -0
  109. package/dist/{index-djeqvfms.js.map → index-hd5nkwd7.js.map} +5 -5
  110. package/dist/index-k6wq0j4q.js +6 -0
  111. package/dist/{index-mjfv7k5w.js.map → index-k6wq0j4q.js.map} +1 -1
  112. package/dist/index-kz01jz58.js +6 -0
  113. package/dist/{index-323jvr1g.js.map → index-kz01jz58.js.map} +1 -1
  114. package/dist/{index-dv9pdjy4.js → index-mgef1n4e.js} +10 -10
  115. package/dist/{index-dv9pdjy4.js.map → index-mgef1n4e.js.map} +1 -1
  116. package/dist/{index-fxpmx6cr.js → index-n197qdw1.js} +191 -191
  117. package/dist/{index-fxpmx6cr.js.map → index-n197qdw1.js.map} +3 -3
  118. package/dist/index-nndwx2wp.js +153 -0
  119. package/dist/{index-dpcm1j62.js.map → index-nndwx2wp.js.map} +2 -2
  120. package/dist/index-pz92ksp8.js +5 -0
  121. package/dist/{index-3c5jt6by.js.map → index-pz92ksp8.js.map} +1 -1
  122. package/dist/index-qj4adnfe.js +14 -0
  123. package/dist/{index-y7dxq4a4.js.map → index-qj4adnfe.js.map} +2 -2
  124. package/dist/index-r83jpct7.js +6 -0
  125. package/dist/{index-xg7s813b.js.map → index-r83jpct7.js.map} +2 -2
  126. package/dist/{index-2zjh5zd5.js → index-rqfwd7j5.js} +4 -4
  127. package/dist/{index-2zjh5zd5.js.map → index-rqfwd7j5.js.map} +1 -1
  128. package/dist/index-s0f0s6n5.js +6 -0
  129. package/dist/{index-pqw1n1pv.js.map → index-s0f0s6n5.js.map} +1 -1
  130. package/dist/index-s0t15ndj.js +6 -0
  131. package/dist/{index-8edck2pr.js.map → index-s0t15ndj.js.map} +1 -1
  132. package/dist/index-tc054tcb.js +6 -0
  133. package/dist/{index-8tmv33mr.js.map → index-tc054tcb.js.map} +1 -1
  134. package/dist/{index-095hrkyr.js → index-ts8a1sdn.js} +6 -6
  135. package/dist/{index-095hrkyr.js.map → index-ts8a1sdn.js.map} +1 -1
  136. package/dist/index-tv52jhac.js +1252 -0
  137. package/dist/{index-hpvfqq6r.js.map → index-tv52jhac.js.map} +3 -3
  138. package/dist/index-x9nn57kk.js +6 -0
  139. package/dist/{index-1x8mzvz7.js.map → index-x9nn57kk.js.map} +1 -1
  140. package/dist/{index-308y9xt0.js → index-xyh98x7p.js} +4 -4
  141. package/dist/{index-308y9xt0.js.map → index-xyh98x7p.js.map} +1 -1
  142. package/dist/{index-jff5q27j.js → index-yy4v9kca.js} +4 -4
  143. package/dist/{index-jff5q27j.js.map → index-yy4v9kca.js.map} +1 -1
  144. package/dist/{index-bqdkm3de.js → index-yz0fcxky.js} +4 -4
  145. package/dist/{index-bqdkm3de.js.map → index-yz0fcxky.js.map} +1 -1
  146. package/dist/{index-p6ya59m6.js → index-z4adxmzm.js} +5 -5
  147. package/dist/{index-p6ya59m6.js.map → index-z4adxmzm.js.map} +1 -1
  148. package/dist/{index-4fj1k64j.js → index-zzpgsbn3.js} +4 -4
  149. package/dist/{index-4fj1k64j.js.map → index-zzpgsbn3.js.map} +1 -1
  150. package/dist/index.js +345 -345
  151. package/dist/index.js.map +4 -4
  152. package/dist/web-7mdrcb8a.js +14 -0
  153. package/dist/{web-gfv0mzgs.js.map → web-7mdrcb8a.js.map} +1 -1
  154. package/dist/wrapper-4hdmdwft.js +5 -0
  155. package/dist/{wrapper-f662ny3r.js.map → wrapper-4hdmdwft.js.map} +1 -1
  156. package/package.json +1 -1
  157. package/dist/APEv2Parser-ysjr6adv.js +0 -5
  158. package/dist/App-2f72vhjv.js +0 -11
  159. package/dist/AsfParser-7emspn04.js +0 -5
  160. package/dist/ConfigEditor-vk7vxaa6.js +0 -6
  161. package/dist/DsdiffParser-dz88pnnr.js +0 -5
  162. package/dist/FlacParser-drm5wq0p.js +0 -5
  163. package/dist/MP4Parser-yr7p3z12.js +0 -5
  164. package/dist/MusepackParser-6e8kbh2d.js +0 -5
  165. package/dist/OggParser-ggcypmag.js +0 -5
  166. package/dist/Picker-j7txnm7w.js +0 -5
  167. package/dist/SessionPicker-hpv2ncsb.js +0 -5
  168. package/dist/SkillBrowser-qc542n71.js +0 -5
  169. package/dist/WavPackParser-jw9stzqp.js +0 -5
  170. package/dist/WaveParser-epmncs9w.js +0 -5
  171. package/dist/WizardApp-pgzcz9zq.js +0 -5
  172. package/dist/channels-m8nambmm.js +0 -31
  173. package/dist/config-hmgrqgf2.js +0 -24
  174. package/dist/credential-nkb2ya59.js +0 -19
  175. package/dist/index-0444sh6x.js +0 -6
  176. package/dist/index-1x8mzvz7.js +0 -6
  177. package/dist/index-22fzzn7z.js +0 -10
  178. package/dist/index-2bsardvh.js +0 -5
  179. package/dist/index-323jvr1g.js +0 -6
  180. package/dist/index-3826kf9t.js +0 -7
  181. package/dist/index-38gs9anh.js +0 -9
  182. package/dist/index-3c5jt6by.js +0 -5
  183. package/dist/index-42e29zs4.js +0 -6
  184. package/dist/index-836hc2h1.js +0 -6
  185. package/dist/index-8edck2pr.js +0 -6
  186. package/dist/index-8tmv33mr.js +0 -6
  187. package/dist/index-9t4dz145.js +0 -8
  188. package/dist/index-djeqvfms.js +0 -74
  189. package/dist/index-dpcm1j62.js +0 -153
  190. package/dist/index-dzy19wtf.js +0 -6
  191. package/dist/index-eztfverw.js +0 -9
  192. package/dist/index-hpvfqq6r.js +0 -1252
  193. package/dist/index-hrwakb11.js +0 -6
  194. package/dist/index-jc4kmfwa.js +0 -6
  195. package/dist/index-k8e9f466.js.map +0 -13
  196. package/dist/index-mjfv7k5w.js +0 -6
  197. package/dist/index-nvc24414.js +0 -6
  198. package/dist/index-nxhqf597.js +0 -6
  199. package/dist/index-pqw1n1pv.js +0 -6
  200. package/dist/index-qgsdgbk8.js +0 -5
  201. package/dist/index-qv6ktepc.js +0 -6
  202. package/dist/index-qv6ktepc.js.map +0 -10
  203. package/dist/index-ry6a4bqh.js +0 -126
  204. package/dist/index-sh44ymqz.js +0 -11
  205. package/dist/index-xg7s813b.js +0 -6
  206. package/dist/index-y7dxq4a4.js +0 -14
  207. package/dist/index-ytxbw8py.js +0 -63
  208. package/dist/web-gfv0mzgs.js +0 -14
  209. package/dist/wrapper-f662ny3r.js +0 -5
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import{createInterface as w}from"node:readline";async function MA(u,o={}){let e=o.input??process.stdin,r=o.output??process.stdout;if(e.isTTY!==!0)return!1;let i=w({input:e,output:r});try{let s=await new Promise((t)=>{i.question(`
3
- ${u} [y/N] `,t)});return/^y(es)?$/i.test(s.trim())}finally{i.close()}}async function ts(u,o,e={}){let r=e.input??process.stdin,i=e.output??process.stdout;if(r.isTTY!==!0)return!1;let s=w({input:r,output:i});try{return(await new Promise((a)=>{s.question(`
4
- ${u} `,a)})).trim()===o}finally{s.close()}}async function Zn(u,o={}){let e=o.input??process.stdin,r=o.output??process.stdout;if(e.isTTY!==!0)return;r.write(`
2
+ import{createInterface as w}from"node:readline";async function TA(u,o={}){let e=o.input??process.stdin,r=o.output??process.stdout;if(e.isTTY!==!0)return!1;let i=w({input:e,output:r});try{let s=await new Promise((t)=>{i.question(`
3
+ ${u} [y/N] `,t)});return/^y(es)?$/i.test(s.trim())}finally{i.close()}}async function As(u,o,e={}){let r=e.input??process.stdin,i=e.output??process.stdout;if(r.isTTY!==!0)return!1;let s=w({input:r,output:i});try{return(await new Promise((a)=>{s.question(`
4
+ ${u} `,a)})).trim()===o}finally{s.close()}}async function $n(u,o={}){let e=o.input??process.stdin,r=o.output??process.stdout;if(e.isTTY!==!0)return;r.write(`
5
5
  ${u} `);let i=typeof e.setRawMode==="function";if(i)e.setRawMode?.(!0);e.resume?.();try{return await new Promise((s)=>{let t="",a=!1,d=!1,l=(f)=>{e.removeListener("data",p),r.write(`
6
6
  `),s(f)},p=(f)=>{let m=typeof f==="string"?f:f.toString("utf8");for(let c of m){let n=c.charCodeAt(0);if(d){if(n>=64&&n<=126)d=!1;continue}if(a){if(a=!1,c==="["||c==="O")d=!0;continue}if(n===27){a=!0;continue}if(n===13||n===10)return l(t);if(n===3)return l(void 0);if(n===4)return l(t===""?void 0:t);if(n===127||n===8){if(t.length>0)t=t.slice(0,-1),r.write("\b \b");continue}if(n<32)continue;t+=c,r.write("*")}};e.on("data",p)})}finally{if(i)e.setRawMode?.(!1)}}
7
- export{MA,ts,Zn};
7
+ export{TA,As,$n};
8
8
 
9
- //# debugId=53D6C51D513B5AF964756E2164756E21
10
- //# sourceMappingURL=index-095hrkyr.js.map
9
+ //# debugId=DFA1A365894E870364756E2164756E21
10
+ //# sourceMappingURL=index-ts8a1sdn.js.map
@@ -5,6 +5,6 @@
5
5
  "/**\n * A yes/no question on the plain path.\n *\n * One question, one place. The wizard has its own confirm *screen* under Ink and the picker has a\n * selection; what was missing was the shape a single command needs before doing something outside its\n * own workspace — and the only current caller, `terminal-setup`, is the only command that does that.\n *\n * **Not a TTY means no.** A piped or CI run cannot answer, so the safe answer is the one that changes\n * nothing — and the caller reports that nothing was written rather than treating it as a failure.\n * Defaulting to yes here would make a redirected invocation edit somebody's editor keybindings, which is\n * the kind of surprise that is only discovered later.\n *\n * Deliberately not a general prompt library. A second kind of question can have a second function; a\n * configurable one would grow options nobody needs and hide the TTY rule above inside them. There are\n * three now — `askExactly` is a different bar, and `askSecret` is a different *channel*, because a\n * value that must not be echoed cannot go through readline at all.\n */\n\nimport { createInterface } from \"node:readline\"\n\nexport interface ConfirmOptions {\n /** Injected by tests. The process streams otherwise. */\n readonly input?: NodeJS.ReadableStream & { isTTY?: boolean }\n readonly output?: NodeJS.WritableStream\n}\n\nexport async function askYesNo(question: string, options: ConfirmOptions = {}): Promise<boolean> {\n const input = options.input ?? process.stdin\n const output = options.output ?? process.stdout\n if (input.isTTY !== true) return false\n\n const rl = createInterface({ input, output })\n try {\n const answer = await new Promise<string>((resolve) => {\n rl.question(`\\n${question} [y/N] `, resolve)\n })\n return /^y(es)?$/i.test(answer.trim())\n } finally {\n // Always closed: a readline left open holds the event loop and the process never exits.\n rl.close()\n }\n}\n\n/**\n * A question answered only by typing something back exactly.\n *\n * The bar for an irreversible, multi-part deletion. `askYesNo` is one keypress, which is right for\n * \"shall I edit your keybindings\" and too cheap for \"delete this agent, its conversations and its\n * memory\" — a stray `y` against the wrong listing is a mistake with nothing to undo it, and the whole\n * point of showing the listing first is that somebody reads it. Typing the name is what proves they did.\n *\n * Compared after trimming and nothing else. Case is **not** folded: an agent's ref is the name of a\n * directory, so `Milo` and `milo` are two different agents on a case-sensitive filesystem, and\n * accepting either here would accept the wrong one somewhere else.\n *\n * Not a TTY means no, for the reason `askYesNo` has it: a piped or CI run cannot answer, and the safe\n * answer is the one that changes nothing. The caller reports that nothing was deleted, and `--yes` is\n * how a script says it meant it.\n */\nexport async function askExactly(\n question: string,\n expected: string,\n options: ConfirmOptions = {},\n): Promise<boolean> {\n const input = options.input ?? process.stdin\n const output = options.output ?? process.stdout\n if (input.isTTY !== true) return false\n\n const rl = createInterface({ input, output })\n try {\n const answer = await new Promise<string>((resolve) => {\n rl.question(`\\n${question} `, resolve)\n })\n return answer.trim() === expected\n } finally {\n rl.close()\n }\n}\n\n/**\n * A value typed at a prompt and never echoed. `undefined` means cancelled or unavailable.\n *\n * ## Why this is not readline\n *\n * readline echoes what it reads, and the documented way to stop it is to overwrite a private method on\n * the interface — which needs a cast this codebase does not allow. Reading the bytes is a dozen more\n * lines and it is the honest version: raw mode on, one `*` written per character, raw mode off in a\n * `finally` so a thrown error cannot leave the terminal unable to echo anything the person types next.\n *\n * ## Why a secret never comes from an argument\n *\n * The alternative was `--value`, and it puts the secret in two places nobody intends: the shell's\n * history file, and `ps` output, where every local process can read it for the lifetime of the call.\n * That is the same exposure `renderPlist` throws to prevent — launchd echoes a job's environment in\n * plaintext, so a plist carries no secret — and the reasoning does not change because the process is\n * short-lived. Not a TTY returns `undefined` rather than reading a pipe, so a CI run is *told* that\n * nothing was written instead of a secret arriving from somewhere the caller did not audit.\n *\n * ^C cancels and ^D on an empty line cancels; both return `undefined`, and the caller reports that\n * nothing changed. Backspace is honoured because a mistyped key in a value you cannot see is otherwise\n * unrecoverable without starting the command again.\n */\n/**\n * The narrow surface `askSecret` touches, rather than a widened `ConfirmOptions.input`.\n *\n * `process.stdin`'s declared `on` is a union of overloads, and intersecting that with an object type\n * makes it uncallable — the compiler cannot pick a signature. Declaring only what is used and asserting\n * the real stream against it once keeps the check where it is useful: anything else this function\n * reached for would be a type error here rather than a runtime surprise.\n */\nexport interface SecretInput {\n readonly isTTY?: boolean\n setRawMode?: (mode: boolean) => unknown\n resume?: () => unknown\n on(event: \"data\", listener: (chunk: Buffer | string) => void): unknown\n removeListener(event: \"data\", listener: (chunk: Buffer | string) => void): unknown\n}\n\nexport interface SecretOptions {\n readonly input?: SecretInput\n readonly output?: NodeJS.WritableStream\n}\n\nexport async function askSecret(\n question: string,\n options: SecretOptions = {},\n): Promise<string | undefined> {\n const input = options.input ?? (process.stdin as unknown as SecretInput)\n const output = options.output ?? process.stdout\n if (input.isTTY !== true) return undefined\n\n output.write(`\\n${question} `)\n const raw = typeof input.setRawMode === \"function\"\n if (raw) input.setRawMode?.(true)\n input.resume?.()\n\n try {\n return await new Promise<string | undefined>((resolve) => {\n let value = \"\"\n // Escape-sequence state. Dropping only the escape *byte* left `[A` in the value for an\n // arrow key — two characters of junk in a string nobody can see, which is worse than three\n // because it looks like nothing happened. CSI runs until a byte in 0x40–0x7e ends it.\n let escaped = false\n let csi = false\n const finish = (result: string | undefined) => {\n input.removeListener(\"data\", onData)\n output.write(\"\\n\")\n resolve(result)\n }\n const onData = (chunk: Buffer | string) => {\n const text = typeof chunk === \"string\" ? chunk : chunk.toString(\"utf8\")\n for (const char of text) {\n const code = char.charCodeAt(0)\n if (csi) {\n // The final byte of a CSI sequence, and the end of it.\n if (code >= 0x40 && code <= 0x7e) csi = false\n continue\n }\n if (escaped) {\n escaped = false\n // `[` opens CSI and `O` opens SS3, which is how some terminals send arrows.\n if (char === \"[\" || char === \"O\") csi = true\n continue\n }\n if (code === 27) {\n escaped = true\n continue\n }\n if (code === 13 || code === 10) return finish(value)\n // ^C always cancels; ^D cancels only an empty line, so it cannot silently\n // truncate a value somebody was halfway through typing.\n if (code === 3) return finish(undefined)\n if (code === 4) return finish(value === \"\" ? undefined : value)\n if (code === 127 || code === 8) {\n if (value.length > 0) {\n value = value.slice(0, -1)\n output.write(\"\\b \\b\")\n }\n continue\n }\n // Any remaining control byte is a chord, and a secret has none in it.\n if (code < 32) continue\n value += char\n output.write(\"*\")\n }\n }\n input.on(\"data\", onData)\n })\n } finally {\n // Always restored. A thrown error that left raw mode on would leave the shell that follows\n // unable to echo anything at all, which reads as a hung terminal rather than a failed command.\n if (raw) input.setRawMode?.(false)\n }\n}\n"
6
6
  ],
7
7
  "mappings": ";AAkBA,0BAAS,sBAQF,eAAe,EAAQ,CAAC,EAAkB,EAA0B,CAAC,EAAqB,CAC7F,IAAM,EAAQ,EAAQ,OAAS,QAAQ,MACjC,EAAS,EAAQ,QAAU,QAAQ,OACzC,GAAI,EAAM,QAAU,GAAM,MAAO,GAEjC,IAAM,EAAK,EAAgB,CAAE,QAAO,QAAO,CAAC,EAC5C,GAAI,CACA,IAAM,EAAS,MAAM,IAAI,QAAgB,CAAC,IAAY,CAClD,EAAG,SAAS;AAAA,EAAK,WAAmB,CAAO,EAC9C,EACD,MAAO,YAAY,KAAK,EAAO,KAAK,CAAC,EACvC,OAAQ,CAEN,EAAG,MAAM,GAoBV,eAAe,EAAU,CAC5B,EACA,EACA,EAA0B,CAAC,EACX,CAChB,IAAM,EAAQ,EAAQ,OAAS,QAAQ,MACjC,EAAS,EAAQ,QAAU,QAAQ,OACzC,GAAI,EAAM,QAAU,GAAM,MAAO,GAEjC,IAAM,EAAK,EAAgB,CAAE,QAAO,QAAO,CAAC,EAC5C,GAAI,CAIA,OAHe,MAAM,IAAI,QAAgB,CAAC,IAAY,CAClD,EAAG,SAAS;AAAA,EAAK,KAAa,CAAO,EACxC,GACa,KAAK,IAAM,EAC3B,OAAQ,CACN,EAAG,MAAM,GAgDV,eAAe,EAAS,CAC3B,EACA,EAAyB,CAAC,EACC,CAC3B,IAAM,EAAQ,EAAQ,OAAU,QAAQ,MAClC,EAAS,EAAQ,QAAU,QAAQ,OACzC,GAAI,EAAM,QAAU,GAAM,OAE1B,EAAO,MAAM;AAAA,EAAK,IAAW,EAC7B,IAAM,EAAM,OAAO,EAAM,aAAe,WACxC,GAAI,EAAK,EAAM,aAAa,EAAI,EAChC,EAAM,SAAS,EAEf,GAAI,CACA,OAAO,MAAM,IAAI,QAA4B,CAAC,IAAY,CACtD,IAAI,EAAQ,GAIR,EAAU,GACV,EAAM,GACJ,EAAS,CAAC,IAA+B,CAC3C,EAAM,eAAe,OAAQ,CAAM,EACnC,EAAO,MAAM;AAAA,CAAI,EACjB,EAAQ,CAAM,GAEZ,EAAS,CAAC,IAA2B,CACvC,IAAM,EAAO,OAAO,IAAU,SAAW,EAAQ,EAAM,SAAS,MAAM,EACtE,QAAW,KAAQ,EAAM,CACrB,IAAM,EAAO,EAAK,WAAW,CAAC,EAC9B,GAAI,EAAK,CAEL,GAAI,GAAQ,IAAQ,GAAQ,IAAM,EAAM,GACxC,SAEJ,GAAI,EAAS,CAGT,GAFA,EAAU,GAEN,IAAS,KAAO,IAAS,IAAK,EAAM,GACxC,SAEJ,GAAI,IAAS,GAAI,CACb,EAAU,GACV,SAEJ,GAAI,IAAS,IAAM,IAAS,GAAI,OAAO,EAAO,CAAK,EAGnD,GAAI,IAAS,EAAG,OAAO,EAAO,MAAS,EACvC,GAAI,IAAS,EAAG,OAAO,EAAO,IAAU,GAAK,OAAY,CAAK,EAC9D,GAAI,IAAS,KAAO,IAAS,EAAG,CAC5B,GAAI,EAAM,OAAS,EACf,EAAQ,EAAM,MAAM,EAAG,EAAE,EACzB,EAAO,MAAM,OAAO,EAExB,SAGJ,GAAI,EAAO,GAAI,SACf,GAAS,EACT,EAAO,MAAM,GAAG,IAGxB,EAAM,GAAG,OAAQ,CAAM,EAC1B,EACH,OAAQ,CAGN,GAAI,EAAK,EAAM,aAAa,EAAK",
8
- "debugId": "53D6C51D513B5AF964756E2164756E21",
8
+ "debugId": "DFA1A365894E870364756E2164756E21",
9
9
  "names": []
10
10
  }