dispach 0.2.3 → 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.
Files changed (219) hide show
  1. package/README.md +46 -43
  2. package/dist/APEv2Parser-rt8hyadd.js +5 -0
  3. package/dist/{AiffParser-9hj6fpmy.js → AiffParser-gvpmtb2e.js} +3 -3
  4. package/dist/{AiffParser-9hj6fpmy.js.map → AiffParser-gvpmtb2e.js.map} +1 -1
  5. package/dist/App-18dvbyev.js +11 -0
  6. package/dist/{App-2f72vhjv.js.map → App-18dvbyev.js.map} +1 -1
  7. package/dist/AsfParser-h9zyh6cx.js +5 -0
  8. package/dist/{AsfParser-7emspn04.js.map → AsfParser-h9zyh6cx.js.map} +1 -1
  9. package/dist/ConfigEditor-444m13ta.js +6 -0
  10. package/dist/{ConfigEditor-vk7vxaa6.js.map → ConfigEditor-444m13ta.js.map} +1 -1
  11. package/dist/DsdiffParser-gxqv4gn1.js +5 -0
  12. package/dist/{DsdiffParser-dz88pnnr.js.map → DsdiffParser-gxqv4gn1.js.map} +1 -1
  13. package/dist/{DsfParser-qgh63tbs.js → DsfParser-sndt4jbk.js} +3 -3
  14. package/dist/{DsfParser-qgh63tbs.js.map → DsfParser-sndt4jbk.js.map} +1 -1
  15. package/dist/FlacParser-rmkpvf9e.js +5 -0
  16. package/dist/{KeyProbe-5anphmb7.js → KeyProbe-6t531sy6.js} +3 -3
  17. package/dist/{KeyProbe-5anphmb7.js.map → KeyProbe-6t531sy6.js.map} +1 -1
  18. package/dist/MP4Parser-87xfsck4.js +5 -0
  19. package/dist/{MP4Parser-yr7p3z12.js.map → MP4Parser-87xfsck4.js.map} +2 -2
  20. package/dist/{MatroskaParser-jkbsbsk3.js → MatroskaParser-7krspfgx.js} +3 -3
  21. package/dist/{MatroskaParser-jkbsbsk3.js.map → MatroskaParser-7krspfgx.js.map} +1 -1
  22. package/dist/{MpegParser-t93vwnew.js → MpegParser-jcs35q0h.js} +3 -3
  23. package/dist/{MpegParser-t93vwnew.js.map → MpegParser-jcs35q0h.js.map} +1 -1
  24. package/dist/MusepackParser-d4zfnzk3.js +5 -0
  25. package/dist/{MusepackParser-6e8kbh2d.js.map → MusepackParser-d4zfnzk3.js.map} +2 -2
  26. package/dist/OggParser-fbspjs7v.js +5 -0
  27. package/dist/{OggParser-ggcypmag.js.map → OggParser-fbspjs7v.js.map} +1 -1
  28. package/dist/Picker-x6aj42tc.js +5 -0
  29. package/dist/{Picker-j7txnm7w.js.map → Picker-x6aj42tc.js.map} +1 -1
  30. package/dist/SessionPicker-pngdv97x.js +5 -0
  31. package/dist/{SessionPicker-hpv2ncsb.js.map → SessionPicker-pngdv97x.js.map} +1 -1
  32. package/dist/SkillBrowser-3mnzkakr.js +5 -0
  33. package/dist/{SkillBrowser-qc542n71.js.map → SkillBrowser-3mnzkakr.js.map} +1 -1
  34. package/dist/WavPackParser-0x9z4466.js +5 -0
  35. package/dist/{WavPackParser-jw9stzqp.js.map → WavPackParser-0x9z4466.js.map} +1 -1
  36. package/dist/WaveParser-31b6qtef.js +5 -0
  37. package/dist/{WaveParser-epmncs9w.js.map → WaveParser-31b6qtef.js.map} +1 -1
  38. package/dist/WizardApp-c42wc116.js +5 -0
  39. package/dist/{WizardApp-pgzcz9zq.js.map → WizardApp-c42wc116.js.map} +1 -1
  40. package/dist/channels-nf6d8fvx.js +31 -0
  41. package/dist/{channels-m8nambmm.js.map → channels-nf6d8fvx.js.map} +1 -1
  42. package/dist/client.d.ts +1 -1
  43. package/dist/client.js +11 -11
  44. package/dist/client.js.map +4 -4
  45. package/dist/config-sx40rg8m.js +24 -0
  46. package/dist/{config-hmgrqgf2.js.map → config-sx40rg8m.js.map} +2 -2
  47. package/dist/credential-vdbkfk65.js +19 -0
  48. package/dist/{credential-nkb2ya59.js.map → credential-vdbkfk65.js.map} +1 -1
  49. package/dist/daemon.d.ts.map +1 -1
  50. package/dist/{index-51x0n5z0.js → index-0dcpsfet.js} +4 -4
  51. package/dist/{index-51x0n5z0.js.map → index-0dcpsfet.js.map} +1 -1
  52. package/dist/{index-yw3fby4n.js → index-1h8s50d9.js} +3 -3
  53. package/dist/{index-yw3fby4n.js.map → index-1h8s50d9.js.map} +1 -1
  54. package/dist/index-1hbvhrsj.js +6 -0
  55. package/dist/{index-dzy19wtf.js.map → index-1hbvhrsj.js.map} +1 -1
  56. package/dist/index-1hfece7s.js +10 -0
  57. package/dist/{index-22fzzn7z.js.map → index-1hfece7s.js.map} +2 -2
  58. package/dist/index-2h566rtg.js +6 -0
  59. package/dist/{index-jc4kmfwa.js.map → index-2h566rtg.js.map} +1 -1
  60. package/dist/index-4g4smpkk.js +11 -0
  61. package/dist/{index-sh44ymqz.js.map → index-4g4smpkk.js.map} +1 -1
  62. package/dist/index-4gfsf9n8.js +6 -0
  63. package/dist/{index-8tmv33mr.js.map → index-4gfsf9n8.js.map} +1 -1
  64. package/dist/{index-dv9pdjy4.js → index-5ptbytze.js} +10 -10
  65. package/dist/{index-dv9pdjy4.js.map → index-5ptbytze.js.map} +1 -1
  66. package/dist/index-5s1cq8np.js +8 -0
  67. package/dist/{index-9t4dz145.js.map → index-5s1cq8np.js.map} +1 -1
  68. package/dist/{index-2zjh5zd5.js → index-659ggfbf.js} +2 -2
  69. package/dist/index-6ebppx3t.js +6 -0
  70. package/dist/{index-1x8mzvz7.js.map → index-6ebppx3t.js.map} +1 -1
  71. package/dist/index-6pym9p8h.js +9 -0
  72. package/dist/{index-38gs9anh.js.map → index-6pym9p8h.js.map} +1 -1
  73. package/dist/index-9ejax6hp.js +6 -0
  74. package/dist/{index-8edck2pr.js.map → index-9ejax6hp.js.map} +1 -1
  75. package/dist/{index-zw6wyas6.js → index-9hw9j1qg.js} +4 -4
  76. package/dist/{index-zw6wyas6.js.map → index-9hw9j1qg.js.map} +1 -1
  77. package/dist/{index-bqdkm3de.js → index-9xhresrg.js} +4 -4
  78. package/dist/{index-bqdkm3de.js.map → index-9xhresrg.js.map} +1 -1
  79. package/dist/{index-hgm2gchq.js → index-abm0zyc0.js} +12 -12
  80. package/dist/{index-hgm2gchq.js.map → index-abm0zyc0.js.map} +1 -1
  81. package/dist/index-ar5c9d2f.js +7 -0
  82. package/dist/{index-3826kf9t.js.map → index-ar5c9d2f.js.map} +1 -1
  83. package/dist/index-bhj4pmrx.js +74 -0
  84. package/dist/index-bhj4pmrx.js.map +13 -0
  85. package/dist/index-brt17yfr.js +6 -0
  86. package/dist/{index-hrwakb11.js.map → index-brt17yfr.js.map} +2 -2
  87. package/dist/index-bysnsdkd.js +6 -0
  88. package/dist/{index-nxhqf597.js.map → index-bysnsdkd.js.map} +1 -1
  89. package/dist/index-c74wx9pv.js +6 -0
  90. package/dist/{index-323jvr1g.js.map → index-c74wx9pv.js.map} +1 -1
  91. package/dist/index-cm3g4t3r.js +14 -0
  92. package/dist/{index-y7dxq4a4.js.map → index-cm3g4t3r.js.map} +2 -2
  93. package/dist/index-dzp6mc5h.js +6 -0
  94. package/dist/{index-42e29zs4.js.map → index-dzp6mc5h.js.map} +1 -1
  95. package/dist/index-fad09b8c.js +6 -0
  96. package/dist/{index-836hc2h1.js.map → index-fad09b8c.js.map} +2 -2
  97. package/dist/{index-0444sh6x.js → index-fvb2dxzn.js} +4 -4
  98. package/dist/{index-0444sh6x.js.map → index-fvb2dxzn.js.map} +1 -1
  99. package/dist/{index-2bsardvh.js → index-gpq4agva.js} +3 -3
  100. package/dist/{index-2bsardvh.js.map → index-gpq4agva.js.map} +1 -1
  101. package/dist/{index-qgsdgbk8.js → index-hcpvk5de.js} +3 -3
  102. package/dist/{index-qgsdgbk8.js.map → index-hcpvk5de.js.map} +1 -1
  103. package/dist/{index-pqw1n1pv.js → index-jv5t63tp.js} +4 -4
  104. package/dist/{index-pqw1n1pv.js.map → index-jv5t63tp.js.map} +1 -1
  105. package/dist/index-kyz4t0j0.js +126 -0
  106. package/dist/{index-ry6a4bqh.js.map → index-kyz4t0j0.js.map} +2 -2
  107. package/dist/{index-ytxbw8py.js → index-m6r2sxcw.js} +33 -33
  108. package/dist/{index-ytxbw8py.js.map → index-m6r2sxcw.js.map} +1 -1
  109. package/dist/{index-snz49ndn.js → index-mhw3d7af.js} +3 -3
  110. package/dist/{index-snz49ndn.js.map → index-mhw3d7af.js.map} +1 -1
  111. package/dist/{index-1mbdz3f7.js → index-mk7hrzq7.js} +9 -9
  112. package/dist/{index-1mbdz3f7.js.map → index-mk7hrzq7.js.map} +1 -1
  113. package/dist/index-n0hqgwad.js +6 -0
  114. package/dist/{index-xg7s813b.js.map → index-n0hqgwad.js.map} +2 -2
  115. package/dist/index-ncb840sk.js +6 -0
  116. package/dist/{index-mjfv7k5w.js.map → index-ncb840sk.js.map} +1 -1
  117. package/dist/{index-fbsrhcga.js → index-ntczmwnf.js} +4 -4
  118. package/dist/{index-fbsrhcga.js.map → index-ntczmwnf.js.map} +1 -1
  119. package/dist/{index-095hrkyr.js → index-p5gy5s7p.js} +4 -4
  120. package/dist/{index-095hrkyr.js.map → index-p5gy5s7p.js.map} +1 -1
  121. package/dist/{index-3c5jt6by.js → index-p86w0qjw.js} +3 -3
  122. package/dist/{index-3c5jt6by.js.map → index-p86w0qjw.js.map} +1 -1
  123. package/dist/index-qhh30m9p.js +6 -0
  124. package/dist/{index-nvc24414.js.map → index-qhh30m9p.js.map} +1 -1
  125. package/dist/{index-p6ya59m6.js → index-rerdsr3d.js} +4 -4
  126. package/dist/{index-p6ya59m6.js.map → index-rerdsr3d.js.map} +1 -1
  127. package/dist/{index-k8e9f466.js → index-s0mfq8t7.js} +19 -19
  128. package/dist/index-s0mfq8t7.js.map +11 -0
  129. package/dist/{index-3vzf253k.js → index-s9ybp2r1.js} +7 -7
  130. package/dist/{index-3vzf253k.js.map → index-s9ybp2r1.js.map} +1 -1
  131. package/dist/index-ss77hvwy.js +1246 -0
  132. package/dist/{index-hpvfqq6r.js.map → index-ss77hvwy.js.map} +32 -31
  133. package/dist/{index-jff5q27j.js → index-t9bnt6a1.js} +4 -4
  134. package/dist/{index-jff5q27j.js.map → index-t9bnt6a1.js.map} +1 -1
  135. package/dist/index-w2ss9hn5.js +9 -0
  136. package/dist/{index-eztfverw.js.map → index-w2ss9hn5.js.map} +1 -1
  137. package/dist/{index-pszmnhgq.js → index-w80shmpv.js} +9 -9
  138. package/dist/{index-pszmnhgq.js.map → index-w80shmpv.js.map} +1 -1
  139. package/dist/index-w8e8qxd4.js +337 -0
  140. package/dist/index-w8e8qxd4.js.map +21 -0
  141. package/dist/{index-308y9xt0.js → index-z9r4e0yq.js} +4 -4
  142. package/dist/{index-308y9xt0.js.map → index-z9r4e0yq.js.map} +1 -1
  143. package/dist/index-zj87j4j2.js +6 -0
  144. package/dist/index-zj87j4j2.js.map +10 -0
  145. package/dist/{index-m6fqx0ch.js → index-zmerx9rc.js} +6 -6
  146. package/dist/{index-m6fqx0ch.js.map → index-zmerx9rc.js.map} +1 -1
  147. package/dist/index-zqjtjs7c.js +153 -0
  148. package/dist/{index-dpcm1j62.js.map → index-zqjtjs7c.js.map} +2 -2
  149. package/dist/index.js +381 -368
  150. package/dist/index.js.map +7 -6
  151. package/dist/lib/launchd.d.ts.map +1 -1
  152. package/dist/lib/service-env.d.ts.map +1 -1
  153. package/dist/lib/templates.d.ts.map +1 -1
  154. package/dist/lib/theme.d.ts.map +1 -1
  155. package/dist/lib/watchdog.d.ts +20 -0
  156. package/dist/lib/watchdog.d.ts.map +1 -0
  157. package/dist/serve.d.ts.map +1 -1
  158. package/dist/skills.d.ts.map +1 -1
  159. package/dist/sources.d.ts.map +1 -1
  160. package/dist/web-zvf80ns1.js +14 -0
  161. package/dist/{web-gfv0mzgs.js.map → web-zvf80ns1.js.map} +1 -1
  162. package/dist/wire.js +11 -11
  163. package/dist/wire.js.map +4 -4
  164. package/dist/wrapper-5zhcdmnk.js +5 -0
  165. package/package.json +4 -4
  166. package/dist/APEv2Parser-ysjr6adv.js +0 -5
  167. package/dist/App-2f72vhjv.js +0 -11
  168. package/dist/AsfParser-7emspn04.js +0 -5
  169. package/dist/ConfigEditor-vk7vxaa6.js +0 -6
  170. package/dist/DsdiffParser-dz88pnnr.js +0 -5
  171. package/dist/FlacParser-drm5wq0p.js +0 -5
  172. package/dist/MP4Parser-yr7p3z12.js +0 -5
  173. package/dist/MusepackParser-6e8kbh2d.js +0 -5
  174. package/dist/OggParser-ggcypmag.js +0 -5
  175. package/dist/Picker-j7txnm7w.js +0 -5
  176. package/dist/SessionPicker-hpv2ncsb.js +0 -5
  177. package/dist/SkillBrowser-qc542n71.js +0 -5
  178. package/dist/WavPackParser-jw9stzqp.js +0 -5
  179. package/dist/WaveParser-epmncs9w.js +0 -5
  180. package/dist/WizardApp-pgzcz9zq.js +0 -5
  181. package/dist/channels-m8nambmm.js +0 -31
  182. package/dist/config-hmgrqgf2.js +0 -24
  183. package/dist/credential-nkb2ya59.js +0 -19
  184. package/dist/index-1x8mzvz7.js +0 -6
  185. package/dist/index-22fzzn7z.js +0 -10
  186. package/dist/index-323jvr1g.js +0 -6
  187. package/dist/index-3826kf9t.js +0 -7
  188. package/dist/index-38gs9anh.js +0 -9
  189. package/dist/index-42e29zs4.js +0 -6
  190. package/dist/index-836hc2h1.js +0 -6
  191. package/dist/index-8edck2pr.js +0 -6
  192. package/dist/index-8tmv33mr.js +0 -6
  193. package/dist/index-9t4dz145.js +0 -8
  194. package/dist/index-djeqvfms.js +0 -74
  195. package/dist/index-djeqvfms.js.map +0 -13
  196. package/dist/index-dpcm1j62.js +0 -153
  197. package/dist/index-dzy19wtf.js +0 -6
  198. package/dist/index-eztfverw.js +0 -9
  199. package/dist/index-fxpmx6cr.js +0 -308
  200. package/dist/index-fxpmx6cr.js.map +0 -21
  201. package/dist/index-hpvfqq6r.js +0 -1252
  202. package/dist/index-hrwakb11.js +0 -6
  203. package/dist/index-jc4kmfwa.js +0 -6
  204. package/dist/index-k8e9f466.js.map +0 -13
  205. package/dist/index-mjfv7k5w.js +0 -6
  206. package/dist/index-nvc24414.js +0 -6
  207. package/dist/index-nxhqf597.js +0 -6
  208. package/dist/index-qv6ktepc.js +0 -6
  209. package/dist/index-qv6ktepc.js.map +0 -10
  210. package/dist/index-ry6a4bqh.js +0 -126
  211. package/dist/index-sh44ymqz.js +0 -11
  212. package/dist/index-xg7s813b.js +0 -6
  213. package/dist/index-y7dxq4a4.js +0 -14
  214. package/dist/web-gfv0mzgs.js +0 -14
  215. package/dist/wrapper-f662ny3r.js +0 -5
  216. /package/dist/{APEv2Parser-ysjr6adv.js.map → APEv2Parser-rt8hyadd.js.map} +0 -0
  217. /package/dist/{FlacParser-drm5wq0p.js.map → FlacParser-rmkpvf9e.js.map} +0 -0
  218. /package/dist/{index-2zjh5zd5.js.map → index-659ggfbf.js.map} +0 -0
  219. /package/dist/{wrapper-f662ny3r.js.map → wrapper-5zhcdmnk.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import{ps}from"./index-38gs9anh.js";import{zt}from"./index-9t4dz145.js";function Ue(e){if(e??zt().noEnhancedKeys)return{};return ps(),{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 it(e){return o({...e,stdinIsTTY:process.stdin.isTTY===!0,stdoutIsTTY:process.stdout.isTTY===!0,env:zt()})}
3
- export{Ue,it};
2
+ import{fs}from"./index-6pym9p8h.js";import{Zt}from"./index-5s1cq8np.js";function Ke(e){if(e??Zt().noEnhancedKeys)return{};return fs(),{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 at(e){return o({...e,stdinIsTTY:process.stdin.isTTY===!0,stdoutIsTTY:process.stdout.isTTY===!0,env:Zt()})}
3
+ export{Ke,at};
4
4
 
5
- //# debugId=BAE572569B452FE064756E2164756E21
6
- //# sourceMappingURL=index-308y9xt0.js.map
5
+ //# debugId=4C6E3FD05C8EA25E64756E2164756E21
6
+ //# sourceMappingURL=index-z9r4e0yq.js.map
@@ -6,6 +6,6 @@
6
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
7
  ],
8
8
  "mappings": ";wEAuFO,SAAS,EAAiB,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": "BAE572569B452FE064756E2164756E21",
9
+ "debugId": "4C6E3FD05C8EA25E64756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{A}from"./index-ss77hvwy.js";import{$e}from"./index-5ptbytze.js";import{Ho,ha}from"./index-4gfsf9n8.js";var gn=[{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"}],n={name:"manifest",required:!0,help:"path to an agent.yaml, or the name of a sandbox agent"},a={name:"store",kind:"string",placeholder:"path",help:"session database",defaultHelp:`~/${A.stateDir}/store.db`},l={name:"session",kind:"string",placeholder:"key",help:"session key",bare:""},e={name:"json",kind:"boolean",help:"machine-readable output"},st=[{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: ${$e.map((t)=>t.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:"region",kind:"string",placeholder:"aws-region",help:"AWS region, with --preset bedrock (credentials come from the AWS chain)"},{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, bundled with the binary",defaultHelp:"none"},{name:"whatsapp-number",kind:"string",placeholder:"digits",help:"the account's own number to pair with (pairWith) — digits with no +; empty pairs by QR"},{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:"service"},{name:"dir",kind:"string",placeholder:"path",help:"write the agent here instead of the sandbox",defaultHelp:`~/${A.stateDir}/agents/<agent-name-slug>`},{name:"yes",kind:"boolean",help:"take every default; never ask, even at a terminal"},{name:"measure-window",kind:"boolean",help:"ask the endpoint for the model's window and write it (the wizard always asks)"}]},{name:"run",inSession:"hidden",needsServer:!0,summary:"start an interactive session — bare `run` picks from the sandbox",args:[{...n,required:!1,help:"path or sandbox agent name (omit to pick from the sandbox)"}],flags:[{...l,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"},a,{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:[n],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"},a,e]},{name:"sessions",inSession:"view",needsServer:!1,summary:"list stored sessions, or inspect one",args:[n],flags:[{...l,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(Ho),min:ha,integer:!0},a,e]},{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"}]},{...n,required:!0},{name:"query",required:!1,help:"the words to search for (search only); quote a phrase"}],flags:[a,{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"},e]},{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"}]},{...n,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:[a,{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:"owner",inSession:"hidden",needsServer:!1,summary:"show who owns this machine's agents, or make an existing agent yours",args:[{name:"action",required:!0,help:"what to do",choices:[{value:"show",help:"print the owner id init minted for this sandbox"},{value:"adopt",help:"make an agent yours: assign it, recognise you on its channels, one conversation everywhere"}]},{...n,required:!1}],flags:[a,e]},{name:"validate",inSession:"output",needsServer:!1,summary:"load and validate a manifest, then exit",args:[n],flags:[e]},{name:"workspace",inSession:"output",needsServer:!1,summary:"check the workspace files against the authoring rules",args:[n],flags:[{name:"strict",kind:"boolean",help:"exit non-zero when any authoring warning is reported"},e]},{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"}]},{...n,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"},e]},{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"},e]},{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"}]},{...n,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:[e]},{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"}]},n,{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"},e]},{name:"agents",inSession:"output",needsServer:!1,summary:"the agents in the sandbox, and whether anything is serving them",args:[{...n,required:!1,variadic:!0,help:"paths or sandbox names to describe in full — bare, lists the sandbox"}],flags:[a,e]},{name:"restart",inSession:"hidden",needsServer:!1,summary:"reload one agent on the running host, or restart the whole service",args:[{...n,required:!1,help:"path or sandbox agent name — bare, restarts the background service"}],flags:[a,e]},{name:"status",inSession:"output",needsServer:!1,summary:"the service, the hosts, every agent and its channels — one screen",args:[],flags:[a,e]},{name:"logs",inSession:"hidden",needsServer:!1,summary:"the server's stderr tail — the same as `daemon logs`",args:[{...n,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"},a,e]},{name:"tools",inSession:"output",needsServer:!1,summary:"show the resolved tool catalogue, or fetch a remote provider's schemas into the cache",args:[n],flags:[{name:"warm",kind:"boolean",help:"fetch every pinned slug from the provider and write the resolution cache"},e]},{name:"serve",inSession:"hidden",needsServer:!1,summary:"run the HTTP API and connect the agents' channels",args:[{...n,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"},a,e]},{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 of them"},{name:"expires",kind:"string",placeholder:"dur",help:"how long it lives: 30s, 15m, 2h, 7d, or seconds",defaultHelp:"never"},a,e]},{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"},e]},{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)"},a,e]},{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"},a,e]},{name:"start",inSession:"hidden",needsServer:!0,summary:"switch an agent back on, and have a running host adopt it now",args:[n],flags:[a,e]},{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"},a,e]},{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"},a,e]}];function TA(t){return st.find((r)=>r.name===t)}function cn(t){return[...t.flags,...gn]}function is(t,r){return st.filter((s)=>s.name!==r&&s.flags.some((i)=>i.name===t)).map((s)=>s.name)}function ss(t,r){let s=(r??"").trim();if(s==="")return{action:void 0,ref:void 0};return(TA(t)?.args??[]).find((o)=>o.name==="action")?.choices?.map((o)=>o.value)?.includes(s)===!0?{action:s,ref:void 0}:{action:void 0,ref:s}}
3
+ export{gn,st,TA,cn,is,ss};
4
+
5
+ //# debugId=5B6F206D5E50812664756E2164756E21
6
+ //# sourceMappingURL=index-zj87j4j2.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: \"region\",\n kind: \"string\",\n placeholder: \"aws-region\",\n help: \"AWS region, with --preset bedrock (credentials come from the AWS chain)\",\n },\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, bundled with the binary\",\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: \"the account's own number to pair with (pairWith) — digits with no +; empty pairs by QR\",\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: \"service\",\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 name: \"measure-window\",\n kind: \"boolean\",\n help: \"ask the endpoint for the model's window and write it (the wizard always asks)\",\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 // Who owns the agents on this machine (decisions 15.7, 15.14). `init` makes you the owner of\n // what it creates; `adopt` does it for an agent that already existed. `hidden` for the reason\n // `stop` is: adopting reloads the agent, which would be the one a session is attached to.\n name: \"owner\",\n\n inSession: \"hidden\",\n needsServer: false,\n summary: \"show who owns this machine's agents, or make an existing agent yours\",\n args: [\n {\n name: \"action\",\n required: true,\n help: \"what to do\",\n choices: [\n { value: \"show\", help: \"print the owner id init minted for this sandbox\" },\n {\n value: \"adopt\",\n help: \"make an agent yours: assign it, recognise you on its channels, one conversation everywhere\",\n },\n ],\n },\n { ...MANIFEST, required: false },\n ],\n flags: [STORE, JSON_FLAG],\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 of them\",\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,KAAM,QACN,KAAM,UACN,KAAM,wDACV,EACA,CAAE,KAAM,OAAQ,MAAO,IAAK,KAAM,UAAW,KAAM,yBAA0B,EAC7E,CAAE,KAAM,UAAW,MAAO,IAAK,KAAM,UAAW,KAAM,4BAA6B,EACnF,CAII,KAAM,eACN,KAAM,UACN,KAAM,6CACV,CACJ,EAEM,EAAoB,CAC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ACb,KAAM,0CACN,YAAa,MACjB,EACA,CACI,KAAM,iBACN,KAAM,SACN,YAAa,UACb,KAAM,sEACV,EACA,CACI,KAAM,WACN,KAAM,SACN,YAAa,QACb,KAAM,gFACN,YAAa,MACjB,EACA,CAII,KAAM,kBACN,KAAM,SACN,YAAa,SACb,KAAM,wFACV,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,SACjB,EACA,CACI,KAAM,MACN,KAAM,SACN,YAAa,OACb,KAAM,8CACN,YAAa,KAAK,EAAM,mCAC5B,EACA,CACI,KAAM,MACN,KAAM,UACN,KAAM,mDACV,EACA,CACI,KAAM,iBACN,KAAM,UACN,KAAM,+EACV,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,KAAM,iBACN,KAAM,UACN,KAAM,6DACV,CACJ,CACJ,EACA,CAQI,KAAM,YAGN,UAAW,OACX,YAAa,GACb,QAAS,iEACT,KAAM,CAAC,CAAQ,EACf,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ACV,EACA,CACI,MAAO,aACP,KAAM,8DACV,EACA,CACI,MAAO,OACP,KAAM,mFACV,EACA,CACI,MAAO,SACP,KAAM,+DACV,CACJ,CACJ,EACA,IAAK,EAAU,SAAU,GAAO,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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B,EACA,CACI,KAAM,SACN,MAAO,IACP,KAAM,UACN,KAAM,yEACV,EACA,CAAE,KAAM,WAAY,KAAM,UAAW,KAAM,4BAA6B,EACxE,CACI,KAAM,UACN,KAAM,UACN,KAAM,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": "5B6F206D5E50812664756E2164756E21",
9
+ "names": []
10
+ }
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import{ea}from"./index-4fj1k64j.js";import{ia}from"./index-dzy19wtf.js";import{Ea,mi}from"./index-8tmv33mr.js";var he={value:"",cursor:0,history:[],historyOffset:0,draft:"",past:[],future:[],search:void 0,anchor:void 0};function c(r){return[...r]}function u(r,e){return Math.max(0,Math.min(r,e))}function h(r){return{value:r.value,cursor:r.cursor}}function d(r,e){let n=r.past.at(-1);if(e.coalesce&&n!==void 0&&r.future.length===0)return{...r,future:[]};if(n!==void 0&&n.value===r.value)return{...r,future:[]};return{...r,past:[...r.past,h(r)].slice(-mi),future:[]}}function a(r,e){return{...r,value:e,cursor:c(e).length}}function k(r,e){let n=d(r,{coalesce:!e.includes(`
2
+ import{ea}from"./index-4fj1k64j.js";import{ia}from"./index-1hbvhrsj.js";import{Ea,Qi}from"./index-4gfsf9n8.js";var ye={value:"",cursor:0,history:[],historyOffset:0,draft:"",past:[],future:[],search:void 0,anchor:void 0};function c(r){return[...r]}function u(r,e){return Math.max(0,Math.min(r,e))}function h(r){return{value:r.value,cursor:r.cursor}}function d(r,e){let n=r.past.at(-1);if(e.coalesce&&n!==void 0&&r.future.length===0)return{...r,future:[]};if(n!==void 0&&n.value===r.value)return{...r,future:[]};return{...r,past:[...r.past,h(r)].slice(-Qi),future:[]}}function a(r,e){return{...r,value:e,cursor:c(e).length}}function k(r,e){let n=d(r,{coalesce:!e.includes(`
3
3
  `)}),o=c(n.value),t=u(n.cursor,o.length),i=[...o.slice(0,t),...c(e),...o.slice(t)];return{...n,value:i.join(""),cursor:t+c(e).length}}function E(r){let e=c(r.value),n=u(r.cursor,e.length);if(n===0)return r;let o=d(r,{coalesce:!1}),t=[...e.slice(0,n-1),...e.slice(n)];return{...o,value:t.join(""),cursor:n-1}}function y(r){let e=c(r.value),n=u(r.cursor,e.length);if(n>=e.length)return r;return{...d(r,{coalesce:!1}),value:[...e.slice(0,n),...e.slice(n+1)].join("")}}function f(r){return r===void 0||/\s/.test(r)}function v(r,e){let n=e;while(n>0&&f(r[n-1]))n-=1;while(n>0&&!f(r[n-1]))n-=1;return n}function b(r,e){let n=e;while(n<r.length&&f(r[n]))n+=1;while(n<r.length&&!f(r[n]))n+=1;return n}function x(r){let e=c(r.value),n=v(e,u(r.cursor,e.length));if(n===r.cursor)return r;return{...d(r,{coalesce:!1}),value:[...e.slice(0,n),...e.slice(r.cursor)].join(""),cursor:n}}function A(r){let e=c(r.value),n=u(r.cursor,e.length),o=b(e,n);if(o===n)return r;return{...d(r,{coalesce:!1}),value:[...e.slice(0,n),...e.slice(o)].join("")}}function l(r,e){let n=c(r),o=u(e,n.length),t=o;while(t>0&&n[t-1]!==`
4
4
  `)t-=1;let i=o;while(i<n.length&&n[i]!==`
5
5
  `)i+=1;return{start:t,end:i}}function zo(r){let e=c(r.value),n=u(r.cursor,e.length),o=e.slice(0,n),{start:t}=l(r.value,n);return{line:o.filter((i)=>i===`
6
6
  `).length,lines:e.filter((i)=>i===`
7
- `).length+1,column:n-t}}function p(r,e){let n=c(r.value),o=u(r.cursor,n.length),t=l(r.value,o),i=o-t.start;if(e<0){if(t.start===0)return r;let m=l(r.value,t.start-1);return{...r,cursor:Math.min(m.start+i,m.end)}}if(t.end>=n.length)return r;let s=l(r.value,t.end+1);return{...r,cursor:Math.min(s.start+i,s.end)}}function L(r){if(r.history.length===0)return r;let e=Math.min(r.historyOffset+1,r.history.length),n=r.history[r.history.length-e];if(n===void 0)return r;return a({...d(r,{coalesce:!1}),historyOffset:e,draft:r.historyOffset===0?r.value:r.draft},n)}function I(r){if(r.historyOffset===0)return r;let e=r.historyOffset-1,n=d(r,{coalesce:!1});if(e===0)return a({...n,historyOffset:0},r.draft);let o=r.history[r.history.length-e];return o===void 0?r:a({...n,historyOffset:e},o)}function en(r){let e=(r.search?.query??"").toLowerCase(),n=new Set,o=[];for(let t=r.history.length-1;t>=0;t-=1){let i=r.history[t];if(i===void 0||n.has(i))continue;if(e===""||i.toLowerCase().includes(e))n.add(i),o.push(i)}return o}function C(r){let e=en(r);return e[u(r.search?.index??0,Math.max(0,e.length-1))]}function g(r,e){let n=r.search;if(n===void 0)return r;let o=en(r);if(o.length===0)return r;return{...r,search:{...n,index:u(n.index+e,o.length-1)}}}function T(r,e){let n=r.search;if(n===void 0)return r;return{...r,search:{query:n.query+e,index:0}}}function M(r){let e=r.search;if(e===void 0)return r;let n=c(e.query).slice(0,-1).join("");return{...r,search:{query:n,index:0}}}function O(r){let e=C(r);if(e===void 0)return{...r,search:void 0};return a({...d(r,{coalesce:!1}),search:void 0},e)}function K(r){let e=r.past.at(-1);if(e===void 0)return r;return{...r,value:e.value,cursor:u(e.cursor,c(e.value).length),past:r.past.slice(0,-1),future:[h(r),...r.future],historyOffset:0}}function j(r){let e=r.future[0];if(e===void 0)return r;return{...r,value:e.value,cursor:u(e.cursor,c(e.value).length),past:[...r.past,h(r)].slice(-mi),future:r.future.slice(1)}}function wA(r){if(r.anchor===void 0||r.anchor===r.cursor)return;return r.anchor<r.cursor?{start:r.anchor,end:r.cursor}:{start:r.cursor,end:r.anchor}}function w(r){let e=wA(r);if(e===void 0)return{...r,anchor:void 0};let n=c(r.value);return{...d(r,{coalesce:!1}),value:[...n.slice(0,e.start),...n.slice(e.end)].join(""),cursor:e.start,anchor:void 0}}function R(r){return r.kind==="insert"||r.kind==="newline"||r.kind==="backspace"||r.kind==="delete"}function Ge(r,e){if(r.search===void 0&&R(e)&&wA(r)!==void 0){let o=w(r);if(e.kind==="backspace"||e.kind==="delete")return o;return Ge(o,e)}if(e.kind==="extend"){let o=r.anchor??r.cursor;return{...Ge({...r,anchor:void 0},{kind:e.to}),anchor:o}}if(e.kind==="cutSelection")return w(r);if(e.kind==="copySelection")return r;if(e.kind==="selectAll")return{...r,anchor:0,cursor:c(r.value).length};let n=W(r,e);return n.anchor===void 0?n:{...n,anchor:void 0}}function W(r,e){if(r.search!==void 0)switch(e.kind){case"insert":return T(r,e.text);case"backspace":return M(r);case"historyPrev":case"lineUp":return g(r,1);case"historyNext":case"lineDown":return g(r,-1);case"searchAccept":return O(r);case"searchCancel":return{...r,search:void 0};case"searchOpen":return r;default:return{...r,search:void 0}}switch(e.kind){case"insert":return k(r,e.text);case"newline":return k(r,`
8
- `);case"backspace":return E(r);case"delete":return y(r);case"cursorLeft":return{...r,cursor:u(r.cursor-1,c(r.value).length)};case"cursorRight":return{...r,cursor:u(r.cursor+1,c(r.value).length)};case"cursorHome":return{...r,cursor:l(r.value,r.cursor).start};case"cursorEnd":return{...r,cursor:l(r.value,r.cursor).end};case"bufferStart":return{...r,cursor:0};case"bufferEnd":return{...r,cursor:c(r.value).length};case"wordLeft":return{...r,cursor:v(c(r.value),r.cursor)};case"wordRight":return{...r,cursor:b(c(r.value),r.cursor)};case"lineUp":return p(r,-1);case"lineDown":return p(r,1);case"killToStart":{let{start:n}=l(r.value,r.cursor);if(n===r.cursor)return r;let o=c(r.value);return{...d(r,{coalesce:!1}),value:[...o.slice(0,n),...o.slice(r.cursor)].join(""),cursor:n}}case"killToEnd":{let{end:n}=l(r.value,r.cursor);if(n===r.cursor)return r;let o=c(r.value);return{...d(r,{coalesce:!1}),value:[...o.slice(0,r.cursor),...o.slice(n)].join("")}}case"killWord":return x(r);case"killWordForward":return A(r);case"historyPrev":return L(r);case"historyNext":return I(r);case"undo":return K(r);case"redo":return j(r);case"searchOpen":return{...r,search:{query:"",index:0}};case"searchAccept":case"searchCancel":case"submit":case"cancel":case"exit":case"arm":case"scroll":case"pointer":case"reasoning":case"paste":case"none":return r;case"extend":case"selectAll":case"copySelection":case"cutSelection":return r}}function xi(r){let e=r.value.trim();if(e==="")return{text:"",state:{...he,history:r.history}};let o=r.history.at(-1)===e?r.history:[...r.history,e].slice(-Ea);return{text:e,state:{...he,history:o}}}function Gn(r,e,n={}){let{line:o,lines:t}=zo(r);return{busy:e,empty:r.value==="",firstLine:o===0,lastLine:o===t-1,searching:r.search!==void 0,armed:n.armed??!1,scrolled:n.scrolled??!1}}function D(r,e){switch(r){case"c":if(e.searching)return{kind:"searchCancel"};if(e.busy)return{kind:"cancel"};return e.armed?{kind:"exit"}:{kind:"arm"};case"d":return e.empty?{kind:"exit"}:{kind:"delete"};case"a":return{kind:"cursorHome"};case"e":return{kind:"cursorEnd"};case"b":return{kind:"cursorLeft"};case"f":return{kind:"cursorRight"};case"u":return{kind:"killToStart"};case"k":return{kind:"killToEnd"};case"w":return{kind:"killWord"};case"p":return{kind:"historyPrev"};case"n":return{kind:"historyNext"};case"r":return{kind:"searchOpen"};case"o":return{kind:"reasoning"};case"z":return{kind:"undo"};case"y":return{kind:"redo"};default:return{kind:"none"}}}function tn(r,e,n){let o=ia(r);if(o!==void 0){if(o.rows!==0)return{kind:"scroll",move:o.rows<0?"up":"down",times:Math.abs(o.rows)};if(o.at!==void 0&&o.kind!==void 0&&o.kind!=="wheel")return{kind:"pointer",gesture:o.kind,column:o.at.column,row:o.at.row,shift:o.shift===!0};return{kind:"none"}}if(e.eventType==="release")return{kind:"none"};if(e.shift){let i=H(e);if(i!==void 0)return{kind:"extend",to:i}}if(e.super){if(e.leftArrow)return{kind:"cursorHome"};if(e.rightArrow)return{kind:"cursorEnd"};if(e.upArrow)return{kind:"bufferStart"};if(e.downArrow)return{kind:"bufferEnd"};if(e.backspace)return{kind:"killToStart"};if(e.delete)return{kind:"killToEnd"};if(r==="z")return e.shift?{kind:"redo"}:{kind:"undo"};if(r==="a")return{kind:"selectAll"};if(r==="c")return{kind:"copySelection"};if(r==="x")return{kind:"cutSelection"};return{kind:"none"}}if(ea(r))return{kind:"none"};if(e.ctrl&&e.leftArrow)return{kind:"wordLeft"};if(e.ctrl&&e.rightArrow)return{kind:"wordRight"};if(e.ctrl&&e.backspace)return{kind:"killWord"};if(e.ctrl)return D(r.toLowerCase(),n);if(e.meta){if(e.return)return{kind:"newline"};if(e.pageUp)return{kind:"scroll",move:"top"};if(e.pageDown)return{kind:"scroll",move:"bottom"};if(e.upArrow)return{kind:"scroll",move:"up"};if(e.downArrow)return{kind:"scroll",move:"down"};if(e.leftArrow||r==="b")return{kind:"wordLeft"};if(e.rightArrow||r==="f")return{kind:"wordRight"};if(e.backspace)return{kind:"killWord"};if(r==="d")return{kind:"killWordForward"};if(r==="r")return{kind:"reasoning"};return{kind:"none"}}if(e.return&&e.shift)return{kind:"newline"};if(e.pageUp)return{kind:"scroll",move:"pageUp"};if(e.pageDown)return{kind:"scroll",move:"pageDown"};if(e.home)return{kind:"cursorHome"};if(e.end)return{kind:"cursorEnd"};if(e.return)return n.searching?{kind:"searchAccept"}:{kind:"submit"};if(e.backspace)return{kind:"backspace"};if(e.delete)return{kind:"delete"};if(e.leftArrow)return{kind:"cursorLeft"};if(e.rightArrow)return{kind:"cursorRight"};if(e.upArrow)return n.searching||n.firstLine?{kind:"historyPrev"}:{kind:"lineUp"};if(e.downArrow)return n.searching||n.lastLine?{kind:"historyNext"}:{kind:"lineDown"};if(e.escape){if(n.searching)return{kind:"searchCancel"};return n.scrolled?{kind:"scroll",move:"bottom"}:{kind:"none"}}if(e.tab)return{kind:"none"};if(r==="")return{kind:"none"};if(r==="\x1B[H"||r==="\x1B[1~")return{kind:"cursorHome"};if(r==="\x1B[F"||r==="\x1B[4~")return{kind:"cursorEnd"};if(/[\r\n]/.test(r)){let i=r.split(/\r\n|[\r\n]/).map(S),s=i.at(-1)===""&&i.length>1;return{kind:"paste",lines:s?i.slice(0,-1):i,complete:s}}let t=S(r);return t===""?{kind:"none"}:{kind:"insert",text:t}}function H(r){if(r.super){if(r.leftArrow)return"cursorHome";if(r.rightArrow)return"cursorEnd";if(r.upArrow)return"bufferStart";if(r.downArrow)return"bufferEnd";return}if(r.meta||r.ctrl){if(r.leftArrow)return"wordLeft";if(r.rightArrow)return"wordRight";return}if(r.home)return"cursorHome";if(r.end)return"cursorEnd";if(r.leftArrow)return"cursorLeft";if(r.rightArrow)return"cursorRight";if(r.upArrow)return"lineUp";if(r.downArrow)return"lineDown";return}function S(r){return[...r].filter((e)=>{let n=e.codePointAt(0)??0;return n>=32&&n!==127}).join("")}function An(r,e){if(e.ctrl)return r.toLowerCase()==="c"||r.toLowerCase()==="d"?{kind:"cancel"}:{kind:"none"};if(e.return)return{kind:"confirm"};if(e.escape)return{kind:"cancel"};if(r===" ")return{kind:"toggle"};if(r==="a")return{kind:"all"};if(r==="n")return{kind:"none-selected"};let n=mt(r,e);return n.kind==="move"?n:{kind:"none"}}function mt(r,e){if(e.ctrl)return r.toLowerCase()==="c"||r.toLowerCase()==="d"?{kind:"exit"}:{kind:"none"};if(e.return)return{kind:"choose"};if(e.escape)return{kind:"back"};if(e.upArrow)return{kind:"move",move:{kind:"up"}};if(e.downArrow)return{kind:"move",move:{kind:"down"}};switch(r){case"k":return{kind:"move",move:{kind:"up"}};case"j":return{kind:"move",move:{kind:"down"}};case"g":return{kind:"move",move:{kind:"first"}};case"G":return{kind:"move",move:{kind:"last"}};default:break}if(/^[1-9]$/.test(r))return{kind:"move",move:{kind:"jump",index:Number(r)-1}};return{kind:"none"}}function Fn(r,e,n){if(e.ctrl&&r.toLowerCase()==="c")return{kind:"abort"};if(e.escape)return{kind:"back"};if(e.return)return{kind:"commit"};if(n.select)return{kind:"list",intent:mt(r,e)};let o=tn(r,e,{busy:!1,empty:n.empty,firstLine:!0,lastLine:!0,searching:!1,armed:!1,scrolled:!1});switch(o.kind){case"submit":return{kind:"commit"};case"exit":return{kind:"abort"};case"arm":case"scroll":return{kind:"edit",intent:{kind:"none"}};case"historyPrev":case"historyNext":return{kind:"edit",intent:{kind:"none"}};case"paste":return{kind:"edit",intent:{kind:"insert",text:o.lines[0]??""}};default:return{kind:"edit",intent:o}}}
9
- export{he,zo,en,wA,Ge,xi,Gn,tn,An,mt,Fn};
7
+ `).length+1,column:n-t}}function p(r,e){let n=c(r.value),o=u(r.cursor,n.length),t=l(r.value,o),i=o-t.start;if(e<0){if(t.start===0)return r;let m=l(r.value,t.start-1);return{...r,cursor:Math.min(m.start+i,m.end)}}if(t.end>=n.length)return r;let s=l(r.value,t.end+1);return{...r,cursor:Math.min(s.start+i,s.end)}}function L(r){if(r.history.length===0)return r;let e=Math.min(r.historyOffset+1,r.history.length),n=r.history[r.history.length-e];if(n===void 0)return r;return a({...d(r,{coalesce:!1}),historyOffset:e,draft:r.historyOffset===0?r.value:r.draft},n)}function I(r){if(r.historyOffset===0)return r;let e=r.historyOffset-1,n=d(r,{coalesce:!1});if(e===0)return a({...n,historyOffset:0},r.draft);let o=r.history[r.history.length-e];return o===void 0?r:a({...n,historyOffset:e},o)}function en(r){let e=(r.search?.query??"").toLowerCase(),n=new Set,o=[];for(let t=r.history.length-1;t>=0;t-=1){let i=r.history[t];if(i===void 0||n.has(i))continue;if(e===""||i.toLowerCase().includes(e))n.add(i),o.push(i)}return o}function C(r){let e=en(r);return e[u(r.search?.index??0,Math.max(0,e.length-1))]}function g(r,e){let n=r.search;if(n===void 0)return r;let o=en(r);if(o.length===0)return r;return{...r,search:{...n,index:u(n.index+e,o.length-1)}}}function T(r,e){let n=r.search;if(n===void 0)return r;return{...r,search:{query:n.query+e,index:0}}}function M(r){let e=r.search;if(e===void 0)return r;let n=c(e.query).slice(0,-1).join("");return{...r,search:{query:n,index:0}}}function O(r){let e=C(r);if(e===void 0)return{...r,search:void 0};return a({...d(r,{coalesce:!1}),search:void 0},e)}function K(r){let e=r.past.at(-1);if(e===void 0)return r;return{...r,value:e.value,cursor:u(e.cursor,c(e.value).length),past:r.past.slice(0,-1),future:[h(r),...r.future],historyOffset:0}}function j(r){let e=r.future[0];if(e===void 0)return r;return{...r,value:e.value,cursor:u(e.cursor,c(e.value).length),past:[...r.past,h(r)].slice(-Qi),future:r.future.slice(1)}}function wA(r){if(r.anchor===void 0||r.anchor===r.cursor)return;return r.anchor<r.cursor?{start:r.anchor,end:r.cursor}:{start:r.cursor,end:r.anchor}}function w(r){let e=wA(r);if(e===void 0)return{...r,anchor:void 0};let n=c(r.value);return{...d(r,{coalesce:!1}),value:[...n.slice(0,e.start),...n.slice(e.end)].join(""),cursor:e.start,anchor:void 0}}function R(r){return r.kind==="insert"||r.kind==="newline"||r.kind==="backspace"||r.kind==="delete"}function xe(r,e){if(r.search===void 0&&R(e)&&wA(r)!==void 0){let o=w(r);if(e.kind==="backspace"||e.kind==="delete")return o;return xe(o,e)}if(e.kind==="extend"){let o=r.anchor??r.cursor;return{...xe({...r,anchor:void 0},{kind:e.to}),anchor:o}}if(e.kind==="cutSelection")return w(r);if(e.kind==="copySelection")return r;if(e.kind==="selectAll")return{...r,anchor:0,cursor:c(r.value).length};let n=W(r,e);return n.anchor===void 0?n:{...n,anchor:void 0}}function W(r,e){if(r.search!==void 0)switch(e.kind){case"insert":return T(r,e.text);case"backspace":return M(r);case"historyPrev":case"lineUp":return g(r,1);case"historyNext":case"lineDown":return g(r,-1);case"searchAccept":return O(r);case"searchCancel":return{...r,search:void 0};case"searchOpen":return r;default:return{...r,search:void 0}}switch(e.kind){case"insert":return k(r,e.text);case"newline":return k(r,`
8
+ `);case"backspace":return E(r);case"delete":return y(r);case"cursorLeft":return{...r,cursor:u(r.cursor-1,c(r.value).length)};case"cursorRight":return{...r,cursor:u(r.cursor+1,c(r.value).length)};case"cursorHome":return{...r,cursor:l(r.value,r.cursor).start};case"cursorEnd":return{...r,cursor:l(r.value,r.cursor).end};case"bufferStart":return{...r,cursor:0};case"bufferEnd":return{...r,cursor:c(r.value).length};case"wordLeft":return{...r,cursor:v(c(r.value),r.cursor)};case"wordRight":return{...r,cursor:b(c(r.value),r.cursor)};case"lineUp":return p(r,-1);case"lineDown":return p(r,1);case"killToStart":{let{start:n}=l(r.value,r.cursor);if(n===r.cursor)return r;let o=c(r.value);return{...d(r,{coalesce:!1}),value:[...o.slice(0,n),...o.slice(r.cursor)].join(""),cursor:n}}case"killToEnd":{let{end:n}=l(r.value,r.cursor);if(n===r.cursor)return r;let o=c(r.value);return{...d(r,{coalesce:!1}),value:[...o.slice(0,r.cursor),...o.slice(n)].join("")}}case"killWord":return x(r);case"killWordForward":return A(r);case"historyPrev":return L(r);case"historyNext":return I(r);case"undo":return K(r);case"redo":return j(r);case"searchOpen":return{...r,search:{query:"",index:0}};case"searchAccept":case"searchCancel":case"submit":case"cancel":case"exit":case"arm":case"scroll":case"pointer":case"reasoning":case"paste":case"none":return r;case"extend":case"selectAll":case"copySelection":case"cutSelection":return r}}function Ui(r){let e=r.value.trim();if(e==="")return{text:"",state:{...ye,history:r.history}};let o=r.history.at(-1)===e?r.history:[...r.history,e].slice(-Ea);return{text:e,state:{...ye,history:o}}}function Gn(r,e,n={}){let{line:o,lines:t}=zo(r);return{busy:e,empty:r.value==="",firstLine:o===0,lastLine:o===t-1,searching:r.search!==void 0,armed:n.armed??!1,scrolled:n.scrolled??!1}}function D(r,e){switch(r){case"c":if(e.searching)return{kind:"searchCancel"};if(e.busy)return{kind:"cancel"};return e.armed?{kind:"exit"}:{kind:"arm"};case"d":return e.empty?{kind:"exit"}:{kind:"delete"};case"a":return{kind:"cursorHome"};case"e":return{kind:"cursorEnd"};case"b":return{kind:"cursorLeft"};case"f":return{kind:"cursorRight"};case"u":return{kind:"killToStart"};case"k":return{kind:"killToEnd"};case"w":return{kind:"killWord"};case"p":return{kind:"historyPrev"};case"n":return{kind:"historyNext"};case"r":return{kind:"searchOpen"};case"o":return{kind:"reasoning"};case"z":return{kind:"undo"};case"y":return{kind:"redo"};default:return{kind:"none"}}}function tn(r,e,n){let o=ia(r);if(o!==void 0){if(o.rows!==0)return{kind:"scroll",move:o.rows<0?"up":"down",times:Math.abs(o.rows)};if(o.at!==void 0&&o.kind!==void 0&&o.kind!=="wheel")return{kind:"pointer",gesture:o.kind,column:o.at.column,row:o.at.row,shift:o.shift===!0};return{kind:"none"}}if(e.eventType==="release")return{kind:"none"};if(e.shift){let i=H(e);if(i!==void 0)return{kind:"extend",to:i}}if(e.super){if(e.leftArrow)return{kind:"cursorHome"};if(e.rightArrow)return{kind:"cursorEnd"};if(e.upArrow)return{kind:"bufferStart"};if(e.downArrow)return{kind:"bufferEnd"};if(e.backspace)return{kind:"killToStart"};if(e.delete)return{kind:"killToEnd"};if(r==="z")return e.shift?{kind:"redo"}:{kind:"undo"};if(r==="a")return{kind:"selectAll"};if(r==="c")return{kind:"copySelection"};if(r==="x")return{kind:"cutSelection"};return{kind:"none"}}if(ea(r))return{kind:"none"};if(e.ctrl&&e.leftArrow)return{kind:"wordLeft"};if(e.ctrl&&e.rightArrow)return{kind:"wordRight"};if(e.ctrl&&e.backspace)return{kind:"killWord"};if(e.ctrl)return D(r.toLowerCase(),n);if(e.meta){if(e.return)return{kind:"newline"};if(e.pageUp)return{kind:"scroll",move:"top"};if(e.pageDown)return{kind:"scroll",move:"bottom"};if(e.upArrow)return{kind:"scroll",move:"up"};if(e.downArrow)return{kind:"scroll",move:"down"};if(e.leftArrow||r==="b")return{kind:"wordLeft"};if(e.rightArrow||r==="f")return{kind:"wordRight"};if(e.backspace)return{kind:"killWord"};if(r==="d")return{kind:"killWordForward"};if(r==="r")return{kind:"reasoning"};return{kind:"none"}}if(e.return&&e.shift)return{kind:"newline"};if(e.pageUp)return{kind:"scroll",move:"pageUp"};if(e.pageDown)return{kind:"scroll",move:"pageDown"};if(e.home)return{kind:"cursorHome"};if(e.end)return{kind:"cursorEnd"};if(e.return)return n.searching?{kind:"searchAccept"}:{kind:"submit"};if(e.backspace)return{kind:"backspace"};if(e.delete)return{kind:"delete"};if(e.leftArrow)return{kind:"cursorLeft"};if(e.rightArrow)return{kind:"cursorRight"};if(e.upArrow)return n.searching||n.firstLine?{kind:"historyPrev"}:{kind:"lineUp"};if(e.downArrow)return n.searching||n.lastLine?{kind:"historyNext"}:{kind:"lineDown"};if(e.escape){if(n.searching)return{kind:"searchCancel"};return n.scrolled?{kind:"scroll",move:"bottom"}:{kind:"none"}}if(e.tab)return{kind:"none"};if(r==="")return{kind:"none"};if(r==="\x1B[H"||r==="\x1B[1~")return{kind:"cursorHome"};if(r==="\x1B[F"||r==="\x1B[4~")return{kind:"cursorEnd"};if(/[\r\n]/.test(r)){let i=r.split(/\r\n|[\r\n]/).map(S),s=i.at(-1)===""&&i.length>1;return{kind:"paste",lines:s?i.slice(0,-1):i,complete:s}}let t=S(r);return t===""?{kind:"none"}:{kind:"insert",text:t}}function H(r){if(r.super){if(r.leftArrow)return"cursorHome";if(r.rightArrow)return"cursorEnd";if(r.upArrow)return"bufferStart";if(r.downArrow)return"bufferEnd";return}if(r.meta||r.ctrl){if(r.leftArrow)return"wordLeft";if(r.rightArrow)return"wordRight";return}if(r.home)return"cursorHome";if(r.end)return"cursorEnd";if(r.leftArrow)return"cursorLeft";if(r.rightArrow)return"cursorRight";if(r.upArrow)return"lineUp";if(r.downArrow)return"lineDown";return}function S(r){return[...r].filter((e)=>{let n=e.codePointAt(0)??0;return n>=32&&n!==127}).join("")}function An(r,e){if(e.ctrl)return r.toLowerCase()==="c"||r.toLowerCase()==="d"?{kind:"cancel"}:{kind:"none"};if(e.return)return{kind:"confirm"};if(e.escape)return{kind:"cancel"};if(r===" ")return{kind:"toggle"};if(r==="a")return{kind:"all"};if(r==="n")return{kind:"none-selected"};let n=St(r,e);return n.kind==="move"?n:{kind:"none"}}function St(r,e){if(e.ctrl)return r.toLowerCase()==="c"||r.toLowerCase()==="d"?{kind:"exit"}:{kind:"none"};if(e.return)return{kind:"choose"};if(e.escape)return{kind:"back"};if(e.upArrow)return{kind:"move",move:{kind:"up"}};if(e.downArrow)return{kind:"move",move:{kind:"down"}};switch(r){case"k":return{kind:"move",move:{kind:"up"}};case"j":return{kind:"move",move:{kind:"down"}};case"g":return{kind:"move",move:{kind:"first"}};case"G":return{kind:"move",move:{kind:"last"}};default:break}if(/^[1-9]$/.test(r))return{kind:"move",move:{kind:"jump",index:Number(r)-1}};return{kind:"none"}}function Fn(r,e,n){if(e.ctrl&&r.toLowerCase()==="c")return{kind:"abort"};if(e.escape)return{kind:"back"};if(e.return)return{kind:"commit"};if(n.select)return{kind:"list",intent:St(r,e)};let o=tn(r,e,{busy:!1,empty:n.empty,firstLine:!0,lastLine:!0,searching:!1,armed:!1,scrolled:!1});switch(o.kind){case"submit":return{kind:"commit"};case"exit":return{kind:"abort"};case"arm":case"scroll":return{kind:"edit",intent:{kind:"none"}};case"historyPrev":case"historyNext":return{kind:"edit",intent:{kind:"none"}};case"paste":return{kind:"edit",intent:{kind:"insert",text:o.lines[0]??""}};default:return{kind:"edit",intent:o}}}
9
+ export{ye,zo,en,wA,xe,Ui,Gn,tn,An,St,Fn};
10
10
 
11
- //# debugId=1DB124110DBD055F64756E2164756E21
12
- //# sourceMappingURL=index-m6fqx0ch.js.map
11
+ //# debugId=5E326538F3C3386E64756E2164756E21
12
+ //# sourceMappingURL=index-zmerx9rc.js.map
@@ -6,6 +6,6 @@
6
6
  "/**\n * Keystrokes in, intents out. Pure, and free of any Ink import.\n *\n * The one contract worth stating explicitly, because Phase 1 established and measured it:\n * **Ctrl-C cancels the turn, not the process.** Whether a keystroke means \"cancel\" or \"exit\"\n * depends on whether a turn is in flight, so that decision belongs here — in a function that can be\n * tested against both states — rather than in a component where it can only be tested by hand.\n */\n\nimport { lineInfo } from \"#editor\"\nimport { isTerminalReply } from \"#lib/csi\"\nimport { mouseInput } from \"#lib/mouse\"\nimport type { EditorState, Intent, KeyState, MotionKind } from \"#lib/types\"\n\nexport interface KeyContext {\n /** A turn is in flight. */\n readonly busy: boolean\n /** The input buffer is empty. */\n readonly empty: boolean\n /**\n * The cursor is on the first line, so ↑ means history rather than a line up.\n *\n * Position decides, because a multi-line buffer wants both and every editor resolves it this way:\n * at the top of what you are composing there is nothing above to move to, so the arrow is free to\n * mean the other thing. `^P`/`^N` stay unconditional history for anyone who would rather not think\n * about where the cursor is.\n */\n readonly firstLine: boolean\n readonly lastLine: boolean\n /** `^R` is open, so enter accepts a match and escape closes it. */\n readonly searching: boolean\n /**\n * A first ^C has already been pressed at an idle prompt, so the next one leaves.\n *\n * Held by the caller rather than derived, because it is the one piece of keyboard state with a\n * *clock* attached — it expires — and a pure function cannot own that. What it must not do is\n * decide what an armed ^C means, which is why the flag comes in here and the decision stays below.\n */\n readonly armed: boolean\n /**\n * The transcript window is parked above the newest row, so escape means \"come back down\".\n *\n * Escape had nothing to do at an idle prompt and was claimed as `none` to keep control characters\n * out of the buffer. A scrolled-away view is the one state where a reader plainly wants a way out\n * of where they are, and escape is the key they will press.\n */\n readonly scrolled: boolean\n}\n\n/**\n * The context for a given editor state.\n *\n * Exported and derived in one place so no renderer computes it by hand. `empty` was already this shape\n * — editor state passed to the keymap as context — and the two line flags are the same idea; a caller\n * that got `firstLine` wrong would make the arrows misbehave in a way no test of this module would see.\n */\nexport function keyContext(\n editor: EditorState,\n busy: boolean,\n session: { readonly armed?: boolean; readonly scrolled?: boolean } = {},\n): KeyContext {\n const { line, lines } = lineInfo(editor)\n return {\n busy,\n empty: editor.value === \"\",\n firstLine: line === 0,\n lastLine: line === lines - 1,\n searching: editor.search !== undefined,\n armed: session.armed ?? false,\n scrolled: session.scrolled ?? false,\n }\n}\n\n/** Ctrl-key chords arrive as `key.ctrl` plus the letter in `input`. */\nfunction ctrlIntent(letter: string, context: KeyContext): Intent {\n switch (letter) {\n case \"c\":\n // While a search is open, ^C dismisses it rather than the session: the search is the\n // foreground thing, and quitting the whole session from it would lose a message somebody\n // is part-way through composing.\n if (context.searching) return { kind: \"searchCancel\" }\n // The whole point. Busy means a turn is generating; interrupting it must leave the\n // prompt behind, not the shell.\n if (context.busy) return { kind: \"cancel\" }\n // At an idle prompt it takes two, and the first one says so.\n //\n // One press used to exit, which was defensible while the session left its conversation in\n // the scrollback: ^C landed you back in a shell with the transcript still above it. On the\n // alternate screen the buffer is discarded on the way out, so the same keystroke now throws\n // the visible conversation away — and it is one press away from the chord that means\n // \"cancel this turn\", pressed reflexively when a reply runs long. ^D still leaves in one,\n // for anyone who wants that, and the status line names whichever is live.\n return context.armed ? { kind: \"exit\" } : { kind: \"arm\" }\n case \"d\":\n // Ctrl-D is end-of-input, so it only ends the session when there is nothing to submit.\n // On a line with text it is a forward delete, as in a shell.\n return context.empty ? { kind: \"exit\" } : { kind: \"delete\" }\n case \"a\":\n return { kind: \"cursorHome\" }\n case \"e\":\n return { kind: \"cursorEnd\" }\n case \"b\":\n return { kind: \"cursorLeft\" }\n case \"f\":\n return { kind: \"cursorRight\" }\n case \"u\":\n return { kind: \"killToStart\" }\n case \"k\":\n return { kind: \"killToEnd\" }\n case \"w\":\n return { kind: \"killWord\" }\n case \"p\":\n return { kind: \"historyPrev\" }\n case \"n\":\n return { kind: \"historyNext\" }\n case \"r\":\n return { kind: \"searchOpen\" }\n case \"o\":\n // The same thing ⌥r does, on a chord that cannot fail to arrive.\n //\n // ⌥r needs either the kitty protocol or the terminal's option-as-meta setting; a ctrl letter\n // needs neither, because it is a single control byte every terminal has always sent. Reported\n // as \"⌥r doesn't do anything\", and while the immediate cause was a fold with nothing in it,\n // the standing cause is that a view toggle should not depend on a terminal handshake at all.\n // ^O is what the reference CLI binds its own transcript toggle to, so the habit transfers.\n return { kind: \"reasoning\" }\n case \"z\":\n // Undo, not SIGTSTP. Ink puts stdin in raw mode, so the terminal never generates the\n // signal and the byte arrives here — which makes this a choice rather than an accident.\n // Suspending a chat you can leave with ^D is worth little; undo is worth a lot, and the\n // footer says so, which is what keeps the trade visible.\n return { kind: \"undo\" }\n case \"y\":\n return { kind: \"redo\" }\n default:\n return { kind: \"none\" }\n }\n}\n\nexport function keyToIntent(input: string, key: KeyState, context: KeyContext): Intent {\n // The mouse, before anything else, and unconditionally.\n //\n // Ink has no idea what a mouse report is and hands it over as text: with tracking on, one wheel notch\n // reached the insert branch and typed the report into the message. So every report is claimed here —\n // the wheel becomes a scroll and everything else becomes nothing at all, because a click that falls\n // through is the same bug with a different button.\n const mouse = mouseInput(input)\n if (mouse !== undefined) {\n if (mouse.rows !== 0) {\n return {\n kind: \"scroll\",\n move: mouse.rows < 0 ? \"up\" : \"down\",\n times: Math.abs(mouse.rows),\n }\n }\n // A press, drag or release. Reported rather than resolved: which row of the conversation a cell\n // sits on is a question about the frame, and this function has no frame. Still claimed either way —\n // a report that fell through would be typed into the message, which is the bug this branch exists\n // for and does not stop being one because the gesture is now useful.\n if (mouse.at !== undefined && mouse.kind !== undefined && mouse.kind !== \"wheel\") {\n return {\n kind: \"pointer\",\n gesture: mouse.kind,\n column: mouse.at.column,\n row: mouse.at.row,\n shift: mouse.shift === true,\n }\n }\n return { kind: \"none\" }\n }\n\n // A key *release* is not a keystroke. `reportEventTypes` is on so that `super` survives on an arrow\n // key (Ink's kitty branch requires the `:eventType` field), and the cost is that Ink hands the type\n // through without filtering — so every enhanced key arrives twice, down and up, and every chord would\n // fire twice. Repeats are kept: holding a key down is a real thing to do.\n if (key.eventType === \"release\") return { kind: \"none\" }\n\n // ─── shift extends a selection ───────────────────────────────────────────────────────\n //\n // Before the cmd, ctrl and option blocks, because every one of them would otherwise claim the chord\n // and drop the shift: `cmd+shift+←` arrives as `CSI 1;10D` — one plus shift plus super — and the\n // super block below matches on `key.super` without looking at shift at all.\n //\n // Only the motion keys are recognised, which is what keeps this from swallowing ordinary typing:\n // `key.shift` is true for every capital letter, and a letter matches none of the tests in\n // `shiftMotion`. Return is not a motion either, so `⇧⏎` still reaches the newline branch.\n if (key.shift) {\n const to = shiftMotion(key)\n if (to !== undefined) return { kind: \"extend\", to }\n }\n\n // ─── command chords ──────────────────────────────────────────────────────────────────\n //\n // `super` is Cmd, and it is only ever true once the kitty keyboard protocol has been negotiated —\n // no legacy sequence can express it, and Ink's legacy path folds it into `meta`, which is why\n // `cmd+←` used to word-move like `⌥←` instead of jumping to the start of the line.\n //\n // Horizontal is the line, vertical is the whole message: that is what macOS binds and what every\n // editor on the platform does. Before the ctrl and meta blocks because a chord can carry more than\n // one modifier, and cmd is the most specific claim.\n if (key.super) {\n if (key.leftArrow) return { kind: \"cursorHome\" }\n if (key.rightArrow) return { kind: \"cursorEnd\" }\n if (key.upArrow) return { kind: \"bufferStart\" }\n if (key.downArrow) return { kind: \"bufferEnd\" }\n if (key.backspace) return { kind: \"killToStart\" }\n if (key.delete) return { kind: \"killToEnd\" }\n if (input === \"z\") return key.shift ? { kind: \"redo\" } : { kind: \"undo\" }\n if (input === \"a\") return { kind: \"selectAll\" }\n // Reachable only where the protocol delivers `super`, and the terminal may claim them first for\n // its own copy — which is exactly why a *selection* in the composer does not auto-copy: the\n // fallback for a chord that may not arrive is retyping, not a surprise clipboard write.\n if (input === \"c\") return { kind: \"copySelection\" }\n if (input === \"x\") return { kind: \"cutSelection\" }\n // Unclaimed, and deliberately swallowed for the same reason an unclaimed option chord is: the\n // insert branch would type the bare letter, so cmd+s would put an \"s\" in the message.\n return { kind: \"none\" }\n }\n\n // Ctrl with an arrow or a backspace is the other spelling of a word operation — Linux and Windows\n // convention, and the reference honours `ctrl || meta || fn` for exactly one action because a\n // physical chord reaches a terminal in more than one encoding. Before `ctrlIntent`, which dispatches\n // on a *letter* and would see an empty string here.\n // A terminal's answer to a question this process asked is not a keystroke. Claimed next to the mouse\n // for the same reason: Ink hands it over as text, and text reaches the insert branch.\n if (isTerminalReply(input)) return { kind: \"none\" }\n\n if (key.ctrl && key.leftArrow) return { kind: \"wordLeft\" }\n if (key.ctrl && key.rightArrow) return { kind: \"wordRight\" }\n if (key.ctrl && key.backspace) return { kind: \"killWord\" }\n\n if (key.ctrl) return ctrlIntent(input.toLowerCase(), context)\n\n // ─── option chords ───────────────────────────────────────────────────────────────────\n //\n // Every one of these is measured against Ink's parser rather than assumed, because a terminal has\n // more than one way to send them and the parser reporting *a* key says nothing about which:\n //\n // ⌥← Apple Terminal `ESC b` → input \"b\" + meta iTerm2 `CSI 1;3D` → leftArrow + meta\n // ⌥→ Apple Terminal `ESC f` → input \"f\" + meta iTerm2 `CSI 1;3C` → rightArrow + meta\n // ⌥⌫ `ESC DEL` → backspace + meta\n // ⌥d `ESC d` → input \"d\" + meta\n // ⌥r `ESC r` → input \"r\" + meta\n // ⌥⏎ `ESC CR` → return + meta\n // ⇧⏎ kitty protocol `CSI 13;2u` → return + shift (only once the terminal is taught)\n //\n // Both spellings of each are honoured, so the same binding works in both families of terminal.\n //\n // Under the kitty protocol these arrive as `CSI <codepoint>;3u` instead — `⌥r` is `CSI 114;3u`, and\n // Ink reports it as `input \"r\"` with `meta` set, which is the same shape the table above describes.\n // That is why negotiating the protocol needed no change here: these bindings were always right and\n // simply never arrived, because Warp's Option-as-Meta setting is off by default and `⌥r` was\n // reaching us as the composed character `®`.\n if (key.meta) {\n if (key.return) return { kind: \"newline\" }\n // ⌥↑/⌥↓ walk the conversation a row at a time, and ⌥PgUp/⌥PgDn go to its ends. Bare ↑/↓ cannot\n // do this: they already mean line movement inside a message and history at its edges, and a\n // third meaning on one key is how a keyboard stops being predictable.\n if (key.pageUp) return { kind: \"scroll\", move: \"top\" }\n if (key.pageDown) return { kind: \"scroll\", move: \"bottom\" }\n if (key.upArrow) return { kind: \"scroll\", move: \"up\" }\n if (key.downArrow) return { kind: \"scroll\", move: \"down\" }\n if (key.leftArrow || input === \"b\") return { kind: \"wordLeft\" }\n if (key.rightArrow || input === \"f\") return { kind: \"wordRight\" }\n if (key.backspace) return { kind: \"killWord\" }\n if (input === \"d\") return { kind: \"killWordForward\" }\n // Reasoning is folded to a few rows by default, and this is how the rest of it is read. Same\n // shape as ⌥d — a letter with meta — so it works wherever the chords above already do.\n if (input === \"r\") return { kind: \"reasoning\" }\n // An unclaimed option chord does nothing. Falling through would reach the insert branch and\n // type the bare letter, so ⌥s would silently put an \"s\" in the message. Composed characters\n // (é, ∆) are unaffected: macOS sends those as the character itself, with no meta flag.\n return { kind: \"none\" }\n }\n\n // Shift+enter is a newline where the terminal can express it — `terminal-setup` is what teaches\n // iTerm2, VS Code, Ghostty and Kitty to send the sequence Ink already understands. Where it\n // cannot, this is never true and ⏎ submits, which is why ⌥⏎ is the documented chord.\n if (key.return && key.shift) return { kind: \"newline\" }\n\n // Paging the conversation, unmodified.\n //\n // Deliberately not ^U/^D, which the plan named: both are already taken by the editor — ^U deletes to\n // the start of the line and ^D leaves an empty one — and they are documented, shell-standard, and\n // reached by muscle memory. A scroll key that silently deleted half a message would be a worse bug\n // than no scroll key.\n if (key.pageUp) return { kind: \"scroll\", move: \"pageUp\" }\n if (key.pageDown) return { kind: \"scroll\", move: \"pageDown\" }\n\n // Home and End. Ink has always parsed them; `KeyState` never declared the fields, so both keys did\n // nothing whatsoever until now. The raw-sequence fallback further down catches the terminals that\n // send a spelling Ink does not flag.\n if (key.home) return { kind: \"cursorHome\" }\n if (key.end) return { kind: \"cursorEnd\" }\n\n if (key.return) return context.searching ? { kind: \"searchAccept\" } : { kind: \"submit\" }\n if (key.backspace) return { kind: \"backspace\" }\n if (key.delete) return { kind: \"delete\" }\n if (key.leftArrow) return { kind: \"cursorLeft\" }\n if (key.rightArrow) return { kind: \"cursorRight\" }\n // History at the edges of the buffer, line movement inside it. While searching both walk the match\n // list, which the reducer routes — the arrows mean \"previous\" and \"next\" either way.\n if (key.upArrow) {\n return context.searching || context.firstLine ? { kind: \"historyPrev\" } : { kind: \"lineUp\" }\n }\n if (key.downArrow) {\n return context.searching || context.lastLine\n ? { kind: \"historyNext\" }\n : { kind: \"lineDown\" }\n }\n\n // Escape closes a search; otherwise it is claimed deliberately and does nothing, rather than\n // falling through to the insert branch where it would put a control character into the buffer and\n // be sent to a model. Tab is claimed for the same reason.\n if (key.escape) {\n if (context.searching) return { kind: \"searchCancel\" }\n return context.scrolled ? { kind: \"scroll\", move: \"bottom\" } : { kind: \"none\" }\n }\n if (key.tab) return { kind: \"none\" }\n\n // A paste arrives as one large `input` with no key flags, so insert has to accept many\n // characters at once rather than assuming a single keypress.\n if (input === \"\") return { kind: \"none\" }\n\n // Home and End again, by raw sequence. There are four spellings in the wild and Ink flags only some\n // of them — the reference keeps the same fallback for the same reason (`useTextInput.ts:385-389`).\n // After the empty-input check and before the printable filter, which would otherwise strip the\n // escape and insert `[H` into the message.\n if (input === \"\\u001B[H\" || input === \"\\u001B[1~\") return { kind: \"cursorHome\" }\n if (input === \"\\u001B[F\" || input === \"\\u001B[4~\") return { kind: \"cursorEnd\" }\n\n // Newlines inside that chunk are line breaks, not control noise. Stripping them — which the\n // printable filter below would do — silently joins the last word of one line to the first word\n // of the next and submits nothing, so a pasted multi-line prompt arrives mangled with no error.\n if (/[\\r\\n]/.test(input)) {\n const lines = input.split(/\\r\\n|[\\r\\n]/).map(printableOnly)\n // A trailing newline means the final line is finished too; without one, the tail is still\n // being typed.\n const complete = lines.at(-1) === \"\" && lines.length > 1\n return { kind: \"paste\", lines: complete ? lines.slice(0, -1) : lines, complete }\n }\n\n const printable = printableOnly(input)\n return printable === \"\" ? { kind: \"none\" } : { kind: \"insert\", text: printable }\n}\n\n/**\n * Which motion a shift chord extends by, or `undefined` when the key is not a motion at all.\n *\n * Modifier first, then the bare keys, so `shift+cmd+←` is a line and `shift+⌥←` is a word rather than both\n * being a character. `shift+↑` extends a line up even on the first line, where the unshifted arrow means\n * history: selecting upward is unambiguous, and a history chord that also grew a selection would be one\n * key doing two unrelated things.\n *\n * `input` is deliberately not consulted. The `ESC b` spelling of `⌥←` would arrive shifted as `ESC B`, and\n * matching a capital letter here is how `shift+B` would start selecting words. Terminals send the CSI form\n * for a shifted arrow, which carries the flags this reads.\n */\nfunction shiftMotion(key: KeyState): MotionKind | undefined {\n if (key.super) {\n if (key.leftArrow) return \"cursorHome\"\n if (key.rightArrow) return \"cursorEnd\"\n if (key.upArrow) return \"bufferStart\"\n if (key.downArrow) return \"bufferEnd\"\n return undefined\n }\n if (key.meta || key.ctrl) {\n if (key.leftArrow) return \"wordLeft\"\n if (key.rightArrow) return \"wordRight\"\n return undefined\n }\n if (key.home) return \"cursorHome\"\n if (key.end) return \"cursorEnd\"\n if (key.leftArrow) return \"cursorLeft\"\n if (key.rightArrow) return \"cursorRight\"\n if (key.upArrow) return \"lineUp\"\n if (key.downArrow) return \"lineDown\"\n return undefined\n}\n\n/**\n * Drop C0 controls and DEL. A bracketed-paste marker or a stray escape sequence reaching the buffer\n * would be invisible on screen and sent to the model as if it had been typed.\n */\nfunction printableOnly(text: string): string {\n return [...text]\n .filter((char) => {\n const code = char.codePointAt(0) ?? 0\n return code >= 0x20 && code !== 0x7f\n })\n .join(\"\")\n}\n\n// ─── screen keymaps ──────────────────────────────────────────────────────────────────────\n//\n// The wizard and picker differ from the chat input in what Esc means — a *context*, not a new\n// module, which is why they live here beside `keyToIntent` rather than in per-screen files: one\n// keyboard home, closed by the same drift tests.\n\nimport type { SelectMove } from \"#lib/select\"\n\nexport type ListIntent =\n | { readonly kind: \"move\"; readonly move: SelectMove }\n | { readonly kind: \"choose\" }\n | { readonly kind: \"back\" }\n | { readonly kind: \"exit\" }\n | { readonly kind: \"none\" }\n\n/**\n * A checklist adds two verbs a single-select list does not have: tick a row, and finish.\n *\n * Space ticks and enter finishes, which is the convention every multi-select in a terminal uses — and\n * getting it the other way round is the mistake that makes a picker feel broken, because enter on a\n * highlighted row is such a strong habit that people submit with one thing ticked and never see the rest.\n * `a` and `n` are all/none, worth having when the list is fifty rows long.\n */\nexport type CheckIntent =\n | { readonly kind: \"move\"; readonly move: SelectMove }\n | { readonly kind: \"toggle\" }\n | { readonly kind: \"all\" }\n | { readonly kind: \"none-selected\" }\n | { readonly kind: \"confirm\" }\n | { readonly kind: \"cancel\" }\n | { readonly kind: \"none\" }\n\nexport function keyToCheckIntent(input: string, key: KeyState): CheckIntent {\n if (key.ctrl) {\n return input.toLowerCase() === \"c\" || input.toLowerCase() === \"d\"\n ? { kind: \"cancel\" }\n : { kind: \"none\" }\n }\n if (key.return) return { kind: \"confirm\" }\n if (key.escape) return { kind: \"cancel\" }\n // Ink reports the space bar as the input string \" \" with no flag of its own.\n if (input === \" \") return { kind: \"toggle\" }\n if (input === \"a\") return { kind: \"all\" }\n if (input === \"n\") return { kind: \"none-selected\" }\n\n const list = keyToListIntent(input, key)\n // Movement is shared so the two lists cannot drift apart; `choose` cannot arrive, because `key.return`\n // is handled above, and the remaining kinds are not this screen's.\n return list.kind === \"move\" ? list : { kind: \"none\" }\n}\n\n/**\n * List navigation: arrows or j/k, g/G for ends, enter chooses, esc backs out, ^C/^D leave.\n *\n * A digit jumps the cursor — visibly and reversibly — and deliberately does not choose: a stray\n * number must never launch an agent.\n */\nexport function keyToListIntent(input: string, key: KeyState): ListIntent {\n if (key.ctrl) {\n return input.toLowerCase() === \"c\" || input.toLowerCase() === \"d\"\n ? { kind: \"exit\" }\n : { kind: \"none\" }\n }\n if (key.return) return { kind: \"choose\" }\n if (key.escape) return { kind: \"back\" }\n if (key.upArrow) return { kind: \"move\", move: { kind: \"up\" } }\n if (key.downArrow) return { kind: \"move\", move: { kind: \"down\" } }\n\n switch (input) {\n case \"k\":\n return { kind: \"move\", move: { kind: \"up\" } }\n case \"j\":\n return { kind: \"move\", move: { kind: \"down\" } }\n case \"g\":\n return { kind: \"move\", move: { kind: \"first\" } }\n case \"G\":\n return { kind: \"move\", move: { kind: \"last\" } }\n default:\n break\n }\n if (/^[1-9]$/.test(input)) {\n return { kind: \"move\", move: { kind: \"jump\", index: Number(input) - 1 } }\n }\n return { kind: \"none\" }\n}\n\nexport type WizardKeyIntent =\n | { readonly kind: \"back\" }\n | { readonly kind: \"abort\" }\n | { readonly kind: \"commit\" }\n | { readonly kind: \"list\"; readonly intent: ListIntent }\n | { readonly kind: \"edit\"; readonly intent: Intent }\n\n/**\n * The wizard's chrome keys are checked before delegation — Esc means \"back a question\" here,\n * which is exactly why chat's `keyToIntent` (which claims Esc as none) is not reused raw.\n *\n * Text steps then get the full chat editor treatment (^A/^E, ^W, code-point cursor); select steps\n * get the list navigation. A pasted blob collapses to its first line — a wizard answer is one\n * line — and history chords mean nothing inside a question.\n */\nexport function keyToWizardIntent(\n input: string,\n key: KeyState,\n context: { readonly select: boolean; readonly empty: boolean },\n): WizardKeyIntent {\n if (key.ctrl && input.toLowerCase() === \"c\") return { kind: \"abort\" }\n if (key.escape) return { kind: \"back\" }\n if (key.return) return { kind: \"commit\" }\n\n if (context.select) {\n return { kind: \"list\", intent: keyToListIntent(input, key) }\n }\n\n // A wizard answer is one line — a pasted blob collapses to its first — so the cursor is always on\n // both the first and the last line, and ↑/↓ mean history rather than line movement. There is no\n // search here either.\n const intent = keyToIntent(input, key, {\n busy: false,\n empty: context.empty,\n firstLine: true,\n lastLine: true,\n searching: false,\n // A question is not a conversation: there is nothing to scroll and nothing to arm, and Esc is\n // claimed above as \"back a question\" before this is ever reached.\n armed: false,\n scrolled: false,\n })\n switch (intent.kind) {\n case \"submit\":\n return { kind: \"commit\" }\n case \"exit\":\n // ^D on an empty question line reads as \"get me out\", same as ^C.\n return { kind: \"abort\" }\n case \"arm\":\n case \"scroll\":\n // Unreachable in practice — ^C is claimed as `abort` above and there is nothing to scroll —\n // and listed rather than left to the default, so adding a session-only intent cannot\n // silently become an edit the wizard applies to a field.\n return { kind: \"edit\", intent: { kind: \"none\" } }\n case \"historyPrev\":\n case \"historyNext\":\n return { kind: \"edit\", intent: { kind: \"none\" } }\n case \"paste\":\n return {\n kind: \"edit\",\n intent: { kind: \"insert\", text: intent.lines[0] ?? \"\" },\n }\n default:\n return { kind: \"edit\", intent }\n }\n}\n"
7
7
  ],
8
8
  "mappings": ";+GA2BO,IAAM,GAA4B,CACrC,MAAO,GACP,OAAQ,EACR,QAAS,CAAC,EACV,cAAe,EACf,MAAO,GACP,KAAM,CAAC,EACP,OAAQ,CAAC,EACT,OAAQ,OACR,OAAQ,MACZ,EAEA,SAAS,CAAK,CAAC,EAAyB,CACpC,MAAO,CAAC,GAAG,CAAK,EAGpB,SAAS,CAAK,CAAC,EAAgB,EAAwB,CACnD,OAAO,KAAK,IAAI,EAAG,KAAK,IAAI,EAAQ,CAAM,CAAC,EAG/C,SAAS,CAAQ,CAAC,EAAoC,CAClD,MAAO,CAAE,MAAO,EAAM,MAAO,OAAQ,EAAM,MAAO,EAYtD,SAAS,CAAQ,CAAC,EAAoB,EAAsD,CACxF,IAAM,EAAM,EAAM,KAAK,GAAG,EAAE,EAG5B,GAAI,EAAQ,UAAY,IAAQ,QAAa,EAAM,OAAO,SAAW,EACjE,MAAO,IAAK,EAAO,OAAQ,CAAC,CAAE,EAElC,GAAI,IAAQ,QAAa,EAAI,QAAU,EAAM,MAAO,MAAO,IAAK,EAAO,OAAQ,CAAC,CAAE,EAClF,MAAO,IAAK,EAAO,KAAM,CAAC,GAAG,EAAM,KAAM,EAAS,CAAK,CAAC,EAAE,MAAM,CAAC,EAAU,EAAG,OAAQ,CAAC,CAAE,EAI7F,SAAS,CAAU,CAAC,EAAoB,EAA4B,CAChE,MAAO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